summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile64
-rw-r--r--README654
-rw-r--r--READWIN.txt32
-rw-r--r--Testitems79
-rw-r--r--basic/Makefile94
-rw-r--r--basic/console/build.bat37
-rwxr-xr-xbasic/console/test1.mak201
-rwxr-xr-xbasic/console/test2.mak182
-rwxr-xr-xbasic/console/test3.mak182
-rwxr-xr-xbasic/console/test4.mak182
-rwxr-xr-xbasic/console/test4a.mak182
-rwxr-xr-xbasic/console/test5.mak182
-rwxr-xr-xbasic/console/test5a.mak182
-rwxr-xr-xbasic/console/test5b.mak182
-rwxr-xr-xbasic/console/test6.mak182
-rwxr-xr-xbasic/console/test7.mak182
-rwxr-xr-xbasic/console/test7a.mak182
-rwxr-xr-xbasic/console/test7b.mak182
-rwxr-xr-xbasic/console/test8.mak182
-rwxr-xr-xbasic/console/test9.mak182
-rw-r--r--basic/dos/build.bat37
-rwxr-xr-xbasic/dos/test1.mak92
-rwxr-xr-xbasic/dos/test2.mak85
-rwxr-xr-xbasic/dos/test3.mak85
-rwxr-xr-xbasic/dos/test4.mak85
-rwxr-xr-xbasic/dos/test4a.mak85
-rwxr-xr-xbasic/dos/test5.mak85
-rwxr-xr-xbasic/dos/test5a.mak85
-rwxr-xr-xbasic/dos/test5b.mak85
-rwxr-xr-xbasic/dos/test6.mak85
-rwxr-xr-xbasic/dos/test7.mak85
-rwxr-xr-xbasic/dos/test7a.mak85
-rwxr-xr-xbasic/dos/test7b.mak85
-rwxr-xr-xbasic/dos/test8.mak85
-rwxr-xr-xbasic/dos/test9.mak85
-rwxr-xr-xbasic/runtests82
-rw-r--r--basic/runtests.mvs48
-rwxr-xr-xbasic/runtests.orig82
-rw-r--r--basic/scripts/basic.bat101
-rw-r--r--basic/scripts/basic2.bat72
-rw-r--r--basic/scripts/basic3.bat101
-rw-r--r--basic/scripts/cthon.bat16
-rw-r--r--basic/scripts/cthon00.mst126
-rw-r--r--basic/scripts/cthon01.mst436
-rw-r--r--basic/scripts/cthon02.mst469
-rw-r--r--basic/scripts/cthon03.mst428
-rw-r--r--basic/scripts/cthon04.mst366
-rw-r--r--basic/scripts/runcthon.prl66
-rw-r--r--basic/subr.c830
-rw-r--r--basic/tags170
-rw-r--r--basic/test1.c176
-rw-r--r--basic/test2.c173
-rw-r--r--basic/test3.c143
-rw-r--r--basic/test4.c187
-rw-r--r--basic/test4a.c165
-rw-r--r--basic/test5.c358
-rw-r--r--basic/test5a.c301
-rw-r--r--basic/test5b.c219
-rw-r--r--basic/test6.c293
-rw-r--r--basic/test7.c248
-rw-r--r--basic/test7a.c195
-rw-r--r--basic/test7b.c245
-rw-r--r--basic/test8.c207
-rw-r--r--basic/test9.c182
-rw-r--r--domount.c37
-rw-r--r--general/Makefile32
-rw-r--r--general/large.c443
-rw-r--r--general/large4.sh13
-rw-r--r--general/makefile.tst41
-rw-r--r--general/mkdummy16
-rw-r--r--general/nroff.in179
-rw-r--r--general/rmdummy7
-rwxr-xr-xgeneral/runtests37
-rw-r--r--general/runtests.wrk145
-rw-r--r--general/stat.c196
-rw-r--r--getopt.c142
-rw-r--r--lock/Makefile49
-rwxr-xr-xlock/runtests67
-rw-r--r--lock/tlock.c1700
-rwxr-xr-xold/runcthon.orig95
-rwxr-xr-xold/server.org161
-rwxr-xr-xold/server.orig162
-rw-r--r--old/tests.init.orig224
-rwxr-xr-xruncthon186
-rwxr-xr-xruntests122
-rwxr-xr-xserver164
-rw-r--r--special/Makefile123
-rw-r--r--special/READWIN.txt24
-rw-r--r--special/bigfile.c388
-rw-r--r--special/bigfile2.c192
-rw-r--r--special/console/build.bat41
-rw-r--r--special/console/build1.bat12
-rwxr-xr-xspecial/console/dupreq.mak182
-rwxr-xr-xspecial/console/excltest.mak175
-rwxr-xr-xspecial/console/fstat.mak166
-rwxr-xr-xspecial/console/holey.mak166
-rwxr-xr-xspecial/console/negseek.mak166
-rwxr-xr-xspecial/console/nfsidem.mak175
-rwxr-xr-xspecial/console/nstat.mak173
-rwxr-xr-xspecial/console/op_chmod.mak175
-rwxr-xr-xspecial/console/op_ren.mak175
-rwxr-xr-xspecial/console/op_unlk.mak175
-rwxr-xr-xspecial/console/rename.mak175
-rwxr-xr-xspecial/console/rewind.mak168
-rwxr-xr-xspecial/console/stat.mak173
-rwxr-xr-xspecial/console/stat2.mak173
-rwxr-xr-xspecial/console/touchn.mak175
-rwxr-xr-xspecial/console/truncate.mak175
-rw-r--r--special/dos/build.bat44
-rw-r--r--special/dos/build1.bat12
-rwxr-xr-xspecial/dos/dupreq.mak90
-rwxr-xr-xspecial/dos/excltest.mak90
-rwxr-xr-xspecial/dos/fstat.mak81
-rwxr-xr-xspecial/dos/holey.mak90
-rwxr-xr-xspecial/dos/negseek.mak90
-rwxr-xr-xspecial/dos/nfsidem.mak90
-rwxr-xr-xspecial/dos/nstat.mak81
-rwxr-xr-xspecial/dos/op_chmod.mak90
-rwxr-xr-xspecial/dos/op_ren.mak90
-rwxr-xr-xspecial/dos/op_unlk.mak90
-rwxr-xr-xspecial/dos/rename.mak90
-rwxr-xr-xspecial/dos/rewind.mak90
-rwxr-xr-xspecial/dos/stat.mak81
-rwxr-xr-xspecial/dos/stat2.mak81
-rwxr-xr-xspecial/dos/touchn.mak90
-rwxr-xr-xspecial/dos/truncate.mak90
-rw-r--r--special/dupreq.c86
-rw-r--r--special/excltest.c64
-rw-r--r--special/freesp.c150
-rw-r--r--special/fstat.c67
-rw-r--r--special/holey.c243
-rw-r--r--special/negseek.c68
-rw-r--r--special/nfsidem.c189
-rw-r--r--special/nstat.c65
-rw-r--r--special/op_chmod.c151
-rw-r--r--special/op_ren.c179
-rw-r--r--special/op_unlk.c163
-rw-r--r--special/rename.c59
-rw-r--r--special/rewind.c65
-rwxr-xr-xspecial/runtests39
-rw-r--r--special/runtests.wrk106
-rw-r--r--special/scripts/run.bat51
-rw-r--r--special/stat.c130
-rw-r--r--special/stat2.c81
-rw-r--r--special/telldir.c297
-rw-r--r--special/touchn.c37
-rw-r--r--special/truncate.c70
-rw-r--r--tests.h81
-rw-r--r--tests.init225
-rw-r--r--tools/Makefile55
-rw-r--r--tools/README21
-rw-r--r--tools/dirdmp.c220
-rw-r--r--tools/dirprt.c108
-rw-r--r--tools/pmapbrd.c462
-rw-r--r--tools/pmaptst.c81
-rw-r--r--tools/tcp.c73
-rw-r--r--tools/tcpd.c84
-rw-r--r--tools/udp.c74
-rw-r--r--tools/udpd.c80
-rw-r--r--unixdos.h109
160 files changed, 24504 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..87a5e43
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,64 @@
+#
+# @(#)Makefile 1.6 2003/12/29 Connectathon Testsuite
+#
+# 'make all' makes test programs
+# 'make clean' cleans directories
+# 'make copy DESTDIR=path' copies test programs to path
+# 'make dist DESTDIR=path' copies sources to path
+
+DESTDIR=/no/such/path
+COPYFILES=runtests tests.init server domount.c README READWIN.txt Testitems \
+ getopt.c tests.h unixdos.h
+
+include tests.init
+
+all: domount getopt
+ cd basic; $(MAKE)
+ cd general; $(MAKE)
+ cd special; $(MAKE)
+ cd tools; $(MAKE)
+ cd lock; $(MAKE)
+ if test ! -x runtests; then chmod a+x runtests; fi
+
+lint:
+ cd basic; $(MAKE) lint
+ cd special; $(MAKE) lint
+ cd tools; $(MAKE) lint
+ cd lock; $(MAKE) lint
+
+domount: domount.c
+ $(CC) $(CFLAGS) -o $@ $@.c
+ -chown root domount && chmod u+s domount
+
+getopt: getopt.c
+ $(CC) $(CFLAGS) -o $@ $@.c
+
+clean:
+ rm -f domount getopt
+ cd basic; $(MAKE) clean
+ cd general; $(MAKE) clean
+ cd special; $(MAKE) clean
+ cd tools; $(MAKE) clean
+ cd lock; $(MAKE) clean
+
+copy: mknewdirs
+ cp -f domount $(COPYFILES) $(DESTDIR)
+ cd basic; $(MAKE) copy DESTDIR=$(DESTDIR)/basic
+ cd general; $(MAKE) copy DESTDIR=$(DESTDIR)/general
+ cd special; $(MAKE) copy DESTDIR=$(DESTDIR)/special
+ cd tools; $(MAKE) copy DESTDIR=$(DESTDIR)/tools
+ cd lock; $(MAKE) copy DESTDIR=$(DESTDIR)/lock
+
+dist: mknewdirs
+ cp -f Makefile $(COPYFILES) $(DESTDIR)
+ cd basic; $(MAKE) dist DESTDIR=$(DESTDIR)/basic
+ cd general; $(MAKE) dist DESTDIR=$(DESTDIR)/general
+ cd special; $(MAKE) dist DESTDIR=$(DESTDIR)/special
+ cd tools; $(MAKE) dist DESTDIR=$(DESTDIR)/tools
+ cd lock; $(MAKE) dist DESTDIR=$(DESTDIR)/lock
+ chmod u+w $(DESTDIR)/tests.init
+ chmod a+x $(DESTDIR)/server
+
+mknewdirs:
+ -mkdir $(DESTDIR)/basic $(DESTDIR)/general $(DESTDIR)/special \
+ $(DESTDIR)/tools $(DESTDIR)/lock
diff --git a/README b/README
new file mode 100644
index 0000000..28367fa
--- /dev/null
+++ b/README
@@ -0,0 +1,654 @@
+#
+# @(#)README 1.18 2003/12/30 Connectathon Testsuite
+#
+NFS and Connectathon are trademarks of Sun Microsystems, Inc.
+
+
+
+Introduction to the Connectathon NFS Testsuites
+---------------------------------------------
+
+These directories contain programs that can be used to test an
+implementation of the NFS Protocol. The tests run on a UNIX client and
+test server and client functions. (See READWIN.txt for information
+about running on DOS and Windows.) The tests are divided into three
+groups:
+
+ basic - basic file system operations tests
+ general - general file system tests
+ special - tests that poke certain common problem areas
+ lock - tests that exercise network locking
+
+This README is divided into five sections. The first section is the
+introduction, which you are reading now. That is followed by a
+description of what you have to do before you run the testsuites on
+your machine. Then comes a description of how the testsuites are run
+in general followed by a description of how they are used at
+Connectathon. The last section describes what each test does in
+detail.
+
+This testsuite should run on both BSD and System V based systems. The
+System V Release 3 port of the Connectathon Testsuite is provided
+courtesy of the Lachman Technology, Incorporated, 1901 N. Naper Blvd.,
+Naperville, IL. 60563.
+
+
+Preparing to run the Testsuites
+-------------------------------
+
+To prepare to run the testsuites on your machine, change directories
+to the highest level testsuite directory (it should be the same one
+that contains this README file), edit tests.init according to the
+platform you are on, and type "make" to compile the test programs. If
+you are not sure you are in the correct directory, type "ls -CF" and
+you should see the following files and directories:
+
+Makefile basic/ lock/ tests.h
+README domount.c runtests tests.init
+READWIN.txt general/ server tools/
+Testitems getopt.c special/ unixdos.h
+
+The "server" script uses "getopt". A source file of a public-domain
+version of "getopt" is included in the directory. The Makefile will
+compile it for you.
+
+The tests are configured according to parameters found in the script,
+tests.init. It contains various definitions for commands and
+parameters used by the various Makefiles and shell scripts. This file
+should be checked and then perhaps modified to correctly match your
+system. In particular, the values of "MOUNTCMD", "UMOUNTCMD", "PATH",
+"CFLAGS", and "LIBS" should be checked and set correctly. There are
+several sets of suggested values which may be used as possible starting
+places.
+
+Two special targets are included in the Makefiles: copy and dist. The
+command, "make copy DESTDIR="path"", where "path" is the absolute name
+of a directory, will cause the compiled tests to be copied to "path".
+The command, "make dist DESTDIR="path"", where "path" is the absolute
+name of a directory, will copy the test sources to "path". DESTDIR
+must be specified on the make command line when making either of these
+targets.
+
+Modifications may be required so the programs compile on your machine.
+If that is so, we would like to know what they are so that we can
+incorporate them into our distribution.
+
+When defaults are used, the test programs expect the directory,
+/server, to exist on the server. The test driver will use the
+directory /mnt/'server_name' on the client, creating it first if
+necessary (where 'server_name' is the name of the server you are
+testing against). These defaults can be overridden at run time.
+Directions for doing this are contained in the next section.
+
+
+How to run the Testsuites
+-------------------------
+
+There are two ways to run the tests: use the server shell script or
+mount, run the tests yourself, and unmount. We recommend you use the
+server script to run the tests.
+
+The server script:
+
+The server script executes one or more of the test sets depending on
+what option is given (see below). It is set up to mount, run tests
+using the runtests program, and unmount. It will attempt to unmount
+anything mounted on the mount point before attempting to mount the
+server file system. If a test fails, the run is aborted and the file
+system is left mounted to assist in troubleshooting the failure.
+
+The server script uses the domount program to mount and unmount the
+test file systems. Since mount can only be executed by root, domount
+must have root permission. The Makefile will attempt to setuid the
+domount program to root. The server script can be run as a
+nonprivileged user. Alternately, you may login as root before you run
+server.
+
+server [-a|-b|-g|-s|-l] [-f|-t] [-n] [-o mnt_options] [-p server_path] [-m mntpoint] [-N numpasses] server_name
+
+-a|-b|-g|-s|-l - will be passed on to the runtests scripts. This argument
+ is optional. The default is read from the initialization
+ file, tests.init. The variable, TEST, contains this
+ argument.
+ This argument selects which tests to run:
+ -a run basic, general, special, and lock tests
+ -b run basic tests only
+ -g run general tests only
+ -s run special tests only
+ -l run lock tests only
+-f|-t - will be passed on to the runtests scripts. This argument
+ is optional. The default is read from the initialization
+ file, tests.init. The variable, TESTARG, contains this
+ argument.
+ This argument selects how the basic tests are to be run:
+ -f a quick functionality test
+ -t extended test mode with timings
+-n - Don't perform the mkdir and rmdir operations to create
+ and destroy the test directory.
+-o mnt_options - will be passed on to the mount command. This argument is
+ optional. The default is read from the initialization
+ file, tests.init. The variable, MNTOPTIONS, contains this
+ argument.
+-p server_path - specifies a directory on the server to mount. This
+ argument is optional. The default is read from the
+ initialization file, tests.init. The variable, SERVPATH,
+ contains this argument.
+-m mntpoint - specifies a mount point on your client. This argument is
+ optional. The default is read from the initialization
+ file, tests.init. The variable, MNTPOINT, contains this
+ argument.
+-N numpasses - will be passed to the runtests script. This argument
+ is optional. It specifies the number of times to run
+ through the tests.
+server_name - the server you want to exercise. This is the only
+ required argument.
+
+The test programs create a sub-directory in the mntpoint directory with
+the name, 'hostname'.test, (where 'hostname' is the name of the machine
+on which you run the tests). This name can not be overridden if you
+use the server script although it can be if you use runtests directly.
+
+Example: (the client machine is eddie)
+
+eddie% server -o hard,intr,rw slartibartfarst
+Start tests on path /mnt.slartibartfast/eddie.test [y/n]? y
+<output from tests>
+ :
+ :
+All tests completed
+eddie%
+
+See the script for more details.
+
+
+Run tests yourself:
+
+There is a runtest script in the highest level directory (the master
+runtests) which uses tests.init to set up the test environment and then
+executes the runtest scripts in the basic, general, and/or special
+sub-directories.
+
+runtests [-a|-b|-g|-s|-l] [-f|-n|-t] [-N numpasses] [test-directory]
+
+-a - Run the basic, general, special, and lock tests. This
+ is the default.
+-b - Run the basic tests.
+-g - Run the general tests.
+-s - Run the special tests.
+-l - Run the lock tests.
+-f - Set parameters for a quick functional test. It
+ applies only to basic tests.
+-n - Suppress directory operations (mkdir and rmdir) on the
+ test-directory. See descriptions of basic tests for
+ more details.
+-t - Run full-length test with running time statistics. It
+ only applies to basic tests. This is the default mode
+ for the basic tests.
+-N numpasses - Run the tests "numpasses" times.
+test-directory - The name of test directory that the test programs
+ create on the client. runtests executes the basic
+ tests in place and they work on the test directory.
+ The general tests are copied over to the test
+ directory and executed there. When the -n flag is
+ used, the test directory is assumed to already exist.
+
+ The default test-directory is
+ /mnt.'servername'/'hostname'.test (where 'servername'
+ is the name of the server being tested, and
+ 'hostname' is the name of the machine on which you
+ are running the tests). There are three ways to
+ override the default test directory name. One it to
+ put the test_directory on the command line. Another
+ way is to set the environment variable, NFSTESTDIR,
+ equal to the directory name. The command line method
+ overrides setting the environment variable. The
+ third way can only be used for the tests in the basic
+ sub-directory. There you can set the TESTDIR
+ variable in tests.h. The command line and
+ environment variable both override this method.
+
+Running the tests without mounting your NFS server on /mnt will run the
+tests locally (if /mnt is local disk). We recommend that you do this
+once to make sure the testsuites run properly before you use them to
+test NFS.
+
+The runtests in the sub-directories, basic, general, and special, may
+be invoked with the same arguments as the master runtests if you wish
+to run each suite separately.
+
+
+How to run the Testsuites at Connectathon
+-----------------------------------------
+
+The tests should be run in the following order: basic, general, and
+special. The basic tests should be passed completely before other
+tests are attempted.
+
+The NFS Test Suite should be run in three phases:
+
+Phase 1 - Run test programs locally.
+
+Phase 2 - Run the tests against a Sun. Run them on your machine using
+ the Sun as the server and then run them on the Sun using your
+ machine as the server.
+
+Phase 3 - NxN Testing. Run the tests on your machine using every other
+ machine as a server, one at a time. After the tests are
+ successfully completed using a particular server, log that
+ with the electronic board software provided. Check the
+ electronic board to make sure that the tests run successfully
+ on every other machine that uses your machine as a server.
+
+
+Test Descriptions
+-----------------
+
+System and library calls that are used by the testsuites are included
+in parentheses. Look at the source if you are interested in how time
+statistics are recorded since that is not included in this description.
+
+- BASIC TESTS:
+
+Many of the programs listed below have optional calling parameters that
+can be used to override existing parameters. These are not used at
+this time so they are not described.
+
+test1: File and Directory Creation Test
+
+This program creates the test directory (mkdir) on the client and
+changes directories (chdir) to it, unless the -n flag is used in which
+case it simply changes directories to the test directory. Then it
+builds a directory tree N levels deep, where each directory (including
+the test directory) has M files and P directories (creat, close, chdir,
+and mkdir). For the -f option, N = 2, M = 2, and P = 2 so a total of
+six files and six directories are created. For other options, N = 5,
+M = 5, and P = 2. The files that are created are given names that
+begin with "file." and directories with names that begin with "dir.".
+
+test2: File and directory removal test
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and removes the directory tree (unlink, chdir, and rmdir) that
+was just created by test1. The number of levels, files, and
+directories, and the name prefixes, are the same as in test1.
+
+This routine will not remove a file or directory that was not created
+by test1 and will fail if it finds one. It determines this by looking
+at the prefix on the name of the object it's trying to remove.
+
+test3: Lookups across mount point
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and gets the file status of the working directory (getwd or
+getcwd and stat). For the -f option, the getwd or getcwd is done once.
+For other options, 250 getcwds or getcwds are done.
+
+test4: setattr, getattr, and lookup
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and creates ten files (creat). Then the permissions are changed
+(chmod) and the file status is retrieved (stat) for each file. For the
+-f option, one chmod and stat on each file is done. For other options,
+50 getcwds or getcwds and stats on each file are done.
+
+test4a: getattr, and lookup
+
+This test exists but is not called as part of the testsuite. You can
+edit runtests in the basic directory so this test is called.
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and creates ten files (creat). Then the file status is
+retrieved (stat) for each file. For the -f option, the stat is done
+once per file. For other options, 50 stats are done per file.
+
+test5: read and write
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and then:
+
+1) Creates a file (creat)
+2) Gets status of file (fstat)
+3) Checks size of file
+4) Writes 1048576 bytes into the file (write) in 8192 byte buffers.
+5) Closes file (close)
+6) Gets status of file (stat)
+7) Checks the size of the file
+
+For the -f option, the file is created and written once. For other
+options, file is created and written 10 times.
+
+Then the file is opened (open) and read (read) in 8192 byte buffers.
+It's contents are compared with what was written. The file is then
+closed (close).
+
+Then the file is then re-opened (open) and re-read (read) before it is
+removed (unlink). For the -f option, this sequence is done once. For
+other options, this sequence is done 10 times.
+
+test5a: write
+
+This test exists but is not called as part of the testsuite. You can
+edit runtests in the basic directory so this test is called.
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and then:
+
+1) Creates a file (creat)
+2) Gets status of file (fstat)
+3) Checks size of file
+4) Writes 1048576 bytes into the file (write) in 8192 byte buffers.
+5) Closes file (close)
+6) Gets status of file (stat)
+7) Checks the size of the file
+
+For the -f option, the file is created and written once. For other
+options, file is created and written 10 times.
+
+test5b: read
+
+This test exists but is not called as part of the testsuite. You can
+edit runtests in the basic directory so this test is called.
+
+The file created in test5a is opened (open) and read (read) in 8192 byte
+buffers. It's contents are compared with what was written. The file is
+then closed (close) and removed (unlink).
+
+For the -f option, the file is opened and read once. For other
+options, file is created and written 10 times.
+
+test6: readdir
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and creates 200 files (creat). The current directory is opened
+(opendir), the beginning is found (rewinddir), and the directory is
+read (readdir) in a loop until the end is found. Errors flagged are:
+
+1) No entry for "."
+2) No entry for ".."
+3) Duplicate entry
+4) Filename that doesn't begin with "file."
+5) The suffix of the filename is out of range
+6) An entry is returned for an unlinked file. (This error can only be
+ found when the test is run with an option other than -f. For other
+ options the rewinddir/readdir loop is done 200 times and a file is
+ unlinked each time).
+
+The directory is then closed (closedir) and the files that were created
+are removed (unlink).
+
+test7: link and rename
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and creates ten files. For each of these files, the file is
+renamed (rename) and file statistics are retrieved (stat) for both the
+new and old names. Errors that are flagged are:
+
+1) Old file still exists
+2) New file doesn't exist (can't stat)
+3) The new file's number of links doesn't equal one
+
+Then an attempt is made to link the new file to it's old name (link)
+and file stats are again retrieved (stat). An error is flagged if:
+
+1) Can't link
+2) Stats on new file can't be retrieved after link
+3) The new file's number of links doesn't equal two
+4) Stats on old file can't be retrieved after link
+5) The old file's number of links doesn't equal two
+
+Then the new file is removed (unlink) and file stats are retrieved for
+the old file (stat). An error is flagged if:
+
+1) Stats on old file can't be retrieved after unlink
+2) The old file's number of links doesn't equal one
+
+For the -f option, the rename/link/unlink loop is done once for each
+file. For other options, the rename/link/unlink loop is done 10 times
+for each file.
+
+Any files that remain at the end of the test are removed (unlink).
+
+test7a: rename
+
+This test exists but is not called as part of the testsuite. You can
+edit runtests in the basic directory so this test is called.
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and creates ten files. For each of these files, the file is
+renamed (rename) and file statistics are retrieved (stat) for both the
+new and old names. Errors that are flagged are:
+
+1) Old file still exists
+2) New file doesn't exist (can't stat)
+3) The new file's number of links doesn't equal one
+
+The file is then renamed back to its original name and the same tests
+are applied.
+
+For the -f option, the rename/rename loop is done once for each file.
+For other options, the rename/rename loop is done 10 times for each
+file.
+
+Any files that remain at the end of the test are removed (unlink).
+
+test7b: link
+
+This test exists but is not called as part of the testsuite. You can
+edit runtests in the basic directory so this test is called.
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and creates ten files. A link (link) is done for each of these
+files and file stats are retrieved for the old and new files (stat).
+An error is flagged if:
+
+1) Can't link
+2) Stats on either file can't be retrieved after link
+3) The either file's number of links doesn't equal two
+
+This is followed by an unlink (unlink) of the new file. An error is
+flagged if:
+
+1) Stats on the old file can't be retrieved after unlink
+2) The old file's number of links doesn't equal one
+
+For the -f option, the link/unlink loop is done once for each file.
+For other options, the link/unlink loop is done 10 times for each file.
+
+Any files that remain at the end of the test are removed (unlink).
+
+test8: symlink and readlink
+
+NOTE: Not all operating systems support symlink and readlink. If the
+ errno, EOPNOTSUPP, is returned during test8, the test will be
+ counted as passing. For clients not supporting S_IFLNK, the
+ test will not be attempted.
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and makes 10 symlinks (symlink). It reads (readlink), and gets
+statistics for (lstat) each, and then removes them (unlink). Errors
+flagged are:
+
+1) Unsupported function
+2) Can't get statistics (lstat failed)
+3) The mode in the stats is not symlink
+4) The value of the symlink is incorrect (returned from readlink)
+5) The linkname is wrong
+6) The unlink failed
+
+For the -f option, the symlink/readlink/unlink loop is done for each
+symlink. For other options, the symlink/readlink/unlink loop is done
+20 times for each symlink.
+
+test9: statfs
+
+This program changes directory to the test directory (chdir and/or
+mkdir) and gets the file system status on the current directory
+(statfs). For the -f option, the statfs is done once. For other
+options, the statfs is done 1500 times.
+
+
+- GENERAL: General tests to look at server loading.
+
+Runs a small compile, tbl, nroff, a large compile, four simultaneous
+large compiles, and make.
+
+
+- SPECIAL: Information specific to the special tests
+
+The special directory is set up to test special problems that have come
+up in the past. These tests are meant to be advisory, things to watch
+out for. It is not required that you "pass" these tests but we
+strongly suggest that you do.
+
+The tests try to:
+
+ check for proper open/unlink operation
+ check for proper open/rename operation
+ check for proper open/chmod 0 operation
+ check for lost reply on non-idempotent requests
+ test exclusive create
+ test negative seek
+ test rename
+
+
+- LOCK:
+
+The lock directory contains a test program which can be used to test
+the kernel file and record locking facilities. This is done to test
+the network lock manager.
+
+The test program contains 13 sets of locking tests. They test basic
+locking functionality.
+
+By default, mandatory locking is not tested. Mandatory locking is
+generally *not* supported on NFS files.
+
+
+- MISC:
+
+'Testitems' is a list of NFS functionality that can be used for
+reference.
+
+Programs in 'tools' are provided for your use as you see fit. Please
+feel free to add to this (or any other) directory! If you do, please
+make sure that Mike Kupfer <mike.kupfer@sun.com> gets a copy so we can
+add it to the master test distribution.
+
+The code in this tree was checked August 1998 for Y2000 problems.
+None were found.
+
+See READWIN.txt for information about running the tests under DOS or
+Windows.
+
+
+Changes for 2004 include the following:
+
+1. Fix lock/tlock.c to be consistent about when to use stdarg and when
+ to use varargs; reported by Samuel Sha <sam@austin.ibm.com>.
+
+2. Change "make all" so that the various "runtests" scripts have the
+ execute bit set; reported by Erik Deumens <deumens@qtp.ufl.edu>.
+
+3. Removed some lint; from James Peach <jpeach@sgi.com>.
+
+4. Irix 6.5.19 support from James Peach <jpeach@sgi.com>.
+
+5. The "server" script now exports MNTOPTIONS, so that options that
+ are added to "server" can be detected by the rest of the suite.
+ From Chuck Lever <Charles.Lever@netapp.com>.
+
+6. The tests now correctly check for errors returns from mmap(). From
+ David Robinson <david.robinson@sun.com>.
+
+7. MacOS X support from Mike Mackovitch <macko@apple.com>.
+
+8. tests.init now includes a CC= line for Linux, in case your
+ distribution doesn't include "cc". Reported by Rodney Brown
+ <rodney@lehman.com>.
+
+9. Changes for AIX, from Erik Deumens <deumens@qtp.ufl.edu>.
+
+10. Changes for the latest Tru64 Unix, from Eric Werme
+ <werme@hp.com>.
+
+11. The general tests should be more robust in the face of errors from
+ make(1). Based on comments from Chuck Lever
+ <Charles.Lever@netapp.com> and a patch from Mike Mackovitch
+ <macko@apple.com>.
+
+12. The "make lint" target for the basic tests now includes subr.c.
+
+13. Improvements to special/bigfile2:
+ - error messages now print the complete low-order word (from Mike
+ Mackovitch <macko@apple.com>.
+ - the test file is opened with O_SYNC, so that problems are
+ detected right away.
+
+14. Fix to special/op_chmod so that it uses CHMOD_NONE instead
+ of 0. From Pascal Schmidt <der.eremit@email.de>.
+
+
+Changes for 2003 include the following:
+
+1. HPUX fixes from Brian Love <blove@rlmsoftware.com> and Brian
+ McEntire <brianm@fsg1.nws.noaa.gov>.
+
+2. AIX support, based on patches from <saul@exanet.com>.
+
+3. gcc command-line options for building 64-bit binaries, from
+ Sergey Klyushin <sergey.klyushin@hummingbird.com>.
+
+4. The messages from the server script are now a little clearer about
+ leaving the server mounted after a test failure. Thanks to Vincent
+ McIntyre <Vince.McIntyre@atnf.csiro.au> for the suggestion.
+
+5. The locking tests should now work with NFS Version 4 and servers
+ that enforce mandatory locking. Thanks to Bill Baker
+ <bill.baker@sun.com> for the test12 fix.
+
+6. The general tests have been fixed to use the "stat" program that
+ comes with the tests, instead of any system "stat" program.
+
+
+Changes for 2002 include the following:
+
+1. The special tests do a better job of recognizing when NFS version 2
+ was specified (based on a patch from Jay Weber
+ <jweber@mail.thatnet.net>).
+
+2. Compilation and runtime fixes for *BSD systems, based on patches
+ from Marty Johnson <martyj@traakan.com>.
+
+3. The default local mount point was changed from /mnt.'server_name'
+ to /mnt/'server_name'. This is so that if the server dies or
+ hangs, it is less likely to cause operational problems on the
+ client.
+
+4. The "server" script will try to use "mkdir -p" if it's available.
+
+5. The general and special tests do a better job of checking for
+ errors during initialization.
+
+6. The bigfile tests have been moved to the end of the special tests
+ because they can take so long to run.
+
+7. Fixed the definition of signal handlers for Tru64 UNIX.
+
+8. Updated Linux configuration information from Jay Weber
+ <jweber@mail.thatnet.net>.
+
+
+Changes for 2001 include the following:
+
+1. Added a "-N numpasses" option to the top-level "server" and
+"runtests" script.
+
+2. Updated HPUX compilation flags for the benefit of the
+special/bigfile2 test (from Anand Paladugu <paladugu_anand@emc.com>).
+
+3. Minor portability fixes to special/bigfile2.c.
+
+4. The basic tests no longer assume that "." is in $PATH.
+
+5. The basic and special tests should be easier to build under Windows
+(from Rick Hopkins <rhopkins@ssc-corp.com>).
diff --git a/READWIN.txt b/READWIN.txt
new file mode 100644
index 0000000..8ff8616
--- /dev/null
+++ b/READWIN.txt
@@ -0,0 +1,32 @@
+@(#)READWIN.txt 1.4 2002/12/24 Connectathon Testsuite
+
+Notes for DOS/Windows.
+
+The basic tests and some of the special tests have been ported to run
+under DOS and Windows. Each set of tests has "console", "dos", and
+"scripts" subdirectories.
+
+The "console" and "dos" subdirectories have batch files and makefiles
+for building the 32-bit and 16-bit executables, respectively.
+
+The makefiles can be imported into Visual C++ as "external" makefiles.
+Alternatively, a batch file is provided to build the tests using the
+nmake command line utility.
+
+The "scripts" subdirectory has scripts for running the tests (some
+batch files, some MS-Test 2.0 .mst files, and some Perl scripts)
+
+The tests have not been rebuilt in a DOS or Windows environment since
+they were last edited, and the version of Visual C++ that was used is
+known to be pretty old. If you need to make changes to build the
+tests under your environment, please send your changes to the person
+named in the README file, and we will incorporate them into the master
+distribution.
+
+If you port additional tests to DOS/Windows, please send your changes
+to the person named in the README file, so that we can incorporate
+your changes into the master distribution.
+
+Note that we keep a single set of sources for DOS, Windows, and
+assorted Unix variants, so please isolate DOS-specific or
+Windows-specific code with appropriate ifdefs.
diff --git a/Testitems b/Testitems
new file mode 100644
index 0000000..c4a03bf
--- /dev/null
+++ b/Testitems
@@ -0,0 +1,79 @@
+# @(#)Testitems 1.2 97/01/03 Connectathon Testsuite
+NFS items for testing
+=====================
+
+Network connectivity
+
+ - ping
+ - tcp ping
+ - udp ping
+ - netstat
+ - rlogin/telnet
+
+User RPC/XDR services
+ - authentication
+ - none
+ - unix
+ - portmap
+ 0 null
+ 1 set
+ 2 unset
+ 3 getport
+ 4 dump
+ 5 callit
+ - batching (tcp)
+ - broadcast (udp)
+ - rpcinfo
+
+Mount protocol
+ - mountd
+ 0 null
+ 1 mnt
+ 2 dump
+ 3 unmnt
+ 4 umntall
+ 5 export
+ - showmount
+ - mount
+
+NFS protocol
+ - nfsd/server
+ 0 null
+ 1 getattr
+ 2 setattr
+ 3 error
+ 4 lookup
+ 5 readlink
+ 6 read
+ 7 error
+ 8 write
+ 9 create
+ 10 remove
+ 11 rename
+ 12 link
+ 13 symlink
+ 14 mkdir
+ 15 rmdir
+ 16 readdir
+ 17 statfs
+ - biod/client
+ - nfsstat
+ - special situations
+ - open/unlink/read
+ - open/chmod/write
+ - readdir with empty block
+ - non-idempotent (create, unlink)
+
+Yellow pages
+ - domainname
+ - ypbind
+ - ypserv
+ - ypwhich
+ - ypcat
+ - ypinit
+ - makedbm
+ - ypmake: yppush/yppull/yppoll
+ - yppasswd
+ - files
+ passwd, group, hosts, networks, services,
+ protocols, netgroup
diff --git a/basic/Makefile b/basic/Makefile
new file mode 100644
index 0000000..b87462e
--- /dev/null
+++ b/basic/Makefile
@@ -0,0 +1,94 @@
+#
+# @(#)Makefile 1.8 2003/12/29 Connectathon Testsuite
+# 1.5 Lachman ONC Test Suite source
+#
+# to make tests, use 'make'
+# to copy tests to another directory, use 'make copy DESTDIR=dir'
+# to copy source to another directory, use 'make dist DESTDIR=dir'
+
+TESTS = test1 test2 test3 test4 test5 test6 test7 test8 test9
+AUXTESTS = test4a test5a test5b test7a test7b
+DOSRUNFILES = scripts/*.bat scripts/*.mst scripts/*.prl
+DOSBUILDFILES = console/*.bat console/*.mak dos/*.bat dos/*.mak
+DOSFILES = $(DOSRUNFILES) $(DOSBUILDFILES)
+DESTDIR = /no/such/path
+
+INCLUDES=../tests.h
+
+include ../tests.init
+
+all: origtests auxtests
+ if test ! -x runtests; then chmod a+x runtests; fi
+
+origtests: $(TESTS)
+auxtests: $(AUXTESTS)
+
+subr.o: subr.c $(INCLUDES)
+
+test1: test1.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test2: test2.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test3: test3.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test4: test4.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test4a: test4a.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test5: test5.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test5a: test5a.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test5b: test5b.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test6: test6.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test7: test7.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test7a: test7a.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test7b: test7b.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test8: test8.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+test9: test9.c $(INCLUDES) subr.o
+ $(CC) $(CFLAGS) -o $@ $@.c subr.o $(LIBS)
+
+lint:
+ lint $(CFLAGS) test1.c subr.c $(LIBS)
+ lint $(CFLAGS) test2.c subr.c $(LIBS)
+ lint $(CFLAGS) test3.c subr.c $(LIBS)
+ lint $(CFLAGS) test4.c subr.c $(LIBS)
+ lint $(CFLAGS) test4a.c subr.c $(LIBS)
+ lint $(CFLAGS) test5.c subr.c $(LIBS)
+ lint $(CFLAGS) test5a.c subr.c $(LIBS)
+ lint $(CFLAGS) test5b.c subr.c $(LIBS)
+ lint $(CFLAGS) test6.c subr.c $(LIBS)
+ lint $(CFLAGS) test7.c subr.c $(LIBS)
+ lint $(CFLAGS) test7a.c subr.c $(LIBS)
+ lint $(CFLAGS) test7b.c subr.c $(LIBS)
+ lint $(CFLAGS) test8.c subr.c $(LIBS)
+ lint $(CFLAGS) test9.c subr.c $(LIBS)
+
+clean:
+ rm -f *.o $(TESTS) $(AUXTESTS)
+
+copy: $(TESTS)
+ cp -f runtests runtests.mvs $(TESTS) $(AUXTESTS) $(DESTDIR)
+
+dist:
+ cp -f runtests runtests.mvs Makefile *.c $(DESTDIR)
+ tar cf - $(DOSFILES) | (cd $(DESTDIR); tar xfBp -)
diff --git a/basic/console/build.bat b/basic/console/build.bat
new file mode 100644
index 0000000..51fe601
--- /dev/null
+++ b/basic/console/build.bat
@@ -0,0 +1,37 @@
+rem @(#)build.bat 1.1 98/10/26 Connectathon Testsuite
+@echo off
+
+rem Cthon Test Suite NMAKE Build Script for Microsoft Visual C++ 1.5
+
+rem The Cthon Test Suite can not be build reliably with Microsoft
+rem Visual C++ Workbench. This is due to Workbench rebuilding the
+rem dependency files if the source is moved from one location to
+rem another. When this occurs the Unix format pathnames for the
+rem Unix include files are added into the makefile and when the
+rem compiler runs it complains it can not find the files. So this
+rem script was created to run NMAKE with the makefiles instead.
+rem This requires that the PATH, LIB and INCLUDE environment
+rem variables be set up correctly, or their location passed as
+rem parameter %1 to this script.
+
+set LIB=%LIB%;%1\LIB
+set INCLUDE=%INCLUDE%;%1\INCLUDE
+set PATH=%PATH%;%1\BIN
+
+NMAKE TEST1.MAK
+NMAKE TEST2.MAK
+NMAKE TEST3.MAK
+NMAKE TEST4.MAK
+NMAKE TEST5.MAK
+NMAKE TEST6.MAK
+NMAKE TEST7.MAK
+NMAKE TEST8.MAK
+NMAKE TEST9.MAK
+NMAKE TEST4a.MAK
+NMAKE TEST5a.MAK
+NMAKE TEST5b.MAK
+NMAKE TEST7a.MAK
+NMAKE TEST7b.MAK
+
+
+
diff --git a/basic/console/test1.mak b/basic/console/test1.mak
new file mode 100755
index 0000000..7c371b0
--- /dev/null
+++ b/basic/console/test1.mak
@@ -0,0 +1,201 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "test1.mak" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\test1.exe .\WinRel\test1.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /ML /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /ML /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /ML /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"test1.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST1.SBR \
+ .\WinRel\SUBR.SBR
+
+.\WinRel\test1.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:no /PDB:$(OUTDIR)/"test1.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"test1.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST1.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\test1.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST1.exe .\WinDebug\test1.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /ML /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /ML /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /ML /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"test1.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"test1.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST1.SBR \
+ .\WinDebug\SUBR.SBR
+
+.\WinDebug\test1.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"test1.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"test1.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST1.OBJ \
+ .\WinDebug\SUBR.OBJ
+
+.\WinDebug\TEST1.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST1.C
+DEP_TEST1=\
+ ..\tests.h\
+ ..\unixdos.h
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST1.OBJ : $(SOURCE) $(DEP_TEST1) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST1.OBJ : $(SOURCE) $(DEP_TEST1) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=..\SUBR.C
+DEP_SUBR_=\
+ ..\tests.h\
+ ..\unixdos.h
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\SUBR.OBJ : $(SOURCE) $(DEP_SUBR_) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\SUBR.OBJ : $(SOURCE) $(DEP_SUBR_) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test2.mak b/basic/console/test2.mak
new file mode 100755
index 0000000..484f573
--- /dev/null
+++ b/basic/console/test2.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST2.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST2.exe .\WinRel\TEST2.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST2.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST2.SBR
+
+.\WinRel\TEST2.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST2.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST2.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST2.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST2.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST2.exe .\WinDebug\TEST2.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST2.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST2.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST2.SBR
+
+.\WinDebug\TEST2.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST2.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST2.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST2.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST2.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST2.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST2.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST2.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test3.mak b/basic/console/test3.mak
new file mode 100755
index 0000000..a7ffd31
--- /dev/null
+++ b/basic/console/test3.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST3.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST3.exe .\WinRel\TEST3.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST3.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST3.SBR
+
+.\WinRel\TEST3.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST3.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST3.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST3.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST3.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST3.exe .\WinDebug\TEST3.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST3.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST3.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST3.SBR
+
+.\WinDebug\TEST3.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST3.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST3.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST3.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST3.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST3.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST3.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST3.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test4.mak b/basic/console/test4.mak
new file mode 100755
index 0000000..5a17ac2
--- /dev/null
+++ b/basic/console/test4.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST4.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST4.exe .\WinRel\TEST4.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST4.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST4.SBR
+
+.\WinRel\TEST4.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST4.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST4.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST4.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST4.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST4.exe .\WinDebug\TEST4.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST4.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST4.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST4.SBR
+
+.\WinDebug\TEST4.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST4.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST4.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST4.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST4.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST4.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST4.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST4.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test4a.mak b/basic/console/test4a.mak
new file mode 100755
index 0000000..af97f71
--- /dev/null
+++ b/basic/console/test4a.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST4a.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST4a.exe .\WinRel\TEST4a.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST4a.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST4a.SBR
+
+.\WinRel\TEST4a.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST4a.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST4a.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST4a.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST4a.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST4a.exe .\WinDebug\TEST4a.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST4a.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST4a.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST4a.SBR
+
+.\WinDebug\TEST4a.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST4a.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST4a.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST4a.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST4a.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST4a.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST4a.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST4a.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test5.mak b/basic/console/test5.mak
new file mode 100755
index 0000000..e60d8c9
--- /dev/null
+++ b/basic/console/test5.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST5.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST5.exe .\WinRel\TEST5.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST5.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST5.SBR
+
+.\WinRel\TEST5.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST5.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST5.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST5.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST5.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST5.exe .\WinDebug\TEST5.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST5.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST5.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST5.SBR
+
+.\WinDebug\TEST5.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST5.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST5.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST5.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST5.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST5.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST5.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST5.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test5a.mak b/basic/console/test5a.mak
new file mode 100755
index 0000000..4b89c08
--- /dev/null
+++ b/basic/console/test5a.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST5a.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST5a.exe .\WinRel\TEST5a.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST5a.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST5a.SBR
+
+.\WinRel\TEST5a.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST5a.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST5a.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST5a.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST5a.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST5a.exe .\WinDebug\TEST5a.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST5a.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST5a.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST5a.SBR
+
+.\WinDebug\TEST5a.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST5a.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST5a.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST5a.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST5a.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST5a.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST5a.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST5a.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test5b.mak b/basic/console/test5b.mak
new file mode 100755
index 0000000..31b6cc8
--- /dev/null
+++ b/basic/console/test5b.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST5b.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST5b.exe .\WinRel\TEST5b.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST5b.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST5b.SBR
+
+.\WinRel\TEST5b.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST5b.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST5b.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST5b.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST5b.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST5b.exe .\WinDebug\TEST5b.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST5b.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST5b.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST5b.SBR
+
+.\WinDebug\TEST5b.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST5b.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST5b.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST5b.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST5b.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST5b.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST5b.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST5b.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test6.mak b/basic/console/test6.mak
new file mode 100755
index 0000000..42e2a27
--- /dev/null
+++ b/basic/console/test6.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST6.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST6.exe .\WinRel\TEST6.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST6.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST6.SBR
+
+.\WinRel\TEST6.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST6.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST6.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST6.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST6.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST6.exe .\WinDebug\TEST6.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST6.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST6.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST6.SBR
+
+.\WinDebug\TEST6.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST6.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST6.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST6.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST6.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST6.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST6.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST6.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test7.mak b/basic/console/test7.mak
new file mode 100755
index 0000000..2915a78
--- /dev/null
+++ b/basic/console/test7.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST7.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST7.exe .\WinRel\TEST7.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST7.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST7.SBR
+
+.\WinRel\TEST7.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST7.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST7.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST7.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST7.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST7.exe .\WinDebug\TEST7.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST7.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST7.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST7.SBR
+
+.\WinDebug\TEST7.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST7.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST7.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST7.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST7.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST7.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST7.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST7.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test7a.mak b/basic/console/test7a.mak
new file mode 100755
index 0000000..8a3c780
--- /dev/null
+++ b/basic/console/test7a.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST7a.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST7a.exe .\WinRel\TEST7a.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST7a.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST7a.SBR
+
+.\WinRel\TEST7a.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST7a.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST7a.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST7a.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST7a.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST7a.exe .\WinDebug\TEST7a.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST7a.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST7a.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST7a.SBR
+
+.\WinDebug\TEST7a.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST7a.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST7a.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST7a.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST7a.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST7a.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST7a.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST7a.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test7b.mak b/basic/console/test7b.mak
new file mode 100755
index 0000000..c90d870
--- /dev/null
+++ b/basic/console/test7b.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST7b.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST7b.exe .\WinRel\TEST7b.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST7b.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST7b.SBR
+
+.\WinRel\TEST7b.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST7b.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST7b.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST7b.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST7b.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST7b.exe .\WinDebug\TEST7b.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST7b.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST7b.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST7b.SBR
+
+.\WinDebug\TEST7b.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST7b.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST7b.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST7b.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST7b.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST7b.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST7b.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST7b.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test8.mak b/basic/console/test8.mak
new file mode 100755
index 0000000..c9218cc
--- /dev/null
+++ b/basic/console/test8.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST8.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST8.exe .\WinRel\TEST8.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST8.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST8.SBR
+
+.\WinRel\TEST8.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST8.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST8.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST8.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST8.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST8.exe .\WinDebug\TEST8.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST8.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST8.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST8.SBR
+
+.\WinDebug\TEST8.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST8.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST8.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST8.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST8.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST8.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST8.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST8.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/console/test9.mak b/basic/console/test9.mak
new file mode 100755
index 0000000..82ed99c
--- /dev/null
+++ b/basic/console/test9.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TEST9.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TEST9.exe .\WinRel\TEST9.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST9.bsc"
+BSC32_SBRS= \
+ .\WinRel\TEST9.SBR
+
+.\WinRel\TEST9.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST9.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TEST9.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TEST9.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\TEST9.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TEST9.exe .\WinDebug\TEST9.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TEST9.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TEST9.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TEST9.SBR
+
+.\WinDebug\TEST9.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TEST9.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TEST9.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TEST9.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\TEST9.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\TEST9.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TEST9.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TEST9.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/basic/dos/build.bat b/basic/dos/build.bat
new file mode 100644
index 0000000..51fe601
--- /dev/null
+++ b/basic/dos/build.bat
@@ -0,0 +1,37 @@
+rem @(#)build.bat 1.1 98/10/26 Connectathon Testsuite
+@echo off
+
+rem Cthon Test Suite NMAKE Build Script for Microsoft Visual C++ 1.5
+
+rem The Cthon Test Suite can not be build reliably with Microsoft
+rem Visual C++ Workbench. This is due to Workbench rebuilding the
+rem dependency files if the source is moved from one location to
+rem another. When this occurs the Unix format pathnames for the
+rem Unix include files are added into the makefile and when the
+rem compiler runs it complains it can not find the files. So this
+rem script was created to run NMAKE with the makefiles instead.
+rem This requires that the PATH, LIB and INCLUDE environment
+rem variables be set up correctly, or their location passed as
+rem parameter %1 to this script.
+
+set LIB=%LIB%;%1\LIB
+set INCLUDE=%INCLUDE%;%1\INCLUDE
+set PATH=%PATH%;%1\BIN
+
+NMAKE TEST1.MAK
+NMAKE TEST2.MAK
+NMAKE TEST3.MAK
+NMAKE TEST4.MAK
+NMAKE TEST5.MAK
+NMAKE TEST6.MAK
+NMAKE TEST7.MAK
+NMAKE TEST8.MAK
+NMAKE TEST9.MAK
+NMAKE TEST4a.MAK
+NMAKE TEST5a.MAK
+NMAKE TEST5b.MAK
+NMAKE TEST7a.MAK
+NMAKE TEST7b.MAK
+
+
+
diff --git a/basic/dos/test1.mak b/basic/dos/test1.mak
new file mode 100755
index 0000000..ac5b381
--- /dev/null
+++ b/basic/dos/test1.mak
@@ -0,0 +1,92 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST1
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST1.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = SUBR.SBR \
+ TEST1.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+TEST1_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+TEST1.OBJ: ..\TEST1.C $(TEST1_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\TEST1.C
+
+$(PROJ).EXE:: SUBR.OBJ TEST1.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+SUBR.OBJ +
+TEST1.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test2.mak b/basic/dos/test2.mak
new file mode 100755
index 0000000..674359e
--- /dev/null
+++ b/basic/dos/test2.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST2
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST2.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST2.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST2.SBR
+
+
+TEST2_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST2.OBJ: ..\TEST2.C $(TEST2_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST2.C
+
+$(PROJ).EXE:: TEST2.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST2.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test3.mak b/basic/dos/test3.mak
new file mode 100755
index 0000000..8f09995
--- /dev/null
+++ b/basic/dos/test3.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST3
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST3.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST3.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST3.SBR
+
+
+TEST3_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST3.OBJ: ..\TEST3.C $(TEST3_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST3.C
+
+$(PROJ).EXE:: TEST3.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST3.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test4.mak b/basic/dos/test4.mak
new file mode 100755
index 0000000..d856c0c
--- /dev/null
+++ b/basic/dos/test4.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST4
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST4.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST4.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST4.SBR
+
+
+TEST4_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST4.OBJ: ..\TEST4.C $(TEST4_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST4.C
+
+$(PROJ).EXE:: TEST4.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST4.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test4a.mak b/basic/dos/test4a.mak
new file mode 100755
index 0000000..4a2ecc6
--- /dev/null
+++ b/basic/dos/test4a.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST4A
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST4A.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST4A.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST4A.SBR
+
+
+TEST4A_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST4A.OBJ: ..\TEST4A.C $(TEST4A_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST4A.C
+
+$(PROJ).EXE:: TEST4A.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST4A.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test5.mak b/basic/dos/test5.mak
new file mode 100755
index 0000000..f9c6209
--- /dev/null
+++ b/basic/dos/test5.mak
@@ -0,0 +1,85 @@
+# Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST5
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST5.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST5.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:10240
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:10240
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST5.SBR
+
+
+TEST5_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST5.OBJ: ..\TEST5.C $(TEST5_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST5.C
+
+$(PROJ).EXE:: TEST5.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST5.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test5a.mak b/basic/dos/test5a.mak
new file mode 100755
index 0000000..c029345
--- /dev/null
+++ b/basic/dos/test5a.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST5A
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST5A.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST5A.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:10240
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:10240
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST5A.SBR
+
+
+TEST5A_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST5A.OBJ: ..\TEST5A.C $(TEST5A_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST5A.C
+
+$(PROJ).EXE:: TEST5A.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST5A.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test5b.mak b/basic/dos/test5b.mak
new file mode 100755
index 0000000..1fd61ea
--- /dev/null
+++ b/basic/dos/test5b.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST5B
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST5B.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST5B.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:10240
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:10240
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST5B.SBR
+
+
+TEST5B_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST5B.OBJ: ..\TEST5B.C $(TEST5B_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST5B.C
+
+$(PROJ).EXE:: TEST5B.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST5B.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test6.mak b/basic/dos/test6.mak
new file mode 100755
index 0000000..020cb8b
--- /dev/null
+++ b/basic/dos/test6.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST6
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST6.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST6.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST6.SBR
+
+
+TEST6_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST6.OBJ: ..\TEST6.C $(TEST6_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST6.C
+
+$(PROJ).EXE:: TEST6.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST6.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test7.mak b/basic/dos/test7.mak
new file mode 100755
index 0000000..6d08323
--- /dev/null
+++ b/basic/dos/test7.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST7
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST7.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST7.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST7.SBR
+
+
+TEST7_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST7.OBJ: ..\TEST7.C $(TEST7_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST7.C
+
+$(PROJ).EXE:: TEST7.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST7.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test7a.mak b/basic/dos/test7a.mak
new file mode 100755
index 0000000..5a7dd40
--- /dev/null
+++ b/basic/dos/test7a.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST7A
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST7A.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST7A.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST7A.SBR
+
+
+TEST7A_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST7A.OBJ: ..\TEST7A.C $(TEST7A_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST7A.C
+
+$(PROJ).EXE:: TEST7A.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST7A.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test7b.mak b/basic/dos/test7b.mak
new file mode 100755
index 0000000..f05471f
--- /dev/null
+++ b/basic/dos/test7b.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST7B
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST7B.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST7B.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST7B.SBR
+
+
+TEST7B_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST7B.OBJ: ..\TEST7B.C $(TEST7B_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST7B.C
+
+$(PROJ).EXE:: TEST7B.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST7B.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test8.mak b/basic/dos/test8.mak
new file mode 100755
index 0000000..9d0220f
--- /dev/null
+++ b/basic/dos/test8.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST8
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST8.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST8.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST8.SBR
+
+
+TEST8_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST8.OBJ: ..\TEST8.C $(TEST8_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST8.C
+
+$(PROJ).EXE:: TEST8.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST8.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/dos/test9.mak b/basic/dos/test9.mak
new file mode 100755
index 0000000..d17df27
--- /dev/null
+++ b/basic/dos/test9.mak
@@ -0,0 +1,85 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TEST9
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = TEST9.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TEST9.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT = SUBR.OBJ
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TEST9.SBR
+
+
+TEST9_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+SUBR_DEP =
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+TEST9.OBJ: ..\TEST9.C $(TEST9_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\TEST9.C
+
+$(PROJ).EXE:: TEST9.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TEST9.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/basic/runtests b/basic/runtests
new file mode 100755
index 0000000..24b0afc
--- /dev/null
+++ b/basic/runtests
@@ -0,0 +1,82 @@
+:
+#!/bin/sh
+#
+# @(#)runtests 1.3 00/07/10 Connectathon Testsuite
+#
+
+InitFile="../tests.init"
+
+if test $# -ge 1
+then
+ TESTARG=$1
+else
+ . $InitFile
+fi
+
+echo "Starting BASIC tests: test directory $NFSTESTDIR (arg: $TESTARG)"
+mkdir $NFSTESTDIR
+if test ! -d $NFSTESTDIR
+then
+ echo "Can't make directory $NFSTESTDIR"
+ exit 1
+fi
+
+set -e
+
+# File and Directory tree creation test
+echo ""
+./test1 $TESTARG
+
+# File and Directory tree removal test
+echo ""
+./test2 $TESTARG
+
+# Lookup across mount point
+echo ""
+./test3 $TESTARG
+
+# Setattr, getattr and lookup tests
+echo ""
+./test4 $TESTARG
+# Getattr and lookup tests
+# echo ""
+# ./test4a $TESTARG
+
+# Write and read tests
+echo ""
+./test5 $TESTARG
+# Test 5a and 5b separate out the read and write tests into simpler components.
+# echo ""
+# ./test5a $TESTARG
+# echo ""
+# ./test5b $TESTARG
+
+# Read Directory test
+echo "TESTARG=$TESTARG"
+./test6 $TESTARG
+
+# Rename and Link test
+echo ""
+if [ "$HARDLINKS"o != no ]
+then
+ ./test7 $TESTARG
+else
+ ./test7a $TESTARG
+fi
+# Link Test
+# echo ""
+# ./test7b $TESTARG
+
+# Symlink and readlink test
+echo ""
+./test8 $TESTARG
+
+# Getfs test
+echo ""
+./test9 $TESTARG
+
+echo ""
+
+echo "Congratulations, you passed the basic tests!"
+
+exit 0
diff --git a/basic/runtests.mvs b/basic/runtests.mvs
new file mode 100644
index 0000000..ef680b7
--- /dev/null
+++ b/basic/runtests.mvs
@@ -0,0 +1,48 @@
+:
+#!/bin/sh
+#
+# @(#)runtests.mvs 1.2 97/01/03 Connectathon Testsuite
+#
+#. ../startup.sh
+
+# see ../startup.sh for usage info
+# 'ARGS=-f' for basic funtionality tests (one pass of each test)
+# 'ARGS= ' for longer tests without timing (1-3 minutes per test)
+# 'ARGS=-t' for longer tests with timing
+
+ARGS="-m"
+
+echo "Starting BASIC tests: test directory $NFSTESTDIR (arg: $ARGS)"
+
+echo ""
+# levels files dirs fname dname
+test1 $ARGS 1 2 0 mvsn mvsd
+echo ""
+test2 $ARGS 1 2 0 mvsn mvsd
+echo ""
+test3 $ARGS 1
+# echo ""
+# test4 $ARGS DON'T DO SETATTR TESTS
+echo ""
+test4a $ARGS 10 1 mvsn
+echo ""
+test5 $ARGS 1048576 10 bigfile
+# echo ""
+# test5a $ARGS
+# echo ""
+# test5b $ARGS
+echo ""
+test6 -i $ARGS 200 1 mvsn
+# echo ""
+# test7 $ARGS DON'T TEST LINK OPERTAIONS
+echo ""
+test7a $ARGS 10 1 mvsn newn
+# echo ""
+# test7b $ARGS DON'T TEST LINK OPERATIONS
+# echo ""
+# test8 $ARGS DON'T TEST SYMLINK/READLINK OPERATIONS
+echo ""
+test9 $ARGS 1
+echo ""
+
+echo "Congratulations, you passed the basic tests for MVS/NFS!"
diff --git a/basic/runtests.orig b/basic/runtests.orig
new file mode 100755
index 0000000..32e1d85
--- /dev/null
+++ b/basic/runtests.orig
@@ -0,0 +1,82 @@
+:
+#!/bin/sh
+#
+# @(#)runtests 1.3 00/07/10 Connectathon Testsuite
+#
+
+InitFile="../tests.init"
+
+if test $# -ge 1
+then
+ TESTARG=$1
+else
+ . $InitFile
+fi
+
+echo "Starting BASIC tests: test directory $NFSTESTDIR (arg: $TESTARG)"
+mkdir $NFSTESTDIR
+if test ! -d $NFSTESTDIR
+then
+ echo "Can't make directory $NFSTESTDIR"
+ exit 1
+fi
+
+set -e
+
+# File and Directory tree creation test
+echo ""
+./test1 $TESTARG
+
+# File and Directory tree removal test
+echo ""
+./test2 $TESTARG
+
+# Lookup across mount point
+echo ""
+./test3 $TESTARG
+
+# Setattr, getattr and lookup tests
+echo ""
+./test4 $TESTARG
+# Getattr and lookup tests
+# echo ""
+# ./test4a $TESTARG
+
+# Write and read tests
+echo ""
+./test5 $TESTARG
+# Test 5a and 5b separate out the read and write tests into simpler components.
+# echo ""
+# ./test5a $TESTARG
+# echo ""
+# ./test5b $TESTARG
+
+# Read Directory test
+echo ""
+./test6 $TESTARG
+
+# Rename and Link test
+echo ""
+if [ "$HARDLINKS"o != no ]
+then
+ ./test7 $TESTARG
+else
+ ./test7a $TESTARG
+fi
+# Link Test
+# echo ""
+# ./test7b $TESTARG
+
+# Symlink and readlink test
+echo ""
+./test8 $TESTARG
+
+# Getfs test
+echo ""
+./test9 $TESTARG
+
+echo ""
+
+echo "Congratulations, you passed the basic tests!"
+
+exit 0
diff --git a/basic/scripts/basic.bat b/basic/scripts/basic.bat
new file mode 100644
index 0000000..9f10032
--- /dev/null
+++ b/basic/scripts/basic.bat
@@ -0,0 +1,101 @@
+
+rem @(#)basic.bat 1.1 98/10/26 Connectathon Testsuite
+@echo off
+echo.
+echo Starting CONNECTATHON BASIC tests
+echo.
+
+set TESTDIR=%2
+set TESTARG1=%3
+set TESTARG2=%4
+set OLDPATH=%PATH%
+
+echo Arg1 is the network_drive: to create the test dir on = %1%
+rem Note: Arg1 should also be the drive you start the macro (ie. L:)
+echo Arg2 is the basename of the directory to create = %TESTDIR%
+echo Arg3 is the value of test arg1 = %TESTARG1%
+echo Arg4 is the value of test arg2 = %TESTARG2%
+echo Arg5 is the full path to the directory containing the tests = %5%
+echo.
+
+choice /t:C,10 /n /c:AC (A-bort or C-ontinue):
+if errorlevel 2 goto Continue
+if errorlevel 1 goto Exit
+:Continue
+
+PATH=%5;%PATH%
+
+%1
+cd \
+
+deltree /y %TESTDIR%*
+
+set NFSTESTDIR=%TESTDIR%1
+test1 %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+
+test2 %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%3
+rem test3 Only 1 Param
+test3 %TESTARG1%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%4
+test4 %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%5
+test5 %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%6
+rem "'test6 Param 1 must be <= Param 2'"
+test6 %TESTARG1% %TESTARG1%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%7
+test7 %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%8
+test8 %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+rem No cd .. or deltree /y needed
+
+set NFSTESTDIR=%TESTDIR%9
+rem test9 Only 1 Param
+test9 %TESTARG1%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+echo "Congratulations, you completed the basic tests!"
+
+:Exit
+
+PATH=%OLDPATH%
+
diff --git a/basic/scripts/basic2.bat b/basic/scripts/basic2.bat
new file mode 100644
index 0000000..9ee4e38
--- /dev/null
+++ b/basic/scripts/basic2.bat
@@ -0,0 +1,72 @@
+
+rem @(#)basic2.bat 1.1 98/10/26 Connectathon Testsuite
+@echo off
+echo.
+echo Starting CONNECTATHON BASIC tests 4a, 5a, 5b, 7a & 7b
+echo.
+
+set TESTDIR=%2
+set TESTARG1=%3
+set TESTARG2=%4
+set OLDPATH=%PATH%
+
+echo Arg1 is the network_drive: to create the test dir on = %1%
+rem Note: Arg1 should be the drive you start the macro from also
+echo Arg2 is the basename of the directory to create = %TESTDIR%
+echo Arg3 is the value of test arg1 = %TESTARG1%
+echo Arg4 is the value of test arg2 = %TESTARG2%
+echo Arg5 is the full path to the directory containing the tests = %5%
+echo.
+
+choice /t:C,10 /n /c:AC (A-bort or C-ontinue):
+if errorlevel 2 goto Continue
+if errorlevel 1 goto Exit
+:Continue
+
+PATH=%5;%PATH%
+
+%1
+cd \
+
+deltree /y %TESTDIR%*
+
+set NFSTESTDIR=%TESTDIR%4
+test4a %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%5
+test5a %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+
+set NFSTESTDIR=%TESTDIR%5
+test5b %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%7
+test7a %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%7
+test7b %TESTARG1% %TESTARG2%
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+echo "Congratulations, you completed the basic tests!"
+
+:Exit
+
+PATH=%OLDPATH%
+
diff --git a/basic/scripts/basic3.bat b/basic/scripts/basic3.bat
new file mode 100644
index 0000000..f19cacc
--- /dev/null
+++ b/basic/scripts/basic3.bat
@@ -0,0 +1,101 @@
+
+rem @(#)basic3.bat 1.1 98/10/26 Connectathon Testsuite
+@echo off
+echo.
+echo Starting CONNECTATHON BASIC tests 1 -9 with Stress Load Parameters
+echo.
+
+set TESTDIR=%2
+set TESTARG1=%3
+set TESTARG2=%4
+set OLDPATH=%PATH%
+
+echo Arg1 is the network drive to create the test dir on = %1%
+rem Note: Arg1 should be the drive you start the macro from also
+echo Arg2 is the basename of the directory to create = %TESTDIR%
+echo Arg3 is the value of test arg1 = %TESTARG1%
+echo Arg4 is the value of test arg2 = %TESTARG2%
+echo Arg5 is the full path to the directory containing the tests = %5%
+echo.
+
+choice /t:C,10 /n /c:AC (A-bort or C-ontinue):
+if errorlevel 2 goto Continue
+if errorlevel 1 goto Exit
+:Continue
+
+PATH=%5;%PATH%
+
+%1
+cd \
+
+deltree /y %TESTDIR%*
+
+set NFSTESTDIR=%TESTDIR%1
+test1 4 10 5
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+
+test2 4 10 5
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%3
+rem test3 Only 1 Param
+test3 1000
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%4
+test4 500 100
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%5
+test5 8192 128
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%6
+rem "'test6 Param 1 must be <= Param 2'"
+test6 512 512
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%7
+test7 10 100
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+set NFSTESTDIR=%TESTDIR%8
+test8 1 1
+if errorlevel 1 echo *** Test Failed ***
+%1
+rem No cd .. or deltree /y needed
+
+set NFSTESTDIR=%TESTDIR%9
+rem test9 Only 1 Param
+test9 1000
+if errorlevel 1 echo *** Test Failed ***
+%1
+cd \
+deltree /y %NFSTESTDIR%
+
+echo "Congratulations, you completed the basic tests!"
+
+:Exit
+
+PATH=%OLDPATH%
+
diff --git a/basic/scripts/cthon.bat b/basic/scripts/cthon.bat
new file mode 100644
index 0000000..0d27ee5
--- /dev/null
+++ b/basic/scripts/cthon.bat
@@ -0,0 +1,16 @@
+rem @(#)cthon.bat 1.1 98/10/26 Connectathon Testsuite
+@echo off
+
+rem %1 path to executable
+rem %2 name of test
+rem %3 testdir name
+rem %4 logfile name
+rem %+ parameters
+
+
+PATH=%1;%PATH%
+set NFSTESTDIR=%3
+
+@echo on
+redir -r2 %2 %5 %6 %7 %8 %9 >> %4
+
diff --git a/basic/scripts/cthon00.mst b/basic/scripts/cthon00.mst
new file mode 100644
index 0000000..67a19b6
--- /dev/null
+++ b/basic/scripts/cthon00.mst
@@ -0,0 +1,126 @@
+'******************************* CTHON00.MST *********************************
+' @(#)cthon00.mst 1.1 98/10/26 Connectathon Testsuite
+'
+'Description: This test suite contains a set of test cases and scenarios that
+' are used to test Directory Caching. It is the same as CTHON01,
+' except that it uses the MS-Test SHELL command instead of RUN.
+' This allows it to work properly with Win95.
+'
+'******************************************************************************
+
+'********************************* HISTORY ************************************
+' Date DVE Comments
+' 3/01/94 Jack Morrison Initial version
+'******************************************************************************
+'
+'******************************************************************************
+'* Include Files
+'******************************************************************************
+
+'$INCLUDE 'DECLARES.INC'
+
+Const APPL_ABBR$ = "CTHON"
+
+'$INCLUDE 'NFSCOMM.INC'
+'$INCLUDE 'NFSSUBS.INC'
+
+'******************************************************************************
+' Subroutines and Functions Declarations
+'******************************************************************************
+
+Declare Sub CTHONTest12a ()
+Declare Sub CTHONTest12b ()
+Declare Sub CTHONTest12c ()
+
+Declare Sub CTHONTest03 ()
+Declare Sub CTHONTest04 ()
+Declare Sub CTHONTest05 ()
+Declare Sub CTHONTest06 ()
+Declare Sub CTHONTest07 ()
+Declare Sub CTHONTest09 ()
+
+'******************************************************************************
+'* Initialize Variables
+'******************************************************************************
+Const Failed = "err"
+Const Drives = 3
+'******************************************************************************
+'* Main prorgram code
+'******************************************************************************
+On Error Goto ErrorTrap
+
+QueSetSpeed 75
+
+Setup
+
+FOR C = 1 TO Drives
+
+rtn = Connect(NetHost(C), NetDrive(C), NetPath(C), "") 'user$ passwd$
+
+If rtn <> PASS Then EXIT FOR
+If EXISTS (NetDrive(C)+":\testlog.*") Then KILL NetDrive(C)+":\testlog.*"
+
+NEXT C
+
+If C >= Drives Then
+
+' *** Execute the tests
+
+CTHONTest12a
+
+Else
+ WriteLogFile "Drive Could Not Be Connected. Test Aborted !"
+ failure_Occurred = TRUE
+End If
+
+FOR D = 1 TO Drives
+
+rtn = Disconnect (NetDrive(D))
+
+NEXT D
+
+Cleanup
+CheckExit
+
+End
+
+'******************************************************************************
+'Subroutines
+'******************************************************************************
+
+'******************************************************************************
+'SUB CTHONTest12a
+'******************************************************************************
+Sub CTHONTest12a() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON Acceptance Test"+" "+DateTime$
+
+FOR I = 1 TO Drives
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+levels$ = "1"
+files$ = "1"
+dirs$ = "1"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON Acceptance Test In Progess", 0,0,0,0, TRUE, TRUE
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+CheckLog "testlog.12", Failed$, False
+NEXT I
+
+EndSubTest " CTHON Acceptance Test"+" "+DateTime$
+
+End Sub
+
diff --git a/basic/scripts/cthon01.mst b/basic/scripts/cthon01.mst
new file mode 100644
index 0000000..3883183
--- /dev/null
+++ b/basic/scripts/cthon01.mst
@@ -0,0 +1,436 @@
+'******************************* CTHON01.MST *********************************
+' @(#)cthon01.mst 1.1 98/10/26 Connectathon Testsuite
+'
+'Description: This test suite contains a set of test cases and scenarios that
+' are used to test Directory Caching.
+'
+'
+'
+'******************************************************************************
+
+'********************************* HISTORY ************************************
+' Date DVE Comments
+' 3/01/94 Jack Morrison Initial version
+'******************************************************************************
+
+'Test cases:
+'
+'******************************************************************************
+'* Include Files
+'******************************************************************************
+
+'$INCLUDE 'DECLARES.INC'
+
+Const APPL_ABBR$ = "CTHON"
+
+'$INCLUDE 'NFSCOMM.INC'
+'$INCLUDE 'NFSSUBS.INC'
+
+'******************************************************************************
+' Subroutines and Functions Declarations
+'******************************************************************************
+
+Declare Sub CthonTest12a ()
+Declare Sub CthonTest12b ()
+Declare Sub CthonTest12c ()
+
+Declare Sub CthonTest03 ()
+Declare Sub CthonTest04 ()
+Declare Sub CthonTest05 ()
+Declare Sub CthonTest06 ()
+Declare Sub CthonTest07 ()
+Declare Sub CthonTest09 ()
+
+'******************************************************************************
+'* Initialize Variables
+'******************************************************************************
+Global NumDrives AS INTEGER
+'******************************************************************************
+'* Main prorgram code
+'******************************************************************************
+On Error Goto ErrorTrap
+
+QueSetSpeed 75
+
+Setup
+
+ret = Connect (NetHost(1), NetDrive(1), NetPath(1), "") 'user$ passwd$
+ret = Connect (NetHost(2), NetDrive(2), NetPath(2), "") 'user$ passwd$
+ret = Connect (NetHost(3), NetDrive(3), NetPath(3), "") 'user$ passwd$
+
+' At some point set NumDrives% = MaxDrive% because the
+' way it is now it will run thru the same drive every time
+NumDrives% = MaxDrive%
+
+FOR I = 1 TO MaxDrive%
+ If EXISTS (NetDrive(I)+":\testlog.*") Then
+ KILL NetDrive(I)+":\testlog.*"
+ End If
+
+'*** Execute the tests
+
+CthonTest12a
+CthonTest12b
+CthonTest12c
+
+CthonTest03
+CthonTest04
+CthonTest05
+CthonTest06
+CthonTest07
+CthonTest09
+
+
+ret = Disconnect (NetDrive(1))
+ret = Disconnect (NetDrive(2))
+ret = Disconnect (NetDrive(3))
+
+NEXT I
+
+Cleanup
+
+End
+
+'******************************************************************************
+' Subroutines and Functions
+'******************************************************************************
+'******************************************************************************
+'Subroutines
+'******************************************************************************
+
+'******************************************************************************
+'SUB CthonTest12a
+'******************************************************************************
+Sub CthonTest12a() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+FOR L = 1 To 7
+
+levels$ = STR$(L)
+files$ = "1"
+dirs$ = "1"
+
+CHDRIVE NetDrive(I)
+
+If NOT EXISTS ("testdir.12") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test12.dir not deleted"
+End If
+
+NEXT L
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+'******************************************************************************
+'SUB CthonTest12b
+'******************************************************************************
+Sub CthonTest12b() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+levels$ = "1"
+files$ = "999"
+dirs$ = "1"
+
+CHDRIVE NetDrive(I)
+
+If NOT EXISTS ("testdir.12") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test12.dir not deleted"
+End If
+
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+
+'******************************************************************************
+'SUB CthonTest12c
+'******************************************************************************
+Sub CthonTest12c() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+levels$ = "4"
+files$ = "10"
+dirs$ = "5"
+
+CHDRIVE NetDrive(I)
+
+If NOT EXISTS ("testdir.12") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test12.dir not deleted"
+End If
+
+
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+'******************************************************************************
+'SUB CthonTest03
+'******************************************************************************
+Sub CthonTest03() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+CHDRIVE NetDrive(I)
+
+FOR C = 1 TO 1000 STEP 10
+
+count$ = STR$(C)
+
+If NOT EXISTS ("testdir.3") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test3 testdir.3 testlog.3 "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test3.dir not deleted"
+End If
+
+NEXT C
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+'******************************************************************************
+'SUB CthonTest04
+'******************************************************************************
+Sub CthonTest04() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+CHDRIVE NetDrive(I)
+
+FOR F = 1 TO 500 STEP 100
+
+files$ = STR$(F)
+count$ = "10"
+
+If NOT EXISTS ("testdir.4") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test4 testdir.4 testlog.4 "+files$+" "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test4.dir not deleted"
+End If
+
+NEXT F
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+
+'******************************************************************************
+'SUB CthonTest06
+'******************************************************************************
+Sub CthonTest06() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+CHDRIVE NetDrive(I)
+
+FOR F = 1 TO 512 STEP 256
+
+files$ = STR$(F)
+count$ = "1"
+
+If NOT EXISTS ("testdir.6") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test6 testdir.6 testlog.6 "+files$+" "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test6.dir not deleted"
+End If
+
+NEXT F
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+
+'******************************************************************************
+'SUB CthonTest09
+'******************************************************************************
+Sub CthonTest09() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+CHDRIVE NetDrive(I)
+
+FOR C = 1 TO 1000 STEP 10
+
+count$ = STR$(C)
+
+If NOT EXISTS ("testdir.9") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test9 testdir.9 testlog.9 "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test9.dir not deleted"
+End If
+
+NEXT C
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+
+'******************************************************************************
+'SUB CthonTest05
+'******************************************************************************
+Sub CthonTest05() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+CHDRIVE NetDrive(I)
+fname$ = ""
+
+FOR N = 1 TO 8 STEP 1
+fname$ = fname$+"x"
+
+FOR C = 1 TO 10 STEP 1
+count$ = STR$(C)
+
+FOR S = 512 TO 8192 STEP 512
+size$ = STR$(s)
+
+If NOT EXISTS ("testdir.5") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test5 testdir.5 testlog.5 "+size$+" "+count$+" "+fname$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test5.dir not deleted"
+End If
+
+NEXT S
+NEXT C
+NEXT N
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
+
+'******************************************************************************
+'SUB CthonTest07
+'******************************************************************************
+Sub CthonTest07() Static
+
+' initialize - open logs and start Cthon
+
+StartSubTest ""
+
+FOR I = 1 TO NumDrives%
+
+CHDRIVE NetDrive(I)
+sfname$ = ""
+
+FOR S = 1 TO 8
+sfname$ = sfname$ + "a"
+efname$ = ""
+
+FOR E = 1 TO 8
+efname$ = efname$ + "z"
+
+If NOT EXISTS ("testdir.7") Then
+
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test7 testdir.7 testlog.7 1 1 "+sfname$+" "+efname$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test7.dir not deleted"
+End If
+
+NEXT E
+NEXT S
+NEXT I
+
+EndSubTest ""
+
+End Sub
+
diff --git a/basic/scripts/cthon02.mst b/basic/scripts/cthon02.mst
new file mode 100644
index 0000000..6e54423
--- /dev/null
+++ b/basic/scripts/cthon02.mst
@@ -0,0 +1,469 @@
+'******************************* CTHON02.MST *********************************
+' @(#)cthon02.mst 1.1 98/10/26 Connectathon Testsuite
+'
+'Description: This test suite contains a set of test cases and scenarios that
+' are used to test Directory Caching. It is similar to CTHON01,
+' but the parameters used as not as large, so it creates less
+' stress and executes in much less time.
+'
+'******************************************************************************
+
+'********************************* HISTORY ************************************
+' Date DVE Comments
+' 3/01/94 Jack Morrison Initial version
+'******************************************************************************
+
+'Test cases:
+'
+'******************************************************************************
+'* Include Files
+'******************************************************************************
+
+'$INCLUDE 'DECLARES.INC'
+
+Const APPL_ABBR$ = "CTHON"
+
+'$INCLUDE 'NFSCOMM.INC'
+'$INCLUDE 'NFSSUBS.INC'
+
+'******************************************************************************
+' Subroutines and Functions Declarations
+'******************************************************************************
+
+Declare Sub CTHONTest12a ()
+Declare Sub CTHONTest12b ()
+Declare Sub CTHONTest12c ()
+
+Declare Sub CTHONTest03 ()
+Declare Sub CTHONTest04 ()
+Declare Sub CTHONTest05 ()
+Declare Sub CTHONTest06 ()
+Declare Sub CTHONTest07 ()
+Declare Sub CTHONTest09 ()
+
+'******************************************************************************
+'* Initialize Variables
+'******************************************************************************
+Const Failed = "err"
+'******************************************************************************
+'* Main prorgram code
+'******************************************************************************
+On Error Goto ErrorTrap
+
+QueSetSpeed 75
+
+Setup
+
+FOR C = 1 TO MaxDrive%
+
+rtn = Connect(NetHost(C), NetDrive(C), NetPath(C), "") 'user$ passwd$
+
+If rtn <> PASS Then EXIT FOR
+If EXISTS (NetDrive(C)+":\testlog.*") Then KILL NetDrive(C)+":\testlog.*"
+
+NEXT C
+
+If C >= Maxdrive% Then
+
+' *** Execute the tests
+
+CTHONTest12a
+CTHONTest12b
+CTHONTest12c
+
+CTHONTest03
+CTHONTest04
+CTHONTest05
+CTHONTest06
+CTHONTest07
+CTHONTest09
+
+Else
+ WriteLogFile "Drive Could Not Be Connected. Test Aborted !"
+ failure_Occurred = TRUE
+End If
+
+FOR D = 1 TO Maxdrive%
+
+rtn = Disconnect (NetDrive(D))
+
+NEXT D
+
+Cleanup
+CheckExit
+
+End
+
+'******************************************************************************
+' Subroutines and Functions
+'******************************************************************************
+'******************************************************************************
+'Subroutines
+'******************************************************************************
+
+'******************************************************************************
+'SUB CTHONTest12a
+'******************************************************************************
+Sub CTHONTest12a() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12A"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+FOR L = 1 To 1
+
+levels$ = STR$(L)
+files$ = "1"
+dirs$ = "1"
+
+CHDRIVE NetDrive(I)
+
+If NOT EXISTS ("testdir.12") Then
+
+STATUSBOX "CTHON02 SubTest 1a In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+STATUSBOX "CTHON02 SubTest 2a In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test12.dir not deleted"
+End If
+
+NEXT L
+NEXT I
+
+CheckLog "testlog.12", Failed$, False
+EndSubTest " CTHON SubTest12A"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest12b
+'******************************************************************************
+Sub CTHONTest12b() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12B"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+levels$ = "1"
+files$ = "1"
+dirs$ = "1"
+
+CHDRIVE NetDrive(I)
+
+If NOT EXISTS ("testdir.12") Then
+
+STATUSBOX "CTHON02 SubTest 1b In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+STATUSBOX "CTHON02 SubTest 2b In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test12.dir not deleted"
+End If
+
+NEXT I
+
+CheckLog "testlog.12", Failed$, False
+EndSubTest " CTHON SubTest12B"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest12c
+'******************************************************************************
+Sub CTHONTest12c() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12C"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+' CTHON01 => levels$ = "4"
+levels$ = "1"
+' CTHON01 => files$ = "10"
+files$ = "1"
+' CTHON01 => dirs$ = "5"
+dirs$ = "1"
+
+CHDRIVE NetDrive(I)
+
+If NOT EXISTS ("testdir.12") Then
+
+STATUSBOX "CTHON02 SubTest 1c In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+STATUSBOX "CTHON02 SubTest 2c In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test12.dir not deleted"
+End If
+
+
+NEXT I
+
+CheckLog "testlog.12", Failed$, False
+EndSubTest " CTHON SubTest12C"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest03
+'******************************************************************************
+Sub CTHONTest03() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 3"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+
+' CTHON01 => FOR C = 1 TO 1000 STEP 10
+FOR C = 1 TO 10 STEP 10
+
+count$ = STR$(C)
+
+If NOT EXISTS ("testdir.3") Then
+
+STATUSBOX "CTHON02 SubTest 3 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test3 testdir.3 testlog.3 "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test3.dir not deleted"
+End If
+
+NEXT C
+NEXT I
+
+CheckLog "testlog.3", Failed$, False
+EndSubTest " CTHON SubTest 3"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest04
+'******************************************************************************
+Sub CTHONTest04() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 4"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+
+FOR F = 1 TO 100 STEP 100
+
+files$ = STR$(F)
+' CTHON01 => count$ = "10"
+count$ = "1"
+
+If NOT EXISTS ("testdir.4") Then
+
+STATUSBOX "CTHON02 SubTest 4 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test4 testdir.4 testlog.4 "+files$+" "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test4.dir not deleted"
+End If
+
+NEXT F
+NEXT I
+
+CheckLog "testlog.4", Failed$, False
+EndSubTest " CTHON SubTest 4"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest06
+'******************************************************************************
+Sub CTHONTest06() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 6"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+
+FOR F = 1 TO 256 STEP 256
+
+files$ = STR$(F)
+count$ = "1"
+
+If NOT EXISTS ("testdir.6") Then
+
+STATUSBOX "CTHON02 SubTest 6 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test6 testdir.6 testlog.6 "+files$+" "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test6.dir not deleted"
+End If
+
+NEXT F
+NEXT I
+
+CheckLog "testlog.6", Failed$, False
+EndSubTest " CTHON SubTest 6"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest09
+'******************************************************************************
+Sub CTHONTest09() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 9"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+
+' CTHON01 - FOR C = 1 TO 1000 STEP 10
+FOR C = 1 TO 100 STEP 100
+
+count$ = STR$(C)
+
+If NOT EXISTS ("testdir.9") Then
+
+STATUSBOX "CTHON02 SubTest 9 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test9 testdir.9 testlog.9 "+count$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test9.dir not deleted"
+End If
+
+NEXT C
+NEXT I
+
+CheckLog "testlog.9", Failed$, False
+EndSubTest " CTHON SubTest 9"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest05
+'******************************************************************************
+Sub CTHONTest05() Static
+
+' initialize - open logs and start CTHON (this is the longest test)
+
+StartSubTest " CTHON SubTest 5"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+fname$ = ""
+
+' CTHON01 => FOR N = 1 TO 4 STEP 1
+FOR N = 1 TO 1 STEP 1
+fname$ = fname$+"x"
+
+' CTHON01 => FOR C = 1 TO 10 STEP 1
+FOR C = 1 TO 1 STEP 1
+count$ = STR$(C)
+
+' CTHON01 => FOR S = 512 TO 8192 STEP 512
+FOR S = 1024 TO 1024 STEP 1024 ' 1024 > 5120 > 9216 > 13312
+size$ = STR$(s)
+
+If NOT EXISTS ("testdir.5") Then
+
+STATUSBOX "CTHON02 SubTest 5 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test5 testdir.5 testlog.5 "+size$+" "+count$+" "+fname$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test5.dir not deleted"
+End If
+
+NEXT S
+NEXT C
+NEXT N
+NEXT I
+
+CheckLog "testlog.5", Failed$, False
+EndSubTest " CTHON SubTest 5"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest07
+'******************************************************************************
+Sub CTHONTest07() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 7"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+sfname$ = ""
+
+FOR S = 1 TO 2
+sfname$ = sfname$ + "a"
+efname$ = ""
+
+FOR E = 2 TO 2
+efname$ = efname$ + "z"
+
+If NOT EXISTS ("testdir.7") Then
+
+STATUSBOX "CTHON02 SubTest 7 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"test7 testdir.7 testlog.7 1 1 "+sfname$+" "+efname$
+Run Execute$, ,SW_HIDE
+
+Else
+failure_Occurred = True
+WriteLogFile "Previous test directory test7.dir not deleted"
+End If
+
+NEXT E
+NEXT S
+NEXT I
+
+CheckLog "testlog.7", Failed$, False
+EndSubTest " CTHON SubTest 7"+" "+DateTime$
+
+End Sub
+
diff --git a/basic/scripts/cthon03.mst b/basic/scripts/cthon03.mst
new file mode 100644
index 0000000..f020688
--- /dev/null
+++ b/basic/scripts/cthon03.mst
@@ -0,0 +1,428 @@
+'******************************* CTHON03.MST *********************************
+' @(#)cthon03.mst 1.1 98/10/26 Connectathon Testsuite
+'
+'Description: This test suite contains a set of test cases and scenarios that
+' are used to test Directory Caching. It is the same as CTHON01,
+' except that it uses the MS-Test SHELL command instead of RUN.
+' This allows it to work properly with Win95.
+'
+'******************************************************************************
+
+'********************************* HISTORY ************************************
+' Date DVE Comments
+' 3/01/94 Jack Morrison Initial version
+'******************************************************************************
+'
+'******************************************************************************
+'* Include Files
+'******************************************************************************
+
+'$INCLUDE 'DECLARES.INC'
+
+Const APPL_ABBR$ = "CTHON"
+
+'$INCLUDE 'NFSCOMM.INC'
+'$INCLUDE 'NFSSUBS.INC'
+
+'******************************************************************************
+' Subroutines and Functions Declarations
+'******************************************************************************
+
+Declare Sub CTHONTest12a ()
+Declare Sub CTHONTest12b ()
+Declare Sub CTHONTest12c ()
+
+Declare Sub CTHONTest03 ()
+Declare Sub CTHONTest04 ()
+Declare Sub CTHONTest05 ()
+Declare Sub CTHONTest06 ()
+Declare Sub CTHONTest07 ()
+Declare Sub CTHONTest09 ()
+
+'******************************************************************************
+'* Initialize Variables
+'******************************************************************************
+Const Failed = "err"
+'******************************************************************************
+'* Main prorgram code
+'******************************************************************************
+On Error Goto ErrorTrap
+
+QueSetSpeed 75
+
+Setup
+
+FOR C = 1 TO MaxDrive%
+
+rtn = Connect(NetHost(C), NetDrive(C), NetPath(C), "") 'user$ passwd$
+
+If rtn <> PASS Then EXIT FOR
+If EXISTS (NetDrive(C)+":\testlog.*") Then KILL NetDrive(C)+":\testlog.*"
+
+NEXT C
+
+If C >= Maxdrive% Then
+
+' *** Execute the tests
+
+CTHONTest12a
+CTHONTest12b
+CTHONTest12c
+
+CTHONTest03
+CTHONTest04
+CTHONTest05
+CTHONTest06
+CTHONTest07
+CTHONTest09
+
+Else
+ WriteLogFile "Drive Could Not Be Connected. Test Aborted !"
+ failure_Occurred = TRUE
+End If
+
+FOR D = 1 TO Maxdrive%
+
+rtn = Disconnect (NetDrive(D))
+
+NEXT D
+
+Cleanup
+CheckExit
+
+End
+
+'******************************************************************************
+'Subroutines
+'******************************************************************************
+
+'******************************************************************************
+'SUB CTHONTest12a
+'******************************************************************************
+Sub CTHONTest12a() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12A"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+FOR L = 1 To 7
+
+levels$ = STR$(L)
+files$ = "1"
+dirs$ = "1"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 1a In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+STATUSBOX "CTHON03 SubTest 2a In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+NEXT L
+CheckLog "testlog.12", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest12A"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest12b
+'******************************************************************************
+Sub CTHONTest12b() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12B"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+levels$ = "1"
+files$ = "999"
+dirs$ = "1"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 1b In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+STATUSBOX "CTHON03 SubTest 2b In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+CheckLog "testlog.12", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest12B"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest12c
+'******************************************************************************
+Sub CTHONTest12c() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12C"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+levels$ = "4"
+files$ = "10"
+dirs$ = "5"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 1c In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+STATUSBOX "CTHON03 SubTest 2c In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+CheckLog "testlog.12", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest12C"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest03
+'******************************************************************************
+Sub CTHONTest03() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 3"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.3"
+CreateDir$ = ""
+
+FOR C = 1 TO 1000 STEP 10
+
+count$ = STR$(C)
+
+If EXISTS ("testdir.3","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 3 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test3 testdir.3 testlog.3 "+CreateDir$+" "+count$
+SHELL Execute$
+
+NEXT C
+CheckLog "testlog.3", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest 3"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest04
+'******************************************************************************
+Sub CTHONTest04() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 4"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.4"
+CreateDir$ = ""
+
+FOR F = 1 TO 500 STEP 100
+
+files$ = STR$(F)
+count$ = "10"
+
+If EXISTS ("testdir.4","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 4 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test4 testdir.4 testlog.4 "+CreateDir$+" "+files$+" "+count$
+SHELL Execute$
+
+NEXT F
+CheckLog "testlog.4", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest 4"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest06
+'******************************************************************************
+Sub CTHONTest06() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 6"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.6"
+CreateDir$ = ""
+
+FOR F = 1 TO 512 STEP 256
+
+files$ = STR$(F)
+count$ = "1"
+
+If EXISTS ("testdir.6","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 6 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test6 testdir.6 testlog.6 "+CreateDir$+" "+files$+" "+count$
+SHELL Execute$
+
+NEXT F
+CheckLog "testlog.6", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest 6"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest09
+'******************************************************************************
+Sub CTHONTest09() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 9"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.9"
+CreateDir$ = ""
+
+FOR C = 1 TO 1000 STEP 10
+
+count$ = STR$(C)
+
+If EXISTS ("testdir.9","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 9 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test9 testdir.9 testlog.9 "+CreateDir$+" "+count$
+SHELL Execute$
+
+NEXT C
+CheckLog "testlog.9", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest 9"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest05
+'******************************************************************************
+Sub CTHONTest05() Static
+
+' initialize - open logs and start CTHON (this is the longest test)
+
+StartSubTest " CTHON SubTest 5"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.5"
+CreateDir$ = ""
+fname$ = ""
+
+FOR N = 1 TO 8 STEP 1
+fname$ = fname$+"x"
+
+FOR C = 1 TO 10 STEP 1
+count$ = STR$(C)
+
+FOR S = 512 TO 8192 STEP 512
+size$ = STR$(s)
+
+If EXISTS ("testdir.5","+d") Then CreateDir$ = "-n"
+
+
+STATUSBOX "CTHON03 SubTest 5 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test5 testdir.5 testlog.5 "+CreateDir$+" "+size$+" "+count$+" "+fname$
+SHELL Execute$
+
+NEXT S
+NEXT C
+NEXT N
+CheckLog "testlog.5", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest 5"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest07
+'******************************************************************************
+Sub CTHONTest07() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 7"+" "+DateTime$
+
+FOR I = 1 TO MaxDrive%
+
+CHDRIVE NetDrive(I)
+SHELL "deltree /y *.7"
+CreateDir$ = ""
+sfname$ = ""
+
+FOR S = 1 TO 8
+sfname$ = sfname$ + "a"
+efname$ = ""
+
+FOR E = 1 TO 8
+efname$ = efname$ + "z"
+
+If EXISTS ("testdir.7","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON03 SubTest 7 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test7 testdir.7 testlog.7 "+CreateDir$+" 1 1 "+sfname$+" "+efname$
+SHELL Execute$
+
+NEXT E
+NEXT S
+CheckLog "testlog.7", Failed$, False
+NEXT I
+
+EndSubTest " CTHON SubTest 7"+" "+DateTime$
+
+End Sub
+
diff --git a/basic/scripts/cthon04.mst b/basic/scripts/cthon04.mst
new file mode 100644
index 0000000..b5f5542
--- /dev/null
+++ b/basic/scripts/cthon04.mst
@@ -0,0 +1,366 @@
+'******************************* CTHON04.MST *********************************
+' @(#)cthon04.mst 1.1 98/10/26 Connectathon Testsuite
+'
+'Description: This test suite contains a set of test cases and scenarios that
+' are used to test Directory Caching. It is similar to CTHON02,
+' but it only runs on 1 drive and the parameters used are not as
+' large, so it creates less stress and executes in much less time.
+' It also uses the MS-Test SHELL command instead of RUN, which
+' allows it to work properly with Win95 (usually).
+'
+'******************************************************************************
+
+'********************************* HISTORY ************************************
+' Date DVE Comments
+' 3/01/94 Jack Morrison Initial version
+'******************************************************************************
+'
+'******************************************************************************
+'* Include Files
+'******************************************************************************
+
+'$INCLUDE 'DECLARES.INC'
+
+Const APPL_ABBR$ = "CTHON"
+
+'$INCLUDE 'NFSCOMM.INC'
+'$INCLUDE 'NFSSUBS.INC'
+
+'******************************************************************************
+' Subroutines and Functions Declarations
+'******************************************************************************
+
+Declare Sub CTHONTest12a ()
+Declare Sub CTHONTest12b ()
+Declare Sub CTHONTest12c ()
+
+Declare Sub CTHONTest03 ()
+Declare Sub CTHONTest04 ()
+Declare Sub CTHONTest05 ()
+Declare Sub CTHONTest06 ()
+Declare Sub CTHONTest07 ()
+Declare Sub CTHONTest09 ()
+
+'******************************************************************************
+'* Initialize Variables
+'******************************************************************************
+Const Failed = "err"
+'******************************************************************************
+'* Main prorgram code
+'******************************************************************************
+On Error Goto ErrorTrap
+
+QueSetSpeed 75
+
+Setup
+
+rtn = Connect(NetHost(1), NetDrive(1), NetPath(1), "") 'user$ passwd$
+If rtn = PASS Then
+
+If EXISTS (NetDrive(1)+":\testlog.*") Then KILL NetDrive(1)+":\testlog.*"
+
+CTHONTest12a
+CTHONTest12b
+CTHONTest12c
+CTHONTest03
+CTHONTest04
+CTHONTest05
+CTHONTest06
+CTHONTest07
+CTHONTest09
+
+rtn = Disconnect (NetDrive(1))
+
+Else
+ WriteLogFile "Could Not Connect Drive "+NetDrive(1)+" to "+NetHost(1)+" "+NetPath(1)
+ failure_Occurred = TRUE
+End If
+
+Cleanup
+CheckExit
+
+End
+
+'******************************************************************************
+'Subroutines
+'******************************************************************************
+
+'******************************************************************************
+'SUB CTHONTest12a
+'******************************************************************************
+Sub CTHONTest12a() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12A"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+levels$ = "1"
+files$ = "1"
+dirs$ = "1"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 1a In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+STATUSBOX "CTHON04 SubTest 2a In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+CheckLog "testlog.12", Failed$, False
+EndSubTest " CTHON SubTest12A"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest12b
+'******************************************************************************
+Sub CTHONTest12b() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12B"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+levels$ = "1"
+files$ = "1"
+dirs$ = "1"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 1b In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+STATUSBOX "CTHON04 SubTest 2b In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+CheckLog "testlog.12", Failed$, False
+EndSubTest " CTHON SubTest12B"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest12c
+'******************************************************************************
+Sub CTHONTest12c() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest12C"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.12"
+CreateDir$ = ""
+
+levels$ = "1"
+files$ = "1"
+dirs$ = "1"
+
+If EXISTS ("testdir.12","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 1c In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+STATUSBOX "CTHON04 SubTest 2c In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+CreateDir$+" "+levels$+" "+files$+" "+dirs$
+SHELL Execute$
+
+CheckLog "testlog.12", Failed$, False
+EndSubTest " CTHON SubTest12C"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest03
+'******************************************************************************
+Sub CTHONTest03() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 3"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.3"
+CreateDir$ = ""
+
+count$ = "1"
+
+If EXISTS ("testdir.3","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 3 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test3 testdir.3 testlog.3 "+CreateDir$+" "+count$
+SHELL Execute$
+
+CheckLog "testlog.3", Failed$, False
+EndSubTest " CTHON SubTest 3"+" "+DateTime$
+
+End Sub
+
+'******************************************************************************
+'SUB CTHONTest04
+'******************************************************************************
+Sub CTHONTest04() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 4"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.4"
+CreateDir$ = ""
+
+files$ = "1"
+count$ = "10"
+
+If EXISTS ("testdir.4","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 4 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test4 testdir.4 testlog.4 "+CreateDir$+" "+files$+" "+count$
+SHELL Execute$
+
+CheckLog "testlog.4", Failed$, False
+EndSubTest " CTHON SubTest 4"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest06
+'******************************************************************************
+Sub CTHONTest06() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 6"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.6"
+CreateDir$ = ""
+
+F = 512
+files$ = "1"
+count$ = "1"
+
+If EXISTS ("testdir.6","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 6 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test6 testdir.6 testlog.6 "+CreateDir$+" "+files$+" "+count$
+SHELL Execute$
+
+CheckLog "testlog.6", Failed$, False
+EndSubTest " CTHON SubTest 6"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest09
+'******************************************************************************
+Sub CTHONTest09() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 9"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.9"
+CreateDir$ = ""
+
+count$ = "1"
+
+If EXISTS ("testdir.9","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 9 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test9 testdir.9 testlog.9 "+CreateDir$+" "+count$
+SHELL Execute$
+
+CheckLog "testlog.9", Failed$, False
+EndSubTest " CTHON SubTest 9"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest05
+'******************************************************************************
+Sub CTHONTest05() Static
+
+' initialize - open logs and start CTHON (this is the longest test)
+
+StartSubTest " CTHON SubTest 5"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.5"
+CreateDir$ = ""
+fname$ = ""
+
+FOR N = 1 TO 2 STEP 1
+fname$ = fname$+"x"
+
+FOR C = 1 TO 2 STEP 1
+count$ = STR$(C)
+
+size$ = "512"
+
+If EXISTS ("testdir.5","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 5 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test5 testdir.5 testlog.5 "+CreateDir$+" "+size$+" "+count$+" "+fname$
+SHELL Execute$
+
+NEXT C
+NEXT N
+
+CheckLog "testlog.5", Failed$, False
+EndSubTest " CTHON SubTest 5"+" "+DateTime$
+
+End Sub
+
+
+'******************************************************************************
+'SUB CTHONTest07
+'******************************************************************************
+Sub CTHONTest07() Static
+
+' initialize - open logs and start CTHON
+
+StartSubTest " CTHON SubTest 7"+" "+DateTime$
+
+CHDRIVE NetDrive(1)
+SHELL "deltree /y *.7"
+CreateDir$ = ""
+sfname$ = ""
+
+FOR S = 1 TO 2
+sfname$ = sfname$ + "a"
+efname$ = ""
+
+FOR E = 1 TO 2
+efname$ = efname$ + "z"
+
+If EXISTS ("testdir.7","+d") Then CreateDir$ = "-n"
+
+STATUSBOX "CTHON04 SubTest 7 In Progess", 0,0,0,0, TRUE, TRUE
+Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test7 testdir.7 testlog.7 "+CreateDir$+" 1 1 "+sfname$+" "+efname$
+SHELL Execute$
+
+NEXT E
+NEXT S
+
+CheckLog "testlog.7", Failed$, False
+EndSubTest " CTHON SubTest 7"+" "+DateTime$
+
+End Sub
+
diff --git a/basic/scripts/runcthon.prl b/basic/scripts/runcthon.prl
new file mode 100644
index 0000000..80975a8
--- /dev/null
+++ b/basic/scripts/runcthon.prl
@@ -0,0 +1,66 @@
+# @(#)runcthon.prl 1.1 98/10/26 Connectathon Testsuite
+
+print "Run CONNECTATHON Tests\n";
+
+$count = $ARGV[0];
+
+&initpwd;
+
+chdir($ENV{'PWD'});
+
+$path = ($ENV{'PWD'});
+print $path;
+print "\n";
+
+for ($i = 1; $i <= $count; $i++) {
+
+$winpath = ($path . "\\win32\\basic");
+print "\n$i $winpath\n";
+chdir $winpath;
+system "perl runbasic.prl";
+chdir($ENV{'PWD'});
+
+$dospath = ($path . "\\dos\\basic");
+print "\n$i $dospath\n";
+chdir $dospath;
+system "perl runbasic.prl";
+chdir($ENV{'PWD'});
+
+$pospath = ($path . "\\posix\\basic");
+print "\n$i $pospath\n";
+chdir $pospath;
+#system "perl runbasic.prl";
+chdir($ENV{'PWD'});
+
+$dospath = ($path . "\\dos\\special");
+print "\n$i $dospath\n";
+chdir $dospath;
+system "runtests.bat";
+chdir($ENV{'PWD'});
+
+}
+
+exit 0;
+
+
+
+sub initpwd {
+ if ($ENV{'PWD'}) {
+ local($dd,$di) = stat('.');
+ local($pd,$pi) = stat($ENV{'PWD'});
+ if ($di != $pi || $dd != $pd) {
+ chop($ENV{'PWD'} = `cd`);
+ }
+ }
+ else {
+ chop($ENV{'PWD'} = `cd`);
+ }
+ if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|) {
+ local($pd,$pi) = stat($2);
+ local($dd,$di) = stat($1);
+ if ($di == $pi && $dd == $pd) {
+ $ENV{'PWD'}="$2$3";
+ }
+ }
+# print "$ENV{'PWD'}\n";
+}
diff --git a/basic/subr.c b/basic/subr.c
new file mode 100644
index 0000000..cf220b7
--- /dev/null
+++ b/basic/subr.c
@@ -0,0 +1,830 @@
+/*
+ * @(#)subr.c 1.6 03/12/29 Connectathon Testsuite
+ * 1.6 Lachman ONC Test Suite source
+ *
+ * Useful subroutines shared by all tests
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifdef DOSorWIN32
+#include <io.h>
+#include <direct.h>
+#else
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/timeb.h>
+
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef STDARG
+#include <stdarg.h>
+#endif
+
+#include "../tests.h"
+
+char *Myname;
+int Dflag = 0;
+
+static void chdrive ARGS_((char *path));
+
+/*
+ * Build a directory tree "lev" levels deep
+ * with "files" number of files in each directory
+ * and "dirs" fan out. Starts at the current directory.
+ * "fname" and "dname" are the base of the names used for
+ * files and directories.
+ */
+void
+dirtree(lev, files, dirs, fname, dname, totfiles, totdirs)
+ int lev;
+ int files;
+ int dirs;
+ char *fname;
+ char *dname;
+ int *totfiles;
+ int *totdirs;
+{
+ int fd;
+ int f, d;
+ char name[MAXPATHLEN];
+
+ if (lev-- == 0) {
+ return;
+ }
+ for ( f = 0; f < files; f++) {
+ if (Dflag == 0)
+ sprintf(name, "%s%d", fname, f);
+ else
+ sprintf(name, "%s%d.%d", fname, lev, f);
+ if ((fd = creat(name, CHMOD_RW)) < 0) {
+ error("creat %s failed", name);
+ exit(1);
+ }
+ (*totfiles)++;
+ if (close(fd) < 0) {
+ error("close %d failed", fd);
+ exit(1);
+ }
+ }
+ for ( d = 0; d < dirs; d++) {
+ if (Dflag == 0)
+ sprintf(name, "%s%d", dname, d);
+ else
+ sprintf(name, "%s%d.%d", dname, lev, d);
+ if (unix_mkdir(name, 0777) < 0) {
+ error("mkdir %s failed", name);
+ exit(1);
+ }
+ (*totdirs)++;
+ if (unix_chdir(name) < 0) {
+ error("chdir %s failed", name);
+ exit(1);
+ }
+ dirtree(lev, files, dirs, fname, dname, totfiles, totdirs);
+ if (unix_chdir("..") < 0) {
+ error("chdir .. failed");
+ exit(1);
+ }
+ }
+}
+
+/*
+ * Remove a directory tree starting at the current directory.
+ * "fname" and "dname" are the base of the names used for
+ * files and directories to be removed - don't remove anything else!
+ * "files" and "dirs" are used with fname and dname to generate
+ * the file names to remove.
+ *
+ * This routine will fail if, say after removing known files,
+ * the directory is not empty.
+ *
+ * This is used to test the unlink function and to clean up after tests.
+ */
+void
+rmdirtree(lev, files, dirs, fname, dname, totfiles, totdirs, ignore)
+ int lev;
+ int files;
+ int dirs;
+ char *fname;
+ char *dname;
+ int *totfiles; /* total removed */
+ int *totdirs; /* total removed */
+ int ignore;
+{
+ int f, d;
+ char name[MAXPATHLEN];
+
+ if (lev-- == 0) {
+ return;
+ }
+ for ( f = 0; f < files; f++) {
+ if (Dflag == 0)
+ sprintf(name, "%s%d", fname, f);
+ else
+ sprintf(name, "%s%d.%d", fname, lev, f);
+ if (unlink(name) < 0 && !ignore) {
+ error("unlink %s failed", name);
+ exit(1);
+ }
+ (*totfiles)++;
+ }
+ for ( d = 0; d < dirs; d++) {
+ if (Dflag == 0)
+ sprintf(name, "%s%d", dname, d);
+ else
+ sprintf(name, "%s%d.%d", dname, lev, d);
+ if (unix_chdir(name) < 0) {
+ if (ignore)
+ continue;
+ error("chdir %s failed", name);
+ exit(1);
+ }
+ rmdirtree(lev, files, dirs, fname, dname, totfiles, totdirs, ignore);
+ if (unix_chdir("..") < 0) {
+ error("chdir .. failed");
+ exit(1);
+ }
+ if (rmdir(name) < 0) {
+ error("rmdir %s failed", name);
+ exit(1);
+ }
+ (*totdirs)++;
+ }
+}
+
+#ifdef STDARG
+void
+error(char *str, ...)
+{
+ int oerrno;
+ char *ret;
+ char path[MAXPATHLEN];
+ va_list ap;
+
+ oerrno = errno;
+
+ va_start(ap, str);
+ if ((ret = getcwd(path, sizeof(path))) == NULL)
+ fprintf(stderr, "%s: getcwd failed\n", Myname);
+ else
+ fprintf(stderr, "\t%s: (%s) ", Myname, path);
+ vfprintf(stderr, str, ap);
+ va_end(ap);
+
+ if (oerrno) {
+ errno = oerrno;
+ perror(" ");
+ } else {
+ fprintf(stderr, "\n");
+ }
+ fflush(stderr);
+ if (ret == NULL)
+ exit(1);
+}
+#else
+/* VARARGS */
+error(str, ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9)
+ char *str;
+{
+ int oerrno;
+ char *ret;
+ char path[MAXPATHLEN];
+
+ oerrno = errno;
+ if ((ret = getcwd(path, sizeof(path))) == NULL)
+ fprintf(stderr, "%s: getcwd failed\n", Myname);
+ else
+ fprintf(stderr, "\t%s: (%s) ", Myname, path);
+
+ fprintf(stderr, str, ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9);
+ if (oerrno) {
+ errno = oerrno;
+ perror(" ");
+ } else {
+ fprintf(stderr, "\n");
+ }
+ fflush(stderr);
+ if (ret == NULL)
+ exit(1);
+}
+#endif /* STDARG */
+
+static struct timeval ts, te;
+
+/*
+ * save current time in struct ts
+ */
+void
+starttime()
+{
+
+ gettimeofday(&ts, (struct timezone *)0);
+}
+
+/*
+ * sets the struct tv to the difference in time between
+ * current time and the time in struct ts.
+ */
+void
+endtime(tv)
+ struct timeval *tv;
+{
+
+ gettimeofday(&te, (struct timezone *)0);
+ if (te.tv_usec < ts.tv_usec) {
+ te.tv_sec--;
+ te.tv_usec += 1000000;
+ }
+ tv->tv_usec = te.tv_usec - ts.tv_usec;
+ tv->tv_sec = te.tv_sec - ts.tv_sec;
+#ifdef DOS
+ /*
+ * DOS uses time since midnight, so it could go negative if the
+ * test spans midnight. If that happens, add a day.
+ */
+ if (tv->tv_sec < 0)
+ tv->tv_sec += 24 * 3600;
+#endif
+}
+
+/*
+ * Set up and move to a test directory
+ */
+void
+testdir(dir)
+ char *dir;
+{
+ struct stat statb;
+ char str[MAXPATHLEN];
+
+ /*
+ * If dir is non-NULL, use that dir. If NULL, first
+ * check for env variable NFSTESTDIR. If that is not
+ * set, use the compiled-in TESTDIR.
+ */
+ if (dir == NULL)
+ if ((dir = getenv("NFSTESTDIR")) == NULL)
+ dir = TESTDIR;
+
+ if (stat(dir, &statb) == 0) {
+ sprintf(str, "rm -r %s", dir);
+#ifdef WIN16
+ if (rmdir(dir) < 0) {
+#else
+ if (system(str) != 0) {
+#endif
+ error("can't remove old test directory %s", dir);
+ exit(1);
+ }
+ }
+
+ if (unix_mkdir(dir, 0777) < 0) {
+ error("can't create test directory %s", dir);
+ exit(1);
+ }
+ if (unix_chdir(dir) < 0) {
+ error("can't chdir to test directory %s", dir);
+ exit(1);
+ }
+}
+
+/*
+ * Move to a test directory
+ */
+int
+mtestdir(dir)
+ char *dir;
+{
+ /*
+ * If dir is non-NULL, use that dir. If NULL, first
+ * check for env variable NFSTESTDIR. If that is not
+ * set, use the compiled-in TESTDIR.
+ */
+ if (dir == NULL)
+ if ((dir = getenv("NFSTESTDIR")) == NULL)
+ dir = TESTDIR;
+
+ if (unix_chdir(dir) < 0) {
+ error("can't chdir to test directory %s", dir);
+ return(-1);
+ }
+ return(0);
+}
+
+/*
+ * get parameter at parm, convert to int, and make sure that
+ * it is at least min.
+ */
+long
+getparm(parm, min, label)
+ char *parm;
+ long min;
+ char *label;
+{
+ long val;
+
+ val = atol(parm);
+ if (val < min) {
+ error("Illegal %s parameter %ld, must be at least %ld",
+ label, val, min);
+ exit(1);
+ }
+ return(val);
+}
+
+/*
+ * exit point for successful test
+ */
+void
+complete()
+{
+
+ fprintf(stdout, "\t%s ok.\n", Myname);
+ chdrive(Myname);
+ exit(0);
+}
+
+/*
+ * Change to drive specified in path
+ */
+int
+unix_chdir(path)
+char *path;
+{
+ chdrive(path);
+ return chdir(path);
+}
+
+#ifndef DOSorWIN32
+
+static void
+chdrive(path)
+ char *path;
+{
+}
+
+int
+unix_mkdir(path, mode)
+ char *path;
+ mode_t mode;
+{
+ return mkdir(path, mode);
+}
+
+#endif /* DOSorWIN32 */
+
+
+#ifdef NEED_STRERROR
+/*
+ * Hack replacement for strerror(). This could be made to include useful
+ * error strings, but it will do for the time being.
+ */
+char *
+strerror(errval)
+ int errval; /* errno value */
+{
+ static char buf[1024];
+
+ sprintf(buf, "error %d", errval);
+ return (buf);
+}
+#endif /* NEED_STRERROR */
+
+/***********************************************************/
+/* The following routines were ADDED specifically for */
+/* DOS AND WIN32. */
+/***********************************************************/
+
+#ifdef DOSorWIN32
+
+/*
+ * Return file statistics for the path specified
+ */
+
+int
+lstat(char * path, struct stat * buf)
+{
+ return stat(path, buf);
+}
+
+int
+unix_mkdir(const char * path, int mode)
+{
+ mode = mode; /* keep lint, compiler happy */
+ return mkdir(path);
+}
+
+#endif /* DOSorWIN32 */
+
+/************************************************************/
+/* The following routines were ADDED specifically for WIN32.*/
+/************************************************************/
+
+#ifdef WIN32
+
+/*
+ * Change to drive specified in path
+ */
+static void
+chdrive(char * path)
+{
+ int desireddrive;
+
+ if (path[1] == ':') {
+ desireddrive = toupper(path[0]) - ('A' - 1);
+ if (_chdrive(desireddrive)) {
+ error("can't change to drive %c:", path[0]);
+ exit(1);
+ }
+ }
+}
+
+void
+gettimeofday(struct timeval *TV, struct timezone *TimeZone)
+{
+ struct _timeb dostime;
+
+ _ftime(&dostime);
+ TV->tv_sec = dostime.time;
+ TV->tv_usec = dostime.millitm * 1000L;
+ TimeZone = TimeZone; /* shut up compiler/lint */
+}
+
+int
+statfs(char * path, struct statfs * buf)
+{
+ char *p = (char *) buf;
+ int i;
+ unsigned drive;
+
+ unsigned sect_per_clust;
+ unsigned bytes_per_sect;
+ unsigned free_clust;
+ unsigned clust;
+ char rootpath[MAXPATHLEN];
+
+ for (i = 0; i < sizeof(*buf); i++)
+ *p++ = (char) -1;
+ buf->f_type = 0; /* that's what the man page says */
+ if (path[1] == ':')
+ drive = toupper(path[0]) - ('A' - 1);
+ else
+ drive = _getdrive();
+
+ // GetDiskFreeSpace must have the #$%^&* root!
+ // be simple-minded: must be "d:\<whatever>"
+ strcpy(rootpath, path);
+ p = strtok(rootpath, "\\");
+ *p++ = '\\';
+ *p = '\0';
+ if (! GetDiskFreeSpace(rootpath, &sect_per_clust, &bytes_per_sect,
+ &free_clust, &clust)) {
+ printf("GetDiskFreeSpace failed\n");
+ return -1;
+ }
+ buf->f_bsize = bytes_per_sect;
+ buf->f_blocks = clust * sect_per_clust;
+ buf->f_bfree = free_clust * sect_per_clust;
+ buf->f_bavail = buf->f_bfree;
+
+ return 0;
+}
+
+/***************************************************************
+DIRENT emulation for Win32
+***************************************************************/
+char pattern[MAXNAMLEN];
+struct _finddata_t findtst;
+long findhandle;
+int maxentry;
+int currententry;
+int diropen = 0;
+struct dirent *dirlist;
+DIR dirst;
+
+static void copynametolower(char *dest, char *src);
+static void findt_to_dirent(struct dirent *d);
+static int win32_findfirst(char *pattern);
+static int win32_findnext(void);
+
+int
+win32_findfirst(char *pattern)
+{
+ findhandle = _findfirst(pattern, &findtst);
+ return findhandle == -1;
+}
+
+int
+win32_findnext(void)
+{
+ return _findnext(findhandle, &findtst);
+}
+
+int
+win32_findclose(void)
+{
+ return _findclose(findhandle);
+}
+
+DIR *
+opendir(char * dirname)
+{
+ int i;
+
+ strcpy(pattern, dirname);
+ strcat(pattern, "\\*.*");
+ if (diropen)
+ return NULL;
+ diropen = 1;
+ dirlist = (struct dirent *) malloc(512 * sizeof(struct dirent));
+ if (dirlist == NULL)
+ return NULL;
+
+ if (win32_findfirst(pattern))
+ return NULL;
+ findt_to_dirent(&dirlist[0]);
+ for (i = 1; ! win32_findnext(); i++) {
+ findt_to_dirent(&dirlist[i]);
+ }
+ win32_findclose();
+
+ maxentry = i - 1;
+ currententry = 0;
+ return &dirst;
+}
+
+void
+rewinddir(DIR * dirp)
+{
+ int i;
+ unsigned int attributes = _A_NORMAL|_A_RDONLY|_A_HIDDEN|_A_SUBDIR;
+
+ dirp = dirp; /* shut up compiler */
+
+ if (win32_findfirst(pattern)) {
+ error("rewind failed");
+ exit(1);
+ }
+ findt_to_dirent(&dirlist[0]);
+ for (i = 1; ! win32_findnext(); i++) {
+ findt_to_dirent(&dirlist[i]);
+ }
+ win32_findclose();
+
+ maxentry = i - 1;
+ currententry = 0;
+}
+
+long
+telldir(DIR * dirp)
+{
+ dirp = dirp; /* keep compiler happy */
+ return (long) currententry;
+}
+
+void
+seekdir(DIR * dirp, long loc)
+{
+ dirp = dirp; /* keep compiler happy */
+ if (loc <= (long) maxentry)
+ currententry = (int) loc;
+ /* else seekdir silently fails */
+}
+
+struct dirent *
+readdir(DIR * dirp)
+{
+ dirp = dirp; /* shut up compiler */
+ if (currententry > maxentry)
+ return (struct dirent *) NULL;
+ else {
+ return &dirlist[currententry++];
+ }
+}
+
+void
+findt_to_dirent(struct dirent * d)
+{
+ copynametolower(d->d_name, findtst.name);
+}
+
+static void
+copynametolower(char * dest, char * src)
+{
+ int i;
+ for (i = 0; dest[i] = (char) tolower((int) src[i]); i++) {
+ /* null body */
+ }
+}
+
+void
+closedir(DIR * dirp)
+{
+ dirp = dirp; /* keep compiler happy */
+ diropen = 0;
+}
+
+
+#endif /* WIN32 */
+
+/***********************************************************/
+/* The following routines were ADDED specifically for DOS */
+/***********************************************************/
+
+#if defined DOS
+
+/*
+ * Change to drive specified in path
+ */
+
+static void
+chdrive(path)
+ char *path;
+{
+ int desireddrive, drive;
+ if (path[1] == ':') {
+ desireddrive = toupper(path[0]) - ('A' - 1);
+ _dos_setdrive(desireddrive, &drive);
+ _dos_getdrive(&drive);
+ if (drive != desireddrive) {
+ error("can't change to drive %c:", path[0]);
+ exit(1);
+ }
+ }
+}
+
+
+void
+gettimeofday(struct timeval *TV, struct timezone *TimeZone)
+{
+ struct dostime_t dostime;
+
+ _dos_gettime(&dostime);
+ TV->tv_sec = dostime.hour * 3600L
+ + dostime.minute * 60L
+ + dostime.second;
+ TV->tv_usec = dostime.hsecond * 10000L;
+ TimeZone = TimeZone; /* shut up compiler/lint */
+}
+
+int
+statfs(path, buf)
+ char *path;
+ struct statfs *buf;
+{
+ char *p = (char *) buf;
+ int i;
+ unsigned drive;
+ struct diskfree_t diskspace;
+
+ for (i = 0; i < sizeof(*buf); i++)
+ *p++ = (char) -1;
+ buf->f_type = 0; /* that's what the man page says */
+ if (path[1] == ':')
+ drive = toupper(path[0]) - ('A' - 1);
+ else
+ _dos_getdrive(&drive);
+ if (_dos_getdiskfree(drive, &diskspace))
+ return -1;
+ buf->f_bsize = diskspace.bytes_per_sector;
+ buf->f_blocks = (long) diskspace.total_clusters
+ * diskspace.sectors_per_cluster;
+ buf->f_bfree = (long) diskspace.avail_clusters
+ * diskspace.sectors_per_cluster;
+ buf->f_bavail = buf->f_bfree;
+ return 0;
+}
+
+/***************************************************************
+DIRENT emulation for DOS
+***************************************************************/
+char pattern[MAXNAMLEN];
+struct find_t findtst;
+int maxentry;
+int currententry;
+int diropen = 0;
+struct dirent *dirlist;
+DIR dirst;
+
+static void copynametolower(char *dest, char *src);
+static void findt_to_dirent(struct find_t *f, struct dirent *d);
+
+DIR *
+opendir(dirname)
+ char *dirname;
+{
+ int i;
+ unsigned int attributes = _A_NORMAL|_A_RDONLY|_A_HIDDEN|_A_SUBDIR;
+
+ strcpy(pattern, dirname);
+ strcat(pattern, "\\*.*");
+ if (diropen)
+ return NULL;
+ diropen = 1;
+ dirlist = (struct dirent *) malloc(512 * sizeof(struct dirent));
+ if (dirlist == NULL)
+ return NULL;
+ if (_dos_findfirst(pattern, attributes, &findtst))
+ return NULL;
+ findt_to_dirent(&findtst, &dirlist[0]);
+ for (i = 1; ! _dos_findnext(&findtst); i++) {
+ findt_to_dirent(&findtst, &dirlist[i]);
+ }
+ maxentry = i - 1;
+ currententry = 0;
+ return &dirst;
+}
+
+void
+rewinddir(dirp)
+ DIR *dirp;
+{
+ int i;
+ unsigned int attributes = _A_NORMAL|_A_RDONLY|_A_HIDDEN|_A_SUBDIR;
+
+ dirp = dirp; /* shut up compiler */
+ if (_dos_findfirst(pattern, attributes, &findtst)) {
+ error("rewind failed");
+ exit(1);
+ }
+ findt_to_dirent(&findtst, &dirlist[0]);
+ for (i = 1; ! _dos_findnext(&findtst); i++) {
+ findt_to_dirent(&findtst, &dirlist[i]);
+ }
+ maxentry = i - 1;
+ currententry = 0;
+}
+
+long
+telldir(dirp)
+ DIR *dirp;
+{
+ dirp = dirp; /* keep compiler happy */
+ return (long) currententry;
+}
+
+void
+seekdir(dirp, loc)
+ DIR *dirp;
+ long loc;
+{
+ dirp = dirp; /* keep compiler happy */
+ if (loc <= (long) maxentry)
+ currententry = (int) loc;
+ /* else seekdir silently fails */
+}
+
+struct dirent *
+readdir(dirp)
+ DIR *dirp;
+{
+ dirp = dirp; /* shut up compiler */
+ if (currententry > maxentry)
+ return (struct dirent *) NULL;
+ else {
+ return &dirlist[currententry++];
+ }
+}
+
+void
+findt_to_dirent(f, d)
+ struct find_t *f;
+ struct dirent *d;
+{
+ copynametolower(d->d_name, f->name);
+}
+
+static void
+copynametolower(dest, src)
+ char *dest;
+ char *src;
+{
+ int i;
+ for (i = 0; dest[i] = (char) tolower((int) src[i]); i++) {
+ /* null body */
+ }
+}
+
+void
+closedir(dirp)
+ DIR *dirp;
+{
+ dirp = dirp; /* keep compiler happy */
+ diropen = 0;
+}
+
+#endif /* DOS */
diff --git a/basic/tags b/basic/tags
new file mode 100644
index 0000000..dacdda4
--- /dev/null
+++ b/basic/tags
@@ -0,0 +1,170 @@
+!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
+!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
+!_TAG_PROGRAM_NAME Exuberant Ctags //
+!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
+!_TAG_PROGRAM_VERSION 5.6 //
+BIT test6.c 53;" d file:
+BITMOD test6.c 50;" d file:
+BUFSZ test5.c 56;" d file:
+BUFSZ test5a.c 55;" d file:
+BUFSZ test5b.c 46;" d file:
+CLRBIT test6.c 55;" d file:
+DOSorWIN32 subr.c 10;" d file:
+DOSorWIN32 test1.c 17;" d file:
+DOSorWIN32 test2.c 17;" d file:
+DOSorWIN32 test3.c 16;" d file:
+DOSorWIN32 test4.c 21;" d file:
+DOSorWIN32 test4a.c 20;" d file:
+DOSorWIN32 test5.c 22;" d file:
+DOSorWIN32 test5a.c 21;" d file:
+DOSorWIN32 test5b.c 18;" d file:
+DOSorWIN32 test6.c 18;" d file:
+DOSorWIN32 test7.c 19;" d file:
+DOSorWIN32 test7a.c 19;" d file:
+DOSorWIN32 test7b.c 19;" d file:
+DOSorWIN32 test8.c 20;" d file:
+DOSorWIN32 test9.c 24;" d file:
+DSIZE test5.c 57;" d file:
+DSIZE test5a.c 56;" d file:
+DSIZE test5b.c 47;" d file:
+Dflag subr.c /^int Dflag = 0;$/;" v
+Fflag test1.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test2.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test3.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test4.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test4a.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test5.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test5a.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test5b.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test6.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test7.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test7a.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test7b.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test8.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Fflag test9.c /^static int Fflag = 0; \/* test function only; set count to 1, negate -t *\/$/;" v file:
+Iflag test6.c /^static int Iflag = 0; \/* Ignore non-test files dir entries *\/$/;" v file:
+MAXFILES test6.c 49;" d file:
+MIN test5.c 53;" d file:
+MIN test5a.c 52;" d file:
+MIN test5b.c 43;" d file:
+Myname subr.c /^char *Myname;$/;" v
+NNAME test7.c 44;" d file:
+NNAME test7a.c 42;" d file:
+NNAME test7b.c 44;" d file:
+Nflag test1.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test2.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test3.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test4.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test4a.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test5.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test5a.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test5b.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test6.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test7.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test7a.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test7b.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test8.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+Nflag test9.c /^static int Nflag = 0; \/* Suppress directory operations *\/$/;" v file:
+O_SYNC test5.c 24;" d file:
+O_SYNC test5a.c 23;" d file:
+SETBIT test6.c 54;" d file:
+SNAME test8.c 46;" d file:
+Sflag test1.c /^static int Sflag = 0; \/* don't print non-error messages *\/$/;" v file:
+Sflag test5.c /^static int Sflag = 0; \/* use synchronous writes *\/$/;" v file:
+Sflag test5a.c /^static int Sflag = 0; \/* use synchronous writes *\/$/;" v file:
+Tflag test1.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test2.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test3.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test4.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test4a.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test5.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test5a.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test5b.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test6.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test7.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test7a.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test7b.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test8.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+Tflag test9.c /^static int Tflag = 0; \/* print timing *\/$/;" v file:
+USE_OPEN test5.c 49;" d file:
+USE_OPEN test5a.c 48;" d file:
+bitmap test6.c /^static unsigned char bitmap[MAXFILES \/ BITMOD];$/;" v file:
+chdrive subr.c /^chdrive(char * path)$/;" f file:
+chdrive subr.c /^chdrive(path)$/;" f file:
+closedir subr.c /^closedir(DIR * dirp)$/;" f
+closedir subr.c /^closedir(dirp)$/;" f
+complete subr.c /^complete()$/;" f
+copynametolower subr.c /^copynametolower(char * dest, char * src)$/;" f file:
+copynametolower subr.c /^copynametolower(dest, src)$/;" f file:
+currententry subr.c /^int currententry;$/;" v
+dirlist subr.c /^struct dirent *dirlist;$/;" v typeref:struct:dirent
+diropen subr.c /^int diropen = 0;$/;" v
+dirst subr.c /^DIR dirst;$/;" v
+dirtree subr.c /^dirtree(lev, files, dirs, fname, dname, totfiles, totdirs)$/;" f
+endtime subr.c /^endtime(tv)$/;" f
+error subr.c /^error(char *str, ...)$/;" f
+error subr.c /^error(str, ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9)$/;" f
+findhandle subr.c /^long findhandle;$/;" v
+findt_to_dirent subr.c /^findt_to_dirent(f, d)$/;" f
+findt_to_dirent subr.c /^findt_to_dirent(struct dirent * d)$/;" f
+findtst subr.c /^struct _finddata_t findtst;$/;" v typeref:struct:_finddata_t
+findtst subr.c /^struct find_t findtst;$/;" v typeref:struct:find_t
+getparm subr.c /^getparm(parm, min, label)$/;" f
+gettimeofday subr.c /^gettimeofday(struct timeval *TV, struct timezone *TimeZone)$/;" f
+lstat subr.c /^lstat(char * path, struct stat * buf)$/;" f
+main test1.c /^main(argc, argv)$/;" f
+main test2.c /^main(argc, argv)$/;" f
+main test3.c /^main(argc, argv)$/;" f
+main test4.c /^main(argc, argv)$/;" f
+main test4a.c /^main(argc, argv)$/;" f
+main test5.c /^main(argc, argv)$/;" f
+main test5a.c /^main(argc, argv)$/;" f
+main test5b.c /^main(argc, argv)$/;" f
+main test6.c /^main(argc, argv)$/;" f
+main test7.c /^main(argc, argv)$/;" f
+main test7a.c /^main(argc, argv)$/;" f
+main test7b.c /^main(argc, argv)$/;" f
+main test8.c /^main(argc, argv)$/;" f
+main test9.c /^main(argc, argv)$/;" f
+maxentry subr.c /^int maxentry;$/;" v
+mtestdir subr.c /^mtestdir(dir)$/;" f
+opendir subr.c /^opendir(char * dirname)$/;" f
+opendir subr.c /^opendir(dirname)$/;" f
+pattern subr.c /^char pattern[MAXNAMLEN];$/;" v
+readdir subr.c /^readdir(DIR * dirp)$/;" f
+readdir subr.c /^readdir(dirp)$/;" f
+rewinddir subr.c /^rewinddir(DIR * dirp)$/;" f
+rewinddir subr.c /^rewinddir(dirp)$/;" f
+rmdirtree subr.c /^rmdirtree(lev, files, dirs, fname, dname, totfiles, totdirs, ignore)$/;" f
+seekdir subr.c /^seekdir(DIR * dirp, long loc)$/;" f
+seekdir subr.c /^seekdir(dirp, loc)$/;" f
+starttime subr.c /^starttime()$/;" f
+statfs subr.c /^statfs(char * path, struct statfs * buf)$/;" f
+statfs subr.c /^statfs(path, buf)$/;" f
+strerror subr.c /^strerror(errval)$/;" f
+te subr.c /^static struct timeval ts, te;$/;" v typeref:struct: file:
+telldir subr.c /^telldir(DIR * dirp)$/;" f
+telldir subr.c /^telldir(dirp)$/;" f
+testdir subr.c /^testdir(dir)$/;" f
+ts subr.c /^static struct timeval ts, te;$/;" v typeref:struct:timeval file:
+unix_chdir subr.c /^unix_chdir(path)$/;" f
+unix_mkdir subr.c /^unix_mkdir(const char * path, int mode)$/;" f
+unix_mkdir subr.c /^unix_mkdir(path, mode)$/;" f
+usage test1.c /^usage()$/;" f file:
+usage test2.c /^usage()$/;" f file:
+usage test3.c /^usage()$/;" f file:
+usage test4.c /^usage()$/;" f file:
+usage test4a.c /^usage()$/;" f file:
+usage test5.c /^usage()$/;" f file:
+usage test5a.c /^usage()$/;" f file:
+usage test5b.c /^usage()$/;" f file:
+usage test6.c /^usage()$/;" f file:
+usage test7.c /^usage()$/;" f file:
+usage test7a.c /^usage()$/;" f file:
+usage test7b.c /^usage()$/;" f file:
+usage test8.c /^usage()$/;" f file:
+usage test9.c /^usage()$/;" f file:
+win32_findclose subr.c /^win32_findclose(void)$/;" f
+win32_findfirst subr.c /^win32_findfirst(char *pattern)$/;" f
+win32_findnext subr.c /^win32_findnext(void)$/;" f
diff --git a/basic/test1.c b/basic/test1.c
new file mode 100644
index 0000000..6b15c34
--- /dev/null
+++ b/basic/test1.c
@@ -0,0 +1,176 @@
+/*
+ * @(#)test1.c 1.5 99/08/29 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * Test file and directory creation.
+ * Builds a tree on the server.
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (if creating directories, level > 1)
+ * creat()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#endif
+
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <sys/stat.h>
+#include <stdio.h>
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Sflag = 0; /* don't print non-error messages */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [levels files dirs fname dname]\n",
+ Myname);
+ /* -s is a hidden option used by test2 */
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = DFILS; /* number of files in each dir */
+ int totfiles = 0;
+ int dirs = DDIRS; /* directories in each dir */
+ int totdirs = 0;
+ int levels = DLEVS; /* levels deep */
+ char *fname = FNAME;
+ char *dname = DNAME;
+ struct timeval time;
+ char *opts;
+
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 's': /* silent */
+ Sflag++;
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ levels = getparm(*argv, 1, "levels");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ files = getparm(*argv, 0, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ dirs = getparm(*argv, 0, "dirs");
+ if (dirs == 0 && levels != 1) {
+ error("Illegal dirs parameter, must be at least 1");
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argc--;
+ argv++;
+ }
+ if (argc) {
+ dname = *argv;
+ argc--;
+ argv++;
+ }
+ if (argc != 0) {
+ error("too many parameters");
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ levels = 2;
+ files = 2;
+ dirs = 2;
+ }
+
+ if (!Sflag) {
+ fprintf(stdout, "%s: File and directory creation test\n",
+ Myname);
+ }
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ if (Tflag && !Sflag) {
+ starttime();
+ }
+ dirtree(levels, files, dirs, fname, dname, &totfiles, &totdirs);
+ if (Tflag && !Sflag) {
+ endtime(&time);
+ }
+ if (!Sflag) {
+ fprintf(stdout,
+ "\tcreated %d files %d directories %d levels deep",
+ totfiles, totdirs, levels);
+ }
+ if (Tflag && !Sflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ if (!Sflag) {
+ fprintf(stdout, "\n");
+ }
+ complete();
+}
diff --git a/basic/test2.c b/basic/test2.c
new file mode 100644
index 0000000..cdb52eb
--- /dev/null
+++ b/basic/test2.c
@@ -0,0 +1,173 @@
+/*
+ * @(#)test2.c 1.6 99/08/29 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Test file and directory removal.
+ * Builds a tree on the server.
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * rmdir() (if removing directories, level > 1)
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#endif
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [levels files dirs fname dname]\n",
+ Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = DFILS; /* number of files in each dir */
+ int totfiles = 0;
+ int dirs = DDIRS; /* directories in each dir */
+ int totdirs = 0;
+ int levels = DLEVS; /* levels deep */
+ char *fname = FNAME;
+ char *dname = DNAME;
+ struct timeval time;
+ char *opts;
+ char str[256];
+
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ levels = getparm(*argv, 1, "levels");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ files = getparm(*argv, 0, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ dirs = getparm(*argv, 0, "dirs");
+ if (dirs == 0 && levels != 1) {
+ error("Illegal dirs parameter, must be at least 1");
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argc--;
+ argv++;
+ }
+ if (argc) {
+ dname = *argv;
+ argc--;
+ argv++;
+ }
+ if (argc != 0) {
+ error("too many parameters");
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ levels = 2;
+ files = 2;
+ dirs = 2;
+ }
+
+ fprintf(stdout, "%s: File and directory removal test\n", Myname);
+
+ if (mtestdir(NULL)) {
+ sprintf(str, "test1 -s %s %d %d %d %s %s",
+ Nflag ? "-n" : "",
+ levels, files, dirs, fname, dname);
+ if (system(str) != 0) {
+ error("can't make directroy tree to remove");
+ exit(1);
+ }
+ if (mtestdir(NULL)) {
+ error("still can't go to test directory");
+ exit(1);
+ }
+ }
+
+ if (Tflag) {
+ starttime();
+ }
+ rmdirtree(levels, files, dirs, fname, dname, &totfiles, &totdirs, 0);
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout,
+ "\tremoved %d files %d directories %d levels deep",
+ totfiles, totdirs, levels);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+ complete();
+}
diff --git a/basic/test3.c b/basic/test3.c
new file mode 100644
index 0000000..c53fff8
--- /dev/null
+++ b/basic/test3.c
@@ -0,0 +1,143 @@
+/*
+ * @(#)test3.c 1.7 00/12/30 Connectathon Testsuite
+ * 1.5 Lachman ONC Test Suite source
+ *
+ * Test lookup up and down across mount points
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * getcwd()
+ * stat()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <sys/types.h>
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [count]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int count = 250; /* times to do test */
+ int ct;
+ struct timeval time;
+ struct stat statb;
+ char *opts;
+ char path[MAXPATHLEN];
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ fprintf(stdout, "%s: lookups across mount point\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ if (getcwd(path, sizeof(path)) == NULL) {
+ fprintf(stderr, "%s: getcwd failed\n", Myname);
+ exit(1);
+ }
+ if (stat(path, &statb) < 0) {
+ error("can't stat %s after getcwd", path);
+ exit(1);
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d getcwd and stat calls", count * 2);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+ complete();
+}
diff --git a/basic/test4.c b/basic/test4.c
new file mode 100644
index 0000000..f72e956
--- /dev/null
+++ b/basic/test4.c
@@ -0,0 +1,187 @@
+/*
+ * @(#)test4.c 1.7 99/12/10 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * Test setattr, getattr and lookup
+ *
+ * Creates the files in the test directory - does not create a directory
+ * tree.
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * chmod()
+ * stat()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#endif
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [files count]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout,
+ " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = 10; /* number of files in each dir */
+ int fi;
+ int count = 50; /* times to do each file */
+ int ct;
+ int totfiles = 0;
+ int totdirs = 0;
+ char *fname = FNAME;
+ struct timeval time;
+ char str[MAXPATHLEN];
+ struct stat statb;
+ char *opts;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* suppress initial directory */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argc--;
+ argv++;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ dirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs);
+
+ fprintf(stdout, "%s: setattr, getattr, and lookup\n", Myname);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ for (fi = 0; fi < files; fi++) {
+ sprintf(str, "%s%d", fname, fi);
+ if (chmod(str, CHMOD_NONE) < 0) {
+ error("can't chmod %o %s", CHMOD_NONE, str);
+ exit(0);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after CMOD_NONE", str);
+ exit(1);
+ }
+ if ((statb.st_mode & CHMOD_MASK) != CHMOD_NONE) {
+ error("%s has mode %o after chmod 0",
+ str, (statb.st_mode & 0777));
+ exit(1);
+ }
+ if (chmod(str, CHMOD_RW) < 0) {
+ error("can't chmod %o %s", CHMOD_RW, str);
+ exit(0);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after CHMOD_RW", str);
+ exit(1);
+ }
+ if ((statb.st_mode & CHMOD_MASK) != CHMOD_RW) {
+ error("%s has mode %o after chmod 0666",
+ str, (statb.st_mode & 0777));
+ exit(1);
+ }
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d chmods and stats on %d files",
+ files * count * 2, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+ /* XXX REMOVE DIRECTORY TREE? */
+ complete();
+}
diff --git a/basic/test4a.c b/basic/test4a.c
new file mode 100644
index 0000000..336ed74
--- /dev/null
+++ b/basic/test4a.c
@@ -0,0 +1,165 @@
+/*
+ * @(#)test4a.c 1.7 99/12/10 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Test getattr and lookup
+ *
+ * Creates the files in the test directory - does not create a directory
+ * tree.
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * stat()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#endif
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [files [count [fname]]]\n",
+ Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout,
+ " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = 10; /* number of files in each dir */
+ int fi;
+ int count = 50; /* times to do each file */
+ int ct;
+ int totfiles = 0;
+ int totdirs = 0;
+ char *fname = FNAME;
+ struct timeval time;
+ char str[MAXPATHLEN];
+ struct stat statb;
+ char *opts;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* suppress initial directory */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argc--;
+ argv++;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ dirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs);
+
+ fprintf(stdout, "%s: getattr and lookup\n", Myname);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ for (fi = 0; fi < files; fi++) {
+ sprintf(str, "%s%d", fname, fi);
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s", str);
+ exit(1);
+ }
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d stats on %d files",
+ files * count * 2, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+ /* XXX REMOVE DIRECTORY TREE? */
+ complete();
+}
diff --git a/basic/test5.c b/basic/test5.c
new file mode 100644
index 0000000..f9463ae
--- /dev/null
+++ b/basic/test5.c
@@ -0,0 +1,358 @@
+/*
+ * @(#)test5.c 1.8 2003/12/01 Connectathon Testsuite
+ * 1.5 Lachman ONC Test Suite source
+ *
+ * Test read and write
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * open()
+ * read()
+ * write()
+ * stat()
+ * fstat()
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+/* Synchronous Write is Not supported in the Windows version yet.*/
+#undef O_SYNC
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#ifdef MMAP
+#include <sys/mman.h>
+#endif
+
+#include "../tests.h"
+
+#if defined(O_SYNC) || defined(DOSorWIN32)
+#define USE_OPEN
+#endif
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define BUFSZ 8192
+#define DSIZE 1048576
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+#ifdef O_SYNC
+static int Sflag = 0; /* use synchronous writes */
+#endif
+
+static void
+usage()
+{
+#ifdef O_SYNC
+ fprintf(stdout, "usage: %s [-htfns] [size count fname]\n", Myname);
+#else
+ fprintf(stdout, "usage: %s [-htfn] [size count fname]\n", Myname);
+#endif
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+#ifdef O_SYNC
+ fprintf(stdout, " s Use synchronous writes\n");
+#endif
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int count = DCOUNT; /* times to do each file */
+ int ct;
+ off_t size = DSIZE;
+ off_t si;
+ int i;
+ int fd;
+ off_t bytes = 0;
+ int roflags; /* open read-only flags */
+ int woflags; /* write-only create flags */
+ char *bigfile = "bigfile";
+ struct timeval time;
+ struct stat statb;
+ char *opts;
+ char buf[BUFSZ];
+ double etime;
+#ifdef MMAP
+ caddr_t maddr;
+#endif
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+#ifdef O_SYNC
+ case 's': /* synchronous writes */
+ Sflag++;
+ break;
+#endif
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ size = getparm(*argv, 1, "size");
+ if (size <= 0) {
+ usage();
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ if (count <= 0) {
+ usage();
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ bigfile = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ woflags = O_WRONLY|O_CREAT|O_TRUNC;
+ roflags = O_RDONLY;
+#ifdef O_SYNC
+ if (Sflag) {
+ woflags |= O_SYNC;
+ }
+#endif
+#ifdef DOSorWIN32
+ woflags |= O_BINARY | O_RDWR; /* create and open file */
+ roflags |= O_BINARY;
+#endif
+
+ fprintf(stdout, "%s: read and write\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ for (i = 0; i < BUFSZ / sizeof (int); i++) {
+ ((int *)buf)[i] = i;
+ }
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+#ifdef USE_OPEN
+ if ((fd = open(bigfile, woflags, CHMOD_RW)) < 0) {
+#else
+ if ((fd = creat(bigfile, CHMOD_RW)) < 0) {
+#endif
+ error("can't create '%s'", bigfile);
+ exit(1);
+ }
+ if (stat(bigfile, &statb) < 0) {
+ error("can't stat '%s'", bigfile);
+ exit(1);
+ }
+ if (statb.st_size != 0) {
+ error("'%s' has size %ld, should be 0",
+ bigfile, (long)statb.st_size);
+ exit(1);
+ }
+ for (si = size; si > 0; si -= bytes) {
+ bytes = MIN(BUFSZ, si);
+ if (write(fd, buf, bytes) != bytes) {
+ error("'%s' write failed", bigfile);
+ exit(1);
+ }
+ }
+ if (close(fd) < 0) {
+ error("can't close %s", bigfile);
+ exit(1);
+ }
+ if (stat(bigfile, &statb) < 0) {
+ error("can't stat '%s'", bigfile);
+ exit(1);
+ }
+ if (statb.st_size != size) {
+ error("'%s' has size %ld, should be %ld",
+ bigfile, (long)(statb.st_size), (long)size);
+ exit(1);
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+
+ if ((fd = open(bigfile, roflags)) < 0) {
+ error("can't open '%s'", bigfile);
+ exit(1);
+ }
+#ifdef MMAP
+ maddr = mmap((caddr_t)0, (size_t)size, PROT_READ,
+ MAP_PRIVATE, fd, (off_t)0);
+ if (maddr == MAP_FAILED) {
+ error("can't mmap '%s'", bigfile);
+ exit(1);
+ }
+ if (msync(maddr, (size_t)size, MS_INVALIDATE) < 0) {
+ error("can't invalidate pages for '%s'", bigfile);
+ exit(1);
+ }
+ if (munmap(maddr, (size_t)size) < 0) {
+ error("can't munmap '%s'", bigfile);
+ exit(1);
+ }
+#endif
+ for (si = size; si > 0; si -= bytes) {
+ bytes = MIN(BUFSZ, si);
+ if (read(fd, buf, bytes) != bytes) {
+ error("'%s' read failed", bigfile);
+ exit(1);
+ }
+ for (i = 0; i < bytes / sizeof (int); i++) {
+ if (((int *)buf)[i] != i) {
+ error("bad data in '%s'", bigfile);
+ exit(1);
+ }
+ }
+ }
+ close(fd);
+
+ fprintf(stdout, "\twrote %ld byte file %d times", (long)size, count);
+
+ if (Tflag) {
+ etime = (double)time.tv_sec + (double)time.tv_usec / 1000000.0;
+ if (etime != 0.0) {
+ fprintf(stdout, " in %ld.%-2ld seconds (%d bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (int)((double)size * ((double)count / etime)));
+ } else {
+ fprintf(stdout, " in %ld.%-2ld seconds (> %ld bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (long)size * count);
+ }
+ }
+ fprintf(stdout, "\n");
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ if ((fd = open(bigfile, roflags)) < 0) {
+ error("can't open '%s'", bigfile);
+ exit(1);
+ }
+#ifdef MMAP
+ maddr = mmap((caddr_t)0, (size_t)size, PROT_READ,
+ MAP_PRIVATE, fd, (off_t)0);
+ if (maddr == MAP_FAILED) {
+ error("can't mmap '%s'", bigfile);
+ exit(1);
+ }
+ if (msync(maddr, (size_t)size, MS_INVALIDATE) < 0) {
+ error("can't invalidate pages for '%s'", bigfile);
+ exit(1);
+ }
+ if (munmap(maddr, (size_t)size) < 0) {
+ error("can't munmap '%s'", bigfile);
+ exit(1);
+ }
+#endif
+ for (si = size; si > 0; si -= bytes) {
+ bytes = MIN(BUFSZ, si);
+ if (read(fd, buf, bytes) != bytes) {
+ error("'%s' read failed", bigfile);
+ exit(1);
+ }
+ }
+ close(fd);
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\tread %ld byte file %d times", (long)size, count);
+ if (Tflag) {
+ etime = (double)time.tv_sec + (double)time.tv_usec / 1000000.0;
+ if (etime != 0.0) {
+ fprintf(stdout, " in %ld.%-2ld seconds (%d bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (int)((double)size * ((double)count / etime)));
+ } else {
+ fprintf(stdout, " in %ld.%-2ld seconds (> %ld bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (long)size * count);
+ }
+ }
+ fprintf(stdout, "\n");
+
+ if (unlink(bigfile) < 0) {
+ error("can't unlink '%s'", bigfile);
+ exit(1);
+ }
+ complete();
+}
diff --git a/basic/test5a.c b/basic/test5a.c
new file mode 100644
index 0000000..716d917
--- /dev/null
+++ b/basic/test5a.c
@@ -0,0 +1,301 @@
+/*
+ * @(#)test5a.c 1.8 2003/12/01 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Test write
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * open()
+ * read()
+ * write()
+ * stat()
+ * fstat()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+/* Synchronous Write is Not supported in the Windows version yet.*/
+#undef O_SYNC
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#ifdef MMAP
+#include <sys/mman.h>
+#endif
+
+#include "../tests.h"
+
+#if defined(O_SYNC) || defined(DOSorWIN32)
+#define USE_OPEN
+#endif
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define BUFSZ 8192
+#define DSIZE 1048576
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+#ifdef O_SYNC
+static int Sflag = 0; /* use synchronous writes */
+#endif
+
+static void
+usage()
+{
+#ifdef O_SYNC
+ fprintf(stdout, "usage: %s [-htfns] [size count fname]\n", Myname);
+#else
+ fprintf(stdout, "usage: %s [-htfn] [size count fname]\n", Myname);
+#endif
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+#ifdef O_SYNC
+ fprintf(stdout, " s Use synchronous writes\n");
+#endif
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int count = DCOUNT; /* times to do each file */
+ int ct;
+ off_t size = DSIZE;
+ off_t si;
+ int i;
+ int fd;
+ off_t bytes = 0;
+ int roflags; /* open read-only flags */
+ int woflags; /* write-only create flags */
+ char *bigfile = "bigfile";
+ struct timeval time;
+ struct stat statb;
+ char *opts;
+ char buf[BUFSZ];
+ double etime;
+#ifdef MMAP
+ caddr_t maddr;
+#endif
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+#ifdef O_SYNC
+ case 's': /* synchronous writes */
+ Sflag++;
+ break;
+#endif
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ size = getparm(*argv, 1, "size");
+ if (size <= 0) {
+ usage();
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ if (count <= 0) {
+ usage();
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ bigfile = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ woflags = O_WRONLY|O_CREAT|O_TRUNC;
+ roflags = O_RDONLY;
+#ifdef O_SYNC
+ if (Sflag) {
+ woflags |= O_SYNC;
+ }
+#endif
+#ifdef DOSorWIN32
+ woflags |= O_BINARY | O_RDWR; /* create and open file */
+ roflags |= O_BINARY;
+#endif
+
+ fprintf(stdout, "%s: write\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ for (i = 0; i < BUFSZ / sizeof (int); i++) {
+ ((int *)buf)[i] = i;
+ }
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+#ifdef USE_OPEN
+ if ((fd = open(bigfile, woflags, CHMOD_RW)) < 0) {
+#else
+ if ((fd = creat(bigfile, CHMOD_RW)) < 0) {
+#endif
+ error("can't create '%s'", bigfile);
+ exit(1);
+ }
+ if (stat(bigfile, &statb) < 0) {
+ error("can't stat '%s'", bigfile);
+ exit(1);
+ }
+ if (statb.st_size != 0) {
+ error("'%s' has size %ld, should be 0",
+ bigfile, (long)statb.st_size);
+ exit(1);
+ }
+ for (si = size; si > 0; si -= bytes) {
+ bytes = MIN(BUFSZ, si);
+ if (write(fd, buf, bytes) != bytes) {
+ error("'%s' write failed", bigfile);
+ exit(1);
+ }
+ }
+ if (close(fd) < 0) {
+ error("can't close %s", bigfile);
+ exit(1);
+ }
+ if (stat(bigfile, &statb) < 0) {
+ error("can't stat '%s'", bigfile);
+ exit(1);
+ }
+ if (statb.st_size != size) {
+ error("'%s' has size %ld, should be %ld",
+ bigfile, (long)(statb.st_size), (long)size);
+ exit(1);
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+
+ if ((fd = open(bigfile, roflags)) < 0) {
+ error("can't open '%s'", bigfile);
+ exit(1);
+ }
+#ifdef MMAP
+ maddr = mmap((caddr_t)0, (size_t)size, PROT_READ,
+ MAP_PRIVATE, fd, (off_t)0);
+ if (maddr == MAP_FAILED) {
+ error("can't mmap '%s'", bigfile);
+ exit(1);
+ }
+ if (msync(maddr, (size_t)size, MS_INVALIDATE) < 0) {
+ error("can't invalidate pages for '%s'", bigfile);
+ exit(1);
+ }
+ if (munmap(maddr, (size_t)size) < 0) {
+ error("can't munmap '%s'", bigfile);
+ exit(1);
+ }
+#endif
+ for (si = size; si > 0; si -= bytes) {
+ bytes = MIN(BUFSZ, si);
+ if (read(fd, buf, bytes) != bytes) {
+ error("'%s' read failed", bigfile);
+ exit(1);
+ }
+ for (i = 0; i < bytes / sizeof (int); i++) {
+ if (((int *)buf)[i] != i) {
+ error("bad data in '%s'", bigfile);
+ exit(1);
+ }
+ }
+ }
+ close(fd);
+
+ fprintf(stdout, "\twrote %ld byte file %d times", (long)size, count);
+
+ if (Tflag) {
+ etime = (double)time.tv_sec + (double)time.tv_usec / 1000000.0;
+ if (etime != 0.0) {
+ fprintf(stdout, " in %ld.%-2ld seconds (%ld bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (long)((double)size * ((double)count / etime)));
+ } else {
+ fprintf(stdout, " in %ld.%-2ld seconds (> %ld bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (long)size * count);
+ }
+ }
+ fprintf(stdout, "\n");
+
+ complete();
+}
diff --git a/basic/test5b.c b/basic/test5b.c
new file mode 100644
index 0000000..7062680
--- /dev/null
+++ b/basic/test5b.c
@@ -0,0 +1,219 @@
+/*
+ * @(#)test5b.c 1.7 03/12/01 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Test read - will read a file of specified size, contents not looked at
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * open()
+ * read()
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#ifdef MMAP
+#include <sys/mman.h>
+#endif
+
+#include "../tests.h"
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define BUFSZ 8192
+#define DSIZE 1048576
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [size count fname]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int count = DCOUNT; /* times to do each file */
+ int ct;
+ off_t size = DSIZE;
+ off_t si;
+ int fd;
+ off_t bytes = 0;
+ int roflags; /* open read-only flags */
+ char *bigfile = "bigfile";
+ struct timeval time;
+ char *opts;
+ char buf[BUFSZ];
+ double etime;
+#ifdef MMAP
+ caddr_t maddr;
+#endif
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ size = getparm(*argv, 1, "size");
+ if (size <= 0) {
+ usage();
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ if (count <= 0) {
+ usage();
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ bigfile = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ roflags = O_RDONLY;
+#ifdef DOSorWIN32
+ roflags |= O_BINARY;
+#endif
+
+ fprintf(stdout, "%s: read\n", Myname);
+
+ mtestdir(NULL);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ if ((fd = open(bigfile, roflags)) < 0) {
+ error("can't open '%s'", bigfile);
+ exit(1);
+ }
+#ifdef MMAP
+ maddr = mmap((caddr_t)0, (size_t)size, PROT_READ,
+ MAP_PRIVATE, fd, (off_t)0);
+ if (maddr == MAP_FAILED) {
+ error("can't mmap '%s'", bigfile);
+ exit(1);
+ }
+ if (msync(maddr, (size_t)size, MS_INVALIDATE) < 0) {
+ error("can't invalidate pages for '%s'", bigfile);
+ exit(1);
+ }
+ if (munmap(maddr, (size_t)size) < 0) {
+ error("can't munmap '%s'", bigfile);
+ exit(1);
+ }
+#endif
+ for (si = size; si > 0; si -= bytes) {
+ bytes = MIN(BUFSZ, si);
+ if (read(fd, buf, bytes) != bytes) {
+ error("'%s' read failed", bigfile);
+ exit(1);
+ }
+ }
+ close(fd);
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+
+ fprintf(stdout, "\tread %ld byte file %d times", (long)size, count);
+
+ if (Tflag) {
+ etime = (double)time.tv_sec + (double)time.tv_usec / 1000000.0;
+ if (etime != 0.0) {
+ fprintf(stdout, " in %ld.%-2ld seconds (%ld bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (long)((double)size * ((double)count / etime)));
+ } else {
+ fprintf(stdout, " in %ld.%-2ld seconds (> %ld bytes/sec)",
+ (long)time.tv_sec, (long)time.tv_usec / 10000,
+ (long)size * count);
+ }
+ }
+ fprintf(stdout, "\n");
+
+ if (unlink(bigfile) < 0) {
+ error("can't unlink '%s'", bigfile);
+ exit(1);
+ }
+ complete();
+}
diff --git a/basic/test6.c b/basic/test6.c
new file mode 100644
index 0000000..1d64c88
--- /dev/null
+++ b/basic/test6.c
@@ -0,0 +1,293 @@
+/*
+ * @(#)test6.c 1.5 99/08/29 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * Test readdir
+ *
+ * Uses the following important system/library calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * unlink()
+ * opendir(), rewinddir(), readdir(), closedir()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#include <string.h>
+#ifdef use_directs
+#include <sys/dir.h>
+#else
+#include <dirent.h>
+#endif
+#endif /* DOSorWIN32 */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+static int Iflag = 0; /* Ignore non-test files dir entries */
+
+#define MAXFILES 512 /* maximum files allowed for this test */
+#define BITMOD 8 /* bits per u_char */
+static unsigned char bitmap[MAXFILES / BITMOD];
+
+#define BIT(x) (bitmap[(x) / BITMOD] & (1 << ((x) % BITMOD)) )
+#define SETBIT(x) (bitmap[(x) / BITMOD] |= (1 << ((x) % BITMOD)) )
+#define CLRBIT(x) (bitmap[(x) / BITMOD] &= ~(1 << ((x) % BITMOD)) )
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfni] [files count fname]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+ fprintf(stdout, " i Ignore non-test files dir entries\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef use_directs
+ struct direct *dp;
+#else
+ struct dirent *dp;
+#endif
+ char *fname = FNAME;
+ int files = 200; /* number of files in each dir */
+ int fi;
+ int count = 200; /* times to read dir */
+ int ct;
+ int entries = 0;
+ int totfiles = 0;
+ int totdirs = 0;
+ DIR *dir;
+ struct timeval time;
+ char *p, str[MAXPATHLEN];
+ char *opts;
+ int err, i, dot, dotdot;
+ int nmoffset;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ case 'i': /* ignore spurious files */
+ Iflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ nmoffset = strlen(fname);
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ if (count > files) {
+ error("count (%d) can't be greater than files (%d)",
+ count, files);
+ exit(1);
+ }
+
+ if (files > MAXFILES) {
+ error("too many files requested (max is %d)", MAXFILES);
+ exit(1);
+ }
+
+ fprintf(stdout, "%s: readdir\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ dirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ if ((dir = opendir(".")) == NULL) {
+ error("can't opendir %s", ".");
+ exit(1);
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ rewinddir(dir);
+ dot = 0;
+ dotdot = 0;
+ err = 0;
+ for (i = 0; i < sizeof(bitmap); i++)
+ bitmap[i] = 0;
+ while ((dp = readdir(dir)) != NULL) {
+ entries++;
+ if (strcmp(".", dp->d_name) == 0) {
+ if (dot) {
+ /* already read dot */
+ error("'.' dir entry read twice");
+ exit(1);
+ }
+ dot++;
+ continue;
+ } else if (strcmp("..", dp->d_name) == 0) {
+ if (dotdot) {
+ /* already read dotdot */
+ error("'..' dir entry read twice");
+ exit(1);
+ }
+ dotdot++;
+ continue;
+ }
+
+ /*
+ * at this point, should have entry of the form
+ * fname%d
+ */
+ /* If we don't have our own directory, ignore
+ such errors (if Iflag set). */
+ if (strncmp(dp->d_name, fname, nmoffset)) {
+ if (Iflag)
+ continue;
+ else {
+ error("unexpected dir entry '%s'",
+ dp->d_name);
+ exit(1);
+ }
+ }
+
+ /* get ptr to numeric part of name */
+ p = dp->d_name + nmoffset;
+ fi = atoi(p);
+ if (fi < 0 || fi >= MAXFILES) {
+ error("unexpected dir entry '%s'",
+ dp->d_name);
+ exit(1);
+ }
+ if (BIT(fi)) {
+ error("duplicate '%s' dir entry read",
+ dp->d_name);
+ err++;
+ } else
+ SETBIT(fi);
+ } /* end readdir loop */
+ if (!dot) {
+ error("didn't read '.' dir entry, pass %d", ct);
+ err++;
+ }
+ if (!dotdot) {
+ error("didn't read '..' dir entry, pass %d", ct);
+ err++;
+ }
+ for (fi = 0; fi < ct; fi++) {
+ if (BIT(fi)) {
+ sprintf(str, "%s%d", fname, fi);
+ error("unlinked '%s' dir entry read pass %d",
+ str, ct);
+ err++;
+ }
+ }
+ for (fi = ct; fi < files; fi++) {
+ if (!BIT(fi)) {
+ sprintf(str, "%s%d", fname, fi);
+ error("\
+didn't read expected '%s' dir entry, pass %d", str, ct);
+ err++;
+ }
+ }
+ if (err) {
+ error("Test failed with %d errors", err);
+ exit(1);
+ }
+ sprintf(str, "%s%d", fname, ct);
+ if (unlink(str) < 0) {
+ error("can't unlink %s", str);
+ exit(1);
+ }
+ }
+
+ closedir(dir);
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d entries read, %d files",
+ entries, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+ rmdirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs, 1);
+ complete();
+}
diff --git a/basic/test7.c b/basic/test7.c
new file mode 100644
index 0000000..f7b3e2e
--- /dev/null
+++ b/basic/test7.c
@@ -0,0 +1,248 @@
+/*
+ * @(#)test7.c 1.7 99/08/29 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * Test rename, link
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * creat()
+ * stat()
+ * rename()
+ * link()
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <sys/types.h>
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+#define NNAME "newfile." /* new filename for rename and link */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [files count fname nname]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = 10; /* number of files in each dir */
+ int fi;
+ int count = 10; /* times to do each file */
+ int ct;
+ int totfiles = 0;
+ int totdirs = 0;
+ char *fname = FNAME;
+ char *nname = NNAME;
+ struct timeval time;
+ char str[MAXPATHLEN];
+ char new[MAXPATHLEN];
+ struct stat statb;
+ char *opts;
+ int oerrno;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ nname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ fprintf(stdout, "%s: link and rename\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ dirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ for (fi = 0; fi < files; fi++) {
+ sprintf(str, "%s%d", fname, fi);
+ sprintf(new, "%s%d", nname, fi);
+ if (rename(str, new) < 0) {
+ error("can't rename %s to %s", str, new);
+ exit(1);
+ }
+ if (stat(str, &statb) == 0) {
+ error("%s exists after rename to %s", str, new);
+ exit(1);
+ }
+ if (stat(new, &statb) < 0) {
+ error("can't stat %s after rename from %s",
+ new, str);
+ exit(1);
+ }
+ if (statb.st_nlink != 1) {
+ error("%s has %d links after rename (expect 1)",
+ new, statb.st_nlink);
+ exit(1);
+ }
+#ifndef DOSorWIN32
+ if (link(new, str) < 0) {
+ oerrno = errno;
+ error("can't link %s to %s", new, str);
+ errno = oerrno;
+ if (errno == EOPNOTSUPP)
+ complete();
+ exit(1);
+ }
+ if (stat(new, &statb) < 0) {
+ error("can't stat %s after link", new);
+ exit(1);
+ }
+ if (statb.st_nlink != 2) {
+ error("%s has %d links after link (expect 2)",
+ new, statb.st_nlink);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after link", str);
+ exit(1);
+ }
+ if (statb.st_nlink != 2) {
+ error("%s has %d links after link (expect 2)",
+ str, statb.st_nlink);
+ exit(1);
+ }
+ if (unlink(new) < 0) {
+ error("can't unlink %s", new);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after unlink %s",
+ str, new);
+ exit(1);
+ }
+ if (statb.st_nlink != 1) {
+ error("%s has %d links after unlink (expect 1)",
+ str, statb.st_nlink);
+ exit(1);
+ }
+#else /* DOSorWIN32 */
+ /* just rename back to orig name */
+ if (rename(new, str) < 0) {
+ error("can't rename %s to %s", new, str);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't find %s after rename", str);
+ exit(1);
+ }
+ if (stat(new, &statb) == 0) {
+ error("still found %s after rename", new);
+ exit(1);
+ }
+#endif /* DOSorWIN32 */
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d renames and links on %d files",
+ files * count * 2, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+
+ /* Cleanup files left around */
+ rmdirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs, 1);
+
+ complete();
+}
diff --git a/basic/test7a.c b/basic/test7a.c
new file mode 100644
index 0000000..1e4170c
--- /dev/null
+++ b/basic/test7a.c
@@ -0,0 +1,195 @@
+/*
+ * @(#)test7a.c 1.6 99/08/29 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Test rename
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * stat()
+ * rename()
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#endif
+
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+#define NNAME "newfile." /* new filename for rename */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [files count fname nname]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = 10; /* number of files in each dir */
+ int fi;
+ int count = 10; /* times to do each file */
+ int ct;
+ int totfiles = 0;
+ int totdirs = 0;
+ char *fname = FNAME;
+ char *nname = NNAME;
+ struct timeval time;
+ char str[MAXPATHLEN];
+ char new[MAXPATHLEN];
+ struct stat statb;
+ char *opts;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ nname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ fprintf(stdout, "%s: rename\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ dirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ for (fi = 0; fi < files; fi++) {
+ sprintf(str, "%s%d", fname, fi);
+ sprintf(new, "%s%d", nname, fi);
+ if (rename(str, new) < 0) {
+ error("can't rename %s to %s", str, new);
+ exit(1);
+ }
+ if (stat(str, &statb) == 0) {
+ error("%s exists after rename", str);
+ exit(1);
+ }
+ if (stat(new, &statb) < 0) {
+ error("can't stat %s after rename", new);
+ exit(1);
+ }
+ if (rename(new, str) < 0) {
+ error("can't rename %s to %s", new, str);
+ exit(1);
+ }
+ if (stat(new, &statb) == 0) {
+ error("%s exists after rename", new);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after rename", str);
+ exit(1);
+ }
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d renames on %d files",
+ files * count * 2, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+
+ /* Cleanup files left around */
+ rmdirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs, 1);
+
+ complete();
+}
diff --git a/basic/test7b.c b/basic/test7b.c
new file mode 100644
index 0000000..2f5b119
--- /dev/null
+++ b/basic/test7b.c
@@ -0,0 +1,245 @@
+/*
+ * @(#)test7b.c 1.7 99/08/29 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Test link
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * stat()
+ * link()
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <sys/types.h>
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+#define NNAME "newfile." /* new filename for link */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [files count fname nname]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = 10; /* number of files in each dir */
+ int fi;
+ int count = 10; /* times to do each file */
+ int ct;
+ int totfiles = 0;
+ int totdirs = 0;
+ char *fname = FNAME;
+ char *nname = NNAME;
+ struct timeval time;
+ char str[MAXPATHLEN];
+ char new[MAXPATHLEN];
+ struct stat statb;
+ char *opts;
+ int oerrno;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ nname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ fprintf(stdout, "%s: link\n", Myname);
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ dirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ for (fi = 0; fi < files; fi++) {
+ sprintf(str, "%s%d", fname, fi);
+ sprintf(new, "%s%d", nname, fi);
+#ifndef DOSorWIN32
+ if (link(str, new) < 0) {
+ oerrno = errno;
+ error("can't link %s to %s", str, new);
+ errno = oerrno;
+ if (errno == EOPNOTSUPP)
+ complete();
+ exit(1);
+ }
+ if (stat(new, &statb) < 0) {
+ error("can't stat %s after link", new);
+ exit(1);
+ }
+ if (statb.st_nlink != 2) {
+ error("%s has %d links after link (expect 2)",
+ new, statb.st_nlink);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after link", str);
+ exit(1);
+ }
+ if (statb.st_nlink != 2) {
+ error("%s has %d links after link (expect 2)",
+ str, statb.st_nlink);
+ exit(1);
+ }
+ if (unlink(new) < 0) {
+ error("can't unlink %s", new);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after unlink %s",
+ str, new);
+ exit(1);
+ }
+ if (statb.st_nlink != 1) {
+ error("%s has %d links after unlink (expect 1)",
+ str, statb.st_nlink);
+ exit(1);
+ }
+#else /* DOSorWIN32 */ /* just rename back to orig name */
+ if (rename(str, new) < 0) {
+ error("can't rename %s to %s", str, new);
+ exit(1);
+ }
+ if (stat(new, &statb) < 0) {
+ error("can't stat %s after rename %s",
+ new, str);
+ exit(1);
+ }
+ if (statb.st_nlink != 1) {
+ error("%s has %d links after rename (expect 1)",
+ new, statb.st_nlink);
+ exit(1);
+ }
+ if (rename(new, str) < 0) {
+ error("can't rename %s to %s", new, str);
+ exit(1);
+ }
+ if (stat(str, &statb) < 0) {
+ error("can't stat %s after rename %s",
+ str, new);
+ exit(1);
+ }
+ if (statb.st_nlink != 1) {
+ error("%s has %d links after rename (expect 1)",
+ str, statb.st_nlink);
+ exit(1);
+ }
+#endif /* DOSorWIN32 */
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d links on %d files",
+ files * count, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+
+ /* Cleanup files left around */
+ rmdirtree(1, files, 0, fname, DNAME, &totfiles, &totdirs, 1);
+
+ complete();
+}
diff --git a/basic/test8.c b/basic/test8.c
new file mode 100644
index 0000000..ea9aa0c
--- /dev/null
+++ b/basic/test8.c
@@ -0,0 +1,207 @@
+/*
+ * @(#)test8.c 1.7 2001/08/25 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * Test symlink, readlink
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+ * creat()
+ * symlink()
+ * readlink()
+ * lstat()
+ * unlink()
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#endif
+
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+#define SNAME "/this/is/a/symlink" /* symlink prefix */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [files count fname sname]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int files = 10; /* number of files in each dir */
+ int fi;
+ int count = 20; /* times to do each file */
+ int ct;
+ char *fname = FNAME;
+ char *sname = SNAME;
+ struct timeval time;
+ char str[MAXPATHLEN];
+ char new[MAXPATHLEN];
+ char buf[MAXPATHLEN];
+ int ret;
+ struct stat statb;
+ char *opts;
+ int oerrno;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ files = getparm(*argv, 1, "files");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ fname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ sname = *argv;
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+#ifndef S_IFLNK
+ fprintf(stdout, "\
+%s: symlink and readlink not supported on this client\n", Myname);
+#else /* S_IFLNK */
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+ fprintf(stdout, "%s: symlink and readlink\n", Myname);
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+ for (fi = 0; fi < files; fi++) {
+ sprintf(str, "%s%d", fname, fi);
+ sprintf(new, "%s%d", sname, fi);
+ if (symlink(new, str) < 0) {
+ oerrno = errno;
+ error("can't make symlink %s", str);
+ errno = oerrno;
+ if (errno == EOPNOTSUPP)
+ complete();
+ else
+ exit(1);
+ }
+ if (lstat(str, &statb) < 0) {
+ error("can't stat %s after symlink", str);
+ exit(1);
+ }
+ if ((statb.st_mode & S_IFMT) != S_IFLNK) {
+ error("mode of %s not symlink");
+ exit(1);
+ }
+ if ((ret = readlink(str, buf, MAXPATHLEN))
+ != strlen(new)) {
+ error("readlink %s ret %d, expect %d",
+ str, ret, strlen(new));
+ exit(1);
+ }
+ if (strncmp(new, buf, ret) != 0) {
+ error("readlink %s returned bad linkname",
+ str);
+ exit(1);
+ }
+ if (unlink(str) < 0) {
+ error("can't unlink %s", str);
+ exit(1);
+ }
+ }
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+ fprintf(stdout, "\t%d symlinks and readlinks on %d files",
+ files * count * 2, files);
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+#endif /* S_IFLNK */
+ complete();
+}
diff --git a/basic/test9.c b/basic/test9.c
new file mode 100644
index 0000000..ef68fc2
--- /dev/null
+++ b/basic/test9.c
@@ -0,0 +1,182 @@
+/*
+ * @(#)test9.c 1.7 2001/08/25 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+#ifdef SVR4
+ * Test statvfs
+#else
+ * Test statfs
+#endif
+ *
+ * Uses the following important system calls against the server:
+ *
+ * chdir()
+ * mkdir() (for initial directory creation if not -m)
+#ifdef SVR4
+ * statvfs()
+#else
+ * statfs()
+#endif
+ */
+
+#if defined (DOS) || defined (WIN32)
+/* If Dos, Windows or Win32 */
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#include <unistd.h>
+#ifdef SVR4
+#include <sys/statvfs.h>
+#else
+#if defined (OSF1) || defined (BSD)
+#include <sys/mount.h>
+#else
+#include <sys/vfs.h>
+#endif /* OSF1 || BSD */
+#endif /* SVR4 */
+#endif /* DOSorWIN32 */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef DOSorWIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#include "../tests.h"
+
+static int Tflag = 0; /* print timing */
+static int Fflag = 0; /* test function only; set count to 1, negate -t */
+static int Nflag = 0; /* Suppress directory operations */
+
+static void
+usage()
+{
+ fprintf(stdout, "usage: %s [-htfn] [count]\n", Myname);
+ fprintf(stdout, " Flags: h Help - print this usage info\n");
+ fprintf(stdout, " t Print execution time statistics\n");
+ fprintf(stdout, " f Test function only (negate -t)\n");
+ fprintf(stdout, " n Suppress test directory create operations\n");
+}
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef SVR4
+ int count = 1500; /* times to do statvfs call */
+#else
+ int count = 1500; /* times to do statfs call */
+#endif
+ int ct;
+ struct timeval time;
+#ifdef SVR4
+ struct statvfs sfsb;
+#else
+ struct statfs sfsb;
+#endif
+ char *opts;
+
+ umask(0);
+ setbuf(stdout, NULL);
+ Myname = *argv++;
+ argc--;
+ while (argc && **argv == '-') {
+ for (opts = &argv[0][1]; *opts; opts++) {
+ switch (*opts) {
+ case 'h': /* help */
+ usage();
+ exit(1);
+ break;
+
+ case 't': /* time */
+ Tflag++;
+ break;
+
+ case 'f': /* funtionality */
+ Fflag++;
+ break;
+
+ case 'n': /* No Test Directory create */
+ Nflag++;
+ break;
+
+ default:
+ error("unknown option '%c'", *opts);
+ usage();
+ exit(1);
+ }
+ }
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ count = getparm(*argv, 1, "count");
+ argv++;
+ argc--;
+ }
+ if (argc) {
+ usage();
+ exit(1);
+ }
+
+ if (Fflag) {
+ Tflag = 0;
+ count = 1;
+ }
+
+ if (!Nflag)
+ testdir(NULL);
+ else
+ mtestdir(NULL);
+
+#ifdef SVR4
+ fprintf(stdout, "%s: statvfs\n", Myname);
+#else
+ fprintf(stdout, "%s: statfs\n", Myname);
+#endif
+
+ if (Tflag) {
+ starttime();
+ }
+
+ for (ct = 0; ct < count; ct++) {
+#ifdef SVR4
+ if (statvfs(".", &sfsb) < 0) {
+ error("can't do statvfs on \".\"");
+ exit(1);
+ }
+#else
+#ifdef SVR3
+ if (statfs(".", &sfsb, sizeof(sfsb), 0) < 0) {
+#else
+ if (statfs(".", &sfsb) < 0) {
+#endif
+ error("can't do statfs on \".\"");
+ exit(1);
+ }
+#endif
+ }
+
+ if (Tflag) {
+ endtime(&time);
+ }
+#ifdef SVR4
+ fprintf(stdout, "\t%d statvfs calls", count);
+#else
+ fprintf(stdout, "\t%d statfs calls", count);
+#endif
+ if (Tflag) {
+ fprintf(stdout, " in %ld.%-2ld seconds",
+ (long)time.tv_sec, (long)time.tv_usec / 10000);
+ }
+ fprintf(stdout, "\n");
+ complete();
+}
diff --git a/domount.c b/domount.c
new file mode 100644
index 0000000..8982684
--- /dev/null
+++ b/domount.c
@@ -0,0 +1,37 @@
+/*
+ * @(#)domount.c 1.2 97/01/03 Connectathon testsuite
+ * 1.1 Lachman ONC Test Suite source
+ *
+ * domount [-u] [args]
+ *
+ * NOTE: This program should be suid root to work properly.
+ */
+
+#include <stdio.h>
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ char *comm;
+ extern char *getenv();
+
+ if (argc > 1 && strcmp(argv[1], "-u") == 0) {
+ if ((comm = getenv("UMOUNT")) != NULL)
+ *++argv = comm;
+ else
+ *++argv = "/etc/umount";
+ } else {
+ if ((comm = getenv("MOUNT")) != NULL)
+ *argv = comm;
+ else
+ *argv = "/etc/mount";
+ }
+
+ (void)setuid(0);
+
+ (void)execv(*argv, argv);
+
+ exit(1);
+ /* NOTREACHED */
+}
diff --git a/general/Makefile b/general/Makefile
new file mode 100644
index 0000000..c26fd77
--- /dev/null
+++ b/general/Makefile
@@ -0,0 +1,32 @@
+#
+# @(#)Makefile 1.5 2003/12/29 Connectathon Testsuite
+# 1.3 Lachman ONC Test Suite source
+#
+
+DESTDIR=/no/such/path
+FILES=Makefile runtests runtests.wrk *.sh *.c mkdummy rmdummy \
+ nroff.in makefile.tst
+
+LARGE_SRC=large1.c large2.c large3.c
+
+all: $(LARGE_SRC)
+ if test ! -x runtests; then chmod a+x runtests; fi
+
+large1.c: large.c
+ rm -f large1.c
+ cp large.c large1.c
+
+large2.c: large.c
+ rm -f large2.c
+ cp large.c large2.c
+
+large3.c: large.c
+ rm -f large3.c
+ cp large.c large3.c
+
+clean:
+ rm -f *.time *.o stat $(LARGE_SRC)
+
+copy dist: all
+ cd $(DESTDIR); rm -f $(FILES)
+ cp $(FILES) $(DESTDIR)
diff --git a/general/large.c b/general/large.c
new file mode 100644
index 0000000..5dd2950
--- /dev/null
+++ b/general/large.c
@@ -0,0 +1,443 @@
+/* @(#)large.c 1.3 2002/12/13 Connectathon Testsuite */
+/*
+ * cc - front end for C compiler
+ */
+#include <sys/param.h>
+#ifndef major
+#include <sys/types.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+#ifdef SVR4
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#endif
+
+#undef MAXNAMLEN
+#define MAXNAMLEN 256
+
+/* return type for signal handlers */
+#if defined(SVR4) || defined (TRU64)
+#define SIGHAND_T void
+#else
+#define SIGHAND_T int
+#endif
+
+char *cpp = "/lib/cpp";
+char *ccom = "/lib/ccom";
+char *c2 = "/lib/c2";
+char *as = "/bin/as";
+char *ld = "/bin/ld";
+char *crt0 = "/lib/crt0.o";
+
+char tmp0[30]; /* big enough for /tmp/ctm%05.5d */
+char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
+char *outfile;
+char *savestr(), *strspl(), *setsuf();
+SIGHAND_T idexit();
+char **av, **clist, **llist, **plist;
+int cflag, eflag, oflag, pflag, sflag, wflag, Rflag, exflag, proflag;
+int gflag, Gflag;
+char *dflag;
+int exfail;
+char *passes;
+char *npassname;
+
+int nc, nl, np, nxo, na;
+
+#define cunlink(s) if (s) unlink(s)
+
+main(argc, argv)
+ char **argv;
+{
+ char *t;
+ char *assource;
+ int i, j, c;
+
+ /* ld currently adds upto 5 args; 10 is room to spare */
+ av = (char **)calloc(argc+10, sizeof (char **));
+ clist = (char **)calloc(argc, sizeof (char **));
+ llist = (char **)calloc(argc, sizeof (char **));
+ plist = (char **)calloc(argc, sizeof (char **));
+ for (i = 1; i < argc; i++) {
+ if (*argv[i] == '-') switch (argv[i][1]) {
+
+ case 'S':
+ sflag++;
+ cflag++;
+ continue;
+ case 'o':
+ if (++i < argc) {
+ outfile = argv[i];
+ switch (getsuf(outfile)) {
+
+ case 'c':
+ case 'o':
+ error("-o would overwrite %s",
+ outfile);
+ exit(8);
+ }
+ }
+ continue;
+ case 'R':
+ Rflag++;
+ continue;
+ case 'O':
+ oflag++;
+ continue;
+ case 'p':
+ proflag++;
+ crt0 = "/lib/mcrt0.o";
+ if (argv[i][2] == 'g')
+ crt0 = "/usr/lib/gcrt0.o";
+ continue;
+ case 'g':
+ if (argv[i][2] == 'o') {
+ Gflag++; /* old format for -go */
+ } else {
+ gflag++; /* new format for -g */
+ }
+ continue;
+ case 'w':
+ wflag++;
+ continue;
+ case 'E':
+ exflag++;
+ case 'P':
+ pflag++;
+ if (argv[i][1]=='P')
+ fprintf(stderr,
+ "cc: warning: -P option obsolete; you should use -E instead\n");
+ plist[np++] = argv[i];
+ case 'c':
+ cflag++;
+ continue;
+ case 'D':
+ case 'I':
+ case 'U':
+ case 'C':
+ plist[np++] = argv[i];
+ continue;
+ case 't':
+ if (passes)
+ error("-t overwrites earlier option", 0);
+ passes = argv[i]+2;
+ if (passes[0]==0)
+ passes = "012p";
+ continue;
+ case 'f':
+ fprintf(stderr,
+ "cc: warning: -f option obsolete (unnecessary)\n");
+ continue;
+ case 'B':
+ if (npassname)
+ error("-B overwrites earlier option", 0);
+ npassname = argv[i]+2;
+ if (npassname[0]==0)
+ npassname = "/usr/c/o";
+ continue;
+ case 'd':
+ dflag = argv[i];
+ continue;
+ }
+ t = argv[i];
+ c = getsuf(t);
+ if (c=='c' || c=='s' || exflag) {
+ clist[nc++] = t;
+ t = setsuf(t, 'o');
+ }
+ if (nodup(llist, t)) {
+ llist[nl++] = t;
+ if (getsuf(t)=='o')
+ nxo++;
+ }
+ }
+ if (gflag || Gflag) {
+ if (oflag)
+ fprintf(stderr, "cc: warning: -g disables -O\n");
+ oflag = 0;
+ }
+ if (npassname && passes ==0)
+ passes = "012p";
+ if (passes && npassname==0)
+ npassname = "/usr/new";
+ if (passes)
+ for (t=passes; *t; t++) {
+ switch (*t) {
+
+ case '0':
+ ccom = strspl(npassname, "ccom");
+ continue;
+ case '2':
+ c2 = strspl(npassname, "c2");
+ continue;
+ case 'p':
+ cpp = strspl(npassname, "cpp");
+ continue;
+ }
+ }
+ if (nc==0)
+ goto nocom;
+ if (signal(SIGINT, SIG_IGN) != SIG_IGN)
+ signal(SIGINT, idexit);
+ if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
+ signal(SIGTERM, idexit);
+ if (pflag==0)
+ sprintf(tmp0, "/tmp/ctm%05.5d", getpid());
+ tmp1 = strspl(tmp0, "1");
+ tmp2 = strspl(tmp0, "2");
+ tmp3 = strspl(tmp0, "3");
+ if (pflag==0)
+ tmp4 = strspl(tmp0, "4");
+ if (oflag)
+ tmp5 = strspl(tmp0, "5");
+ for (i=0; i<nc; i++) {
+ if (nc > 1) {
+ printf("%s:\n", clist[i]);
+ fflush(stdout);
+ }
+ if (getsuf(clist[i]) == 's') {
+ assource = clist[i];
+ goto assemble;
+ } else
+ assource = tmp3;
+ if (pflag)
+ tmp4 = setsuf(clist[i], 'i');
+ av[0] = "cpp"; av[1] = clist[i]; av[2] = exflag ? "-" : tmp4;
+ na = 3;
+ for (j = 0; j < np; j++)
+ av[na++] = plist[j];
+ av[na++] = 0;
+ if (callsys(cpp, av)) {
+ exfail++;
+ eflag++;
+ }
+ if (pflag || exfail) {
+ cflag++;
+ continue;
+ }
+ if (sflag)
+ assource = tmp3 = setsuf(clist[i], 's');
+ av[0] = "ccom"; av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3;
+ if (proflag)
+ av[na++] = "-XP";
+ if (gflag) {
+ av[na++] = "-Xg";
+ } else if (Gflag) {
+ av[na++] = "-XG";
+ }
+ if (wflag)
+ av[na++] = "-w";
+ av[na] = 0;
+ if (callsys(ccom, av)) {
+ cflag++;
+ eflag++;
+ continue;
+ }
+ if (oflag) {
+ av[0] = "c2"; av[1] = tmp5; av[2] = tmp3; av[3] = 0;
+ if (callsys(c2, av)) {
+ unlink(tmp3);
+ tmp3 = assource = tmp5;
+ } else
+ unlink(tmp5);
+ }
+ if (sflag)
+ continue;
+ assemble:
+ cunlink(tmp1); cunlink(tmp2); cunlink(tmp4);
+ av[0] = "as"; av[1] = "-o"; av[2] = setsuf(clist[i], 'o');
+ na = 3;
+ if (Rflag)
+ av[na++] = "-R";
+ if (dflag)
+ av[na++] = dflag;
+ av[na++] = assource;
+ av[na] = 0;
+ if (callsys(as, av) > 1) {
+ cflag++;
+ eflag++;
+ continue;
+ }
+ }
+nocom:
+ if (cflag==0 && nl!=0) {
+ i = 0;
+ av[0] = "ld"; av[1] = "-X"; av[2] = crt0; na = 3;
+ if (outfile) {
+ av[na++] = "-o";
+ av[na++] = outfile;
+ }
+ while (i < nl)
+ av[na++] = llist[i++];
+ if (gflag || Gflag)
+ av[na++] = "-lg";
+ if (proflag)
+ av[na++] = "-lc_p";
+ else
+ av[na++] = "-lc";
+ av[na++] = 0;
+ eflag |= callsys(ld, av);
+ if (nc==1 && nxo==1 && eflag==0)
+ unlink(setsuf(clist[0], 'o'));
+ }
+ dexit();
+}
+
+SIGHAND_T
+idexit()
+{
+
+ eflag = 100;
+ dexit();
+}
+
+dexit()
+{
+
+ if (!pflag) {
+ cunlink(tmp1);
+ cunlink(tmp2);
+ if (sflag==0)
+ cunlink(tmp3);
+ cunlink(tmp4);
+ cunlink(tmp5);
+ }
+ exit(eflag);
+}
+
+error(s, x)
+ char *s, *x;
+{
+ FILE *diag = exflag ? stderr : stdout;
+
+ fprintf(diag, "cc: ");
+ fprintf(diag, s, x);
+ putc('\n', diag);
+ exfail++;
+ cflag++;
+ eflag++;
+}
+
+getsuf(as)
+char as[];
+{
+ register int c;
+ register char *s;
+ register int t;
+
+ s = as;
+ c = 0;
+ while (t = *s++)
+ if (t=='/')
+ c = 0;
+ else
+ c++;
+ s -= 3;
+ if (c <= MAXNAMLEN && c > 2 && *s++ == '.')
+ return (*s);
+ return (0);
+}
+
+char *
+setsuf(as, ch)
+ char *as;
+{
+ register char *s, *s1;
+
+ s = s1 = savestr(as);
+ while (*s)
+ if (*s++ == '/')
+ s1 = s;
+ s[-1] = ch;
+ return (s1);
+}
+
+callsys(f, v)
+ char *f, **v;
+{
+ int t, status;
+
+ t = fork();
+ if (t == -1) {
+ printf("No more processes\n");
+ return (100);
+ }
+ if (t == 0) {
+ execv(f, v);
+ printf("Can't find %s\n", f);
+ fflush(stdout);
+ _exit(100);
+ }
+ while (t != wait(&status))
+ ;
+ if ((t=(status&0377)) != 0 && t!=14) {
+ if (t!=2) {
+ printf("Fatal error in %s\n", f);
+ eflag = 8;
+ }
+ dexit();
+ }
+ return ((status>>8) & 0377);
+}
+
+nodup(l, os)
+ char **l, *os;
+{
+ register char *t, *s;
+ register int c;
+
+ s = os;
+ if (getsuf(s) != 'o')
+ return (1);
+ while (t = *l++) {
+ while (c = *s++)
+ if (c != *t++)
+ break;
+ if (*t==0 && c==0)
+ return (0);
+ s = os;
+ }
+ return (1);
+}
+
+#define NSAVETAB 1024
+char *savetab;
+int saveleft;
+
+char *
+savestr(cp)
+ register char *cp;
+{
+ register int len;
+
+ len = strlen(cp) + 1;
+ if (len > saveleft) {
+ saveleft = NSAVETAB;
+ if (len > saveleft)
+ saveleft = len;
+ savetab = (char *)malloc(saveleft);
+ if (savetab == 0) {
+ fprintf(stderr, "ran out of memory (savestr)\n");
+ exit(1);
+ }
+ }
+ strncpy(savetab, cp, len);
+ cp = savetab;
+ savetab += len;
+ saveleft -= len;
+ return (cp);
+}
+
+char *
+strspl(left, right)
+ char *left, *right;
+{
+ char buf[BUFSIZ];
+
+ strcpy(buf, left);
+ strcat(buf, right);
+ return (savestr(buf));
+}
diff --git a/general/large4.sh b/general/large4.sh
new file mode 100644
index 0000000..7c3117f
--- /dev/null
+++ b/general/large4.sh
@@ -0,0 +1,13 @@
+:
+#! /bin/sh
+#
+# @(#)large4.sh 1.2 97/01/03 Connectathon Testsuite
+# 1.4 Lachman ONC Test Suite source
+#
+
+$CC $CFLAGS -o large large.c&
+$CC $CFLAGS -o large1 large1.c&
+$CC $CFLAGS -o large2 large2.c&
+$CC $CFLAGS -o large3 large3.c&
+wait
+rm large large1 large2 large3
diff --git a/general/makefile.tst b/general/makefile.tst
new file mode 100644
index 0000000..78deca9
--- /dev/null
+++ b/general/makefile.tst
@@ -0,0 +1,41 @@
+#
+# @(#)makefile.tst 1.1 97/01/03 Connectathon Testsuite
+#
+HDRS = /usr/include/stdio.h /usr/include/ctype.h \
+ /usr/include/time.h /usr/include/pwd.h \
+ /usr/include/signal.h /usr/include/setjmp.h
+XOBJ = dummy1.o dummy2.o dummy3.o dummy4.o dummy5.o \
+ dummy6.o dummy7.o dummy8.o dummy9.o dummy10.o \
+ dummy11.o dummy12.o dummy13.o dummy14.o dummy15.o \
+ dummy16.o dummy17.o dummy18.o dummy19.o dummy20.o \
+ dummy21.o dummy22.o dummy23.o dummy24.o dummy25.o
+.c.o: ; echo $@ > /dev/null
+
+x: $(XOBJ)
+ echo done > /dev/null
+
+dummy1.o: dummy1.c $(HDRS)
+dummy2.o: dummy2.c $(HDRS)
+dummy3.o: dummy3.c $(HDRS)
+dummy4.o: dummy4.c $(HDRS)
+dummy5.o: dummy5.c $(HDRS)
+dummy6.o: dummy6.c $(HDRS)
+dummy7.o: dummy7.c $(HDRS)
+dummy8.o: dummy8.c $(HDRS)
+dummy9.o: dummy9.c $(HDRS)
+dummy10.o: dummy10.c $(HDRS)
+dummy11.o: dummy11.c $(HDRS)
+dummy12.o: dummy12.c $(HDRS)
+dummy13.o: dummy13.c $(HDRS)
+dummy14.o: dummy14.c $(HDRS)
+dummy15.o: dummy15.c $(HDRS)
+dummy16.o: dummy16.c $(HDRS)
+dummy17.o: dummy17.c $(HDRS)
+dummy18.o: dummy18.c $(HDRS)
+dummy19.o: dummy19.c $(HDRS)
+dummy20.o: dummy20.c $(HDRS)
+dummy21.o: dummy21.c $(HDRS)
+dummy22.o: dummy22.c $(HDRS)
+dummy23.o: dummy23.c $(HDRS)
+dummy24.o: dummy24.c $(HDRS)
+dummy25.o: dummy25.c $(HDRS)
diff --git a/general/mkdummy b/general/mkdummy
new file mode 100644
index 0000000..78b3fc9
--- /dev/null
+++ b/general/mkdummy
@@ -0,0 +1,16 @@
+:
+#! /bin/sh
+#
+# @(#)mkdummy 1.2 97/01/03 Connectathon Testsuite
+#
+
+bases=" 1 2 3 4 5 6 7 8 9 10
+ 11 12 13 14 15 16 17 18 19 20
+ 21 22 23 24 25"
+rm -rf dummy*
+for i in $bases; do
+ touch dummy$i.o
+done
+for i in $bases; do
+ touch dummy$i.c
+done
diff --git a/general/nroff.in b/general/nroff.in
new file mode 100644
index 0000000..522ac80
--- /dev/null
+++ b/general/nroff.in
@@ -0,0 +1,179 @@
+.\" @(#)nroff.in 1.1 97/01/03 Connectathon Testsuite
+.DA
+.ds RF Company Confidential
+.ds LF Sun Microsystems
+.nr PS 12
+.nr VS 14
+.ps 12
+.vs 14
+.TL
+Fortran Benchmarks from General Electric
+.AU
+Evan Adams
+.LP
+Walter Sawka from the New York office sent a memo
+on June 21, 1983 detailing fortran performance.
+It included the source and results to three fortran
+benchmarks.
+.LP
+I ran the benchmarks on the following configurations:
+.TS
+center;
+l l l l.
+CPU Unix Fortran Memory
+.sp 4p
+Sun 1 Version 7 SVS 1 Meg
+Sun 1.5 Sun 0.4 Berkeley 2 Meg
+Sun 2 Sun 0.3 Berkeley 2 Meg
+Sun 2 Sun 0.3 Berkeley/Optimizer 2 Meg
+VAX 750 4.1cBSD Berkeley/Optimizer 4 Meg
+.TE
+.LP
+The benchmarks are:
+.IP 1)
+Matrix inversion of double precision values.
+.IP 2)
+A bubble sort of integers.
+.IP 3)
+A prime number generator.
+.LP
+.TS
+center;
+ c|c|c s|c s|
+ c|c|c s|c s|
+ c|c|c s|c s|
+ c|c|c s|c s|
+|l|n|n|n|n|n|.
+ _ _ _ _ _
+.sp 4p
+ Matrix Inversion Bubble Sort Prime Numbers
+.sp 4p
+ _ _ _ _ _
+.sp 4p
+ Dimension Number of Elements Highest N
+.sp 4p
+_ _ _ _ _ _
+.sp 4p
+Configuration 50 1000 2000 10000 50000
+.sp 4p
+=
+.sp 3p
+Version 7 91.7 23.1 88.9 24.3 180.1
+.sp 3p
+_
+.sp 3p
+Sun 1.5 74.9 29.0 112.7 49.0/28.5\(dg 290.3/188.6\(dg
+.sp 3p
+_
+.sp 3p
+Sun 2 60.5 22.8 88.0 39.1/22.7\(dg 231.4/150.6\(dg
+.sp 3p
+_
+.sp 3p
+Sun 2 (OPT) 55.9 15.8 59.9 38.3/22.7\(dg 227.6/150.6\(dg
+.sp 3p
+_
+.sp 3p
+Apollo 68000 61 30 122 19 164
+.sp 3p
+_
+.sp 3p
+Apollo DN300 51 25 94 16 130
+.sp 3p
+_
+.sp 3p
+Apollo (PE) 28 22 88 14 127
+.sp 3p
+_
+.sp 3p
+VAX (OPT) 19.3 12.1 46.4 14.5 87.2
+.sp 3p
+_
+.TE
+.LP
+\(dg using a single precision square root function
+.LP
+All times are in seconds.
+The times for the Apollo machines are from Walt's memo.
+His memo claims the times are elapsed (wall clock) time.
+This seems silly since most of the programs prompt for some information.
+The times for V7 and 4.2 are user time as given by the /bin/time command.
+The Apollo is a 68000 at 10Mhz,
+the Apollo DN300 is a 68010 at 10MHz, and
+the Apollo (PE) is a 68000 at 10Mhz with the performance enhancement option.
+.LP
+The Apollo numbers for the prime number generator
+with a highest N of 10000 look suspect.
+I find it difficult to believe that the Apollo (PE)
+beat the VAX in this benchmark while it was
+consistently beaten badly in the other benchmarks.
+.LP
+Berkeley fortran fared poorly in the prime number generator.
+This program makes many calls to the square root function.
+The square root function is part of the math library and is written
+in C.
+To take the square root of a single precision number
+it is converted to doubled precision and passed to sqrt().
+A double precision square root is calculated and returned where
+it is promptly converted to single precision.
+Approximately 75% of the execution time was spent in sqrt() and its
+descendants.
+.LP
+I wrote a single precision sqrt() routine in
+fortran and the prime number generator ran 43% faster on
+the Sun 2.
+.LP
+The fortran optimizer mainly improves array references within
+inner loops.
+The bubble sort improves by 30%; the prime number generator
+does not change at all.
+.LP
+It should also be noted that the system times on the 4.2 systems were
+2 to 7 times greater than the system times for the version 7 system.
+On version 7, the system time averaged 2.4% of the user time.
+On the Sun 2, the system time averaged 8.2% of the user time.
+.SH
+Conclusions
+.LP
+The same object code ran on the Sun 1.5 and the Sun 2.
+The Sun 2 execution times averaged 20.6% less than the Sun 1.5.
+There was speculation that the Sun 2 performance would improve
+by as much as 30% as compared to Sun 1.5.
+Some people may be disappointed by these numbers.
+.LP
+The Sun 2 with the fortran optimizer beats the best Apollo
+time by 28% for the sorting program.
+I believe that the Apollo performance enhancement option includes
+hardware floating point.
+Still, the Sun 2 is 9% slower than the Apollo DN300 on the matrix
+inversion program and a factor of two slower on the prime number
+generator.
+Taking into account the double precision/single precision problem
+for the prime number generator, the Sun 2 is 13% slower
+than the Apollo DN300.
+.LP
+The fortran optimizer is still in a developement stage and
+is not very reliable yet.
+It is not ready for release!
+.SH
+Future
+.LP
+The benchmark numbers give us a reflection of where
+we are at today.
+The ultimate goal is
+.IP 1)
+A Sun 2 CPU,
+.IP 2)
+Unix 4.2BSD (not 4.1c),
+.IP 3)
+the SKY floating point board,
+.IP 4)
+the fortran optimizer,
+.IP 5)
+a single precision and double precision math library, and
+.IP 6)
+an improved fortran I/O library.
+.LP
+Development is in progress for everything but the libraries.
+It is conjecture, but with each of these components in place
+we should beat Apollo consistently.
diff --git a/general/rmdummy b/general/rmdummy
new file mode 100644
index 0000000..bd93e68
--- /dev/null
+++ b/general/rmdummy
@@ -0,0 +1,7 @@
+:
+#! /bin/sh
+#
+# @(#)rmdummy 1.2 97/01/03 Connectathon Testsuite
+#
+
+rm -rf dummy*
diff --git a/general/runtests b/general/runtests
new file mode 100755
index 0000000..2b7ae0b
--- /dev/null
+++ b/general/runtests
@@ -0,0 +1,37 @@
+:
+#!/bin/sh
+#
+# @(#)runtests 1.4 2001/12/07 Connectathon Testsuite
+#
+
+# If the initialization file is present, assume we are in the distribution
+# tree and that we must copy the tests to the test directory. Otherwise,
+# we are in the test directory and can just run the tests
+
+InitFile="../tests.init"
+
+if test -f $InitFile
+then
+ . $InitFile
+ export PATH CC CFLAGS LIBS
+ echo "GENERAL TESTS: directory $NFSTESTDIR"
+ mkdir $NFSTESTDIR
+ if test ! -d $NFSTESTDIR
+ then
+ echo "Can't make directory $NFSTESTDIR"
+ exit 1
+ fi
+ make copy DESTDIR=$NFSTESTDIR
+ if test $? -ne 0
+ then
+ exit 1
+ fi
+ cd $NFSTESTDIR
+else
+ NFSTESTDIR=`pwd`
+ export PATH
+ echo "GENERAL TESTS: directory $NFSTESTDIR"
+ make
+fi
+
+exec sh runtests.wrk FROM_RUNTESTS
diff --git a/general/runtests.wrk b/general/runtests.wrk
new file mode 100644
index 0000000..24df09a
--- /dev/null
+++ b/general/runtests.wrk
@@ -0,0 +1,145 @@
+#!/bin/sh
+#
+# @(#)runtests.wrk 1.9 2003/12/30 Connectathon Testsuite
+# 1.4 Lachman ONC Test Suite source
+#
+# This script is intended to be invoked from 'runtests'
+# Don't run it manually
+
+case x$1 in
+ xFROM_RUNTESTS)
+ ;;
+ *)
+ echo "$0 must be run from 'runtests' - Don't run manually"
+ exit 1
+ ;;
+esac
+
+errexit='cat $FILE; exit 1'
+
+TIME=time
+# if the default time command doesn't return the right format,
+# you may have to use the following lines
+case `uname` in
+[lL]inux*)
+ TIME=/usr/bin/time
+ ;;
+*)
+ TIME=/bin/time
+ ;;
+esac
+if [ ! -f $TIME ]
+then
+ TIME=/usr/bin/time
+ if [ ! -f $TIME ]
+ then
+ echo "Where is the time command?"
+ exit 1
+ fi
+fi
+
+chmod 777 large4.sh mkdummy rmdummy
+umask 0
+
+# Newer compilers tend to produce warning messages for the source code
+# that is used for the general tests. This confuses "stat". There
+# are a couple ways we could fix this (e.g., make "stat" ignore
+# compiler warnings). But since the general tests as a whole probably
+# should be replaced by something that is less Unix-centric, we'll
+# just hack around the problem by supressing compiler warnings.
+CFLAGS="$CFLAGS -w"
+export CFLAGS
+
+echo ""
+echo "Small Compile"
+rm -f smcomp.time
+FILE=smcomp.time
+set -x
+$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
+ls smcomp.time
+set -e
+./stat smcomp.time
+set +e
+
+echo ""
+echo "Tbl"
+rm -f tbl.time
+$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
+$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
+$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
+$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
+$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
+set -e
+# Filter excessive noise from GNU tbl. Should be harmless for other
+# versions of tbl.
+egrep -v '^tbl:.*$' <tbl.time >tbl.new
+mv -f tbl.new tbl.time
+./stat tbl.time
+set +e
+
+echo ""
+echo "Nroff"
+rm -f nroff.time
+$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
+$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
+$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
+$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
+$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
+rm nroff.out nroff.tbl
+set -e
+./stat nroff.time
+set +e
+
+echo ""
+echo "Large Compile"
+rm -f lrgcomp.time
+FILE=lrgcomp.time
+$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
+$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
+rm large
+set -e
+./stat lrgcomp.time
+set +e
+
+echo ""
+echo "Four simultaneous large compiles"
+rm -f 4lrg.time
+FILE=4lrg.time
+$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
+$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
+$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
+$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
+$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
+set -e
+./stat 4lrg.time
+set +e
+
+echo ""
+echo "Makefile"
+mkdummy
+rm -f makefile.time
+FILE=makefile.time
+$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
+$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
+$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
+$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
+$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
+rmdummy
+# Remove warnings (e.g., due to clock skew) that might confuse "stat".
+grep -iv warning: makefile.time | grep -v 'make: ' > makefile.time2
+mv makefile.time2 makefile.time
+set -e
+./stat makefile.time
+set +e
+
+echo ""
+echo "General tests complete"
+
+exit 0
diff --git a/general/stat.c b/general/stat.c
new file mode 100644
index 0000000..c4e4fc0
--- /dev/null
+++ b/general/stat.c
@@ -0,0 +1,196 @@
+/* @(#)stat.c 1.1 97/01/03 Connectathon Testsuite */
+/* 1.3 Lachman ONC Test Suite source */
+
+#include <stdio.h>
+#include <math.h>
+
+/*
+ * crunch through time stat files. This program will handle two
+ * formats: BSD
+ * 1.7 real 0.0 user 0.4 sys
+ * and ATT
+ * real 1.4
+ * user 0.0
+ * sys 0.2
+ *
+ * ATT format may break out minutes -- 2:03.2
+ */
+#define MAXINDEX 100
+double real[MAXINDEX];
+double user[MAXINDEX];
+double sys[MAXINDEX];
+char *Prog, *File;
+
+int getattfmt();
+void prtstat();
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ FILE *fp;
+ int i, n;
+ char c, *fmt;
+ int attfmt = 0; /* set if using att time format */
+
+ Prog = argv[0];
+ if (argc == 1) {
+ fprintf(stderr, "Usage: %s datafile\n", Prog);
+ exit(1);
+ }
+ File = argv[1];
+ fp = fopen(File, "r");
+ if (fp == NULL) {
+ fprintf(stderr, "%s: unable to open %s\n",
+ Prog, File);
+ exit(1);
+ }
+ if ((i = fgetc(fp)) == EOF) {
+ fprintf(stderr, "%s: %s is empty\n",
+ Prog, File);
+ exit(1);
+ }
+ c = i & 0x7f;
+ if (c == '\n' || c == '\r' || c == 'r')
+ attfmt = 1;
+ else
+ fmt = "%lf %*s %lf %*s %lf %*s"; /* BSD fmt */
+ if (ungetc(c, fp) == EOF) {
+ fprintf(stderr, "%s: can't push char back to %s\n",
+ Prog, File);
+ exit(1);
+ }
+
+ if (attfmt) {
+ for (n = 0; getattfmt(fp, n, 1); n++) {
+ (void) getattfmt(fp, n, 2);
+ (void) getattfmt(fp, n, 3);
+ }
+ } else {
+ n = 0;
+ while (fscanf(fp, fmt, &real[n], &user[n], &sys[n]) == 3)
+ n++;
+ }
+ if (n == 0) {
+ fprintf(stderr, "%s: no data in %s\n",
+ Prog, File);
+#ifdef SVR3
+ exit(0);
+#else
+ exit(1);
+#endif
+ }
+ prtstat(real, n);
+ printf(" real");
+ prtstat(user, n);
+ printf(" user");
+ prtstat(sys, n);
+ printf(" sys\n");
+
+ exit(0);
+}
+
+/*
+ * which: 1: real, 2:user, 3:sys
+ *
+ * returns 0 if no more data, else 1
+ */
+int
+getattfmt(fp, n, which)
+ FILE *fp;
+ int n, which;
+{
+ char buf[BUFSIZ];
+ char *p;
+ char *fmt;
+ double *dp;
+ int min, err = 0;
+
+ if (n < 0 || n >= MAXINDEX) {
+ fprintf(stderr, "%s: illegal index=%d in getattfmt\n",
+ Prog, n);
+ exit(1);
+ }
+
+ switch (which) {
+ case 1: /* real */
+ dp = &real[n];
+ break;
+ case 2: /* user */
+ dp = &user[n];
+ break;
+ case 3: /* sys */
+ dp = &sys[n];
+ break;
+ default:
+ fprintf(stderr, "%s: illegal which=%d in getattfmt\n",
+ Prog, which);
+ exit(1);
+ }
+
+ while (fgets(buf, BUFSIZ, fp)) {
+ /* null out newline */
+ for (p = buf; *p != '\0' && *p != '\n'; p++)
+ ;
+ if (*p == '\n')
+ *p = '\0';
+
+ /* look for blank line and skip it */
+ for (p = buf; *p != '\0' && (*p == ' ' || *p == '\t'); p++)
+ ;
+ if (*p == '\0')
+ continue;
+
+ min = 0;
+ for (p = buf; *p != '\0' && *p != ':'; p++)
+ ;
+ if (*p == ':') {
+ fmt = "%*s %d:%lf";
+ if (sscanf(buf, fmt, &min, dp) != 2)
+ err = 1;
+ } else {
+ fmt = "%*s %lf";
+ if (sscanf(buf, fmt, dp) != 1)
+ err = 1;
+ }
+ if (err) {
+ fprintf(stderr, "%s: bad data format in %s (%s)\n",
+ Prog, File, buf);
+ exit(1);
+ }
+ if (min > 0)
+ *dp += (double)(min * 60);
+ return (1);
+ }
+
+ /* EOF */
+ if (which == 1)
+ return (0);
+
+ fprintf(stderr, "%s: premature EOF in %s\n", Prog, File);
+ exit(1);
+}
+
+void
+prtstat(array, n)
+ double array[];
+ int n;
+{
+ double avg, sd;
+ int i;
+
+ avg = 0;
+ for (i = 0; i < n; i++)
+ avg += array[i];
+ avg = avg / (float) n;
+
+ sd = 0;
+ for (i = 0; i < n; i++)
+ sd += (array[i] - avg)*(array[i] - avg);
+ if (n > 1) {
+ sd = sd / (float) (n - 1);
+ sd = sqrt(sd);
+ } else
+ sd = 0.0;
+ printf("\t%.1f (%.1f)", avg, sd);
+}
diff --git a/getopt.c b/getopt.c
new file mode 100644
index 0000000..da64713
--- /dev/null
+++ b/getopt.c
@@ -0,0 +1,142 @@
+/*
+ * @(#)getopt.c 1.5 2003/12/29 Connectathon testsuite
+ * 1.1 Lachman ONC Test Suite source
+ */
+
+/*
+ * Here's something you've all been waiting for: the AT&T public domain
+ * source for getopt(3). It is the code which was given out at the 1985
+ * UNIFORUM conference in Dallas. I obtained it by electronic mail
+ * directly from AT&T. The people there assure me that it is indeed
+ * in the public domain.
+ *
+ * There is no manual page. That is because the one they gave out at
+ * UNIFORUM was slightly different from the current System V Release 2
+ * manual page. The difference apparently involved a note about the
+ * famous rules 5 and 6, recommending using white space between an option
+ * and its first argument, and not grouping options that have arguments.
+ * Getopt itself is currently lenient about both of these things White
+ * space is allowed, but not mandatory, and the last option in a group can
+ * have an argument. That particular version of the man page evidently
+ * has no official existence, and my source at AT&T did not send a copy.
+ * The current SVR2 man page reflects the actual behavor of this getopt.
+ * However, I am not about to post a copy of anything licensed by AT&T.
+ */
+
+
+/*LINTLIBRARY*/
+#define NULL 0
+#define EOF (-1)
+#define ERR(s, c) if(opterr){\
+ extern int write();\
+ char errbuf[2];\
+ errbuf[0] = c; errbuf[1] = '\n';\
+ (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
+ (void) write(2, s, (unsigned)strlen(s));\
+ (void) write(2, errbuf, 2);}
+
+#include <string.h>
+
+int opterr = 1;
+int optind = 1;
+int optopt;
+char *optarg;
+
+int
+nfs_getopt(argc, argv, opts)
+int argc;
+char **argv, *opts;
+{
+ static int sp = 1;
+ register int c;
+ register char *cp;
+
+ if(sp == 1)
+ if(optind >= argc ||
+ argv[optind][0] != '-' || argv[optind][1] == '\0')
+ return(EOF);
+ else if(strcmp(argv[optind], "--") == 0) {
+ optind++;
+ return(EOF);
+ }
+ optopt = c = argv[optind][sp];
+#if defined(SVR3) || defined(SVR4) || defined(__STDC__)
+ if(c == ':' || (cp=strchr(opts, c)) == NULL) {
+#else
+ if(c == ':' || (cp=index(opts, c)) == NULL) {
+#endif
+ ERR(": illegal option -- ", c);
+ if(argv[optind][++sp] == '\0') {
+ optind++;
+ sp = 1;
+ }
+ return('?');
+ }
+ if(*++cp == ':') {
+ if(argv[optind][sp+1] != '\0')
+ optarg = &argv[optind++][sp+1];
+ else if(++optind >= argc) {
+ ERR(": option requires an argument -- ", c);
+ sp = 1;
+ return('?');
+ } else
+ optarg = argv[optind++];
+ sp = 1;
+ } else {
+ if(argv[optind][++sp] == '\0') {
+ sp = 1;
+ optind++;
+ }
+ optarg = NULL;
+ }
+ return(c);
+}
+
+#include <stdio.h>
+
+main(ac, av)
+char **av;
+{
+ register int i;
+ int first = 1;
+ char buf[BUFSIZ];
+ char line[BUFSIZ];
+ extern char *optarg;
+ extern int optind;
+
+ if (ac == 1) {
+ fprintf(stderr, "usage: getopt legal-args $*\n");
+ exit(2);
+ }
+
+ line[0] = '\0';
+ while ((i = nfs_getopt(ac - 1, &av[1], av[1])) != EOF) {
+ if (i == '?')
+ exit(2);
+
+ if (first) {
+ first = 0;
+ sprintf(buf, "-%c", i & 0xff);
+ }
+ else
+ sprintf(buf, " -%c", i & 0xff);
+ strcat(line, buf);
+ if (optarg) {
+ sprintf(buf, " %s", optarg);
+ strcat(line, buf);
+ }
+ }
+
+ if (first)
+ strcat(line, "--");
+ else
+ strcat(line, " --");
+
+ optind++;
+ for (; optind < ac; optind++) {
+ sprintf(buf, " %s", av[optind]);
+ strcat(line, buf);
+ }
+ printf("%s\n", line);
+ exit(0);
+}
diff --git a/lock/Makefile b/lock/Makefile
new file mode 100644
index 0000000..6be1cde
--- /dev/null
+++ b/lock/Makefile
@@ -0,0 +1,49 @@
+#
+# @(#)Makefile 1.9 2003/12/29 Connectathon Testsuite
+#
+# to make tests, use 'make'
+# to copy tests to another directory, use 'make copy DESTDIR=dir'
+# to copy source to another directory, use 'make dist DESTDIR=dir'
+
+DESTDIR = /no/such/path
+
+include ../tests.init
+
+LIBS = -lm
+
+all:
+ @make $(LOCKTESTS)
+ if test ! -x runtests; then chmod a+x runtests; fi
+
+# Native file offsets (32- or 64-bit), pre-Large File Summit semantics.
+tlock: tlock.c
+ $(CC) $(CFLAGS) -o tlock tlock.c $(LIBS)
+
+# Large File Summit semantics for 32- or 64-bit files.
+tlocklfs: tlock.c
+ $(CC) $(CFLAGS) -DLF_SUMMIT -o tlocklfs tlock.c $(LIBS)
+
+# 64-bit file offsets on 32-bit OS. Assumes Large File Summit
+# semantics.
+tlock64: tlock.c
+ $(CC) $(CFLAGS) -DLF_SUMMIT -DLARGE_LOCKS -o tlock64 tlock.c $(LIBS)
+
+clean:
+ rm -f *.o tlock tlocklfs tlock64
+
+copy: all
+ cp -f runtests $(LOCKTESTS) $(DESTDIR)
+
+dist:
+ cp -f runtests Makefile *.c $(DESTDIR)
+
+lint: tlock.c
+ lint $(CFLAGS) tlock.c $(LIBS)
+
+lint32lfs: tlock.c
+ lint $(CFLAGS) -DLF_SUMMIT tlock.c $(LIBS)
+
+lint64: tlock.c
+ lint $(CFLAGS) -DLF_SUMMIT -DLARGE_LOCKS tlock.c $(LIBS)
+
+lintall: lint lint32lfs lint64
diff --git a/lock/runtests b/lock/runtests
new file mode 100755
index 0000000..a25f101
--- /dev/null
+++ b/lock/runtests
@@ -0,0 +1,67 @@
+:
+#!/bin/sh
+#
+# @(#)runtests 1.4 99/07/16 Connectathon testsuite
+#
+
+InitFile="../tests.init"
+
+# Save mount options because InitFile clobbers it (XXX).
+mntopts="$MNTOPTIONS"
+
+. $InitFile
+
+if test $# -ge 1
+then
+ TESTARG=$1
+fi
+
+set -e
+umask 0
+
+echo "Starting LOCKING tests: test directory $NFSTESTDIR (arg: $TESTARG)"
+
+if test ! -d $NFSTESTDIR
+then
+ mkdir $NFSTESTDIR
+fi
+if test ! -d $NFSTESTDIR
+then
+ echo "Can't make directory $NFSTESTDIR"
+ exit 1
+fi
+
+case $TESTARG in
+ -f) TESTARGS="" ;;
+ -t) TESTARGS="-r" ;;
+esac
+
+if echo "$mntopts" | grep vers=2 > /dev/null
+then
+ TESTARGS="-v 2 $TESTARGS"
+fi
+
+for i in $LOCKTESTS
+do
+ echo ""
+ case $i in
+ tlock) echo 'Testing native pre-LFS locking';;
+ tlocklfs) echo 'Testing native post-LFS locking';;
+ tlock64)
+ if echo "$mntopts" | grep vers=2 > /dev/null
+ then
+ echo "64-bit locking not supported with NFS v2"
+ echo " "
+ continue
+ else
+ echo 'Testing non-native 64 bit LFS locking'
+ fi
+ ;;
+ esac
+ echo ""
+ $i $TESTARGS $NFSTESTDIR
+done
+
+echo "Congratulations, you passed the locking tests!"
+
+exit 0
diff --git a/lock/tlock.c b/lock/tlock.c
new file mode 100644
index 0000000..8a7d0cc
--- /dev/null
+++ b/lock/tlock.c
@@ -0,0 +1,1700 @@
+/* @(#)tlock.c 1.21 2003/12/30 Connectathon Testsuite */
+/*
+ * System V NFS
+ *
+ * Copyright 1986, 1987, 1988, 1989 Lachman Associates, Incorporated (LAI)
+ *
+ * All Rights Reserved.
+ *
+ * The copyright above and this notice must be preserved in all
+ * copies of this source code. The copyright above does not
+ * evidence any actual or intended publication of this source
+ * code.
+ *
+ * This is unpublished proprietary trade secret source code of
+ * Lachman Associates. This source code may not be copied,
+ * disclosed, distributed, demonstrated or licensed except as
+ * expressly authorized by Lachman Associates.
+ */
+
+/*
+ * #ifndef lint
+ * static char SysVr3NFSID[] = "@(#)tlock.c 4.11 System V NFS source";
+ * #endif
+ */
+
+/*
+ * Test program for record locking. If USE_LOCKF is defined, lockf is used
+ * (System V, Release 3). Otherwise, fcntl is used (Posix).
+ */
+
+/*
+ * Large file support, added June 1996
+ *
+ * These tests exercise the large file locking capabilities defined
+ * by the large file summit proposal as defined in the final draft:
+ * http://www.sas.com:80/standards/large.file/x_open.20Mar96.html
+ *
+ * The tests done may be modified by the following flags:
+ * LF_SUMMIT: accept EOVERFLOW in place of EINVAL where
+ * large file summit spec calls for that, rather
+ * than warning about it.
+ * LARGE_LOCKS: use 64-bit API to test locking in [0-2^^63]
+ * range rather than the [0-2^^31] range. This flag
+ * should not be used if the OS supports a native
+ * 64-bit API (e.g., Alpha).
+ */
+
+#if defined(LARGE_LOCKS)
+#undef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#else
+#if !defined(_FILE_OFFSET_BITS) && !defined(__alpha) && !defined(__sparcv9)
+#define _FILE_OFFSET_BITS 32
+#endif
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#ifdef STDARG
+#include <stdarg.h>
+#endif
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <sys/times.h>
+#ifdef MMAP
+#include <sys/mman.h>
+#endif
+#include <inttypes.h>
+
+#if defined(LARGE_LOCKS) && !defined(_LFS64_LARGEFILE) && !defined(MACOSX)
+This machine cannot compile the 64 bit version of this test using the
+LARGE_LOCKS symbol.
+If your machine uses native 64-bit offsets, you should not define
+LARGE_LOCKS.
+#endif
+
+#ifndef HZ
+#define HZ 60 /* a common default */
+#endif
+
+static off_t maxeof;
+
+#define PARENT 0 /* Who am I? */
+#define CHILD 1
+
+#define PASS 0 /* Passed test. */
+#define EQUAL -1 /* Compared equal. */
+#define UNEQUAL -2 /* Compared unequal. */
+
+#define WARN 1 /* Warning, may be a problem. */
+#define FATAL 2 /* Fatal testing error. */
+
+#define END (0) /* A bit more readable. */
+
+#define COMMENT 1 /* write_testfile */
+#define NO_COMMENT 0
+
+#define DO_TEST(n) ((testnum == 0) || (testnum == (n)))
+#define DO_RATE(n) ((ratetest > 0) || (testnum == (n)))
+#define DO_MAND(n) ((mandtest > 0) || (testnum == (n)))
+
+#define DO_UNLINK 1
+#define JUST_CLOSE 0
+
+/*
+ * Size of read/write buffer for test14, in bytes. Should be reasonably
+ * large compared to the default file size (iorate_kb). Must be big
+ * enough to hold the test strings used in test7 and test9.
+ */
+#define IORATE_BUFSIZE 32768
+
+static int ratetest = 0;
+static int ratecount = 1000; /* test 8 */
+static int mandtest = 0;
+
+static int iorate_kb = 256; /* test 14 */
+static int iorate_count = 10; /* test 14 */
+
+static int wait_time = 3;
+
+static char arr[1]; /* dummy buffer for pipe */
+
+static int parentpipe[2];
+static int childpipe[2];
+static int pidpipe[2];
+
+static char testfile[256]; /* file for locking test */
+static char *filepath = ".";
+static int testfd;
+#ifdef MMAP
+static caddr_t mappedaddr; /* address file is mapped to (some tests) */
+static off_t mappedlen;
+#endif
+
+/*
+ * Protocol version. Assume v3 unless told otherwise. Version 2 doesn't
+ * support large files, which restricts some of the tests that can be run.
+ */
+static int proto_vers = 3;
+
+static int testnum; /* current test number */
+static int passnum; /* current pass number */
+static int passcnt; /* repeat pass count */
+static int cumpass; /* pass for all passes */
+static int cumwarn; /* warn for all passes */
+static int cumfail; /* fail for all passes */
+static int tstpass; /* pass for last pass */
+static int tstwarn; /* warn for last pass */
+static int tstfail; /* fail for last pass */
+
+static int parentpid, childpid;
+static int who;
+
+#ifdef O_SYNC
+#define OPENFLAGS (O_CREAT | O_RDWR | O_SYNC)
+#else
+#define OPENFLAGS (O_CREAT | O_RDWR)
+#endif
+#define OPENMODES (0666)
+#define MANDMODES (02666)
+
+/*
+ * Some tests try to provoke a failure by seeking to a bad value. The
+ * specific errno value depends on whether the Large File Summit API is
+ * being followed.
+ */
+#ifdef LF_SUMMIT
+static int oflow_err = EOVERFLOW;
+#else
+static int oflow_err = EINVAL;
+#endif
+
+/*
+ * If a lock request is denied because of a conflicting lock, System V
+ * defines the return value to be EAGAIN. BSD UNIX uses EACCES. Posix
+ * allows either. IRIX is generally SVR4-like, but in this case uses EACCES.
+ */
+#if defined(SVR4) && !defined(IRIX)
+static int denied_err = EAGAIN;
+#else
+static int denied_err = EACCES;
+#endif
+
+#ifdef BSD
+#define SIGCLD SIGCHLD
+#endif
+
+#ifndef ARGS_
+#ifdef __STDC__
+#define ARGS_(x) x
+#else
+#define ARGS_(x) ()
+#endif
+#endif
+
+static void close_testfile ARGS_((int));
+#ifdef STDARG
+static void comment(char *fmt, ...);
+#else
+static void comment();
+#endif
+
+static void
+initialize()
+{
+ maxeof = (off_t)1 << (sizeof (off_t) * 8 - 2);
+ maxeof += maxeof - 1;
+
+ /*
+ * NFS Version 2 only supports 32-bit offsets. This has a couple
+ * consequences. First, we have to throttle back maxeof to what
+ * the protocol supports. Second, the Large File Summit defines
+ * EOVERFLOW for locking in terms of what can be represented by
+ * off_t. This means that an overflow error with v2 on a 64-bit
+ * system will return EINVAL, not EOVERFLOW.
+ */
+ if (proto_vers == 2) {
+ off_t orig_maxeof = maxeof;
+
+ maxeof = 0x7fffffff;
+ if (maxeof < orig_maxeof)
+ oflow_err = EINVAL;
+ }
+
+ parentpid = getpid();
+ sprintf(&testfile[0], "%s/lockfile%d", filepath, parentpid);
+
+ printf("Creating parent/child synchronization pipes.\n");
+ pipe(parentpipe);
+ pipe(childpipe);
+ pipe(pidpipe);
+
+ fflush(stdout);
+
+#ifdef MMAP
+#ifdef MACOSX
+ mappedlen = getpagesize();
+#else
+ mappedlen = sysconf(_SC_PAGESIZE);
+#endif
+#endif
+}
+
+static void
+testreport(nok)
+ int nok;
+{
+ FILE *outf;
+ char *sp;
+
+ cumpass += tstpass;
+ cumwarn += tstwarn;
+ cumfail += tstfail;
+ outf = (nok ? stderr : stdout);
+ sp = ((who == PARENT) ? "PARENT" : " CHILD");
+ fprintf(outf, "\n** %s pass %d results: ", sp, passnum);
+ fprintf(outf, "%d/%d pass, %d/%d warn, %d/%d fail (pass/total).\n",
+ tstpass, cumpass, tstwarn, cumwarn, tstfail, cumfail);
+ tstpass = tstwarn = tstfail = 0;
+ fflush(outf);
+}
+
+static void
+testexit(nok)
+ int nok;
+{
+
+ close_testfile(DO_UNLINK);
+ if (nok) {
+ testreport(1);
+ }
+ if (who == PARENT) {
+ signal(SIGCLD, SIG_DFL);
+ if (nok) {
+ signal(SIGINT, SIG_IGN);
+ kill(childpid, SIGINT);
+ }
+ wait((int *)0);
+ } else {
+ if (nok) {
+ signal(SIGINT, SIG_IGN);
+ kill(parentpid, SIGINT);
+ }
+ }
+ exit(nok);
+ /* NOTREACHED */
+}
+
+/* ARGSUSED */
+static void
+parentsig(sig)
+ int sig;
+{
+
+ testexit(1);
+}
+
+/* ARGSUSED */
+static void
+childsig(sig)
+ int sig;
+{
+
+ testexit(1);
+}
+
+/* ARGSUSED */
+static void
+childdied(sig)
+ int sig;
+{
+
+ comment("Child died");
+}
+
+static void
+header(test, string)
+ int test;
+ char *string;
+{
+
+ printf("\nTest #%d - %s", test, string);
+ printf("\n");
+ fflush(stdout);
+}
+
+#ifdef STDARG
+
+static void
+comment(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ printf("\t%s", ((who == PARENT) ? "Parent: " : "Child: "));
+ vfprintf(stdout, fmt, ap);
+ va_end(ap);
+ printf("\n");
+ fflush(stdout);
+}
+
+#else /* STDARG */
+
+/* VARARGS1 */
+static void
+comment(fmt, arg1, arg2, arg3, arg4)
+ char *fmt;
+#ifdef OSF1
+ void *arg1, *arg2, *arg3, *arg4;
+#else
+ int arg1, arg2, arg3, arg4;
+#endif
+{
+
+ printf("\t%s", ((who == PARENT) ? "Parent: " : "Child: "));
+ printf(fmt, arg1, arg2, arg3, arg4);
+ printf("\n");
+ fflush(stdout);
+}
+#endif /* STDARG */
+
+static void
+childwait()
+{
+
+ if (read(parentpipe[0], arr, 1) != 1) {
+ perror("tlock: child pipe read");
+ testexit(1);
+ }
+}
+
+static void
+childfree(wait)
+ int wait;
+{
+
+ if (write(parentpipe[1], arr, 1) != 1) {
+ perror("tlock: childfree pipe write");
+ testexit(1);
+ }
+ if (wait)
+ sleep(wait);
+}
+
+static void
+parentwait()
+{
+
+ if (read(childpipe[0], arr, 1) != 1) {
+ perror("tlock: parentwait pipe read");
+ testexit(1);
+ }
+}
+
+static void
+parentfree(wait)
+ int wait;
+{
+
+ if (write(childpipe[1], arr, 1) != 1) {
+ perror("tlock: child pipe write");
+ testexit(1);
+ }
+ if (wait)
+ sleep(wait);
+}
+
+static char tmpstr[16];
+
+static char *
+terrstr(err)
+ int err;
+{
+
+ switch (err) {
+ case UNEQUAL:
+ return ("unequal");
+ case EQUAL:
+ return ("equal");
+ case PASS:
+ return ("success");
+ case EAGAIN:
+ return ("EAGAIN");
+ case EBADF:
+ return ("EBADF");
+ case EACCES:
+ return ("EACCES");
+ case EFAULT:
+ return ("EFAULT");
+ case EINVAL:
+ return ("EINVAL");
+#ifdef EOVERFLOW
+ case EOVERFLOW:
+ return ("EOVERFLOW");
+#endif
+ case EFBIG:
+ return ("EFBIG");
+ case EDEADLK:
+ return ("EDEADLK");
+#ifdef ECOMM
+ case ECOMM:
+ return ("ECOMM");
+#endif
+#ifdef ENOLINK
+ case ENOLINK:
+ return ("ENOLINK");
+#endif
+ default:
+ sprintf(tmpstr, "errno=%d", err);
+ return (tmpstr);
+ }
+}
+
+/*
+ * Return a string representing the range starting at offset, with length
+ * bytes.
+ */
+
+static char *
+fmtrange(offset, length)
+ off_t offset;
+ off_t length;
+{
+ static char buf[256];
+
+#ifdef LARGE_LOCKS /* non-native 64-bit */
+ if (length != 0)
+ sprintf(buf, "[%16llx,%16llx] ", offset, length);
+ else
+ sprintf(buf, "[%16llx, ENDING] ", offset);
+#else /* LARGE_LOCKS */
+ if (sizeof (offset) == 4) {
+ if (length != 0)
+ sprintf(buf, "[%8lx,%8lx] ", (int32_t)offset,
+ (int32_t)length);
+ else
+ sprintf(buf, "[%8lx, ENDING] ", (int32_t)offset);
+ } else {
+ if (length != 0)
+ sprintf(buf, "[%16llx,%16llx] ", offset, length);
+ else
+ sprintf(buf, "[%16llx, ENDING] ", offset);
+ }
+#endif /* LARGE_LOCKS */
+
+ return (buf);
+}
+
+static void
+report(num, sec, what, offset, length, pass, result, fail)
+ int num; /* test number */
+ int sec; /* test section */
+ char *what;
+ off_t offset;
+ off_t length;
+ int pass; /* expected result */
+ int result; /* actual result */
+ int fail; /* fail or warning */
+{
+
+ printf("\t%s", ((who == PARENT) ? "Parent: " : "Child: "));
+ printf("%d.%-2d - %s %s", num, sec, what,
+ fmtrange(offset, length));
+ if (pass == result) {
+ printf("PASSED.\n");
+ tstpass++;
+ }
+#ifdef EOVERFLOW
+ else if (pass == EOVERFLOW && result == EINVAL) {
+ printf("WARNING!\n");
+ comment("**** Expected %s, returned %s...",
+ terrstr(pass), terrstr(result));
+ comment("**** Okay if expecting pre-large file semantics.");
+ tstwarn++;
+ } else if (pass == EINVAL && result == EOVERFLOW) {
+ printf("WARNING!\n");
+ comment("**** Expected %s, returned %s...",
+ terrstr(pass), terrstr(result));
+ comment("**** Okay if expecting large file semantics.");
+ tstwarn++;
+ }
+#endif /* EOVERFLOW */
+ else if (pass == EAGAIN && result == EACCES) {
+ printf("WARNING!\n");
+ comment("**** Expected %s, returned %s...",
+ terrstr(pass), terrstr(result));
+ comment("**** Probably BSD semantics instead of SVID.");
+ tstwarn++;
+ } else if (pass == EACCES && result == EAGAIN) {
+ printf("WARNING!\n");
+ comment("**** Expected %s, returned %s...",
+ terrstr(pass), terrstr(result));
+ comment("**** Probably SVID semantics instead of BSD.");
+ tstwarn++;
+ } else if (fail == WARN) {
+ printf("WARNING!\n");
+ comment("**** Expected %s, returned %s...",
+ terrstr(pass), terrstr(result));
+ tstwarn++;
+ } else {
+ printf("FAILED!\n");
+ comment("**** Expected %s, returned %s...",
+ terrstr(pass), terrstr(result));
+ if (pass == PASS && result == EFBIG)
+ comment("**** Filesystem doesn't support large files.");
+ else
+ comment("**** Probably implementation error.");
+ tstfail++;
+ testexit(1);
+ }
+ fflush(stdout);
+}
+
+static char *
+tfunstr(fun)
+ int fun;
+{
+
+ switch (fun) {
+ case F_ULOCK:
+ return ("F_ULOCK");
+ case F_LOCK:
+ return ("F_LOCK ");
+ case F_TLOCK:
+ return ("F_TLOCK");
+ case F_TEST:
+ return ("F_TEST ");
+ default:
+ fprintf(stderr, "tlock: unknown lockf() F_<%d>.\n", fun);
+ testexit(1);
+ }
+ /* NOTREACHED */
+}
+
+static void
+open_testfile(flags, modes)
+ int flags;
+ int modes;
+{
+
+ testfd = open(testfile, flags, modes);
+ if (testfd < 0) {
+ perror("tlock: open");
+ testexit(1);
+ }
+}
+
+static void
+close_testfile(cleanup)
+ int cleanup;
+{
+
+ if (cleanup == JUST_CLOSE)
+ comment("Closed testfile.");
+ close(testfd);
+ if (cleanup == DO_UNLINK)
+ (void) unlink(testfile);
+}
+
+static void
+write_testfile(datap, offset, count, do_comment)
+ char *datap;
+ off_t offset;
+ int count;
+ int do_comment;
+{
+ int result;
+
+ (void) lseek(testfd, offset, 0);
+ result = write(testfd, datap, count);
+ if (result < 0) {
+ perror("tlock: testfile write");
+ testexit(1);
+ }
+ if (result != count) {
+ fprintf(stderr, "tlock: short write (got %d, expected %d)\n",
+ result, count);
+ testexit(1);
+ }
+
+ if (do_comment) {
+#ifdef LARGE_LOCKS
+ comment("Wrote '%.40s' to testfile [ %lld, %d ].",
+ datap, offset, count);
+#else
+ comment("Wrote '%.40s' to testfile [ %ld, %d ].",
+ datap, offset, count);
+#endif
+ }
+}
+
+/*
+ * Read count bytes from the given offset. If datap is non-null, make sure
+ * the bytes read are the same as what datap points to.
+ */
+
+static void
+read_testfile(test, sec, datap, offset, count, pass, fail)
+ int test;
+ int sec;
+ char *datap;
+ off_t offset;
+ unsigned int count;
+ int pass;
+ int fail;
+{
+ int result;
+ static char *array = NULL;
+
+ if (array == NULL)
+ array = malloc(IORATE_BUFSIZE);
+ if (array == NULL) {
+ perror("read_testfile: can't allocate buffer");
+ exit(1);
+ }
+
+ (void) lseek(testfd, offset, 0);
+ if (count > IORATE_BUFSIZE)
+ count = IORATE_BUFSIZE;
+ result = read(testfd, array, count);
+ if (result < 0) {
+ perror("tlock: testfile read");
+ testexit(1);
+ }
+ if (result != count) {
+ fprintf(stderr, "tlock: short read (got %d, expected %d)\n",
+ result, count);
+ testexit(1);
+ }
+
+ if (datap != NULL) {
+#ifdef LARGE_LOCKS
+ comment("Read '%.40s' from testfile [ %lld, %d ].",
+ datap, offset, count);
+#else
+ comment("Read '%.40s' from testfile [ %ld, %d ].",
+ datap, offset, count);
+#endif
+ array[count] = '\0';
+ if (strncmp(datap, array, count) != 0) {
+ comment("**** Test expected '%s', read '%s'.",
+ datap, array);
+ result = UNEQUAL;
+ } else {
+ result = EQUAL;
+ }
+ report(test, sec, "COMPARE", offset, (off_t)count, pass,
+ result, fail);
+ }
+}
+
+static void
+testdup2(fd1, fd2)
+ int fd1;
+ int fd2;
+{
+
+ if (dup2(fd1, fd2) < 0) {
+ perror("tlock: dup2");
+ testexit(1);
+ }
+}
+
+static void
+testtruncate()
+{
+
+ comment("Truncated testfile.");
+ if (ftruncate(testfd, (off_t)0) < 0) {
+ perror("tlock: ftruncate");
+ testexit(1);
+ }
+}
+
+#ifdef MMAP
+
+#ifndef MAP_FAILED
+#define MAP_FAILED (-1)
+#endif
+
+/*
+ * Try to mmap testfile. It's not necessarily a fatal error if the request
+ * fails. Returns 0 on success and sets mappedaddr to the mapped address.
+ * Returns an errno value on failure.
+ */
+static int
+testmmap()
+{
+ mappedaddr = mmap(0, mappedlen, PROT_READ | PROT_WRITE, MAP_SHARED,
+ testfd, (off_t)0);
+ if (mappedaddr == (caddr_t)MAP_FAILED)
+ return (errno);
+ return (0);
+}
+
+static void
+testmunmap()
+{
+ comment("unmap testfile.");
+ if (munmap(mappedaddr, mappedlen) < 0) {
+ perror("Can't unmap testfile.");
+ testexit(1);
+ }
+ mappedaddr = (caddr_t)0xdeadbeef;
+}
+#endif /* MMAP */
+
+#ifdef USE_LOCKF
+
+static void
+test(num, sec, func, offset, length, pass, fail)
+ int num; /* test number */
+ int sec; /* section number */
+ int func; /* lockf function to invoke */
+ off_t offset; /* starting offset of lock */
+ off_t length; /* length of lock */
+ int pass; /* expected return code */
+ int fail; /* error vs warning */
+{
+ int result = PASS;
+
+ /*
+ * Don't ignore lseek errors. If the lseek fails, we won't be
+ * testing what you'd think we are testing just looking at the
+ * test() calls.
+ */
+ if (lseek(testfd, offset, 0) < 0) {
+ result = errno;
+ }
+ if (result == 0) {
+ if ((result = lockf(testfd, func, length)) != 0) {
+ if (result != -1) {
+ fprintf(stderr, "tlock: lockf() returned %d.\n",
+ result);
+ testexit(1);
+ }
+ result = errno;
+ }
+ }
+ report(num, sec, tfunstr(func), offset, length, pass, result, fail);
+}
+
+#else /* USE_LOCKF */
+
+/*
+ * Map a lockf function to the corresponding fcntl locking function and
+ * command. Prints an error message and exits if the function if invalid.
+ */
+
+static void
+lockf2fcntl(func, typep, cmdp)
+ int func;
+ short *typep; /* OUT */
+ int *cmdp; /* OUT */
+{
+ switch (func) {
+ case F_ULOCK:
+ *typep = F_UNLCK;
+ *cmdp = F_SETLK;
+ break;
+ case F_LOCK:
+ *typep = F_WRLCK;
+ *cmdp = F_SETLKW;
+ break;
+ case F_TLOCK:
+ *typep = F_WRLCK;
+ *cmdp = F_SETLK;
+ break;
+ case F_TEST:
+ *typep = F_WRLCK;
+ *cmdp = F_GETLK;
+ break;
+ default:
+ fprintf(stderr, "invalid lockf function: %d\n", func);
+ testexit(1);
+ break;
+ }
+}
+
+static void
+test(num, sec, func, offset, length, pass, fail)
+ int num; /* test number */
+ int sec; /* section number */
+ int func; /* lockf function to invoke */
+ off_t offset; /* starting offset of lock */
+ off_t length; /* length of lock */
+ int pass; /* expected return code */
+ int fail; /* error vs warning */
+{
+ struct flock request;
+ int result = PASS;
+ int fcntlcmd;
+
+ lockf2fcntl(func, &request.l_type, &fcntlcmd);
+ request.l_whence = 0;
+ request.l_start = offset;
+ request.l_len = length;
+
+ if (fcntl(testfd, fcntlcmd, &request) < 0)
+ result = errno;
+ else if (func == F_TEST && request.l_type != F_UNLCK)
+ result = denied_err;
+ report(num, sec, tfunstr(func), offset, length, pass, result,
+ fail);
+}
+
+#endif /* USE_LOCKF */
+
+static void
+rate(cnt)
+ int cnt;
+{
+ int i;
+ long beg;
+ long end;
+ struct tms tms;
+ long delta;
+
+ beg = times(&tms);
+ for (i = 0; i < cnt; i++) {
+ if ((lockf(testfd, F_LOCK, 1) != 0) ||
+ (lockf(testfd, F_ULOCK, 1) != 0)) {
+ fprintf(stderr, "tlock: rate error=%d.\n", errno);
+ tstfail++;
+ break;
+ }
+ }
+ /* See makefile: Sun must use SysV times()! */
+ end = times(&tms);
+ delta = ((end - beg) * 1000) / HZ;
+ if (delta == 0) {
+ fprintf(stderr, "tlock: rate time=0.\n");
+ return;
+ }
+ comment("Performed %d lock/unlock cycles in %d msecs. [%d lpm].",
+ i, delta, (i * 120000) / delta);
+ fflush(stdout);
+}
+
+static void
+iorate(kb, count)
+ int kb;
+ int count;
+{
+ int i;
+ long beg;
+ long end;
+ struct tms tms;
+ long delta;
+ static char *buf = NULL;
+ long msec_sum = 0;
+ long msec_sqsum = 0;
+ double mean_time;
+ double stddev_time;
+
+ if (buf == NULL)
+ buf = malloc(IORATE_BUFSIZE);
+ if (buf == NULL) {
+ perror("iorate: can't allocate buffer");
+ exit(1);
+ }
+
+ for (i = 0; i < IORATE_BUFSIZE; i++) {
+ buf[i] = 'a' + (i % 26);
+ }
+
+ for (i = 0; i < count; i++) {
+ off_t xferred;
+
+ beg = times(&tms);
+ testtruncate();
+
+ for (xferred = 0;
+ xferred < kb * 1024;
+ xferred += IORATE_BUFSIZE) {
+ write_testfile(buf, xferred, IORATE_BUFSIZE,
+ NO_COMMENT);
+ }
+ for (xferred = 0;
+ xferred < kb * 1024;
+ xferred += IORATE_BUFSIZE) {
+ read_testfile(14, 0, (char *)NULL, xferred,
+ IORATE_BUFSIZE, 0, 0);
+ }
+
+ end = times(&tms);
+ delta = ((end - beg) * 1000) / HZ;
+ msec_sum += delta;
+ msec_sqsum += delta * delta;
+ }
+
+ mean_time = msec_sum / (1000.0 * count);
+ stddev_time = 1.0 * count * msec_sqsum - 1.0 * msec_sum * msec_sum;
+ stddev_time /= (count * (count - 1));
+ stddev_time = sqrt(stddev_time);
+
+#define TO_THRUPUT(t) (kb * 2.0 / (t))
+
+ comment("Wrote and read %d KB file %d times; [%.2lf +/- %.2lf KB/s].",
+ kb, count, TO_THRUPUT(mean_time), TO_THRUPUT(stddev_time));
+ fflush(stdout);
+}
+
+static void
+test1()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ header(1, "Test regions of an unlocked file.");
+ test(1, 1, F_TEST, (off_t)0, (off_t)1, PASS, FATAL);
+ test(1, 2, F_TEST, (off_t)0, (off_t)END, PASS, FATAL);
+ test(1, 3, F_TEST, (off_t)0, maxeof, PASS, FATAL);
+ test(1, 4, F_TEST, (off_t)1, (off_t)1, PASS, FATAL);
+ test(1, 5, F_TEST, (off_t)1, (off_t)END, PASS, FATAL);
+ test(1, 6, F_TEST, (off_t)1, maxeof, PASS, FATAL);
+ test(1, 7, F_TEST, maxeof, (off_t)1, PASS, FATAL);
+ test(1, 8, F_TEST, maxeof, (off_t)END, PASS, FATAL);
+ /*
+ * Some systems might not rigorously enforce Posix
+ * restrictions on the offset and length (signed positive
+ * integer, no overflow). So treat those failures as
+ * warnings, not fatal.
+ */
+ test(1, 9, F_TEST, maxeof, maxeof, oflow_err,
+ WARN);
+ close_testfile(DO_UNLINK);
+ childfree(0);
+ } else {
+ parentfree(0);
+ childwait();
+ }
+}
+
+static void
+test2()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(2, "Try to lock the whole file.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(2, 0, F_TLOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(2, 10, F_ULOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(2, 1, F_TEST, (off_t)0, (off_t)1, denied_err, FATAL);
+ test(2, 2, F_TEST, (off_t)0, (off_t)END, denied_err, FATAL);
+ test(2, 3, F_TEST, (off_t)0, maxeof, denied_err, FATAL);
+ test(2, 4, F_TEST, (off_t)1, (off_t)1, denied_err, FATAL);
+ test(2, 5, F_TEST, (off_t)1, (off_t)END, denied_err, FATAL);
+ test(2, 6, F_TEST, (off_t)1, maxeof, denied_err, FATAL);
+ test(2, 7, F_TEST, maxeof, (off_t)1, denied_err, FATAL);
+ test(2, 8, F_TEST, maxeof, (off_t)END, denied_err,
+ FATAL);
+ test(2, 9, F_TEST, maxeof, maxeof, oflow_err,
+ WARN);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test3()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(3, "Try to lock just the 1st byte.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(3, 0, F_TLOCK, (off_t)0, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(3, 5, F_ULOCK, (off_t)0, (off_t)1, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(3, 1, F_TEST, (off_t)0, (off_t)1, denied_err, FATAL);
+ test(3, 2, F_TEST, (off_t)0, (off_t)END, denied_err, FATAL);
+ test(3, 3, F_TEST, (off_t)1, (off_t)1, PASS, FATAL);
+ test(3, 4, F_TEST, (off_t)1, (off_t)END, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test4()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(4, "Try to lock the 2nd byte, test around it.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(4, 0, F_TLOCK, (off_t)1, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(4, 10, F_ULOCK, (off_t)1, (off_t)1, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(4, 1, F_TEST, (off_t)0, (off_t)1, PASS, FATAL);
+ test(4, 2, F_TEST, (off_t)0, (off_t)2, denied_err, FATAL);
+ test(4, 3, F_TEST, (off_t)0, (off_t)END, denied_err, FATAL);
+ test(4, 4, F_TEST, (off_t)1, (off_t)1, denied_err, FATAL);
+ test(4, 5, F_TEST, (off_t)1, (off_t)2, denied_err, FATAL);
+ test(4, 6, F_TEST, (off_t)1, (off_t)END, denied_err, FATAL);
+ test(4, 7, F_TEST, (off_t)2, (off_t)1, PASS, FATAL);
+ test(4, 8, F_TEST, (off_t)2, (off_t)2, PASS, FATAL);
+ test(4, 9, F_TEST, (off_t)2, (off_t)END, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test5()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(5, "Try to lock 1st and 2nd bytes, test around them.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(5, 0, F_TLOCK, (off_t)0, (off_t)1, PASS, FATAL);
+ test(5, 1, F_TLOCK, (off_t)2, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(5, 14, F_ULOCK, (off_t)0, (off_t)1, PASS, FATAL);
+ test(5, 15, F_ULOCK, (off_t)2, (off_t)1, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(5, 2, F_TEST, (off_t)0, (off_t)1, denied_err, FATAL);
+ test(5, 3, F_TEST, (off_t)0, (off_t)2, denied_err, FATAL);
+ test(5, 4, F_TEST, (off_t)0, (off_t)END, denied_err, FATAL);
+ test(5, 5, F_TEST, (off_t)1, (off_t)1, PASS, FATAL);
+ test(5, 6, F_TEST, (off_t)1, (off_t)2, denied_err, FATAL);
+ test(5, 7, F_TEST, (off_t)1, (off_t)END, denied_err, FATAL);
+ test(5, 8, F_TEST, (off_t)2, (off_t)1, denied_err, FATAL);
+ test(5, 9, F_TEST, (off_t)2, (off_t)2, denied_err, FATAL);
+ test(5, 10, F_TEST, (off_t)2, (off_t)END, denied_err, FATAL);
+ test(5, 11, F_TEST, (off_t)3, (off_t)1, PASS, FATAL);
+ test(5, 12, F_TEST, (off_t)3, (off_t)2, PASS, FATAL);
+ test(5, 13, F_TEST, (off_t)3, (off_t)END, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test6()
+{
+#ifdef LARGE_LOCKS
+ unsigned long long maxplus1 = (unsigned long long)maxeof + 1;
+#else
+ unsigned long maxplus1 = (unsigned long)maxeof + 1;
+#endif
+
+ if (who == PARENT) {
+ parentwait();
+ header(6, "Try to lock the MAXEOF byte.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(6, 0, F_TLOCK, maxeof, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(6, 11, F_ULOCK, maxeof, (off_t)1, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(6, 1, F_TEST, maxeof - 1, (off_t)1, PASS, FATAL);
+ test(6, 2, F_TEST, maxeof - 1, (off_t)2, denied_err,
+ FATAL);
+ test(6, 3, F_TEST, maxeof - 1, (off_t)END,
+ denied_err, FATAL);
+ test(6, 4, F_TEST, maxeof, (off_t)1, denied_err, FATAL);
+ test(6, 5, F_TEST, maxeof, (off_t)2, oflow_err, WARN);
+ test(6, 6, F_TEST, maxeof, (off_t)END, denied_err,
+ FATAL);
+ test(6, 7, F_TEST, (off_t)maxplus1, (off_t)END, EINVAL,
+ WARN);
+ test(6, 8, F_TEST, (off_t)maxplus1, (off_t)1, EINVAL,
+ WARN);
+ test(6, 9, F_TEST, (off_t)maxplus1, maxeof, EINVAL,
+ WARN);
+ test(6, 10, F_TEST, (off_t)maxplus1, (off_t)maxplus1, EINVAL,
+ WARN);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test7()
+{
+ /*
+ * Considerations for strings:
+ * 1. the lengths should not be multiples of 4, and the parent
+ * length should be different from the child length, in order to
+ * exercise the XDR code as well as possible.
+ * 2. make the child's string longer than the parent's, to ensure
+ * that the file length gets extended correctly.
+ */
+ char *parent_msg = "aaaa eh";
+ size_t parent_len = strlen(parent_msg);
+ char *child_msg = "bebebebeb";
+ size_t child_len = strlen(child_msg);
+ int locklen;
+
+ off_t pagesize;
+ off_t start;
+
+ locklen = (parent_len > child_len ? parent_len : child_len);
+
+ /*
+ * Try to get the I/O requests to cross a page boundary. If the
+ * system can't tell us how big a page is, default to something
+ * big, like 64KB.
+ */
+#ifdef MACOSX
+ pagesize = getpagesize();
+#else
+ pagesize = sysconf(_SC_PAGESIZE);
+#endif
+ if (pagesize < 0) {
+ pagesize = 64 * 1024;
+ }
+ start = pagesize - 4;
+
+ if (who == PARENT) {
+ parentwait();
+ header(7, "Test parent/child mutual exclusion.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(7, 0, F_TLOCK, start, (off_t)locklen, PASS, FATAL);
+ write_testfile(parent_msg, start, (int)parent_len, COMMENT);
+ comment("Now free child to run, should block on lock.");
+ childfree(wait_time);
+ comment("Check data in file to insure child blocked.");
+ read_testfile(7, 1, parent_msg, start, parent_len,
+ EQUAL, FATAL);
+ comment("Now unlock region so child will unblock.");
+ test(7, 2, F_ULOCK, start, (off_t)locklen, PASS, FATAL);
+ parentwait(); /* wait for child to claim it has lock */
+ comment("Now try to regain lock, parent should block.");
+ test(7, 5, F_LOCK, start, (off_t)locklen, PASS, FATAL);
+ comment("Check data in file to insure child unblocked.");
+ read_testfile(7, 6, child_msg, start, child_len,
+ EQUAL, FATAL);
+ test(7, 7, F_ULOCK, start, (off_t)locklen, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ childfree(0);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(7, 3, F_LOCK, start, (off_t)locklen, PASS, FATAL);
+ parentfree(0);
+ comment("Write child's version of the data and release lock.");
+ write_testfile(child_msg, start, (int)child_len, COMMENT);
+ test(7, 4, F_ULOCK, start, (off_t)locklen, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ childwait();
+ }
+}
+
+static void
+test8()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(8, "Rate test performing lock/unlock cycles.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ rate(ratecount);
+ close_testfile(DO_UNLINK);
+ childfree(0);
+ } else {
+ parentfree(0);
+ childwait();
+ }
+}
+
+static void
+test9()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(9, "Test mandatory locking (LAI NFS client).");
+ open_testfile(OPENFLAGS, MANDMODES);
+ test(9, 0, F_TLOCK, (off_t)0, (off_t)4, PASS, FATAL);
+ write_testfile("aaaa", (off_t)0, 4, COMMENT);
+ comment("Now free child to run, should block on write.");
+ childfree(wait_time);
+ comment("Check data in file before child writes.");
+ read_testfile(9, 1, "aaaa", (off_t)0, 4, EQUAL, FATAL);
+ comment("Now unlock region so child will write.");
+ test(9, 2, F_ULOCK, (off_t)0, (off_t)4, PASS, FATAL);
+ comment("Check data in file after child writes.");
+ read_testfile(9, 3, "bbbb", (off_t)0, 4, EQUAL, FATAL);
+ close_testfile(DO_UNLINK);
+ childfree(0);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ write_testfile("bbbb", (off_t)0, 4, COMMENT);
+ close_testfile(DO_UNLINK);
+ childwait();
+ }
+}
+
+static void
+test10()
+{
+
+ if (who == PARENT) {
+ parentwait();
+ header(10, "Make sure a locked region is split properly.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(10, 0, F_TLOCK, (off_t)0, (off_t)3, PASS, FATAL);
+ test(10, 1, F_ULOCK, (off_t)1, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(10, 6, F_ULOCK, (off_t)0, (off_t)1, PASS, FATAL);
+ test(10, 7, F_ULOCK, (off_t)2, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ test(10, 9, F_ULOCK, (off_t)0, (off_t)1, PASS, FATAL);
+ test(10, 10, F_TLOCK, (off_t)1, (off_t)3, PASS, FATAL);
+ test(10, 11, F_ULOCK, (off_t)2, (off_t)1, PASS, FATAL);
+ childfree(0);
+ parentwait();
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(10, 2, F_TEST, (off_t)0, (off_t)1, denied_err, FATAL);
+ test(10, 3, F_TEST, (off_t)2, (off_t)1, denied_err, FATAL);
+ test(10, 4, F_TEST, (off_t)3, (off_t)END, PASS, FATAL);
+ test(10, 5, F_TEST, (off_t)1, (off_t)1, PASS, FATAL);
+ parentfree(0);
+ childwait();
+ test(10, 8, F_TEST, (off_t)0, (off_t)3, PASS, FATAL);
+ parentfree(0);
+ childwait();
+ test(10, 12, F_TEST, (off_t)1, (off_t)1, denied_err, FATAL);
+ test(10, 13, F_TEST, (off_t)3, (off_t)1, denied_err, FATAL);
+ test(10, 14, F_TEST, (off_t)4, (off_t)END, PASS, FATAL);
+ test(10, 15, F_TEST, (off_t)2, (off_t)1, PASS, FATAL);
+ test(10, 16, F_TEST, (off_t)0, (off_t)1, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test11()
+{
+ int dupfd;
+ char *data = "123456789abcdef";
+ int datalen;
+
+ datalen = strlen(data) + 1; /* including trailing NULL */
+
+ if (who == PARENT) {
+ parentwait();
+ header(11, "Make sure close() releases the process's locks.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ dupfd = dup(testfd);
+ test(11, 0, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ close_testfile(JUST_CLOSE);
+ childfree(0);
+
+ parentwait();
+ testdup2(dupfd, testfd);
+ test(11, 3, F_TLOCK, (off_t)29, (off_t)1463, PASS, FATAL);
+ test(11, 4, F_TLOCK, (off_t)0x2000, (off_t)87, PASS, FATAL);
+ close_testfile(JUST_CLOSE);
+ childfree(0);
+
+ parentwait();
+ testdup2(dupfd, testfd);
+ write_testfile(data, (off_t)0, datalen, COMMENT);
+ test(11, 7, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ write_testfile(data, (off_t)(datalen - 3), datalen, COMMENT);
+ close_testfile(JUST_CLOSE);
+ childfree(0);
+
+ parentwait();
+ testdup2(dupfd, testfd);
+ write_testfile(data, (off_t)0, datalen, COMMENT);
+ test(11, 10, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ testtruncate();
+ close_testfile(JUST_CLOSE);
+ childfree(0);
+
+ parentwait();
+ close(dupfd);
+ close_testfile(DO_UNLINK);
+ } else {
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ test(11, 1, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ test(11, 2, F_ULOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ parentfree(0);
+
+ childwait();
+ test(11, 5, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ test(11, 6, F_ULOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ parentfree(0);
+
+ childwait();
+ test(11, 8, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ test(11, 9, F_ULOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ parentfree(0);
+
+ childwait();
+ test(11, 11, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ test(11, 12, F_ULOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ parentfree(0);
+ }
+}
+
+static void
+test12()
+{
+ if (who == PARENT) {
+ pid_t target;
+
+ close(pidpipe[1]);
+
+ parentwait();
+ header(12, "Signalled process should release locks.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ childfree(0);
+
+ parentwait();
+ (void) lseek(testfd, (off_t)0, 0);
+ if (read(pidpipe[0], &target, sizeof (target)) !=
+ sizeof (target)) {
+ perror("can't read pid to kill");
+ testexit(1);
+ }
+ kill(target, SIGINT);
+ comment("Killed child process.");
+ sleep(wait_time);
+ test(12, 1, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ childfree(0);
+ close_testfile(DO_UNLINK);
+ } else {
+ pid_t subchild;
+
+ close(pidpipe[0]);
+
+ parentfree(0);
+ childwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ /*
+ * Create a subprocess to obtain a lock and get killed. If
+ * the parent kills the regular child, tlock will stop
+ * after the first pass.
+ */
+ subchild = fork();
+ if (subchild < 0) {
+ perror("can't fork off subchild");
+ testexit(1);
+ }
+ /*
+ * Record the pid of the subprocess and wait for the parent
+ * to tell the child that the test is done. Note that the
+ * child and subchild share the file offset; keep this in
+ * mind if you change this test.
+ */
+ if (subchild > 0) {
+ /* original child */
+ sleep(wait_time);
+ (void) lseek(testfd, (off_t)0, 0);
+ if (write(pidpipe[1], &subchild, sizeof (subchild)) !=
+ sizeof (subchild)) {
+ perror("can't record pid to kill");
+ kill(subchild, SIGINT);
+ testexit(1);
+ }
+ parentfree(0);
+ childwait();
+ close_testfile(DO_UNLINK);
+ } else {
+ /* subchild */
+ signal(SIGINT, SIG_DFL);
+ test(12, 0, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
+ for (;;)
+ sleep(1);
+ /* NOTREACHED */
+ }
+ }
+}
+
+#ifdef MMAP
+static void
+test13()
+{
+ if (who == PARENT) {
+ int lock1err;
+ int err;
+
+ parentwait();
+ open_testfile(OPENFLAGS, OPENMODES);
+ header(13, "Check locking and mmap semantics.");
+
+ /*
+ * Can a file be locked and mapped at same time? It's
+ * potentially safe if the whole file is locked, or if the
+ * locked region is page-aligned. Otherwise, there is a
+ * race condition between two clients that lock disjoint
+ * regions of the same page. So for this test we
+ * deliberately lock a region that is not
+ * page-aligned--that should cause the mmap to fail. But if
+ * it doesn't, that's arguably not an interoperability
+ * problem, so make it a warning, not a fatal error.
+ */
+ test(13, 0, F_TLOCK, (off_t)mappedlen - 2, (off_t)END, PASS,
+ FATAL);
+ lock1err = testmmap();
+ report(13, 1, "mmap", (off_t)0, (off_t)mappedlen, EAGAIN,
+ lock1err, WARN);
+ test(13, 2, F_ULOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ if (lock1err == 0)
+ testmunmap();
+
+ /*
+ * Does the order of lock/mmap matter? This also verifies
+ * that releasing the lock makes the file mappable again.
+ * Again, allowing an unsafe map and lock combination is
+ * not an interoperability problem, so flag it as a
+ * warning, not an error.
+ */
+ err = testmmap();
+ report(13, 3, "mmap", (off_t)0, (off_t)mappedlen, PASS, err,
+ FATAL);
+ test(13, 4, F_TLOCK, (off_t)mappedlen - 2, (off_t)END,
+ lock1err, WARN);
+ close_testfile(DO_UNLINK);
+
+ childfree(0);
+ } else {
+ parentfree(0);
+ childwait();
+ }
+}
+#endif /* MMAP */
+
+static void
+test14()
+{
+ if (who == PARENT) {
+ header(14,
+ "Rate test performing I/O on unlocked and locked file.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ comment("File Unlocked");
+ iorate(iorate_kb, iorate_count);
+ test(14, 0, F_TLOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ comment("File Locked");
+ iorate(iorate_kb, iorate_count);
+ test(14, 1, F_ULOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ close_testfile(DO_UNLINK);
+ }
+}
+
+static void
+test15()
+{
+ char *data = "abcdefghij";
+ int datalen;
+ int testfd2;
+
+ if (who == CHILD)
+ return;
+
+ datalen = strlen(data) + 1; /* including trailing NULL */
+
+ header(15, "Test 2nd open and I/O after lock and close.");
+ open_testfile(OPENFLAGS, OPENMODES);
+ testfd2 = open(testfile, OPENFLAGS, OPENMODES);
+ if (testfd2 < 0) {
+ perror("second open");
+ testexit(1);
+ }
+ comment("Second open succeeded.");
+
+ test(15, 0, F_LOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ test(15, 1, F_ULOCK, (off_t)0, (off_t)END, PASS, FATAL);
+ close_testfile(JUST_CLOSE);
+ open_testfile(OPENFLAGS, OPENMODES);
+ write_testfile(data, (off_t)0, datalen, COMMENT);
+ read_testfile(15, 2, data, (off_t)0, (unsigned int)datalen, EQUAL,
+ FATAL);
+ close(testfd2);
+ close_testfile(DO_UNLINK);
+}
+
+static void
+runtests()
+{
+
+ if (DO_TEST(1)) {
+ test1();
+ }
+ if (DO_TEST(2)) {
+ test2();
+ }
+ if (DO_TEST(3)) {
+ test3();
+ }
+ if (DO_TEST(4)) {
+ test4();
+ }
+ if (DO_TEST(5)) {
+ test5();
+ }
+ if (DO_TEST(6)) {
+ test6();
+ }
+ if (DO_TEST(7)) {
+ test7();
+ }
+ if (DO_RATE(8)) {
+ test8();
+ }
+ if (DO_MAND(9)) {
+ test9();
+ }
+ if (DO_TEST(10)) {
+ test10();
+ }
+ if (DO_TEST(11)) {
+ test11();
+ }
+ if (DO_TEST(12)) {
+ test12();
+ }
+#ifdef MMAP
+ if (DO_TEST(13)) {
+ test13();
+ }
+#endif
+ if (DO_TEST(14)) {
+ test14();
+ }
+ if (DO_TEST(15)) {
+ test15();
+ }
+}
+
+/*
+ * Main record locking test loop.
+ */
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ extern int optind;
+ extern char *optarg;
+ int errflg = 0;
+
+ passcnt = 1; /* default, test for 1 pass */
+
+ while ((c = getopt(argc, argv, "p:t:rmv:w:")) != -1) {
+ switch (c) {
+ case 'p':
+ sscanf(optarg, "%d", &passcnt);
+ break;
+ case 't':
+ sscanf(optarg, "%d", &testnum);
+ break;
+ case 'r':
+ ratetest++;
+ break;
+ case 'm':
+ mandtest++;
+ break;
+ case 'v':
+ sscanf(optarg, "%d", &proto_vers);
+ break;
+ case 'w':
+ sscanf(optarg, "%d", &wait_time);
+ break;
+ default:
+ errflg++;
+ }
+ }
+ if (errflg) {
+ fprintf(stderr,
+"usage: tlock [-p passcnt] [-t testnum] [-r] [-m] [-w wait_time] [dirpath]\n");
+ exit(2);
+ }
+ if (optind < argc) {
+ filepath = argv[optind];
+ }
+ initialize();
+
+ /*
+ * Fork child...
+ */
+ if ((childpid = fork()) == 0) {
+ who = CHILD;
+ signal(SIGINT, parentsig);
+ } else {
+ who = PARENT;
+ signal(SIGINT, childsig);
+ signal(SIGCLD, childdied);
+ }
+
+ /*
+ * ...and run the tests for count passes.
+ */
+ for (passnum = 1; passnum <= passcnt; passnum++) {
+ runtests();
+ if (who == CHILD) {
+ childwait();
+ testreport(0);
+ } else {
+ testreport(0);
+ childfree(0);
+ }
+ }
+ if (who == CHILD) {
+ childwait();
+ } else {
+ signal(SIGCLD, SIG_DFL);
+ childfree(0);
+ }
+ testexit(0);
+ /* NOTREACHED */
+}
diff --git a/old/runcthon.orig b/old/runcthon.orig
new file mode 100755
index 0000000..6fcd025
--- /dev/null
+++ b/old/runcthon.orig
@@ -0,0 +1,95 @@
+#!/bin/bash
+SRV=rhel5hat
+privatemnts=0
+
+runtests()
+{
+test=$1
+server=$2
+vers=$3
+proto=$4
+sec=$5
+homedir="/home"
+#echo "proto=$proto"
+#echo "sec=$sec"
+ [ $server = "gfiler" ] && homedir="/vol/vol3"
+ [ $server = "sol10" ] && homedir="/export/cthon_automount"
+ [ $server = "sol9" ] && homedir="/export/home"
+
+ if [ $vers = "4" ]; then
+ if [ -n "$sec" ] ; then
+ mntargs="-F nfs4 -o proto=$proto,sec=$sec"
+ else
+ mntargs="-F nfs4 -o proto=$proto"
+ fi
+ else
+ if [ -n "$sec" ] ; then
+ mntargs="-o $proto,nfsvers=$vers,sec=$sec"
+ else
+ mntargs="-o $proto,nfsvers=$vers"
+ fi
+ fi
+ if [ $privatemnts -eq 1 ]; then
+ mnt=/mnt/$SRV
+ else
+ mnt=/mnt
+ fi
+ mkdir -p $mnt/nfsv$vers$proto || exit 1
+ mntpoint="-m $mnt/nfsv$vers$proto"
+ exportdir="-p $homedir/tmp/nfsv$vers$proto"
+ echo "./server $test $mntargs $mntpoint $exportdir $SRV"
+ (./server $test $mntargs $mntpoint $exportdir $SRV > /tmp/nfsv$vers$proto 2>&1 ;
+ [ -d $mnt/nfsv$vers$proto/`hostname -s`.test ] &&
+ sudo umount $mnt/nfsv$vers$proto ) &
+ #echo -n "waiting...."
+ #wait
+}
+umountall()
+{
+ for proto in udp tcp
+ do
+ for vers in 2 3 4
+ do
+ [ -d /mnt/nfsv$vers$proto/`hostname -s`.test ] &&
+ sudo umount /mnt/nfsv$vers$proto
+ done
+ done
+ exit 0
+}
+trap 'echo SIGINT; pkill runcthon server; exit 1 ' SIGINT
+trap 'echo; echo -n "Done:"; date; exit 2' SIGTERM
+
+while [ -n "$1" ]
+do
+ case $1 in
+ "-u" )
+ umountall
+ ;;
+ "-s" )
+ SRV="$2"
+ shift
+ ;;
+ "-p" )
+ privatemnts=1
+ ;;
+ esac
+ shift
+done
+date
+cd /home/steved/work/cthon04 || exit 1
+for i in b g s l
+do
+ for j in krb5 krb5i krb5p
+ do
+ runtests -$i $SRV 3 udp $j
+ runtests -$i $SRV 3 tcp $j
+ runtests -$i $SRV 2 tcp $j
+ runtests -$i $SRV 2 udp $j
+ runtests -$i $SRV 4 udp $j
+
+ echo -n "Waiting for '$i' to finish..."
+ wait
+ echo -n "Done: "
+ date
+ done
+done
diff --git a/old/server.org b/old/server.org
new file mode 100755
index 0000000..0a76f33
--- /dev/null
+++ b/old/server.org
@@ -0,0 +1,161 @@
+:
+#!/bin/sh
+#
+# @(#)server 1.8 2003/12/29 Connectathon testsuite
+# 1.1 Lachman ONC Test Suite source
+#
+# run tests given a server name. mounts, tests, and unmounts
+# arguments:
+# -a|-b|-g|-s|-l test selectors, passed to runtests
+# -f|-t|-n test arguments, passed to runtests
+# -c use cachefs; need to specify cachefs mount
+# options with -o
+# -N passes repeat "passes" times
+# mnt_options arg to -o mount options
+# server_path path to mount from server
+# mntpoint path to mount on locally
+# server_name server to mount from
+#
+Program=`basename $0`
+
+InitFile="./tests.init"
+USAGE="usage: $Program [-a|-b|-g|-s|-l|-c] [-f|-t|-n|-h] [-o mnt_options] [-p server_path] [-m mntpoint] [-N passes] server_name"
+
+# defaults
+. $InitFile
+export PATH CFLAGS LIBS MOUNT UMOUNT MNTOPTIONS
+
+passes="1"
+
+set - `getopt abcfglhm:N:no:p:st $*`
+
+if [ $? != 0 ]
+then
+ echo $USAGE
+ exit 1
+fi
+for c in $*
+do
+ case $c in
+ -a|-b|-g|-s|-l) TEST=$c; shift ;;
+ -f|-n|-t) TESTARG=$c; shift ;;
+ -c) cachefs="yes"; shift ;;
+ -h) HARDLINKS=n; export HARDLINKS; shift ;;
+ -m) USRMNTPOINT=$2; shift; shift ;;
+ -o) MNTOPTIONS=$2; export MNTOPTIONS;
+ shift; shift ;;
+ -p) SERVPATH=$2; shift; shift ;;
+ -N) passes=$2; shift; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+if test $# -gt 0
+then
+ SERVER=$1
+ shift
+ if test $# -gt 0
+ then
+ echo $USAGE
+ exit 1
+ fi
+fi
+
+# if no server specified, exit
+if test x$SERVER = x
+then
+ echo $USAGE
+ exit 1
+fi
+
+# If the user specified a particular moint point, use that.
+# Otherwise, use /mnt/<server_name>. The reason for the default name
+# is twofold:
+# 1. If the mount point is in / (e.g., /mnt.<server_name>) and the
+# server dies, things like getcwd() might hang.
+# 2. Having a server-specific name makes administration and concurrent
+# test runs a little easier.
+if test x$USRMNTPOINT != x
+then
+ MNTPOINT=$USRMNTPOINT
+else
+ MNTPOINT="/mnt/$SERVER"
+fi
+
+# If the mount point doesn't exist, create it and note that we should
+# remove it when done. This is a bit of a hack, but combined with
+# tying the mountpoint to the server name, it makes it easier to run
+# multiple tests at the same time.
+if test ! -d $MNTPOINT
+then
+ mkdir -p $MNTPOINT || mkdir $MNTPOINT
+ dormdir="yes"
+fi
+
+# make sure nothing is mounted on the mountpoint
+eval $UMOUNTCMD > /dev/null 2>&1
+
+if test -z "$cachefs"
+then
+ eval $MOUNTCMD
+else
+ if test -z "$CFSMOUNTCMD"
+ then
+ echo "error: no cachefs mount command (CFSMOUNTCMD) specified"
+ exit 1
+ else
+ eval $CFSMOUNTCMD
+ fi
+fi
+
+case $? in
+ 0)
+ ;;
+ *)
+ echo "Can't mount $SERVER:$SERVPATH on $MNTPOINT"
+ exit 1
+ ;;
+esac
+
+# mount doesn't always return error code if it fails, so lets
+# ask here just in case
+HOSTNAME=`hostname`
+HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'`
+NFSTESTDIR=$MNTPOINT/$HOSTNAME.test
+export NFSTESTDIR
+echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC"
+read ans
+case $ans in
+ Y*|y*)
+ ;;
+ *)
+ echo "Terminating ($MNTPOINT left mounted)."
+ exit 1
+ ;;
+esac
+
+echo ""
+
+if test $passes = "1"
+then
+ passarg=""
+else
+ passarg="-N $passes"
+fi
+
+echo "sh ./runtests $passarg $TEST $TESTARG $NFSTESTDIR"
+sh ./runtests $passarg $TEST $TESTARG $NFSTESTDIR
+
+if [ $? -ne 0 ]
+then
+ echo Tests failed, leaving $MNTPOINT mounted
+ exit 1
+fi
+
+eval $UMOUNTCMD
+if test x$dormdir = xyes
+then
+ rmdir $MNTPOINT
+fi
+
+exit 0
diff --git a/old/server.orig b/old/server.orig
new file mode 100755
index 0000000..7e57a7c
--- /dev/null
+++ b/old/server.orig
@@ -0,0 +1,162 @@
+:
+#!/bin/sh
+#
+# @(#)server 1.8 2003/12/29 Connectathon testsuite
+# 1.1 Lachman ONC Test Suite source
+#
+# run tests given a server name. mounts, tests, and unmounts
+# arguments:
+# -a|-b|-g|-s|-l test selectors, passed to runtests
+# -f|-t|-n test arguments, passed to runtests
+# -c use cachefs; need to specify cachefs mount
+# options with -o
+# -N passes repeat "passes" times
+# mnt_options arg to -o mount options
+# server_path path to mount from server
+# mntpoint path to mount on locally
+# server_name server to mount from
+#
+Program=`basename $0`
+
+InitFile="./tests.init"
+USAGE="usage: $Program [-a|-b|-g|-s|-l|-c] [-f|-t|-n|-h] [-o mnt_options] [-p server_path] [-m mntpoint] [-N passes] server_name"
+
+# defaults
+. $InitFile
+export PATH CFLAGS LIBS MOUNT UMOUNT MNTOPTIONS
+
+passes="1"
+
+set - `getopt abcfglhm:N:no:p:st $*`
+
+if [ $? != 0 ]
+then
+ echo $USAGE
+ exit 1
+fi
+for c in $*
+do
+ case $c in
+ -a|-b|-g|-s|-l) TEST=$c; shift ;;
+ -f|-n|-t) TESTARG=$c; shift ;;
+ -c) cachefs="yes"; shift ;;
+ -h) HARDLINKS=n; export HARDLINKS; shift ;;
+ -m) USRMNTPOINT=$2; shift; shift ;;
+ -o) MNTOPTIONS=$2; export MNTOPTIONS;
+ shift; shift ;;
+ -p) SERVPATH=$2; shift; shift ;;
+ -N) passes=$2; shift; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+if test $# -gt 0
+then
+ SERVER=$1
+ shift
+ if test $# -gt 0
+ then
+ echo $USAGE
+ exit 1
+ fi
+fi
+
+# if no server specified, exit
+if test x$SERVER = x
+then
+ echo $USAGE
+ exit 1
+fi
+
+# If the user specified a particular moint point, use that.
+# Otherwise, use /mnt/<server_name>. The reason for the default name
+# is twofold:
+# 1. If the mount point is in / (e.g., /mnt.<server_name>) and the
+# server dies, things like getcwd() might hang.
+# 2. Having a server-specific name makes administration and concurrent
+# test runs a little easier.
+if test x$USRMNTPOINT != x
+then
+ MNTPOINT=$USRMNTPOINT
+else
+ MNTPOINT="/mnt/$SERVER"
+fi
+
+# If the mount point doesn't exist, create it and note that we should
+# remove it when done. This is a bit of a hack, but combined with
+# tying the mountpoint to the server name, it makes it easier to run
+# multiple tests at the same time.
+if test ! -d $MNTPOINT
+then
+ mkdir -p $MNTPOINT || mkdir $MNTPOINT
+ dormdir="yes"
+fi
+
+# make sure nothing is mounted on the mountpoint
+eval $UMOUNTCMD > /dev/null 2>&1
+
+if test -z "$cachefs"
+then
+ eval $MOUNTCMD
+else
+ if test -z "$CFSMOUNTCMD"
+ then
+ echo "error: no cachefs mount command (CFSMOUNTCMD) specified"
+ exit 1
+ else
+ eval $CFSMOUNTCMD
+ fi
+fi
+
+case $? in
+ 0)
+ ;;
+ *)
+ echo "Can't mount $SERVER:$SERVPATH on $MNTPOINT"
+ exit 1
+ ;;
+esac
+
+# mount doesn't always return error code if it fails, so lets
+# ask here just in case
+HOSTNAME=`hostname`
+HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'`
+NFSTESTDIR=$MNTPOINT/$HOSTNAME.test
+export NFSTESTDIR
+#echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC"
+#read ans
+ans="y"
+case $ans in
+ Y*|y*)
+ ;;
+ *)
+ echo "Terminating ($MNTPOINT left mounted)."
+ exit 1
+ ;;
+esac
+
+echo ""
+
+if test $passes = "1"
+then
+ passarg=""
+else
+ passarg="-N $passes"
+fi
+
+echo "sh ./runtests $passarg $TEST $TESTARG $NFSTESTDIR"
+sh ./runtests $passarg $TEST $TESTARG $NFSTESTDIR
+
+if [ $? -ne 0 ]
+then
+ echo Tests failed, leaving $MNTPOINT mounted 2>&1
+ exit 1
+fi
+
+eval $UMOUNTCMD
+if test x$dormdir = xyes
+then
+ rmdir $MNTPOINT
+fi
+
+exit 0
diff --git a/old/tests.init.orig b/old/tests.init.orig
new file mode 100644
index 0000000..c1d3fe1
--- /dev/null
+++ b/old/tests.init.orig
@@ -0,0 +1,224 @@
+
+#
+# @(#)tests.init 1.26 2003/12/30 Connectathon testsuite
+#
+MNTOPTIONS="rw,hard,intr"
+# Dummy MNTPOINT definition; should get overriden by server script.
+MNTPOINT="/mnt"
+
+# Use this mount command if using:
+# SVR3
+#MOUNTCMD='./domount -f NFS,$MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+# Use this mount command if using:
+# SVR4
+# Solaris 2.x
+#MOUNTCMD='./domount -F nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+#CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+# Use this mount command if using:
+# BSD
+# SunOS 4.X
+# Tru64 UNIX
+# HPUX
+# Linux
+# AIX
+# Mac OS X
+# At least some BSD systems don't recognize "hard" (since that's the
+# default), so you might also want to use this definition of MNTOPTIONS.
+MNTOPTIONS="rw,intr"
+MOUNTCMD='./domount -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+#MOUNTCMD='./domount -t nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+# Use this mount command if using:
+# DG/UX
+#MOUNTCMD='./domount -t nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+UMOUNTCMD='./domount -u $MNTPOINT'
+
+# Use the next two lines if using:
+# SVR3
+# SVR4
+# Solaris 2.x
+# HPUX
+#DASHN=
+#BLC=\\c
+
+# Use the next two lines if using:
+# BSD
+# SunOS 4.X
+# Linux
+# Tru64 UNIX
+# Mac OS X
+DASHN=-n
+BLC=
+
+# Use this path for:
+# Solaris 2.x
+#PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
+
+# Use this path for:
+# Solaris 2.x with GCC
+#PATH=/opt/gnu/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
+
+# Use this path for:
+# HPUX
+#PATH=/bin:/usr/bin:/etc:/usr/etc:/usr/local/bin:/usr/contrib/bin:.
+
+# Use this path for:
+# BSD
+# SunOS 4.X
+#PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/etc:.
+
+# Use this path for:
+# Tru64 UNIX
+# SVR4
+# Linux
+PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:.
+
+# Use this path for:
+# DG/UX
+#PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/etc:.
+
+# Use this path for:
+# IRIX
+#PATH=/bin:/usr/bin:/usr/bsd:/etc:/usr/etc:.
+
+# Use this path for:
+# AIX
+#PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:.
+#MOUNT=/usr/sbin/mount
+#UMOUNT=/usr/sbin/umount
+
+# Use this path for:
+# Mac OS X
+#PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:.
+
+SERVER=""
+SERVPATH="/server"
+TEST="-a"
+TESTARG="-t"
+
+# -----------------------------------------------
+# Defines for various variables used in scripts and makefiles.
+#
+# Do not remove the following three lines. They may be overridden by
+# other configuration parameters lower in this file, but these three
+# variables must be defined.
+CC=cc
+CFLAGS=
+LIBS=
+LOCKTESTS=tlock
+
+# Use with SVR3 systems.
+# Add -TR2 to CFLAGS for use on Amdahl UTS systems.
+#CFLAGS=-DSVR3
+#LIBS=`echo -lrpc -lsocket`
+
+# Use with BSD systems.
+#CC=gcc
+#CFLAGS=`echo -Duse_directs -DBSD`
+#MOUNT=/sbin/mount
+#UMOUNT=/sbin/umount
+
+# Use with SVR4 systems.
+#CFLAGS=-DSVR4
+#LIBS=`echo -lsocket -lnsl`
+
+# Use with SunOS 4.X systems
+#CC=/usr/5bin/cc
+#CFLAGS=`echo -DSUNOS4X -DNEED_STRERROR`
+
+# Use with Solaris 2.x systems. Need the 5.0 C compiler (or later)
+# for 64-bit mode.
+#CC=/opt/SUNWspro/bin/cc
+# Use this with GCC
+#CC=/opt/gnu/bin/gcc
+# Use this through Solaris 2.6. For Solaris 2.7 and later, use
+# this for 32-bit mode applications.
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG`
+# Use this with gcc (32-bit binaries):
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -mcpu=ultrasparc`
+# For Solaris 2.7 and later, use this for 64-bit mode applications
+# (Sun compiler).
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -xO0 -xarch=v9 -dalign -Xt -L/usr/lib/sparcv9`
+# Use this to make 64-bit binaries with gcc (3.1 or later; untested):
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -m64`
+#LIBS=`echo -lsocket -lnsl`
+# Use this through Solaris 2.5.1.
+#LOCKTESTS=`echo tlock`
+# Use with 2.6 and later systems, 32-bit mode.
+#LOCKTESTS=`echo tlocklfs tlock64`
+# Use with 2.7 and later, 64-bit mode.
+#LOCKTESTS=`echo tlocklfs`
+
+# Use with Tru64 UNIX systems
+#CFLAGS=`echo -O -DTRU64 -DOSF1 -DMMAP -DSTDARG`
+# use the following instead of the above if using gcc
+#CFLAGS=`echo -O -DTRU64 -DOSF1 -DMMAP -DSTDARG -fwritable-strings`
+# 64-bit binaries with gcc (3.1 or later; untested):
+#CFLAGS=`echo -O -DTRU64 -DOSF1 -DMMAP -DSTDARG -fwritable-strings -m64`
+#MOUNT=/sbin/mount
+#UMOUNT=/sbin/umount
+
+# Use with HPUX systems, 10.00 and earlier.
+#CFLAGS=-DHPUX
+#CC=/bin/cc
+#RM=/bin/rm
+#MAKE=/bin/make
+
+# Use with HPUX 10.01.
+#CFLAGS=`echo -Ae -DHPUX`
+#CC=/opt/ansic/bin/cc
+#RM=/bin/rm
+#MAKE=/usr/bin/make
+
+# Use with HPUX 11.0, 32-bit machines.
+#CFLAGS=`echo -Ae -DHPUX -D_PSTAT64 -D_LARGEFILE64_SOURCE -DPORTMAP`
+#CC=/opt/ansic/bin/cc
+#LIBS=`echo -lnsl`
+#RM=/bin/rm
+#MAKE=/usr/bin/make
+
+# Use with HPUX 11.0, 64-bit machines.
+#CFLAGS=`echo -Ae -DHPUX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE`
+#CC=/opt/ansic/bin/cc
+#RM=/bin/rm
+#MAKE=/usr/bin/make
+
+# Use with DG/UX systems.
+#CFLAGS=-DSVR4
+#LIBS=`echo -lsocket -lnsl`
+
+# Use with IRIX systems. Use HAVE_SOCKLEN_T for IRIX >= 6.5.19.
+#CFLAGS=`echo -g -DHAVE_SOCKLEN_T -DSTDARG -DSVR4 -DIRIX -DMMAP`
+
+# Use with AIX.
+#CC=gcc
+#CFLAGS=`echo -DAIX -DSTDARG -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE`
+#LOCKTESTS=`echo tlocklfs`
+
+# Use with Linux 2.2 / GNU libc 2.0
+#CFLAGS=`echo -DLINUX -DGLIBC=20 -DMMAP -DSTDARG -fwritable-strings`
+#LIBS=`echo -lnsl`
+#MOUNT=/bin/mount
+#UMOUNT=/bin/umount
+
+# Use with Linux 2.4 / GNU libc 2.2
+#CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
+CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG`
+LIBS=`echo -lnsl`
+MOUNT=/bin/mount
+UMOUNT=/bin/umount
+LOCKTESTS=`echo tlocklfs tlock64`
+
+# Use with Linux if your distro doesn't provide a "cc".
+#CC=gcc
+
+# Use with Mac OS X
+#CFLAGS=`echo -DMACOSX -DNATIVE64 -DLARGE_LOCKS`
+#MOUNT=/sbin/mount
+#UMOUNT=/sbin/umount
+#LOCKTESTS=`echo tlock`
+
+# -----------------------------------------------
diff --git a/runcthon b/runcthon
new file mode 100755
index 0000000..da993c9
--- /dev/null
+++ b/runcthon
@@ -0,0 +1,186 @@
+#!/bin/bash
+SRV=fedora9server
+privatemnts=0
+homedir="/home/tmp"
+homedir="/server/tmp"
+
+runtests()
+{
+test=$1
+server=$2
+vers=$3
+proto=$4
+sec=$5
+#echo "proto=$proto"
+#echo "sec=$sec"
+ [ $server = "gfiler" ] && homedir="/vol/vol3/tmp"
+ [ $server = "sol10" ] && homedir="/export/cthon_automount/tmp"
+ [ $server = "sol9" ] && homedir="/export/home/tmp"
+
+ if [ $vers = "4" ]; then
+ if [ -n "$sec" ] ; then
+ mntargs="-F nfs4 -o proto=$proto,sec=$sec"
+ else
+ mntargs="-F nfs4 -o proto=$proto"
+ fi
+ else
+ if [ -n "$sec" ] ; then
+ mntargs="-o $proto,nfsvers=$vers,sec=$sec"
+ else
+ mntargs="-o $proto,nfsvers=$vers"
+ fi
+ fi
+ if [ $privatemnts -eq 1 ]; then
+ mnt=/mnt/$SRV
+ else
+ mnt=/mnt
+ fi
+ mkdir -p $mnt/nfsv$vers$proto || exit 1
+ mntpoint="-m $mnt/nfsv$vers$proto"
+ exportdir="-p $homedir/nfsv$vers$proto"
+ echo "./server $test $mntargs $mntpoint $exportdir $SRV"
+ (./server $test $mntargs $mntpoint $exportdir $SRV > /tmp/nfsv$vers$proto 2>&1 ;
+ [ $? -ne 0 ] && echo "\nThe '$test' test using '$mntargs' args to $SRV: Failed!!"
+ [ -d $mnt/nfsv$vers$proto/`hostname -s`.test ] &&
+ sudo umount $mnt/nfsv$vers$proto ) &
+ #echo -n "waiting...."
+ #wait
+}
+umountall()
+{
+ for proto in udp tcp
+ do
+ for vers in 2 3 4
+ do
+ [ -d /mnt/nfsv$vers$proto/`hostname -s`.test ] &&
+ sudo umount /mnt/nfsv$vers$proto
+ done
+ done
+ exit 0
+}
+mkdirs()
+{
+ for proto in udp tcp
+ do
+ for vers in 2 3 4
+ do
+ [ "$proto" == "udp" -a "$vers" == "4" ] && continue
+ mkdir ./nfsv$vers$proto
+ done
+ done
+ exit 0
+}
+trap 'echo SIGINT; pkill runcthon server; exit 1 ' SIGINT
+trap 'echo; echo -n "Done:"; date; exit 2' SIGTERM
+Usage="$0 --mkdirs --unmountall|--server|--serverdir|--noudp|--dokrb5|--onlykrb5|--nov4|--onlyv3|--onlyv4"
+
+noudp=0
+dokrb5=0
+onlykrb5=0
+nov4=0
+onlyv3=0
+onlyv4=0
+while [ -n "$1" ]
+do
+ case $1 in
+ "--mkdirs" )
+ cd $homedir && mkdirs
+ exit 0
+ ;;
+ "--unmountall" )
+ umountall
+ ;;
+ "--server" )
+ SRV="$2"
+ shift
+ ;;
+ "-p" )
+ privatemnts=1
+ ;;
+ "--serverdir" )
+ homedir="$2"
+ shift
+ ;;
+ "-h" )
+ echo $Usage
+ exit 0
+ ;;
+ "--noudp" )
+ noudp=1
+ ;;
+ "--dokrb5" )
+ dokrb5=1
+ ;;
+ "--onlykrb5" )
+ onlykrb5=1
+ ;;
+ "--nov4" )
+ nov4=1
+ ;;
+ "--onlyv3" )
+ onlyv3=1
+ ;;
+ "--onlyv4" )
+ onlyv4=1
+ ;;
+ * )
+ echo "'$1' - invalid option"
+ echo "$Usage"
+ exit 1
+ esac
+ shift
+done
+date
+cd /home/steved/work/cthon04 || exit 1
+seclist="krb5 krb5i krb5p"
+echo "homedir=$homedir"
+for i in b g s l
+do
+ if [ "$onlykrb5" -eq 0 ]; then
+ if [ "$noudp" -ne 1 ]; then
+ if [ "$onlyv4" -eq 0 ]; then
+ runtests -$i $SRV 3 udp ""
+ if [ "$onlyv3" -eq 0 ]; then
+ runtests -$i $SRV 2 udp ""
+ fi
+ fi
+ fi
+ if [ "$onlyv4" -eq 0 ]; then
+ runtests -$i $SRV 3 tcp ""
+ if [ "$onlyv3" -eq 0 ]; then
+ runtests -$i $SRV 2 tcp ""
+ fi
+ fi
+ if [ "$nov4" -eq 0 ]; then
+ runtests -$i $SRV 4 tcp ""
+ fi
+ fi
+ echo -n "Waiting for '$i' to finish..."
+ wait
+
+ if [ "$dokrb5" -eq 1 ]; then
+ for j in krb5 krb5i krb5p
+ do
+ if ["$noudp" -ne 1 ]; then
+ if [ "$onlyv4" -eq 0 ]; then
+ runtests -$i $SRV 3 udp $j
+ if [ "$onlyv3" -eq 0 ]; then
+ runtests -$i $SRV 2 udp $j
+ fi
+ fi
+ fi
+
+ if [ "$onlyv4" -eq 0 ]; then
+ runtests -$i $SRV 3 tcp $j
+ if [ "$onlyv3" -eq 0 ]; then
+ runtests -$i $SRV 2 tcp $j
+ fi
+ fi
+ if [ "$nov4" -eq 0 ]; then
+ runtests -$i $SRV 4 tcp $j
+ fi
+ done
+ fi
+ echo -n "Done: "
+ date
+done
diff --git a/runtests b/runtests
new file mode 100755
index 0000000..76d3d90
--- /dev/null
+++ b/runtests
@@ -0,0 +1,122 @@
+:
+#!/bin/sh
+#
+# @(#)runtests 1.5 00/07/10 Connectathon testsuite
+#
+# Master runtests script. Default is to run tests in each of
+# basic, general, special, and lock subdirectories. $NFSTESTDIR is
+# removed before general and special tests (if previous test done)
+# so that tests.init invoked from their respective runtests script
+# will not ask if the test dir should be removed (since this was
+# verified in the preceeding test).
+#
+
+Program=`basename $0`
+
+passes=1
+if test $# -ge 2
+then
+ if test x$1 = "x-N"
+ then
+ passes=$2
+ shift
+ shift
+ fi
+fi
+
+if test $# = 1
+then
+ TESTS=$1
+elif test $# = 2
+then
+ TESTS=$1
+ TESTARG=$2
+elif test $# = 3
+then
+ TESTS=$1
+ TESTARG=$2
+ TESTPATH=$3
+ NFSTESTDIR=$TESTPATH
+else
+ InitFile="./tests.init"
+ if test -f $InitFile
+ then
+ echo "$Program: using test defaults in $InitFile"
+ . $InitFile
+ else
+ echo "$Program: no test defaults file ($InitFile)"
+ echo "usage: $Program [-N passes] [tests [testargs [testpath]]]"
+ echo "tests: -a=all, -b=basic, -g=general, -s=special, -l=lock"
+ echo "testargs: -f=functional, -t=timing"
+ exit 1
+ fi
+fi
+if test x$NFSTESTDIR = x
+then
+ if test x$TESTPATH = x
+ then
+ echo "$Program: NFSTESTDIR environment variable not set"
+ echo "usage: $Program [-N passes] [tests [testargs [testpath]]]"
+ echo "tests: -a=all, -b=basic, -g=general, -s=special, -l=lock"
+ echo "testargs: -f=functional, -t=timing"
+ exit 1
+ fi
+ NFSTESTDIR=$TESTPATH
+fi
+
+export PATH CFLAGS LIBS NFSTESTDIR
+
+case $TESTS in
+ -a) dirs="basic general special lock" ;;
+ -b) dirs="basic" ;;
+ -g) dirs="general" ;;
+ -s) dirs="special" ;;
+ -l) dirs="lock" ;;
+esac
+
+if test x"$dirs" = x
+then
+ echo "$Program: no tests specified"
+ echo "usage: $Program [tests [testargs [testpath]]]"
+ echo "tests: -a=all, -b=basic, -g=general, -s=special, -l=lock"
+ echo "testargs: -f=functional, -t=timing"
+ exit 1
+
+fi
+
+if test x$TESTARG = x
+then
+ TESTARG=-a
+fi
+
+passnum=1
+while test $passnum -le $passes
+do
+ if test $passes -ne 1
+ then
+ echo "... Pass $passnum ..."
+ fi
+
+ for dir in $dirs
+ do
+ echo ""
+ if test -d $NFSTESTDIR
+ then
+ rm -rf $NFSTESTDIR
+ fi
+ cd $dir
+ sh runtests $TESTARG
+ if [ $? -ne 0 ]
+ then
+ echo $dir tests failed
+ exit 1
+ fi
+ cd ..
+ done
+ passnum=`expr $passnum + 1`
+done
+
+echo ""
+rm -rf $NFSTESTDIR
+
+echo "All tests completed"
diff --git a/server b/server
new file mode 100755
index 0000000..91ffd80
--- /dev/null
+++ b/server
@@ -0,0 +1,164 @@
+:
+#!/bin/sh
+#
+# @(#)server 1.8 2003/12/29 Connectathon testsuite
+# 1.1 Lachman ONC Test Suite source
+#
+# run tests given a server name. mounts, tests, and unmounts
+# arguments:
+# -a|-b|-g|-s|-l test selectors, passed to runtests
+# -f|-t|-n test arguments, passed to runtests
+# -c use cachefs; need to specify cachefs mount
+# options with -o
+# -N passes repeat "passes" times
+# mnt_options arg to -o mount options
+# server_path path to mount from server
+# mntpoint path to mount on locally
+# server_name server to mount from
+#
+Program=`basename $0`
+
+InitFile="./tests.init"
+USAGE="usage: $Program [-a|-b|-g|-s|-l|-c] [-f|-t|-n|-h] [-o mnt_options] [-p server_path] [-m mntpoint] [-N passes] server_name"
+
+# defaults
+. $InitFile
+export PATH CFLAGS LIBS MOUNT UMOUNT MNTOPTIONS FSOPT
+
+passes="1"
+
+set - `getopt abcfF:glhm:N:no:p:st $*`
+
+if [ $? != 0 ]
+then
+ echo $USAGE
+ exit 1
+fi
+for c in $*
+do
+ case $c in
+ -a|-b|-g|-s|-l) TEST=$c; shift ;;
+ -f|-n|-t) TESTARG=$c; shift ;;
+ -c) cachefs="yes"; shift ;;
+ -h) HARDLINKS=n; export HARDLINKS; shift ;;
+ -m) USRMNTPOINT=$2; shift; shift ;;
+ -o) MNTOPTIONS=$2; export MNTOPTIONS;
+ shift; shift ;;
+ -F) FSOPT=$2; export FSOPT;
+ shift; shift ;;
+ -p) SERVPATH=$2; shift; shift ;;
+ -N) passes=$2; shift; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+if test $# -gt 0
+then
+ SERVER=$1
+ shift
+ if test $# -gt 0
+ then
+ echo $USAGE
+ exit 1
+ fi
+fi
+
+# if no server specified, exit
+if test x$SERVER = x
+then
+ echo $USAGE
+ exit 1
+fi
+
+# If the user specified a particular moint point, use that.
+# Otherwise, use /mnt/<server_name>. The reason for the default name
+# is twofold:
+# 1. If the mount point is in / (e.g., /mnt.<server_name>) and the
+# server dies, things like getcwd() might hang.
+# 2. Having a server-specific name makes administration and concurrent
+# test runs a little easier.
+if test x$USRMNTPOINT != x
+then
+ MNTPOINT=$USRMNTPOINT
+else
+ MNTPOINT="/mnt/$SERVER"
+fi
+
+# If the mount point doesn't exist, create it and note that we should
+# remove it when done. This is a bit of a hack, but combined with
+# tying the mountpoint to the server name, it makes it easier to run
+# multiple tests at the same time.
+if test ! -d $MNTPOINT
+then
+ mkdir -p $MNTPOINT || mkdir $MNTPOINT
+ dormdir="yes"
+fi
+
+# make sure nothing is mounted on the mountpoint
+eval $UMOUNTCMD > /dev/null 2>&1
+
+if test -z "$cachefs"
+then
+ eval $MOUNTCMD
+else
+ if test -z "$CFSMOUNTCMD"
+ then
+ echo "error: no cachefs mount command (CFSMOUNTCMD) specified"
+ exit 1
+ else
+ eval $CFSMOUNTCMD
+ fi
+fi
+
+case $? in
+ 0)
+ ;;
+ *)
+ echo "Can't mount $SERVER:$SERVPATH on $MNTPOINT"
+ exit 1
+ ;;
+esac
+
+# mount doesn't always return error code if it fails, so lets
+# ask here just in case
+HOSTNAME=`hostname`
+HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'`
+NFSTESTDIR=$MNTPOINT/$HOSTNAME.test
+export NFSTESTDIR
+#echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC"
+#read ans
+ans="y"
+case $ans in
+ Y*|y*)
+ ;;
+ *)
+ echo "Terminating ($MNTPOINT left mounted)."
+ exit 1
+ ;;
+esac
+
+echo ""
+
+if test $passes = "1"
+then
+ passarg=""
+else
+ passarg="-N $passes"
+fi
+
+echo "sh ./runtests $passarg $TEST $TESTARG $NFSTESTDIR"
+sh ./runtests $passarg $TEST $TESTARG $NFSTESTDIR
+
+if [ $? -ne 0 ]
+then
+ echo Tests failed, leaving $MNTPOINT mounted 2>&1
+ exit 1
+fi
+
+eval $UMOUNTCMD
+if test x$dormdir = xyes
+then
+ rmdir $MNTPOINT
+fi
+
+exit 0
diff --git a/special/Makefile b/special/Makefile
new file mode 100644
index 0000000..77215c1
--- /dev/null
+++ b/special/Makefile
@@ -0,0 +1,123 @@
+#
+# @(#)Makefile 1.8 2003/12/29 Connectathon Testsuite
+# 1.4 Lachman ONC Test Suite source
+#
+
+TESTS=op_unlk op_ren op_chmod dupreq excltest negseek rename holey \
+ truncate nfsidem nstat stat stat2 touchn fstat rewind \
+ telldir bigfile bigfile2 freesp
+DOSRUNFILES = scripts/*.bat
+DOSBUILDFILES = console/*.bat console/*.mak dos/*.bat dos/*.mak
+DOSFILES = $(DOSRUNFILES) $(DOSBUILDFILES)
+DESTDIR=/no/such/path
+COPYFILES=runtests runtests.wrk READWIN.txt Makefile
+
+INCLUDES=../tests.h
+SUBRS=../basic/subr.o
+DEPS=$(INCLUDES) $(SUBRS)
+
+include ../tests.init
+
+all: $(TESTS)
+ if test ! -x runtests; then chmod a+x runtests; fi
+
+../basic/subr.o:
+ cd ../basic; make subr.o
+
+op_unlk: op_unlk.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+op_ren: op_ren.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+op_chmod: op_chmod.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+dupreq: dupreq.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+excltest: excltest.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+negseek: negseek.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+rename: rename.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+holey: holey.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+truncate: truncate.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+nfsidem: nfsidem.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+nstat: nstat.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+stat: stat.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+stat2: stat2.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+touchn: touchn.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+fstat: fstat.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+rewind: rewind.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+telldir: telldir.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+bigfile: bigfile.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+bigfile2: bigfile2.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+freesp: freesp.c $(DEPS)
+ $(CC) $(CFLAGS) -o $@ $@.c ../basic/subr.o $(LIBS)
+
+lint:
+ lint $(CFLAGS) op_unlk.c
+ lint $(CFLAGS) op_ren.c
+ lint $(CFLAGS) op_chmod.c
+ lint $(CFLAGS) dupreq.c
+ lint $(CFLAGS) excltest.c
+ lint $(CFLAGS) negseek.c
+ lint $(CFLAGS) rename.c
+ lint $(CFLAGS) holey.c
+ lint $(CFLAGS) truncate.c
+ lint $(CFLAGS) nfsidem.c
+ lint $(CFLAGS) nstat.c
+ lint $(CFLAGS) stat.c
+ lint $(CFLAGS) stat2.c
+ lint $(CFLAGS) touchn.c
+ lint $(CFLAGS) fstat.c
+ lint $(CFLAGS) rewind.c
+ lint $(CFLAGS) telldir.c
+ lint $(CFLAGS) bigfile.c
+ lint $(CFLAGS) bigfile2.c
+ lint $(CFLAGS) freesp.c
+
+clean:
+ rm -f *.o $(TESTS) testfile exctest.file holeyfile
+
+# "copy" can't depend on $(TESTS) because $(TESTS) depends on the
+# sources, and the sources might not be available (e.g., running the
+# tests from a tree that was created with "make copy"). (runtests
+# uses "make copy" to copy the tests over to the server.)
+copy:
+ cd $(DESTDIR); rm -f $(COPYFILES) $(TESTS)
+ cp $(COPYFILES) $(TESTS) $(DESTDIR)
+
+dist:
+ cd $(DESTDIR); rm -f $(COPYFILES) *.c $(DOSFILES)
+ cp $(COPYFILES) *.c $(DESTDIR)
+ tar cf - $(DOSFILES) | (cd $(DESTDIR); tar xfBp -)
diff --git a/special/READWIN.txt b/special/READWIN.txt
new file mode 100644
index 0000000..69ca95b
--- /dev/null
+++ b/special/READWIN.txt
@@ -0,0 +1,24 @@
+@(#)READWIN.txt 1.3 00/01/04 Connectathon Testsuite
+
+Certain tests do not run in the DOS/Windows environmant, due to
+limitations or implementation differences between DOS and Unix:
+
+ dupreq
+ fstat
+ nfsidem
+ op_ren (open-rename)
+ rewind
+ truncate
+
+Also, the following tests do not appear to run under Windows, though
+they do appear to run under DOS:
+
+ negseek
+
+The following tests have not been ported to DOS or Windows because
+nobody has tried:
+
+ telldir
+ bigfile
+ bigfile2
+ freesp
diff --git a/special/bigfile.c b/special/bigfile.c
new file mode 100644
index 0000000..956eb5f
--- /dev/null
+++ b/special/bigfile.c
@@ -0,0 +1,388 @@
+/*
+ * @(#)bigfile.c 1.2 98/12/19 Connectathon Testsuite
+ */
+
+/*
+ * Write and reread a large file. This potentially covers a few problems
+ * that have appeared in the past:
+ * - inability of server to commit a large file range with one RPC
+ * - client's dirtying memory faster than it can clean it
+ * - server's returning bogus file attributes, confusing the client
+ * - client and server not propagating "filesystem full" errors back to the
+ * application
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#ifdef MMAP
+#include <sys/mman.h>
+#endif
+
+#include "../tests.h"
+
+static char usage[] = "usage: bigfile [-s size_in_MB] filename";
+
+static off_t file_size = 30 * 1024 * 1024;
+
+static char *filename; /* name of test file */
+static int buffer_size = 8192; /* size of read/write buffer */
+
+#ifdef MMAP
+static long pagesize;
+#endif
+
+static void dump_buf ARGS_((char *, int));
+static void io_error ARGS_((int, char *));
+static unsigned char testval ARGS_((off_t));
+static int verify ARGS_((char *, long, int));
+static void write_read ARGS_((int));
+#ifdef MMAP
+static void write_read_mmap ARGS_((int));
+#endif
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ off_t size;
+ int fd;
+ extern int optind;
+ extern char *optarg;
+
+#ifdef MMAP
+ pagesize = sysconf(_SC_PAGESIZE);
+ if (pagesize < 0) {
+ fprintf(stderr, "can't get page size\n");
+ exit(1);
+ }
+#endif
+
+ while ((c = getopt(argc, argv, "s:")) != EOF)
+ switch (c) {
+ case 's':
+ size = atol(optarg) * 1024 * 1024;
+ if (size > 0)
+ file_size = size;
+ break;
+ case '?':
+ fprintf(stderr, "%s\n", usage);
+ exit(1);
+ break;
+ }
+ if (optind != argc - 1) {
+ fprintf(stderr, "%s\n", usage);
+ exit(1);
+ }
+ filename = argv[optind];
+ fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ if (fd < 0) {
+ fprintf(stderr, "can't create %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+
+ write_read(fd);
+#ifdef MMAP
+ write_read_mmap(fd);
+#endif
+
+ if (unlink(filename) < 0) {
+ fprintf(stderr, "can't unlink %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+ exit(0);
+}
+
+/*
+ * Write and then reread the file, using regular read/write calls. If the
+ * filesystem fills up, exit with a warning message. For any other error,
+ * exit with an error message.
+ */
+
+static void
+write_read(fd)
+ int fd;
+{
+ long numbufs = file_size / buffer_size;
+ char *buf;
+ int i;
+
+ buf = malloc(buffer_size);
+ if (buf == 0) {
+ fprintf(stderr, "can't allocate read/write buffer\n");
+ exit(1);
+ }
+
+ /*
+ * Fill the file with unsigned chars. Change the value for each
+ * buffer written.
+ */
+
+ for (i = 0; i < numbufs; i++) {
+ unsigned char val = testval(i);
+ int bytes_written;
+
+ memset(buf, val, buffer_size);
+ bytes_written = write(fd, buf, buffer_size);
+ if (bytes_written < 0) {
+ int error = errno;
+ char errmsg[1024];
+
+ sprintf(errmsg, "write to %s failed: %s",
+ filename, strerror(errno));
+ io_error(error, errmsg);
+ } else if (bytes_written < buffer_size) {
+ fprintf(stderr, "short write (%d) to %s\n",
+ bytes_written, filename);
+ exit(1);
+ }
+ }
+
+ if (fsync(fd) < 0) {
+ char errmsg[1024];
+ int error = errno;
+
+ sprintf(errmsg, "can't sync %s: %s", filename,
+ strerror(error));
+ io_error(error, errmsg);
+ }
+
+ /*
+ * Close and reopen the file, in case that prompts the client to
+ * throw anything away.
+ */
+
+ if (close(fd) < 0) {
+ char errmsg[1024];
+ int error = errno;
+
+ sprintf(errmsg, "can't close %s: %s", filename,
+ strerror(error));
+ io_error(error, errmsg);
+ }
+ fd = open(filename, O_RDWR, 0666);
+ if (fd < 0) {
+ fprintf(stderr, "can't reopen %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+
+ /*
+ * Reread the file and make sure it has correct bits.
+ */
+
+ for (i = 0; i < numbufs; i++) {
+ unsigned char val = testval(i);
+ int bytes_read;
+
+ if (lseek(fd, i * buffer_size, SEEK_SET) < 0) {
+ fprintf(stderr, "seek to %ld failed: %s\n",
+ (long)i * buffer_size,
+ strerror(errno));
+ exit(1);
+ }
+ bytes_read = read(fd, buf, buffer_size);
+ if (bytes_read < 0) {
+ int error = errno;
+ char errmsg[1024];
+
+ sprintf(errmsg, "read from %s failed: %s",
+ filename, strerror(errno));
+ io_error(error, errmsg);
+ } else if (bytes_read < buffer_size) {
+ fprintf(stderr, "short read (%d) to %s\n",
+ bytes_read, filename);
+ exit(1);
+ }
+ if (!verify(buf, buffer_size, val)) {
+ fprintf(stderr, "verify failed, offset %ld; ",
+ (long)i * buffer_size);
+ fprintf(stderr, "expected %x, got \n",
+ val);
+ dump_buf(buf, buffer_size);
+ exit(1);
+ }
+ }
+}
+
+/*
+ * Return non-zero if the given buffer is full of the given value.
+ * Otherwise, return zero.
+ */
+
+static int
+verify(buf, bufsize, val)
+ char *buf;
+ long bufsize;
+ unsigned char val;
+{
+ int i;
+
+ for (i = 0; i < bufsize; i++) {
+ if ((unsigned char)(buf[i]) != val)
+ return (0);
+ }
+
+ return (1);
+}
+
+/*
+ * Print the contents of the buffer in hex to stderr.
+ */
+
+static void
+dump_buf(buf, bufsize)
+ char *buf;
+ int bufsize;
+{
+ int i;
+
+ for (i = 0; i < bufsize; i++) {
+ fprintf(stderr, "%x ", buf[i]);
+ if ((i + 1) % 10 == 0)
+ fprintf(stderr, "\n");
+ }
+ fprintf(stderr, "\n");
+}
+
+/*
+ * Write out the given error message and exit. If the error is because
+ * there is no more space, flag it as a warning, and delete the file.
+ * Otherwise, flag it as an error and leave the file alone.
+ */
+
+static void
+io_error(error, errmsg)
+ int error; /* errno value */
+ char *errmsg;
+{
+ if (error == EDQUOT || error == ENOSPC)
+ fprintf(stderr, "Warning: can't complete test: ");
+ else
+ fprintf(stderr, "Error: ");
+ fprintf(stderr, "%s\n", errmsg);
+
+ if (error == EDQUOT || error == ENOSPC)
+ unlink(filename);
+
+ exit(1);
+}
+
+/*
+ * Return the test value for the given offset.
+ */
+
+static unsigned char
+testval(offset)
+ off_t offset;
+{
+ return 'a' + (offset % 26);
+}
+
+#ifdef MMAP
+
+/*
+ * Write and then randomly reread the file, by mapping it. Same error
+ * handling as write_read().
+ */
+
+static void
+write_read_mmap(fd)
+ int fd;
+{
+ long numpages = file_size / pagesize;
+ char *buf;
+ int i;
+
+ /*
+ * Truncate the file and then map it in (the entire file). Then
+ * fill it with unsigned chars, the same as write_read().
+ */
+
+ if (ftruncate(fd, 0) < 0) {
+ fprintf(stderr, "can't truncate %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+ if (ftruncate(fd, file_size) < 0) {
+ int error = errno;
+ char errmsg[1024];
+
+ sprintf(errmsg, "write to %s failed: %s",
+ filename, strerror(errno));
+ io_error(error, errmsg);
+ }
+ buf = mmap(0, file_size, PROT_READ | PROT_WRITE,
+ MAP_SHARED, fd, 0);
+ if (buf == (char *)MAP_FAILED) {
+ fprintf(stderr, "can't map %s for writing: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+
+ for (i = 0; i < numpages; i++) {
+ unsigned char val = testval(i);
+
+ memset(buf + i * pagesize, val, pagesize);
+ }
+
+ if (msync(buf, file_size, MS_SYNC | MS_INVALIDATE) < 0) {
+ char errmsg[1024];
+ int error = errno;
+
+ sprintf(errmsg, "can't msync %s: %s", filename,
+ strerror(error));
+ io_error(error, errmsg);
+ }
+ if (munmap(buf, file_size) < 0) {
+ char errmsg[1024];
+ int error = errno;
+
+ sprintf(errmsg, "can't munmap %s: %s", filename,
+ strerror(error));
+ io_error(error, errmsg);
+ }
+
+ /*
+ * Reread the file, a page at a time, and make sure it has correct
+ * bits.
+ */
+
+ for (i = 0; i < numpages; i++) {
+ unsigned char val = testval(i);
+
+ buf = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd,
+ i * pagesize);
+ if (buf == (char *)MAP_FAILED) {
+ fprintf(stderr, "can't map %s for reading: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+ if (!verify(buf, pagesize, val)) {
+ fprintf(stderr,
+ "verify of mapped file failed, offset %ld; ",
+ (long)i * pagesize);
+ fprintf(stderr, "expected %x, got \n",
+ val);
+ dump_buf(buf, pagesize);
+ exit(1);
+ }
+
+ if (munmap(buf, pagesize) < 0) {
+ fprintf(stderr,
+ "can't unmap file after verifying: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ }
+}
+
+#endif /* MMAP */
diff --git a/special/bigfile2.c b/special/bigfile2.c
new file mode 100644
index 0000000..09d1704
--- /dev/null
+++ b/special/bigfile2.c
@@ -0,0 +1,192 @@
+/*
+ * @(#)bigfile2.c 1.6 2003/12/30 Connectathon Testsuite
+ */
+
+/*
+ * Write a holey file that walks around a couple file size edges: 2GB (31
+ * bits) and 4GB (32 bits). Note that this test only makes sense if the
+ * platform supports files with offsets bigger than 31 bits (32-bit signed
+ * integer).
+ */
+
+/*
+ * Explicitly request Large File interfaces. If we omit this, some
+ * implementations (e.g., Red Hat Linux 6.[12], HPUX 11.0) define
+ * _LFS64_LARGEFILE but don't define all the associated types.
+ */
+#define _LARGEFILE64_SOURCE 1
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "../tests.h"
+
+#define HIGH_WORD(n) ((unsigned int)(((unsigned int)((n) >> 32)) & 0xffffffff))
+#define LOW_WORD(n) ((unsigned int)((unsigned int)(n) & 0xffffffff))
+
+static char usage[] = "usage: bigfile2 filename";
+
+static char *filename;
+
+/*
+ * If the native routines support 64-bit offsets, then just use them.
+ * Otherwise, use the Large File Summit transitional routines.
+ */
+
+#ifdef NATIVE64
+#define LSEEK lseek
+#define FSTAT fstat
+typedef off_t offset64;
+typedef struct stat stat_info;
+#else
+#ifdef _LFS64_LARGEFILE
+#define LSEEK lseek64
+#define FSTAT fstat64
+typedef off64_t offset64;
+typedef struct stat64 stat_info;
+#endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) || defined(NATIVE64)
+static void check_around ARGS_((int fd, offset64 where));
+#endif
+
+#if !defined(_LFS64_LARGEFILE) && !defined(NATIVE64)
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ fprintf(stderr, "Skipping this test:\n");
+ fprintf(stderr,
+ "The platform doesn't appear to support 64-bit offsets.\n");
+ exit(0);
+}
+
+#else /* 64-bit support */
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int fd;
+ int oflags;
+
+ /* O_SYNC is to ensure detection of problems when writing */
+ oflags = O_RDWR | O_CREAT | O_TRUNC | O_SYNC;
+
+ if (argc != 2) {
+ fprintf(stderr, "%s\n", usage);
+ exit(1);
+ }
+ filename = argv[1];
+
+#ifdef _LFS64_LARGEFILE
+ oflags |= O_LARGEFILE;
+#endif
+ fd = open(filename, oflags, 0666);
+ if (fd < 0) {
+ fprintf(stderr, "can't open %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+
+ check_around(fd, ((offset64)0x7fffffff) + 1);
+
+ if (ftruncate(fd, 0) < 0) {
+ perror("can't truncate");
+ exit(1);
+ }
+
+ check_around(fd, ((offset64)(0xffffffffU)) + 1);
+
+ unlink(filename);
+ exit(0);
+}
+
+/*
+ * Write 5 bytes, one at a time, starting at "where"-2. For each byte,
+ * verify that the file length is what we expect and that we can read the
+ * byte back again.
+ */
+
+static void
+check_around(fd, where)
+ int fd;
+ offset64 where;
+{
+ char buf;
+ int i;
+ offset64 start = where - 2;
+ int numbytes = 5;
+ stat_info statbuf;
+ char basechar = '0';
+
+ if (LSEEK(fd, start, SEEK_SET) < 0) {
+ fprintf(stderr, "can't do initial seek to 0x%x%08x: %s\n",
+ HIGH_WORD(start), LOW_WORD(start),
+ strerror(errno));
+ exit(1);
+ }
+
+ for (i = 0; i < numbytes; i++) {
+ buf = basechar + i;
+ if (write(fd, &buf, 1) < 0) {
+ fprintf(stderr, "can't write at 0x%x%08x: %s\n",
+ HIGH_WORD(start + i),
+ LOW_WORD(start + i),
+ strerror(errno));
+ exit(1);
+ }
+ if (FSTAT(fd, &statbuf) < 0) {
+ fprintf(stderr, "can't stat %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+ if (statbuf.st_size != start + i + 1) {
+ fprintf(stderr,
+ "expected size 0x%x%08x, got 0x%x%08x\n",
+ HIGH_WORD(start + i + 1),
+ LOW_WORD(start + i + 1),
+ HIGH_WORD(statbuf.st_size),
+ LOW_WORD(statbuf.st_size));
+ exit(1);
+ }
+ }
+
+ for (i = 0; i < numbytes; i++) {
+ if (LSEEK(fd, start + i, SEEK_SET) < 0) {
+ fprintf(stderr,
+ "can't seek to 0x%x%08x to reread file: %s\n",
+ HIGH_WORD(start + i),
+ LOW_WORD(start + i),
+ strerror(errno));
+ exit(1);
+ }
+ if (read(fd, &buf, 1) < 0) {
+ fprintf(stderr, "can't read at offset 0x%x%08x: %s\n",
+ HIGH_WORD(start + i),
+ LOW_WORD(start + i),
+ strerror(errno));
+ exit(1);
+ }
+ if (buf != basechar + i) {
+ fprintf(stderr, "expected `%c', got `%c' ",
+ basechar + i, buf);
+ fprintf(stderr, "at 0x%x%08x\n",
+ HIGH_WORD(start + i),
+ LOW_WORD(start + i));
+ exit(1);
+ }
+ }
+}
+
+#endif /* 64-bit support */
diff --git a/special/console/build.bat b/special/console/build.bat
new file mode 100644
index 0000000..c8c2bb4
--- /dev/null
+++ b/special/console/build.bat
@@ -0,0 +1,41 @@
+@echo off
+rem @(#)build.bat 1.1 98/10/26 Connectathon Testsuite
+
+echo Cthon Test Suite NMAKE Build Script for Microsoft Visual C++ 2.0
+
+rem This batch file is used to build the SPECIAL components of the
+rem Connectathon testsuite. Each file is compiled and the output of
+rem the compile saved in a .log file. Please review the readme.txt for
+rem particular issues in building for the Dos/Windows environment.
+
+rem The Cthon Test Suite for Windows can also be build with Microsoft
+rem Visual C++ 2.0 Workbench. This is different than the C++ 1.5 case
+rem when building for DOS. However, this script was created to run
+rem NMAKE with the makefiles instead, as it is faster in batch mode.
+rem This requires that the PATH, LIB and INCLUDE environment
+rem variables be set up correctly, or their location passed as
+rem parameter %1 to this script.
+
+set LIB=%LIB%;%1\LIB
+set INCLUDE=%INCLUDE%;%1\INCLUDE
+set PATH=%PATH%;%1\BIN
+
+COPY ..\..\BASIC\CONSOLE\SUBR.OBJ .
+
+NMAKE DUPREQ.MAK > DUPREQ.LOG
+NMAKE EXCLTEST.mak > EXCLTEST.LOG
+NMAKE FSTAT.mak > FSTAT.LOG
+NMAKE HOLEY.mak > HOLEY.LOG
+NMAKE NEGSEEK.mak > NEGSEEK.LOG
+NMAKE NFSIDEM.mak > NFSIDEM.LOG
+NMAKE NSTAT.mak > NSTAT.LOG
+NMAKE RENAME.mak > RENAME.LOG
+NMAKE REWIND.mak > REWIND.LOG
+NMAKE STAT.mak > STAT.LOG
+NMAKE STAT2.mak > STAT2.LOG
+NMAKE TOUCHN.mak > TOUCHN.LOG
+NMAKE TRUNCATE.mak > TRUNCATE.LOG
+NMAKE OP_REN.mak > OP_REN.LOG
+NMAKE OP_UNLK.mak > OP_UNLK.LOG
+NMAKE OP_CHMOD.mak > OP_CHMOD.LOG
+
diff --git a/special/console/build1.bat b/special/console/build1.bat
new file mode 100644
index 0000000..63a7e39
--- /dev/null
+++ b/special/console/build1.bat
@@ -0,0 +1,12 @@
+@echo off
+rem @(#)build1.bat 1.1 98/10/26 Connectathon Testsuite
+
+echo Cthon Test Suite NMAKE Build Script for Microsoft Visual C++ 2.0
+
+rem This batch file is used to build ONE of the SPECIAL components of
+rem the Connectathon testsuite. Please review the readme.txt for
+rem particular issues in building for the Dos/Windows environment.
+
+NMAKE %1.MAK > %1.LOG
+TYPE %1.LOG
+DIR %1.exe
diff --git a/special/console/dupreq.mak b/special/console/dupreq.mak
new file mode 100755
index 0000000..1cfafed
--- /dev/null
+++ b/special/console/dupreq.mak
@@ -0,0 +1,182 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "dupreq.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\dupreq.exe .\WinRel\dupreq.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/\
+ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"dupreq.bsc"
+BSC32_SBRS= \
+ .\WinRel\dupreq.SBR
+
+.\WinRel\dupreq.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"dupreq.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"dupreq.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\dupreq.OBJ \
+ .\WinRel\SUBR.OBJ
+
+.\WinRel\dupreq.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\dupreq.exe .\WinDebug\dupreq.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"dupreq.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"dupreq.bsc"
+BSC32_SBRS= \
+ .\WinDebug\dupreq.SBR
+
+.\WinDebug\dupreq.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"dupreq.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"dupreq.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\dupreq.OBJ \
+ .\WINDEBUG\SUBR.OBJ
+
+.\WinDebug\dupreq.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=..\dupreq.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\dupreq.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\dupreq.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\WINDEBUG\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/excltest.mak b/special/console/excltest.mak
new file mode 100755
index 0000000..d428ec0
--- /dev/null
+++ b/special/console/excltest.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "EXCLTEST.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\EXCLTEST.exe .\WinRel\EXCLTEST.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"EXCLTEST.bsc"
+BSC32_SBRS= \
+ .\WinRel\EXCLTEST.SBR
+
+.\WinRel\EXCLTEST.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"EXCLTEST.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"EXCLTEST.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\EXCLTEST.OBJ
+
+.\WinRel\EXCLTEST.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\EXCLTEST.exe .\WinDebug\EXCLTEST.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"EXCLTEST.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"EXCLTEST.bsc"
+BSC32_SBRS= \
+ .\WinDebug\EXCLTEST.SBR
+
+.\WinDebug\EXCLTEST.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"EXCLTEST.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"EXCLTEST.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\EXCLTEST.OBJ
+
+.\WinDebug\EXCLTEST.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\EXCLTEST.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\EXCLTEST.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\EXCLTEST.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/fstat.mak b/special/console/fstat.mak
new file mode 100755
index 0000000..9fc0dc6
--- /dev/null
+++ b/special/console/fstat.mak
@@ -0,0 +1,166 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "FSTAT.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/FSTAT.exe $(OUTDIR)/FSTAT.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"FSTAT.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/FSTAT.SBR
+
+$(OUTDIR)/FSTAT.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"FSTAT.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"FSTAT.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/FSTAT.OBJ
+
+$(OUTDIR)/FSTAT.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/FSTAT.exe $(OUTDIR)/FSTAT.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"FSTAT.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"FSTAT.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/FSTAT.SBR
+
+$(OUTDIR)/FSTAT.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"FSTAT.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"FSTAT.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/FSTAT.OBJ
+
+$(OUTDIR)/FSTAT.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\FSTAT.C
+
+$(INTDIR)/FSTAT.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/holey.mak b/special/console/holey.mak
new file mode 100755
index 0000000..8922327
--- /dev/null
+++ b/special/console/holey.mak
@@ -0,0 +1,166 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "HOLEY.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/HOLEY.exe $(OUTDIR)/HOLEY.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"HOLEY.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/HOLEY.SBR
+
+$(OUTDIR)/HOLEY.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"HOLEY.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"HOLEY.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/HOLEY.OBJ
+
+$(OUTDIR)/HOLEY.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/HOLEY.exe $(OUTDIR)/HOLEY.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"HOLEY.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"HOLEY.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/HOLEY.SBR
+
+$(OUTDIR)/HOLEY.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"HOLEY.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"HOLEY.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/HOLEY.OBJ
+
+$(OUTDIR)/HOLEY.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\HOLEY.C
+
+$(INTDIR)/HOLEY.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/negseek.mak b/special/console/negseek.mak
new file mode 100755
index 0000000..f8a1fbd
--- /dev/null
+++ b/special/console/negseek.mak
@@ -0,0 +1,166 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "NEGSEEK.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/NEGSEEK.exe $(OUTDIR)/NEGSEEK.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"NEGSEEK.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/NEGSEEK.SBR
+
+$(OUTDIR)/NEGSEEK.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"NEGSEEK.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"NEGSEEK.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/NEGSEEK.OBJ
+
+$(OUTDIR)/NEGSEEK.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/NEGSEEK.exe $(OUTDIR)/NEGSEEK.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"NEGSEEK.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"NEGSEEK.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/NEGSEEK.SBR
+
+$(OUTDIR)/NEGSEEK.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"NEGSEEK.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"NEGSEEK.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/NEGSEEK.OBJ
+
+$(OUTDIR)/NEGSEEK.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\NEGSEEK.C
+
+$(INTDIR)/NEGSEEK.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/nfsidem.mak b/special/console/nfsidem.mak
new file mode 100755
index 0000000..71e03f1
--- /dev/null
+++ b/special/console/nfsidem.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "NFSIDEM.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\NFSIDEM.exe .\WinRel\NFSIDEM.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"NFSIDEM.bsc"
+BSC32_SBRS= \
+ .\WinRel\NFSIDEM.SBR
+
+.\WinRel\NFSIDEM.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"NFSIDEM.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"NFSIDEM.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\NFSIDEM.OBJ
+
+.\WinRel\NFSIDEM.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\NFSIDEM.exe .\WinDebug\NFSIDEM.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"NFSIDEM.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"NFSIDEM.bsc"
+BSC32_SBRS= \
+ .\WinDebug\NFSIDEM.SBR
+
+.\WinDebug\NFSIDEM.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"NFSIDEM.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"NFSIDEM.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\NFSIDEM.OBJ
+
+.\WinDebug\NFSIDEM.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\NFSIDEM.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\NFSIDEM.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\NFSIDEM.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/nstat.mak b/special/console/nstat.mak
new file mode 100755
index 0000000..a3e5e67
--- /dev/null
+++ b/special/console/nstat.mak
@@ -0,0 +1,173 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "NSTAT.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/NSTAT.exe $(OUTDIR)/NSTAT.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"NSTAT.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/NSTAT.SBR
+
+$(OUTDIR)/NSTAT.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"NSTAT.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"NSTAT.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/NSTAT.OBJ \
+ .\SUBR.OBJ
+
+$(OUTDIR)/NSTAT.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/NSTAT.exe $(OUTDIR)/NSTAT.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"NSTAT.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"NSTAT.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/NSTAT.SBR
+
+$(OUTDIR)/NSTAT.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"NSTAT.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"NSTAT.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/NSTAT.OBJ \
+ .\SUBR.OBJ
+
+$(OUTDIR)/NSTAT.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\NSTAT.C
+
+$(INTDIR)/NSTAT.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/op_chmod.mak b/special/console/op_chmod.mak
new file mode 100755
index 0000000..fbb7dfa
--- /dev/null
+++ b/special/console/op_chmod.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "OP_CHMOD.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\OP_CHMOD.exe .\WinRel\OP_CHMOD.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"OP_CHMOD.bsc"
+BSC32_SBRS= \
+ .\WinRel\OP_CHMOD.SBR
+
+.\WinRel\OP_CHMOD.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"OP_CHMOD.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"OP_CHMOD.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\OP_CHMOD.OBJ
+
+.\WinRel\OP_CHMOD.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\OP_CHMOD.exe .\WinDebug\OP_CHMOD.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"OP_CHMOD.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"OP_CHMOD.bsc"
+BSC32_SBRS= \
+ .\WinDebug\OP_CHMOD.SBR
+
+.\WinDebug\OP_CHMOD.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"OP_CHMOD.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"OP_CHMOD.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\OP_CHMOD.OBJ
+
+.\WinDebug\OP_CHMOD.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\OP_CHMOD.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\OP_CHMOD.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\OP_CHMOD.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/op_ren.mak b/special/console/op_ren.mak
new file mode 100755
index 0000000..46beb15
--- /dev/null
+++ b/special/console/op_ren.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "OP_REN.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\OP_REN.exe .\WinRel\OP_REN.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"OP_REN.bsc"
+BSC32_SBRS= \
+ .\WinRel\OP_REN.SBR
+
+.\WinRel\OP_REN.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"OP_REN.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"OP_REN.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\OP_REN.OBJ
+
+.\WinRel\OP_REN.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\OP_REN.exe .\WinDebug\OP_REN.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"OP_REN.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"OP_REN.bsc"
+BSC32_SBRS= \
+ .\WinDebug\OP_REN.SBR
+
+.\WinDebug\OP_REN.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"OP_REN.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"OP_REN.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\OP_REN.OBJ
+
+.\WinDebug\OP_REN.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\OP_REN.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\OP_REN.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\OP_REN.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/op_unlk.mak b/special/console/op_unlk.mak
new file mode 100755
index 0000000..d04100e
--- /dev/null
+++ b/special/console/op_unlk.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "OP_UNLK.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\OP_UNLK.exe .\WinRel\OP_UNLK.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"OP_UNLK.bsc"
+BSC32_SBRS= \
+ .\WinRel\OP_UNLK.SBR
+
+.\WinRel\OP_UNLK.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"OP_UNLK.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"OP_UNLK.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\OP_UNLK.OBJ
+
+.\WinRel\OP_UNLK.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\OP_UNLK.exe .\WinDebug\OP_UNLK.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"OP_UNLK.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"OP_UNLK.bsc"
+BSC32_SBRS= \
+ .\WinDebug\OP_UNLK.SBR
+
+.\WinDebug\OP_UNLK.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"OP_UNLK.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"OP_UNLK.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\OP_UNLK.OBJ
+
+.\WinDebug\OP_UNLK.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\OP_UNLK.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\OP_UNLK.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\OP_UNLK.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/rename.mak b/special/console/rename.mak
new file mode 100755
index 0000000..814b922
--- /dev/null
+++ b/special/console/rename.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "RENAME.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\RENAME.exe .\WinRel\RENAME.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"RENAME.bsc"
+BSC32_SBRS= \
+ .\WinRel\RENAME.SBR
+
+.\WinRel\RENAME.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"RENAME.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"RENAME.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\RENAME.OBJ
+
+.\WinRel\RENAME.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\RENAME.exe .\WinDebug\RENAME.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"RENAME.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"RENAME.bsc"
+BSC32_SBRS= \
+ .\WinDebug\RENAME.SBR
+
+.\WinDebug\RENAME.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"RENAME.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"RENAME.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\RENAME.OBJ
+
+.\WinDebug\RENAME.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\RENAME.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\RENAME.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\RENAME.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/rewind.mak b/special/console/rewind.mak
new file mode 100755
index 0000000..61eceb1
--- /dev/null
+++ b/special/console/rewind.mak
@@ -0,0 +1,168 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "REWIND.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/REWIND.exe $(OUTDIR)/REWIND.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"REWIND.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/REWIND.SBR
+
+$(OUTDIR)/REWIND.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"REWIND.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"REWIND.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/REWIND.OBJ
+
+$(OUTDIR)/REWIND.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/REWIND.exe $(OUTDIR)/REWIND.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"REWIND.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"REWIND.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/REWIND.SBR
+
+$(OUTDIR)/REWIND.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"REWIND.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"REWIND.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/REWIND.OBJ
+
+$(OUTDIR)/REWIND.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\REWIND.C
+DEP_REWIN=\
+ \CTHON\97\SPECIAL\SRC\TESTS.H
+
+$(INTDIR)/REWIND.OBJ : $(SOURCE) $(DEP_REWIN) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/stat.mak b/special/console/stat.mak
new file mode 100755
index 0000000..8d99554
--- /dev/null
+++ b/special/console/stat.mak
@@ -0,0 +1,173 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "STAT.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/STAT.exe $(OUTDIR)/STAT.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"STAT.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/STAT.SBR
+
+$(OUTDIR)/STAT.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"STAT.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"STAT.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/STAT.OBJ \
+ .\SUBR.OBJ
+
+$(OUTDIR)/STAT.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/STAT.exe $(OUTDIR)/STAT.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"STAT.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"STAT.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/STAT.SBR
+
+$(OUTDIR)/STAT.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"STAT.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"STAT.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/STAT.OBJ \
+ .\SUBR.OBJ
+
+$(OUTDIR)/STAT.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\STAT.C
+
+$(INTDIR)/STAT.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/stat2.mak b/special/console/stat2.mak
new file mode 100755
index 0000000..2f8eeed
--- /dev/null
+++ b/special/console/stat2.mak
@@ -0,0 +1,173 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "STAT2.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : $(OUTDIR)/STAT2.exe $(OUTDIR)/STAT2.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"STAT2.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/STAT2.SBR
+
+$(OUTDIR)/STAT2.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"STAT2.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"STAT2.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/STAT2.OBJ \
+ .\SUBR.OBJ
+
+$(OUTDIR)/STAT2.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : $(OUTDIR)/STAT2.exe $(OUTDIR)/STAT2.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"STAT2.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"STAT2.bsc"
+BSC32_SBRS= \
+ $(INTDIR)/STAT2.SBR
+
+$(OUTDIR)/STAT2.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"STAT2.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"STAT2.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ $(INTDIR)/STAT2.OBJ \
+ .\SUBR.OBJ
+
+$(OUTDIR)/STAT2.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\STAT2.C
+
+$(INTDIR)/STAT2.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\SUBR.OBJ
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/touchn.mak b/special/console/touchn.mak
new file mode 100755
index 0000000..bf954e5
--- /dev/null
+++ b/special/console/touchn.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TOUCHN.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TOUCHN.exe .\WinRel\TOUCHN.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TOUCHN.bsc"
+BSC32_SBRS= \
+ .\WinRel\TOUCHN.SBR
+
+.\WinRel\TOUCHN.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TOUCHN.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TOUCHN.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TOUCHN.OBJ
+
+.\WinRel\TOUCHN.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TOUCHN.exe .\WinDebug\TOUCHN.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TOUCHN.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TOUCHN.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TOUCHN.SBR
+
+.\WinDebug\TOUCHN.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TOUCHN.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TOUCHN.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TOUCHN.OBJ
+
+.\WinDebug\TOUCHN.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\TOUCHN.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TOUCHN.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TOUCHN.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/console/truncate.mak b/special/console/truncate.mak
new file mode 100755
index 0000000..766a8ef
--- /dev/null
+++ b/special/console/truncate.mak
@@ -0,0 +1,175 @@
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "TRUNCATE.MAK" CFG="Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "WinRel"
+# PROP BASE Intermediate_Dir "WinRel"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "WinRel"
+# PROP Intermediate_Dir "WinRel"
+OUTDIR=.\WinRel
+INTDIR=.\WinRel
+
+ALL : .\WinRel\TRUNCATE.exe .\WinRel\TRUNCATE.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
+CPP_OBJS=.\WinRel/
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TRUNCATE.bsc"
+BSC32_SBRS= \
+ .\WinRel\TRUNCATE.SBR
+
+.\WinRel\TRUNCATE.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /MACHINE:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TRUNCATE.pdb" /MACHINE:I386\
+ /OUT:$(OUTDIR)/"TRUNCATE.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinRel\TRUNCATE.OBJ
+
+.\WinRel\TRUNCATE.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "WinDebug"
+# PROP BASE Intermediate_Dir "WinDebug"
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "WinDebug"
+# PROP Intermediate_Dir "WinDebug"
+OUTDIR=.\WinDebug
+INTDIR=.\WinDebug
+
+ALL : .\WinDebug\TRUNCATE.exe .\WinDebug\TRUNCATE.bsc
+
+$(OUTDIR) :
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+# ADD BASE CPP /nologo /w /W0 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# ADD CPP /nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
+# SUBTRACT CPP /YX
+CPP_PROJ=/nologo /w /W0 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
+ /FR$(INTDIR)/ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"TRUNCATE.pdb" /c
+CPP_OBJS=.\WinDebug/
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"TRUNCATE.bsc"
+BSC32_SBRS= \
+ .\WinDebug\TRUNCATE.SBR
+
+.\WinDebug\TRUNCATE.bsc : $(OUTDIR) $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
+# SUBTRACT LINK32 /INCREMENTAL:no
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /NOLOGO\
+ /SUBSYSTEM:console /INCREMENTAL:yes /PDB:$(OUTDIR)/"TRUNCATE.pdb" /DEBUG\
+ /MACHINE:I386 /OUT:$(OUTDIR)/"TRUNCATE.exe"
+DEF_FILE=
+LINK32_OBJS= \
+ .\WinDebug\TRUNCATE.OBJ
+
+.\WinDebug\TRUNCATE.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Group "Source Files"
+
+################################################################################
+# Begin Source File
+
+SOURCE=\CTHON\97\SPECIAL\SRC\TRUNCATE.C
+
+!IF "$(CFG)" == "Win32 Release"
+
+.\WinRel\TRUNCATE.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ELSEIF "$(CFG)" == "Win32 Debug"
+
+.\WinDebug\TRUNCATE.OBJ : $(SOURCE) $(INTDIR)
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Project
+################################################################################
diff --git a/special/dos/build.bat b/special/dos/build.bat
new file mode 100644
index 0000000..df32e9a
--- /dev/null
+++ b/special/dos/build.bat
@@ -0,0 +1,44 @@
+@echo off
+rem @(#)build.bat 1.1 98/10/26 Connectathon Testsuite
+
+rem Cthon Test Suite NMAKE Build Script for Microsoft Visual C++ 1.5
+
+rem This batch file is used to build the SPECIAL components of the
+rem Connectathon testsuite. Each file is compiled and the output of
+rem the compile saved in a .log file. Please review the readme.txt for
+rem particular issues in building for the Dos/Windows environment.
+
+rem The Cthon Test Suite can not be build reliably with Microsoft
+rem Visual C++ Workbench. This is due to Workbench rebuilding the
+rem dependency files if the source is moved from one location to
+rem another. When this occurs the Unix format pathnames for the
+rem Unix include files are added into the makefile and when the
+rem compiler runs it complains it can not find the files. So this
+rem script was created to run NMAKE with the makefiles instead.
+rem This requires that the PATH, LIB and INCLUDE environment
+rem variables be set up correctly, or their location passed as
+rem parameter %1 to this script.
+
+set LIB=%LIB%;%1\LIB
+set INCLUDE=%INCLUDE%;%1\INCLUDE
+set PATH=%PATH%;%1\BIN
+
+COPY ..\..\BASIC\DOS\SUBR.OBJ .
+
+NMAKE DUPREQ.MAK > DUPREQ.LOG
+NMAKE EXCLTEST.mak > EXCLTEST.LOG
+NMAKE FSTAT.mak > FSTAT.LOG
+NMAKE HOLEY.mak > HOLEY.LOG
+NMAKE NEGSEEK.mak > NEGSEEK.LOG
+NMAKE NFSIDEM.mak > NFSIDEM.LOG
+NMAKE NSTAT.mak > NSTAT.LOG
+NMAKE RENAME.mak > RENAME.LOG
+NMAKE REWIND.mak > REWIND.LOG
+NMAKE STAT.mak > STAT.LOG
+NMAKE STAT2.mak > STAT2.LOG
+NMAKE TOUCHN.mak > TOUCHN.LOG
+NMAKE TRUNCATE.mak > TRUNCATE.LOG
+NMAKE OP_REN.mak > OP_REN.LOG
+NMAKE OP_UNLK.mak > OP_UNLK.LOG
+NMAKE OP_CHMOD.mak > OP_CHMOD.LOG
+
diff --git a/special/dos/build1.bat b/special/dos/build1.bat
new file mode 100644
index 0000000..20a5b0b
--- /dev/null
+++ b/special/dos/build1.bat
@@ -0,0 +1,12 @@
+@echo off
+rem @(#)build1.bat 1.1 98/10/26 Connectathon Testsuite
+rem Cthon Test Suite NMAKE Build Script for Microsoft Visual C++ 1.5
+
+rem This batch file is used to build ONE of the SPECIAL components of
+rem the Connectathon testsuite. Please review the readme.txt for
+rem particular issues in building for the Dos/Windows environment.
+
+DEL %1.OBJ
+NMAKE %1.MAK > %1.LOG
+TYPE %1.LOG
+DIR %1.exe
diff --git a/special/dos/dupreq.mak b/special/dos/dupreq.mak
new file mode 100755
index 0000000..3eaaf73
--- /dev/null
+++ b/special/dos/dupreq.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = DUPREQ
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"DUPREQ.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = DUPREQ.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+DUPREQ_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+DUPREQ.OBJ: ..\DUPREQ.C $(DUPREQ_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\DUPREQ.C
+
+$(PROJ).EXE:: DUPREQ.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+DUPREQ.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/excltest.mak b/special/dos/excltest.mak
new file mode 100755
index 0000000..321859c
--- /dev/null
+++ b/special/dos/excltest.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = EXCLTEST
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"EXCLTEST.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = EXCLTEST.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+EXCLTEST_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+EXCLTEST.OBJ: ..\EXCLTEST.C $(EXCLTEST_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\EXCLTEST.C
+
+$(PROJ).EXE:: EXCLTEST.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+EXCLTEST.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/fstat.mak b/special/dos/fstat.mak
new file mode 100755
index 0000000..fe3d504
--- /dev/null
+++ b/special/dos/fstat.mak
@@ -0,0 +1,81 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = FSTAT
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC =
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"FSTAT.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = FSTAT.SBR
+
+FSTAT_DEP = ..\tests.h \
+ ..\unixdos.h
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+FSTAT.OBJ: ..\FSTAT.C $(FSTAT_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\FSTAT.C
+
+$(PROJ).EXE:: FSTAT.OBJ $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+FSTAT.OBJ +
+SUBR.OBJ
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/holey.mak b/special/dos/holey.mak
new file mode 100755
index 0000000..cc7cd57
--- /dev/null
+++ b/special/dos/holey.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = HOLEY
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"HOLEY.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:10240
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:10240
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = HOLEY.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+HOLEY_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+HOLEY.OBJ: ..\HOLEY.C $(HOLEY_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\HOLEY.C
+
+$(PROJ).EXE:: HOLEY.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+HOLEY.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/negseek.mak b/special/dos/negseek.mak
new file mode 100755
index 0000000..17448c5
--- /dev/null
+++ b/special/dos/negseek.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = NEGSEEK
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"NEGSEEK.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:10240
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:10240
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = NEGSEEK.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+NEGSEEK_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+NEGSEEK.OBJ: ..\NEGSEEK.C $(NEGSEEK_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\NEGSEEK.C
+
+$(PROJ).EXE:: NEGSEEK.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+NEGSEEK.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/nfsidem.mak b/special/dos/nfsidem.mak
new file mode 100755
index 0000000..d9caede
--- /dev/null
+++ b/special/dos/nfsidem.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = NFSIDEM
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"NFSIDEM.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = NFSIDEM.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+NFSIDEM_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+NFSIDEM.OBJ: ..\NFSIDEM.C $(NFSIDEM_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\NFSIDEM.C
+
+$(PROJ).EXE:: NFSIDEM.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+NFSIDEM.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/nstat.mak b/special/dos/nstat.mak
new file mode 100755
index 0000000..fb6692b
--- /dev/null
+++ b/special/dos/nstat.mak
@@ -0,0 +1,81 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = NSTAT
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC =
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"NSTAT.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = NSTAT.SBR
+
+NSTAT_DEP = ..\tests.h \
+ ..\unixdos.h
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+NSTAT.OBJ: ..\NSTAT.C $(NSTAT_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\NSTAT.C
+
+$(PROJ).EXE:: NSTAT.OBJ $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+NSTAT.OBJ +
+SUBR.OBJ
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/op_chmod.mak b/special/dos/op_chmod.mak
new file mode 100755
index 0000000..faaac07
--- /dev/null
+++ b/special/dos/op_chmod.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = OP_CHMOD
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"OP_CHMOD.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = OP_CHMOD.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+OP_CHMOD_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+OP_CHMOD.OBJ: ..\OP_CHMOD.C $(OP_CHMOD_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\OP_CHMOD.C
+
+$(PROJ).EXE:: OP_CHMOD.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+OP_CHMOD.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/op_ren.mak b/special/dos/op_ren.mak
new file mode 100755
index 0000000..ecd5a4d
--- /dev/null
+++ b/special/dos/op_ren.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = OP_REN
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"OP_REN.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = OP_REN.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+OP_REN_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+OP_REN.OBJ: ..\OP_REN.C $(OP_REN_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\OP_REN.C
+
+$(PROJ).EXE:: OP_REN.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+OP_REN.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/op_unlk.mak b/special/dos/op_unlk.mak
new file mode 100755
index 0000000..a22a620
--- /dev/null
+++ b/special/dos/op_unlk.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = OP_UNLK
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"OP_UNLK.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = OP_UNLK.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+OP_UNLK_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+OP_UNLK.OBJ: ..\OP_UNLK.C $(OP_UNLK_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\OP_UNLK.C
+
+$(PROJ).EXE:: OP_UNLK.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+OP_UNLK.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/rename.mak b/special/dos/rename.mak
new file mode 100755
index 0000000..73604e5
--- /dev/null
+++ b/special/dos/rename.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = RENAME
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"RENAME.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = RENAME.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+RENAME_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+RENAME.OBJ: ..\RENAME.C $(RENAME_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\RENAME.C
+
+$(PROJ).EXE:: RENAME.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+RENAME.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/rewind.mak b/special/dos/rewind.mak
new file mode 100755
index 0000000..0432a8e
--- /dev/null
+++ b/special/dos/rewind.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = REWIND
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"REWIND.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:10240
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:10240
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = REWIND.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+REWIND_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+REWIND.OBJ: ..\REWIND.C $(REWIND_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\REWIND.C
+
+$(PROJ).EXE:: REWIND.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+REWIND.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/stat.mak b/special/dos/stat.mak
new file mode 100755
index 0000000..4739068
--- /dev/null
+++ b/special/dos/stat.mak
@@ -0,0 +1,81 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = STAT
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC =
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"STAT.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = STAT.SBR
+
+STAT_DEP = ..\tests.h \
+ ..\unixdos.h
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+STAT.OBJ: ..\STAT.C $(STAT_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\STAT.C
+
+$(PROJ).EXE:: STAT.OBJ $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+STAT.OBJ +
+SUBR.OBJ
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/stat2.mak b/special/dos/stat2.mak
new file mode 100755
index 0000000..3389e14
--- /dev/null
+++ b/special/dos/stat2.mak
@@ -0,0 +1,81 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = STAT2
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC =
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"STAT2.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = STAT2.SBR
+
+STAT2_DEP = ..\tests.h \
+ ..\unixdos.h
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+STAT2.OBJ: ..\STAT2.C $(STAT2_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\STAT2.C
+
+$(PROJ).EXE:: STAT2.OBJ $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+STAT2.OBJ +
+SUBR.OBJ
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/touchn.mak b/special/dos/touchn.mak
new file mode 100755
index 0000000..69ac7c9
--- /dev/null
+++ b/special/dos/touchn.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TOUCHN
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TOUCHN.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TOUCHN.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+TOUCHN_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+TOUCHN.OBJ: ..\TOUCHN.C $(TOUCHN_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\TOUCHN.C
+
+$(PROJ).EXE:: TOUCHN.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TOUCHN.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dos/truncate.mak b/special/dos/truncate.mak
new file mode 100755
index 0000000..7227f00
--- /dev/null
+++ b/special/dos/truncate.mak
@@ -0,0 +1,90 @@
+# External Makefile for Microsoft Visual C++ generated build script - Do not modify
+
+PROJ = TRUNCATE
+DEBUG = 1
+PROGTYPE = 6
+CALLER =
+ARGS =
+DLLS =
+D_RCDEFINES = -d_DEBUG
+R_RCDEFINES = -dNDEBUG
+ORIGIN = MSVC
+ORIGIN_VER = 1.00
+PROJPATH =
+USEMFC = 0
+CC = cl
+CPP = cl
+CXX = cl
+CCREATEPCHFLAG =
+CPPCREATEPCHFLAG =
+CUSEPCHFLAG =
+CPPUSEPCHFLAG =
+FIRSTC = SUBR.C
+FIRSTCPP =
+RC = rc
+CFLAGS_D_DEXE = /nologo /G2 /W0 /Zi /AM /Od /D "_DEBUG" /D "_DOS" /D "DOS" /FR /Fd"TRUNCATE.PDB"
+CFLAGS_R_DEXE = /nologo /Gs /G2 /W0 /AM /Ox /D "NDEBUG" /D "_DOS" /FR
+LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
+LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
+LIBS_D_DEXE = oldnames mlibce
+LIBS_R_DEXE = oldnames mlibce
+RCFLAGS = /nologo
+RESFLAGS = /nologo
+RUNFLAGS =
+OBJS_EXT =
+LIBS_EXT =
+!if "$(DEBUG)" == "1"
+CFLAGS = $(CFLAGS_D_DEXE)
+LFLAGS = $(LFLAGS_D_DEXE)
+LIBS = $(LIBS_D_DEXE)
+MAPFILE = nul
+RCDEFINES = $(D_RCDEFINES)
+!else
+CFLAGS = $(CFLAGS_R_DEXE)
+LFLAGS = $(LFLAGS_R_DEXE)
+LIBS = $(LIBS_R_DEXE)
+MAPFILE = nul
+RCDEFINES = $(R_RCDEFINES)
+!endif
+!if [if exist MSVC.BND del MSVC.BND]
+!endif
+SBRS = TRUNCATE.SBR
+
+
+SUBR_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+TRUNCATE_DEP = ..\tests.h \
+ ..\unixdos.h
+
+
+all: $(PROJ).EXE $(PROJ).BSC
+
+SUBR.OBJ: ..\SUBR.C $(SUBR_DEP)
+ $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ..\SUBR.C
+
+TRUNCATE.OBJ: ..\TRUNCATE.C $(TRUNCATE_DEP)
+ $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\TRUNCATE.C
+
+$(PROJ).EXE:: TRUNCATE.OBJ $(OBJS_EXT) $(DEFFILE)
+ echo >NUL @<<$(PROJ).CRF
+TRUNCATE.OBJ +
+$(OBJS_EXT)
+$(PROJ).EXE
+$(MAPFILE)
+..\..\lib\+
+..\..\include\+
+$(LIBS)
+$(DEFFILE);
+<<
+ link $(LFLAGS) @$(PROJ).CRF
+
+run: $(PROJ).EXE
+ $(PROJ) $(RUNFLAGS)
+
+
+$(PROJ).BSC: $(SBRS)
+ bscmake @<<
+/o$@ $(SBRS)
+<<
diff --git a/special/dupreq.c b/special/dupreq.c
new file mode 100644
index 0000000..29174a6
--- /dev/null
+++ b/special/dupreq.c
@@ -0,0 +1,86 @@
+/* @(#)dupreq.c 1.2 98/10/26 Connectathon Testsuite */
+/*
+ * check for lost reply on non-idempotent resuests
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#endif
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int count, i;
+ int fd;
+ int cfail, lfail, u1fail, u2fail;
+ char name1[256];
+ char name2[256];
+
+#ifdef DOSorWIN32
+/*
+ * The concept of "links" in Unix terms does not exist on the DOS
+ * or Windows platform, so this test will not work.
+ */
+ fprintf(stderr, "This Test Not Executable on DOS or Windows\n");
+ exit(1);
+#else
+ if (argc != 3) {
+ fprintf(stderr, "usage: %s count name\n", argv[0]);
+ exit(1);
+ }
+ setbuf(stdout, NULL);
+ count = atoi(argv[1]);
+ sprintf(name1, "%s1", argv[2]);
+ sprintf(name2, "%s2", argv[2]);
+ cfail = lfail = u1fail = u2fail = 0;
+ for (i=count; i > 0; i--) {
+ if ((fd = creat(name1, 0666)) < 0) {
+ cfail++;
+ fprintf(stderr, "create ");
+ perror(name1);
+ continue;
+ }
+ close(fd);
+ if (link(name1, name2) < 0) {
+ lfail++;
+ fprintf(stderr, "link %s %s", name1, name2);
+ perror(" ");
+ }
+ if (unlink(name2) < 0) {
+ u1fail++;
+ fprintf(stderr, "unlink %s", name2);
+ perror(" ");
+ }
+ if (unlink(name1) < 0) {
+ u2fail++;
+ fprintf(stderr, "unlink %s", name1);
+ perror(" ");
+ }
+ }
+ fprintf(stdout, "%d tries\n", count);
+ if (cfail) {
+ fprintf(stdout, "%d bad create\n", cfail);
+ }
+ if (lfail) {
+ fprintf(stdout, "%d bad link\n", lfail);
+ }
+ if (u1fail) {
+ fprintf(stdout, "%d bad unlink 1\n", u1fail);
+ }
+ if (u2fail) {
+ fprintf(stdout, "%d bad unlink 2\n", u2fail);
+ }
+ exit(0);
+#endif /* DOSorWIN32 */
+}
diff --git a/special/excltest.c b/special/excltest.c
new file mode 100644
index 0000000..f74eaf9
--- /dev/null
+++ b/special/excltest.c
@@ -0,0 +1,64 @@
+/*
+ * @(#)excltest.c 1.2 98/10/26 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * test exclusive create
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#endif /* DOSorWIN32 */
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ char *testfile = "exctest.file";
+ int count;
+ int res, i;
+
+ if (argc > 2) {
+ fprintf(stderr, "usage: %s [count]\n", argv[0]);
+ exit(1);
+ }
+ if (argc == 2)
+ count = atoi(argv[1]);
+ else
+ count = 2;
+
+ unlink(testfile);
+ for (i = 0; i < count; i++) {
+ res = open(testfile, O_CREAT | O_EXCL, 0777);
+ if (i == 0) {
+ if (res < 0) {
+ perror(testfile);
+ exit(1);
+ }
+ } else {
+ if (res >= 0) {
+ fprintf(stderr, "exclusive create succeeded\n");
+ exit(1);
+ } else if (errno != EEXIST) {
+ perror(testfile);
+ exit(1);
+ }
+ }
+ }
+
+ exit(0);
+}
diff --git a/special/freesp.c b/special/freesp.c
new file mode 100644
index 0000000..1affa4a
--- /dev/null
+++ b/special/freesp.c
@@ -0,0 +1,150 @@
+/*
+ * @(#)freesp.c 1.1 98/12/19 Connectathon Testsuite
+ */
+
+
+/*
+ * Write a file and truncate it using fcntl(...F_FREESP). Make sure the
+ * new size is correctly indicated.
+ *
+ * Usage: freesp [filename]
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "../tests.h"
+
+/*
+ * Size of a full and partial buffer. The idea is to write a few copies of
+ * the full buffer and then write a partial buffer, so that the resulting
+ * file is not an even number of pages long. This may not be significant,
+ * but this is the way test cases have worked that provoked failures in the
+ * past.
+ */
+
+#define BUFSIZE 8192
+#define PARTIAL_BUF 42
+#define NUMBUFS 3 /* full buffers to write */
+
+static char buf[BUFSIZE];
+
+static char *filename = "freesp.dat";
+
+static void verify_size ARGS_((int, off_t));
+
+#ifndef F_FREESP
+
+/*ARGUSED*/
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ printf("fcntl(...F_FREESP...) not available on this platform.\n");
+ exit(0);
+}
+
+#else /* F_FREESP */
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int fd;
+ int i;
+ flock_t clear;
+
+ memset(buf, '%', BUFSIZE);
+
+ if (argc > 1)
+ filename = argv[1];
+
+ fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ if (fd < 0) {
+ fprintf(stderr, "can't open %s: %s\n", filename,
+ strerror(errno));
+ exit(1);
+ }
+
+ /*
+ * Put some bits into the file.
+ */
+
+ for (i = 0; i < NUMBUFS; i++) {
+ if (write(fd, buf, BUFSIZE) < 0) {
+ fprintf(stderr, "can't write %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+ }
+ verify_size(fd, NUMBUFS * BUFSIZE);
+
+ if (write(fd, buf, PARTIAL_BUF) < 0) {
+ fprintf(stderr, "can't write %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+
+ /*
+ * Rewind and truncate the file.
+ */
+
+ if (lseek(fd, 0, SEEK_SET) < 0) {
+ fprintf(stderr, "can't seek to 0: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ clear.l_start = 0;
+ clear.l_whence = SEEK_SET;
+ clear.l_len = 0; /* entire file */
+ if (fcntl(fd, F_FREESP, &clear) < 0) {
+ fprintf(stderr, "can't clear %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+
+ /*
+ * Recheck the size.
+ */
+
+ verify_size(fd, 0);
+
+ close(fd);
+ unlink(filename);
+ exit(0);
+}
+
+/*
+ * Verify that the file size is "expected" bytes. Complain and exit if
+ * this isn't the case.
+ * Side effects: fd's offset is moved to the end of the file.
+ */
+
+static void
+verify_size(fd, expected)
+ int fd;
+ off_t expected;
+{
+ off_t actual;
+
+ actual = lseek(fd, 0, SEEK_END);
+ if (actual < 0) {
+ fprintf(stderr, "can't get size: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ if (actual != expected) {
+ fprintf(stderr, "expected size: %ld, got: %ld\n",
+ (long)expected, (long)actual);
+ exit(1);
+ }
+}
+
+#endif /* F_FREESP */
diff --git a/special/fstat.c b/special/fstat.c
new file mode 100644
index 0000000..a2e164b
--- /dev/null
+++ b/special/fstat.c
@@ -0,0 +1,67 @@
+/*
+ * @(#)fstat.c 1.4 2001/08/25 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * test statfs for file count
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/param.h>
+#ifdef SVR3
+#include <sys/statfs.h>
+#elif defined SVR4
+#include <sys/statvfs.h>
+#elif defined (OSF1) || defined (BSD)
+#include <sys/mount.h>
+#else
+#include <sys/vfs.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#endif /* DOSorWIN32 */
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef SVR4
+ struct statvfs fs;
+#else
+ struct statfs fs;
+#endif
+#ifdef DOSorWIN32
+ fprintf(stderr, "This Test Not Executable on DOS or Windows\n");
+ exit(1);
+#else
+ char *name = ".";
+
+ if (argc > 2) {
+ fprintf(stderr, "usage: %s [path]\n", argv[0]);
+ exit(1);
+ }
+ if (argc == 2) {
+ name = argv[1];
+ }
+ fs.f_files = 0;
+ fs.f_ffree = 0;
+#ifdef SVR3
+ if (statfs(name, &fs, sizeof(fs), 0) < 0) {
+#elif defined(SVR4)
+ if (statvfs(name, &fs) < 0) {
+#else
+ if (statfs(name, &fs) < 0) {
+#endif
+ perror(argv[1]);
+ exit(1);
+ }
+ printf("total %lu free %lu\n", (u_long)fs.f_files,
+ (u_long)fs.f_ffree);
+ exit(0);
+#endif /* DOSorWIN32 */
+}
diff --git a/special/holey.c b/special/holey.c
new file mode 100644
index 0000000..93a8e4b
--- /dev/null
+++ b/special/holey.c
@@ -0,0 +1,243 @@
+/*
+ * @(#)holey.c 1.3 2001/08/25 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * test read/write of holey files
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#endif /* DOSorWIN32 */
+
+#ifndef L_INCR
+#define L_INCR 1
+#define L_SET 0
+#endif
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define BUFSZ 8192
+#define FILESZ 70000
+#define DATASZ 4321
+#ifndef DOSorWIN32
+#define HOLESZ 9012
+#define FILENM "holeyfile"
+#else
+#define HOLESZ 8814 /* XXX why different size? */
+#define FILENM "holefile"
+#endif
+
+static int Debug = 0;
+static char *Prog;
+
+int
+main(argc, argv)
+int argc;
+char *argv[];
+{
+ int fd, i, tot, ct, sz, bytes, ret;
+ char *filenm = FILENM;
+ char buf[BUFSZ];
+ int filesz = FILESZ;
+ int datasz = DATASZ;
+ int holesz = HOLESZ;
+ int serrno;
+ int oflags; /* open flags */
+
+ Prog = argv[0];
+ if (argc > 1 && strcmp(argv[1], "-d") == 0) {
+ Debug = 1;
+ argc--;
+ argv++;
+ }
+ if (argc > 5 || (argc > 1 && strcmp(argv[1], "-h") == 0)) {
+ fprintf(stderr,
+ "usage: %s [filename filesize datasize holesize]\n",
+ Prog);
+ exit(1);
+ }
+ if (argc > 1 && strcmp(argv[1], "-") != 0)
+ filenm = argv[1];
+ if (argc > 2 && strcmp(argv[2], "-") != 0)
+ filesz = atoi(argv[2]);
+ if (argc > 3 && strcmp(argv[3], "-") != 0)
+ datasz = atoi(argv[3]);
+ if (argc > 4 && strcmp(argv[4], "-") != 0)
+ holesz = atoi(argv[4]);
+
+ umask(0);
+ if (datasz > BUFSZ) {
+ fprintf(stderr, "%s: datasize (%d) greater than maximum (%d)\n",
+ Prog, datasz, BUFSZ);
+ exit(1);
+ }
+ oflags = O_CREAT|O_TRUNC|O_RDWR;
+#ifdef DOSorWIN32
+ oflags |= O_BINARY;
+#endif
+ if ((fd = open(filenm, oflags, 0666)) < 0) {
+ sprintf(buf, "%s: create of %s", Prog, filenm);
+ perror(buf);
+ exit(1);
+ }
+ if (close(fd) < 0) {
+ sprintf(buf, "%s: close of %s after creat", Prog, filenm);
+ perror(buf);
+ exit(1);
+ }
+ if ((fd = open(filenm, O_RDWR)) < 0) {
+ sprintf(buf, "%s: open of %s", Prog, filenm);
+ perror(buf);
+ exit(1);
+ }
+ for (i = 0; i < BUFSZ / sizeof (int); i++)
+ ((int *)buf)[i] = i;
+
+ for (sz = filesz; sz > 0; ) {
+ if (datasz || sz == 1) {
+ bytes = MIN(sz, datasz);
+ if (bytes == 0)
+ bytes = 1;
+ if ((ret = write(fd, buf, bytes)) != bytes) {
+ serrno = errno;
+ fprintf(stderr, "write ret %d (expect %d)\n",
+ ret, bytes);
+ if (serrno) {
+ errno = serrno;
+ perror("write");
+ }
+ exit(1);
+ }
+ sz -= bytes;
+ }
+ if (sz && holesz) {
+ bytes = MIN(sz - 1, holesz);
+ if (lseek(fd, bytes, L_INCR) == -1L) {
+ perror("lseek (write)");
+ exit(1);
+ }
+ sz -= bytes;
+ }
+ }
+ if (lseek(fd, 0, L_SET) == -1L) {
+ perror("lseek (rewind)");
+ exit(1);
+ }
+
+#ifdef BSD
+ printf("BSD workaround: reopening file read-only.\n");
+ if (close(fd) < 0) {
+ sprintf(buf, "%s: close of %s after write", Prog, filenm);
+ perror(buf);
+ exit(1);
+ }
+ if ((fd = open(filenm, O_RDONLY)) < 0) {
+ sprintf(buf, "%s: open of %s after write", Prog, filenm);
+ perror(buf);
+ exit(1);
+ }
+#endif
+
+ for (sz = filesz; sz > 0; ) {
+ if (datasz || sz == 1) {
+ bytes = MIN(sz, datasz);
+ if (bytes == 0)
+ bytes = 1;
+ sz -= bytes;
+ for (; bytes > 0; bytes -= ret) {
+ if (Debug) {
+ fprintf(stderr,
+ "--data read: offset %d, sz = %d, bytes = %d\n",
+ filesz - sz - bytes, sz, bytes);
+ }
+ if ((ret = read(fd, buf, bytes)) <= 0) {
+ serrno = errno;
+ fprintf(stderr,
+ "read (data) offset %d, sz = %d, bytes = %d (ret = %d), datasz = %d\n",
+ filesz - sz - bytes, sz, bytes,
+ ret, datasz);
+ if (ret < 0) {
+ errno = serrno;
+ perror("read");
+ }
+ exit(1);
+ }
+ ct = bytes - (bytes % sizeof (int));
+ if (Debug) {
+ fprintf(stderr, " ret = %d, ct = %d\n",
+ ret, ct);
+ }
+ for (i = 0; i < ct / sizeof (int); i++) {
+ if (((int *)buf)[i] != i) {
+ fprintf(stderr,
+ "bad data in %s\n",
+ filenm);
+ if (Debug) {
+ fprintf(stderr,
+ "address= %d, valueis= %d, shouldbe= %d\n",
+ i,
+ ((int *)buf)[i], i);
+ }
+ exit(1);
+ }
+ }
+ }
+ }
+ if (sz && holesz) {
+ tot = MIN(holesz, sz - 1);
+ sz -= tot;
+ for (ct = 0; tot > 0; tot -= ret, ct += ret) {
+ bytes = MIN(tot, BUFSZ);
+ if (Debug) {
+ fprintf(stderr,
+ "++hole read: offset %d, sz = %d, tot = %d, bytes = %d\n",
+ filesz - sz - tot, sz, tot,
+ bytes);
+ }
+ if ((ret = read(fd, buf, bytes)) <= 0) {
+ serrno = errno;
+ fprintf(stderr,
+ "read (hole) offset %d, sz = %d, bytes = %d (ret %d), holesz = %d\n",
+ filesz - sz - tot, sz, bytes,
+ ret, holesz);
+ if (ret < 0) {
+ errno = serrno;
+ perror("read");
+ }
+ exit(1);
+ }
+ if (Debug)
+ fprintf(stderr, " ret = %d\n", ret);
+ for (i = 0; i < ret; i++) {
+ if (buf[i] != '\0') {
+ fprintf(stderr,
+ "non-zero data read back from hole (offset %d)\n",
+ filesz - sz + ct + i);
+ exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ printf("Holey file test ok\n");
+ exit(0);
+}
diff --git a/special/negseek.c b/special/negseek.c
new file mode 100644
index 0000000..c974070
--- /dev/null
+++ b/special/negseek.c
@@ -0,0 +1,68 @@
+/*
+ * @(#)negseek.c 1.2 98/10/26 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * test seek to negative offset
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#endif /* DOSorWIN32 */
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int fd;
+ long i;
+ char buf[8192];
+
+#ifdef WIN32
+ /*
+ * The Windows _llseek command returns invalid parameter when this
+ * test is run. However, it appears to work correctly under DOS.
+ */
+ fprintf(stderr, "This Test Not Executable on Windows\n");
+ exit(1);
+#endif
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: negseek filename\n");
+ exit(1);
+ }
+ fd = open(argv[1], O_CREAT|O_RDONLY, 0666);
+ if (fd == -1) {
+ perror(argv[1]);
+ exit(1);
+ }
+
+ for (i = 0L; i > -10240L; i -= 1024L) {
+ if (lseek(fd, i, 0) == -1L) {
+ perror("lseek");
+ close(fd);
+ unlink(argv[1]);
+ exit(0);
+ }
+ if (read(fd, buf, sizeof buf) == -1) {
+ perror("read");
+ close(fd);
+ unlink(argv[1]);
+ exit(0);
+ }
+ }
+ close(fd);
+ unlink(argv[1]);
+ exit(1);
+}
diff --git a/special/nfsidem.c b/special/nfsidem.c
new file mode 100644
index 0000000..ac95c39
--- /dev/null
+++ b/special/nfsidem.c
@@ -0,0 +1,189 @@
+/* @(#)nfsidem.c 1.7 2001/08/25 Connectathon Testsuite */
+/*
+ * Idempotency test:
+ *
+ * forever {
+ * mkdir TEST
+ * mkdir TEST/DIR
+ * echo "..." >TEST/FOO
+ * chmod 0600 TEST/FOO
+ * rename TEST/FOO TEST/DIR/BAR
+ * if link TEST/DIR/BAR TEST/BAR == 0
+ * rename TEST/BAR TEST/DIR/BAR (noop)
+ * symlink ../TEST/DIR/BAR TEST/SBAR
+ * unlink TEST/DIR/BAR
+ * unlink TEST/BAR
+ * unlink TEST/SBAR (if it was created)
+ * rmdir TEST/DIR
+ * rmdir TEST
+ * lookup TEST (expect failure)
+ * }
+ *
+ * Tom Talpey, 1992, Open Software Foundation.
+ * Freely redistributable.
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+#endif /* DOSorWIN32 */
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 128
+#endif
+
+/* maximum number of chars for the message string */
+#define STRCHARS 100
+
+static char DIR[MAXPATHLEN];
+static char FOO[MAXPATHLEN];
+static char BAR[MAXPATHLEN];
+static char SBAR[MAXPATHLEN];
+static char TBAR[MAXPATHLEN];
+static char LBAR[MAXPATHLEN];
+static char str[STRCHARS];
+
+main(ac,av)
+ int ac;
+ char *av[];
+{
+ int count, fd, slen, lerr, slerr;
+ char *fn;
+ struct stat sb;
+
+#ifdef DOSorWIN32
+ fprintf(stderr, "This Test Not Executable on DOS or Windows\n");
+ exit(1);
+#else
+ if (ac >= 2)
+ count = atoi(av[1]);
+ else
+ count = 1;
+ if (ac >= 3)
+ fn = av[2];
+ else
+ fn = "./TEST";
+
+ snprintf(DIR, MAXPATHLEN, "%s/DIR", fn);
+ snprintf(FOO, MAXPATHLEN, "%s/FOO", fn);
+ snprintf(BAR, MAXPATHLEN, "%s/BAR", fn);
+ snprintf(SBAR, MAXPATHLEN, "%s/SBAR", fn);
+ snprintf(TBAR, MAXPATHLEN, "%s/DIR/BAR", fn);
+ snprintf(LBAR, MAXPATHLEN, "../%s/DIR/BAR", fn);
+ snprintf(str, STRCHARS, "Idempotency test %ld running\n",
+ (long)getpid());
+ slen = strlen(str);
+
+ printf("testing %d idempotencies in directory \"%s\"\n", count, fn);
+
+#ifndef S_IFLNK
+ slerr = 1; /* just something non-zero */
+#endif
+
+ while (count--) {
+ if (mkdir(fn, 0755)) {
+ perror("mkdir");
+ break;
+ }
+ if (mkdir(DIR, 0755)) {
+ perror("mkdir DIR");
+ break;
+ }
+ fd = open(FOO, O_RDWR|O_CREAT, 0666);
+ if (fd < 0) {
+ perror("creat");
+ break;
+ }
+ if (write(fd, str, slen) != slen) {
+ perror("write");
+ (void) close(fd);
+ break;
+ }
+ if (close(fd)) {
+ perror("close");
+ break;
+ }
+ if (chmod(FOO, 0611)) {
+ perror("chmod");
+ break;
+ }
+ if (rename(FOO, TBAR)) {
+ perror("rename FOO DIR/BAR");
+ break;
+ }
+ if (lerr = link(TBAR, BAR)) {
+ if (errno != EOPNOTSUPP) {
+ perror("link");
+ break;
+ }
+ } else if (rename(BAR, TBAR)) {
+ perror("rerename");
+ break;
+ }
+#ifdef S_IFLNK
+ if (slerr = symlink(LBAR, SBAR)) {
+ if (errno != EOPNOTSUPP) {
+ perror("symlink");
+ break;
+ }
+ }
+#endif
+ if (stat(!slerr ? SBAR : !lerr ? BAR : TBAR, &sb)) {
+ perror("stat 1");
+ break;
+ }
+ if ((sb.st_mode & (S_IFMT|07777)) != (S_IFREG|0611) ||
+ sb.st_size != slen) {
+ fprintf(stderr, "stat 1: bad file type/size 0%o/%ld\n",
+ (int)sb.st_mode, (long)sb.st_size);
+#ifdef EFTYPE
+ errno = EFTYPE;
+#else
+ errno = EINVAL;
+#endif
+ break;
+ }
+ if (unlink(TBAR)) {
+ perror("unlink 1");
+ break;
+ }
+#ifdef BSD
+ printf("BSD workaround: skipping unlink(BAR)\n");
+#else
+ if (lerr == 0 && unlink(BAR)) {
+ perror("unlink 2");
+ break;
+ }
+#endif
+ if (slerr == 0 && unlink(SBAR)) {
+ perror("unlink 3");
+ break;
+ }
+ if (rmdir(DIR)) {
+ perror("rmdir 1");
+ break;
+ }
+ if (rmdir(fn)) {
+ perror("rmdir 2");
+ break;
+ }
+ if (stat(fn, &sb) == 0 || errno != ENOENT) {
+ perror("stat 2");
+ break;
+ }
+ errno = 0; /* clear error from last stat(2) */
+ }
+
+ exit(errno);
+#endif /* DOSorWIN32 */
+}
diff --git a/special/nstat.c b/special/nstat.c
new file mode 100644
index 0000000..87c1def
--- /dev/null
+++ b/special/nstat.c
@@ -0,0 +1,65 @@
+/*
+ * @(#)nstat.c 1.2 98/10/26 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * Stat a file n times
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef SVR3
+#include <sys/fs/nfs/time.h>
+#else
+#include <sys/time.h>
+#endif
+#endif /* DOSorWIN32 */
+
+#include "../tests.h"
+
+static int stats = 0;
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ struct timeval etim;
+ float elapsed;
+ register int count;
+ register int i;
+ struct stat statb;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s count\n", argv[0]);
+ exit(1);
+ }
+
+ count = atoi(argv[1]);
+ starttime();
+ for (i=0; i<count; i++) {
+ if (stat(argv[0], &statb) < 0) {
+ fprintf(stderr, "pass %d: can't stat %s: %s\n",
+ i, argv[0], strerror(errno));
+ exit(1);
+ }
+ stats++;
+ }
+ endtime(&etim);
+ elapsed = (float)etim.tv_sec + (float)etim.tv_usec / 1000000.0;
+ if (elapsed == 0.0) {
+ fprintf(stdout, "%d calls 0.0 seconds\n", count);
+ } else {
+ fprintf(stdout,
+ "%d calls %.2f seconds %.2f calls/sec %.2f msec/call\n",
+ count, elapsed, (float)count / elapsed,
+ 1000.0 * elapsed / (float)count);
+ }
+ exit(0);
+}
diff --git a/special/op_chmod.c b/special/op_chmod.c
new file mode 100644
index 0000000..41de1ed
--- /dev/null
+++ b/special/op_chmod.c
@@ -0,0 +1,151 @@
+/*
+ * @(#)op_chmod.c 1.5 2003/12/30 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * tests operation on open file which has been chmod'd to 0.
+ * steps taken:
+ * 1. create file
+ * 2. open for read/write
+ * 3. chmod 0
+ * 4. write data
+ * 5. rewind
+ * 6. read data back
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#endif /* DOSorWIN32 */
+
+#include "../tests.h"
+
+#define TBUFSIZ 100
+static char wbuf[TBUFSIZ], rbuf[TBUFSIZ];
+static char buf[BUFSIZ];
+#define TMSG "This is a test message written to the chmod'd file\n"
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int fd, ret;
+ char *tname;
+ int errcount = 0;
+ long lret;
+ int oflags; /* open flags */
+
+ setbuf(stdout, NULL);
+
+#ifdef MACOSX
+ /* make sure TMPDIR isn't set */
+ unsetenv("TMPDIR");
+#endif
+ if ((tname = tempnam(".", "nfs")) == NULL) {
+ fprintf(stderr, "can't construct a temporary filename: ");
+ xxit("tempnam");
+ }
+
+ oflags = O_CREAT|O_TRUNC|O_RDWR;
+#ifdef DOSorWIN32
+ oflags |= O_BINARY;
+#endif
+ if ((fd = open(tname, oflags, CHMOD_RW)) < 0) {
+ fprintf(stderr, "can't create %s: ", tname);
+ xxit("open");
+ }
+
+ printf("testfile before chmod:\n ");
+ sprintf(buf, "ls -l %s", tname);
+ system(buf);
+ ret = chmod(tname, CHMOD_NONE);
+ printf("%s open; chmod ret = %d\n", tname, ret);
+ if (ret)
+ xxit(" chmod");
+ printf("testfile after chmod:\n ");
+ system(buf);
+ strcpy(wbuf, TMSG);
+ if ((ret = write(fd, wbuf, TBUFSIZ)) != TBUFSIZ) {
+ fprintf(stderr, "write ret %d; expected %d\n", ret, TBUFSIZ);
+ if (ret < 0)
+ perror(" write");
+ exit(1);
+ }
+ if ((lret = lseek(fd, 0L, 0)) != 0L) {
+ fprintf(stderr, "lseek ret %ld; expected 0\n", lret);
+ if (lret < 0)
+ perror(" lseek");
+ exit(1);
+ }
+ if ((ret = read(fd, rbuf, TBUFSIZ)) != TBUFSIZ) {
+ fprintf(stderr, "read ret %d; expected %d\n", ret, TBUFSIZ);
+ if (ret < 0)
+ perror(" read");
+ exit(1);
+ }
+ if (strcmp(wbuf, rbuf) != 0) {
+ errcount++;
+ printf("read data not same as written data\n");
+ printf(" written: '%s'\n read: '%s'\n", wbuf, rbuf);
+ } else {
+ printf("data compare ok\n");
+ }
+
+ printf("testfile after write/read:\n ");
+ system(buf);
+
+#ifndef DOSorWIN32
+ if (unlink(tname) < 0) {
+ fprintf(stderr, "can't unlink %s", tname);
+ xxit(" ");
+ }
+ if (close(fd))
+ xxit("error on close");
+#else
+ /*
+ * For DOS you can't delete the file if it is RO, even if you
+ * opened it RW. So, change to RW and close before the unlink.
+ */
+
+ ret = chmod(tname, CHMOD_RW);
+ printf("%s open; chmod ret = %d\n", tname, ret);
+ if (ret)
+ xxit(" chmod RW");
+ printf("testfile after chmod RW:\n ");
+ system(buf);
+
+ if (close(fd))
+ xxit("error on close");
+
+ if (unlink(tname) < 0) {
+ fprintf(stderr, "can't unlink %s", tname);
+ xxit(" ");
+ }
+#endif /* DOSorWIN32 */
+
+ printf("test completed successfully.\n");
+ exit(0);
+}
+
diff --git a/special/op_ren.c b/special/op_ren.c
new file mode 100644
index 0000000..348b4f9
--- /dev/null
+++ b/special/op_ren.c
@@ -0,0 +1,179 @@
+/*
+ * @(#)op_ren.c 1.4 2003/12/30 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * tests operation on open file which has been unlinked.
+ * steps taken:
+ * 1. create file
+ * 2. open for read/write
+ * 3. unlink file
+ * 4. write data
+ * 5. rewind
+ * 6. read data back
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#include <errno.h>
+#endif /* DOSorWIN32 */
+
+#define TBUFSIZ 100
+static char wbuf[TBUFSIZ], rbuf[TBUFSIZ];
+#define TMSG "This is a test message written to the target file\n"
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int fd, ret;
+ char *taname;
+ char *tbname;
+ int errcount = 0;
+ long lret;
+
+#ifdef DOSorWIN32
+ /*
+ * This test is too Unix oriented to be useful on a Dos or
+ * Windows platform. Thus, we'll skip this test, for now.
+ */
+ fprintf(stderr, "This Test Not Executable on DOS or Windows\n");
+ exit(0);
+#endif
+
+#ifdef SUNOS4X
+ /*
+ * SunOS 4.x has the bug for which I assume this is testing,
+ * i.e. it doesn't realize that rename(foo, bar) may remove
+ * "bar" if it exists, and therefore doesn't first rename it
+ * to ".nfsXXXX" if it's currently open.
+ *
+ * Thus, we'll skip this test, for now.
+ */
+ printf("Test skipped because we know SunOS 4.x client has the bug\n");
+ exit(0);
+#endif
+
+ setbuf(stdout, NULL);
+
+#ifdef MACOSX
+ /* make sure TMPDIR isn't set */
+ unsetenv("TMPDIR");
+#endif
+ if ((taname = tempnam(".", "nfsa")) == NULL) {
+ fprintf(stderr, "can't construct a temporary filename: ");
+ xxit("tempnam");
+ }
+
+ if ((fd = creat(taname, 0777)) < 0) {
+ fprintf(stderr, "can't create %s: ", taname);
+ xxit("creat");
+ }
+ close(fd);
+
+ if ((tbname = tempnam(".", "nfsb")) == NULL) {
+ fprintf(stderr, "can't construct a temporary filename: ");
+ xxit("tempnam");
+ }
+
+#ifdef O_RDWR
+ if ((fd = open(tbname, O_CREAT|O_TRUNC|O_RDWR, 0777)) < 0) {
+ fprintf(stderr, "can't create %s: ", tbname);
+ (void) unlink(taname);
+ xxit("open");
+ }
+#else
+ if ((fd = creat(tbname, 0777)) < 0) {
+ fprintf(stderr, "can't create %s: ", tbname);
+ (void) unlink(taname);
+ xxit("creat");
+ }
+ close(fd);
+ if ((fd = open(tbname, 2)) < 0) {
+ fprintf(stderr, "can't reopen %s: ", tbname);
+ (void) unlink(taname);
+ (void) unlink(tbname);
+ xxit("open");
+ }
+#endif /* O_RDWR */
+
+ printf("nfsjunk files before rename:\n ");
+ system("ls -al .nfs*");
+ ret = rename(taname, tbname);
+ printf("%s open; rename ret = %d\n", tbname, ret);
+ if (ret)
+ xxit(" unlink");
+ printf("nfsjunk files after rename:\n ");
+ system("ls -al .nfs*");
+ strcpy(wbuf, TMSG);
+ if ((ret = write(fd, wbuf, TBUFSIZ)) != TBUFSIZ) {
+ fprintf(stderr, "write ret %d; expected %d\n", ret, TBUFSIZ);
+ if (ret < 0)
+ perror(" write");
+ exit(1);
+ }
+ if ((lret = lseek(fd, 0L, 0)) != 0L) {
+ fprintf(stderr, "lseek ret %ld; expected 0\n", lret);
+ if (lret < 0)
+ perror(" lseek");
+ exit(1);
+ }
+ if ((ret = read(fd, rbuf, TBUFSIZ)) != TBUFSIZ) {
+ fprintf(stderr, "read ret %d; expected %d\n", ret, TBUFSIZ);
+ if (ret < 0)
+ perror(" read");
+ exit(1);
+ }
+ if (strcmp(wbuf, rbuf) != 0) {
+ errcount++;
+ printf("read data not same as written data\n");
+ printf(" written: '%s'\n read: '%s'\n", wbuf, rbuf);
+ } else {
+ printf("data compare ok\n");
+ }
+
+ if (unlink(tbname) < 0) {
+ errcount++;
+ perror("unlink");
+ }
+
+ if (ret = close(fd)) {
+ errcount++;
+ perror("close");
+ }
+
+ printf("nfsjunk files after close:\n ");
+ system("ls -al .nfs*");
+
+ if ((ret = close(fd)) == 0) {
+ errcount++;
+ fprintf(stderr, "second close didn't return error!??\n");
+ }
+
+ if (errcount == 0)
+ printf("test completed successfully.\n");
+ exit(errcount);
+}
+
diff --git a/special/op_unlk.c b/special/op_unlk.c
new file mode 100644
index 0000000..93a09b0
--- /dev/null
+++ b/special/op_unlk.c
@@ -0,0 +1,163 @@
+/*
+ * @(#)op_unlk.c 1.4 2003/12/30 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * tests operation on open file which has been unlinked.
+ * steps taken:
+ * 1. create file
+ * 2. open for read/write
+ * 3. unlink file
+ * 4. write data
+ * 5. rewind
+ * 6. read data back
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#endif /* DOSorWIN32 */
+
+#include "../tests.h"
+
+#define TBUFSIZ 100
+static char wbuf[TBUFSIZ], rbuf[TBUFSIZ];
+#define TMSG "This is a test message written to the unlinked file\n"
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int fd, ret;
+ char *tname;
+ int errcount = 0;
+ long lret;
+ int oflags; /* open flags */
+
+ setbuf(stdout, NULL);
+
+#ifdef MACOSX
+ /* make sure TMPDIR isn't set */
+ unsetenv("TMPDIR");
+#endif
+ if ((tname = tempnam(".", "nfs")) == NULL) {
+ fprintf(stderr, "can't construct a temporary filename: ");
+ xxit("tempnam");
+ }
+
+ oflags = O_CREAT|O_TRUNC|O_RDWR;
+#ifdef DOSorWIN32
+ oflags |= O_BINARY;
+#endif
+ if ((fd = open(tname, oflags, CHMOD_RW)) < 0) {
+ fprintf(stderr, "can't create %s: ", tname);
+ xxit("open");
+ }
+
+#ifndef WIN32
+ /* For WIN you can not delete the file if it is open */
+ printf("nfsjunk files before unlink:\n ");
+ system("ls -al .nfs*");
+ ret = unlink(tname);
+ printf("%s open; unlink ret = %d\n", tname, ret);
+ if (ret)
+ xxit(" unlink");
+ printf("nfsjunk files after unlink:\n ");
+ system("ls -al .nfs*");
+#endif
+ strcpy(wbuf, TMSG);
+ if ((ret = write(fd, wbuf, TBUFSIZ)) != TBUFSIZ) {
+ fprintf(stderr, "write ret %d; expected %d\n", ret, TBUFSIZ);
+ if (ret < 0)
+ perror(" write");
+ exit(1);
+ }
+ if ((lret = lseek(fd, 0L, 0)) != 0L) {
+ fprintf(stderr, "lseek ret %ld; expected 0\n", lret);
+ if (lret < 0)
+ perror(" lseek");
+ exit(1);
+ }
+ if ((ret = read(fd, rbuf, TBUFSIZ)) != TBUFSIZ) {
+ fprintf(stderr, "read ret %d; expected %d\n", ret, TBUFSIZ);
+ if (ret < 0)
+ perror(" read");
+ exit(1);
+ }
+ if (strcmp(wbuf, rbuf) != 0) {
+ errcount++;
+ printf("read data not same as written data\n");
+ printf(" written: '%s'\n read: '%s'\n", wbuf, rbuf);
+ } else {
+ printf("data compare ok\n");
+ }
+
+ if (unlink(tname) == 0) {
+ errcount++;
+ printf("Error: second unlink succeeded!??\n");
+ } else {
+ int expected;
+
+#ifdef WIN32
+ expected = EACCES;
+#else
+ expected = ENOENT;
+#endif
+ if (errno != expected) {
+ errcount++;
+ perror("unexpected error on second unlink");
+ }
+ }
+
+ if (ret = close(fd)) {
+ errcount++;
+ perror("error on close");
+ }
+
+#ifndef WIN32
+ printf("nfsjunk files after close:\n ");
+ system("ls -al .nfs*");
+#endif
+
+ if ((ret = close(fd)) == 0) {
+ errcount++;
+ fprintf(stderr, "second close didn't return error!??\n");
+ }
+
+#ifdef DOSorWIN32
+ /*
+ * XXX return of 0 indicates success. Why does the error msg say
+ * "failed"?
+ */
+ if ((ret = unlink(tname)) == 0) {
+ errcount++;
+ fprintf(stderr, "second unlink failed!??\n");
+ }
+#endif
+
+ if (errcount == 0)
+ printf("test completed successfully.\n");
+ exit(errcount);
+}
+
diff --git a/special/rename.c b/special/rename.c
new file mode 100644
index 0000000..8abbc60
--- /dev/null
+++ b/special/rename.c
@@ -0,0 +1,59 @@
+/*
+ * @(#)rename.c 1.2 98/10/26 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * rename a file n times
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include ../"tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#if defined(SVR3) || defined(SVR4)
+#include <fcntl.h>
+#else
+#include <sys/file.h>
+#endif
+#endif /* DOSorWIN32 */
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int count;
+ int i;
+ int fd;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <count>\n", argv[0]);
+ exit(1);
+ }
+ if ((fd = open("rename1", O_CREAT, 0666)) < 0) {
+ perror("rename1");
+ exit(1);
+ }
+ close(fd);
+
+ count = atoi(argv[1]);
+ for (i=0; i<count; i++) {
+ if (rename("rename1", "rename2") < 0) {
+ perror("rename rename1 to rename2");
+ fprintf(stderr, "%d of %d\n", i, count);
+ exit(1);
+ }
+ if (rename("rename2", "rename1") < 0) {
+ perror("rename rename2 to rename1");
+ fprintf(stderr, "%d of %d\n", i, count);
+ exit(1);
+ }
+ }
+cleanup:
+ unlink("rename1");
+ unlink("rename2");
+ exit(0);
+}
diff --git a/special/rewind.c b/special/rewind.c
new file mode 100644
index 0000000..b5400d3
--- /dev/null
+++ b/special/rewind.c
@@ -0,0 +1,65 @@
+/* @(#)rewind.c 1.4 98/12/19 Connectathon Testsuite */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#endif /* DOSorWIN32 */
+
+main()
+{
+ char buffer[8192];
+ int size = 8192;
+ int fd;
+ int i;
+ off_t off;
+
+#ifdef DOSorWIN32
+ fprintf(stderr, "This Test Not Executable on DOS or Windows\n");
+ exit(1);
+#else
+ if ((fd = open("test.file", O_RDWR | O_CREAT, 0666)) == -1) {
+ perror("open");
+ exit(1);
+ }
+
+ for (i = 0; i < 3; i++) {
+ if (write(fd, buffer, size) != size) {
+ perror("write");
+ exit(1);
+ }
+ }
+
+ if ((off = lseek(fd, (off_t)0, SEEK_SET)) != 0) {
+ printf("file offset=%ld, expected 0\n", (long)off);
+ exit(1);
+ }
+
+ if (ftruncate(fd, 0)) {
+ perror("ftruncate");
+ exit(1);
+ }
+
+ if (write(fd, buffer, 1) != 1) {
+ perror("write");
+ exit(1);
+ }
+
+ if ((off = lseek(fd, 0, SEEK_END)) != 1) {
+ printf("file offset=%ld, expected 1\n", (long)off);
+ exit(1);
+ }
+
+ close(fd);
+
+ exit(0);
+#endif /* DOSorWIN32 */
+}
diff --git a/special/runtests b/special/runtests
new file mode 100755
index 0000000..834d69a
--- /dev/null
+++ b/special/runtests
@@ -0,0 +1,39 @@
+:
+#!/bin/sh
+#
+# @(#)runtests 1.3 2001/12/09 Connectathon Testsuite
+#
+
+# If the initialization file is present, assume we are in the distribution
+# tree and that we must copy the tests to the test directory. Otherwise,
+# we are in the test directory and can just run the tests
+
+InitFile="../tests.init"
+
+# Save mount options because InitFile clobbers it (XXX).
+mntopts=$MNTOPTIONS
+
+if test -f $InitFile
+then
+ . $InitFile
+ export PATH CFLAGS LIBS
+ echo "SPECIAL TESTS: directory $NFSTESTDIR"
+ mkdir $NFSTESTDIR
+ if test ! -d $NFSTESTDIR
+ then
+ echo "Can't make directory $NFSTESTDIR"
+ exit 1
+ fi
+ make copy DESTDIR=$NFSTESTDIR
+ if test $? -ne 0
+ then
+ exit 1
+ fi
+ cd $NFSTESTDIR
+else
+ NFSTESTDIR=`pwd`
+ export PATH
+ echo "SPECIAL TESTS: directory $NFSTESTDIR"
+fi
+
+MNTOPTIONS=$mntopts exec sh runtests.wrk FROM_RUNTESTS
diff --git a/special/runtests.wrk b/special/runtests.wrk
new file mode 100644
index 0000000..9543761
--- /dev/null
+++ b/special/runtests.wrk
@@ -0,0 +1,106 @@
+:
+#!/bin/sh
+#
+# @(#)runtests.wrk 1.7 01/12/09 Connectathon Testsuite
+#
+
+# This script is intended to be invoked from 'runtests'
+# Don't run it manually
+
+case x$1 in
+ xFROM_RUNTESTS)
+ ;;
+ *)
+ echo "$0 must be run from 'runtests' - Don't run manually"
+ exit 1
+ ;;
+esac
+
+set -e
+umask 0
+
+echo ""
+echo "check for proper open/unlink operation"
+TMPDIR= ./op_unlk
+
+echo ""
+echo "check for proper open/rename operation"
+TMPDIR= ./op_ren
+
+echo ""
+echo "check for proper open/chmod 0 operation"
+TMPDIR= ./op_chmod
+
+if [ "$HARDLINKS"o != no ]
+then
+ echo ""
+ echo "check for lost reply on non-idempotent requests"
+ ./dupreq 100 testfile
+fi
+
+echo ""
+echo "test exclusive create."
+./excltest
+
+# This is a protocol bug which is not fixed yet
+#echo ""
+#echo "test statfs for file count, should get positive, different numbers"
+#./fstat
+
+echo ""
+echo "test negative seek, you should get: read: Invalid argument"
+echo "or lseek: Invalid argument"
+./negseek testfile
+
+echo ""
+echo "test rename"
+./rename 100
+
+echo ""
+echo "test truncate"
+./truncate
+
+echo ""
+echo "test holey file support"
+./holey
+
+if [ "$HARDLINKS"o != no ]
+then
+ echo ""
+ echo "second check for lost reply on non-idempotent requests"
+ ./nfsidem 50 testdir
+fi
+
+echo ""
+echo "test rewind support"
+./rewind
+
+echo ""
+echo "test telldir cookies"
+./telldir
+
+echo ""
+echo "test freesp and file size"
+./freesp
+
+# Keep the following tests at the end. They can take quite a bit of
+# time to run.
+
+echo ""
+size=30
+echo "write/read" $size "MB file"
+./bigfile -s $size bigfile$$
+
+echo ""
+echo "write/read at 2GB, 4GB edges"
+if echo $MNTOPTIONS | grep vers=2 > /dev/null
+then
+ echo "skipping test; not supported with v2"
+else
+ ./bigfile2 bigfile$$
+fi
+
+echo ""
+echo "Special tests complete"
+
+exit 0
diff --git a/special/scripts/run.bat b/special/scripts/run.bat
new file mode 100644
index 0000000..69bcc45
--- /dev/null
+++ b/special/scripts/run.bat
@@ -0,0 +1,51 @@
+rem @(#)run.bat 1.1 98/10/26 Connectathon Testsuite
+echo Cthon Special Testsuite > log
+DUPREQ.EXE > DUPREQ.LOG
+echo DUPREQ.LOG >> log
+type DUPREQ.LOG >> log
+EXCLTEST.EXE 5 > EXCLTEST.LOG
+echo EXCLTEST.LOG >> log
+type EXCLTEST.LOG >> log
+FSTAT.EXE > FSTAT.LOG
+echo FSTAT.LOG >> log
+type FSTAT.LOG >> log
+HOLEY.EXE > HOLEY.LOG
+echo HOLEY.LOG >> log
+type HOLEY.LOG >> log
+NEGSEEK.EXE > NEGSEEK.LOG
+echo NEGSEEK.LOG >> log
+type NEGSEEK.LOG >> log
+NFSIDEM.EXE > NFSIDEM.LOG
+echo NFSIDEM.LOG >> log
+type NFSIDEM.LOG >> log
+NSTAT.EXE 5 > NSTAT.LOG
+echo NSTAT.LOG >> log
+type NSTAT.LOG >> log
+.\RENAME.EXE 5 > RENAME.LOG
+echo RENAME.LOG >> log
+type RENAME.LOG >> log
+REWIND.EXE > REWIND.LOG
+echo REWIND.LOG >> log
+type REWIND.LOG >> log
+STAT.EXE JUNK1 > STAT.LOG
+echo STAT.LOG >> log
+type STAT.LOG >> log
+STAT2.EXE JUNK2 5 5 > STAT2.LOG
+echo STAT2.LOG >> log
+type STAT2.LOG >> log
+TOUCHN.EXE 5 > TOUCHN.LOG
+echo TOUCHN.LOG >> log
+type TOUCHN.LOG >> log
+TRUNCATE.EXE > TRUNCATE.LOG
+echo TRUNCATE.LOG >> log
+type TRUNCATE.LOG >> log
+OP_REN.EXE > OP_REN.LOG
+echo OP_REN.LOG >> log
+type OP_REN.LOG >> log
+OP_UNLK.EXE > OP_UNLK.LOG
+echo OP_UNLK.LOG >> log
+type OP_UNLK.LOG >> log
+OP_CHMOD.EXE > OP_CHMOD.LOG
+echo OP_CHMOD.LOG >> log
+type OP_CHMOD.LOG >> log
+
diff --git a/special/stat.c b/special/stat.c
new file mode 100644
index 0000000..941eec1
--- /dev/null
+++ b/special/stat.c
@@ -0,0 +1,130 @@
+/*
+ * @(#)stat.c 1.3 98/11/30 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * stat all of the files in a directory tree
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef SVR3
+#include <sys/fs/nfs/time.h>
+#else
+#include <sys/time.h>
+#endif
+#ifdef use_directs
+#include <sys/dir.h>
+#else
+#include <dirent.h>
+#endif
+#endif /* DOSorWIN32 */
+
+#include "../tests.h"
+
+static int stats = 0;
+
+static void statit ARGS_((char *));
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ struct timeval etim;
+ float elapsed;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s dir\n", argv[0]);
+ exit(1);
+ }
+
+ starttime();
+ statit(argv[1]);
+ endtime(&etim);
+ elapsed = (float)etim.tv_sec + (float)etim.tv_usec / 1000000.0;
+ fprintf(stdout, "%d calls in %f seconds (%f calls/sec)\n",
+ stats, elapsed, (float)stats / elapsed);
+ exit(0);
+}
+
+static void
+statit(name)
+ char *name;
+{
+ struct stat statb;
+#ifdef use_directs
+ struct direct *di;
+#else
+ struct dirent *di;
+#endif
+ DIR *dirp;
+ long loc;
+
+#ifdef SVR3
+ if (stat(name, &statb) < 0) {
+#else
+ if (lstat(name, &statb) < 0) {
+#endif
+ fprintf(stderr, "can't stat %s: %s\n",
+ name, strerror(errno));
+ }
+ if ((statb.st_mode & S_IFMT) != S_IFDIR) {
+ return;
+ }
+
+ if ((dirp = opendir(name)) == NULL) {
+ fprintf(stderr, "can't opendir %s: %s\n",
+ name, strerror(errno));
+ return;
+ }
+ stats++;
+ if (chdir(name) < 0) {
+ fprintf(stderr, "can't chdir to %s: %s\n",
+ name, strerror(errno));
+ exit(1);
+ }
+
+ while ((di = readdir(dirp)) != NULL) {
+ if (strcmp(di->d_name, ".") == 0 || strcmp(di->d_name, "..") == 0)
+ continue;
+#ifdef SVR3
+ if (stat(di->d_name, &statb) < 0)
+#else
+ if (lstat(di->d_name, &statb) < 0)
+#endif
+ {
+ fprintf(stderr, "can't stat %s: %s\n",
+ di->d_name, strerror(errno));
+ }
+ stats++;
+ if ((statb.st_mode & S_IFMT) == S_IFDIR) {
+ loc = telldir(dirp);
+ closedir(dirp);
+ statit(di->d_name);
+ if ((dirp = opendir(".")) == NULL) {
+ fprintf(stderr, "can't re-opendir: %s\n",
+ strerror(errno));
+ if (chdir("..") < 0) {
+ perror("..");
+ exit(1);
+ }
+ return;
+ }
+ seekdir(dirp, loc);
+ }
+ }
+
+ closedir(dirp);
+ if (chdir("..") < 0) {
+ perror("..");
+ exit(1);
+ }
+}
diff --git a/special/stat2.c b/special/stat2.c
new file mode 100644
index 0000000..81ce0ec
--- /dev/null
+++ b/special/stat2.c
@@ -0,0 +1,81 @@
+/*
+ * @(#)stat2.c 1.2 98/10/26 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ *
+ * create a bunch of files and stat them repeatedly
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#ifdef SVR3
+#include <sys/fs/nfs/time.h>
+#else
+#include <sys/time.h>
+#endif
+#endif /* DOSorWIN32 */
+
+#include "../tests.h"
+
+static int stats = 0;
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ struct timeval etim;
+ float elapsed;
+ int files, count;
+ register int pass, filenum;
+ char name[256];
+ struct stat statb;
+
+ if (argc != 4) {
+ fprintf(stderr, "usage: %s dir files count\n", argv[0]);
+ exit(1);
+ }
+
+ if (mkdir(argv[1], 0777) < 0) {
+ perror(argv[1]);
+ }
+ if (chdir(argv[1]) < 0) {
+ fprintf(stderr, "can't chdir to %s: %s\n",
+ argv[1], strerror(errno));
+ exit(1);
+ }
+ files = atoi(argv[2]);
+ count = atoi(argv[3]);
+ for (filenum = 0; filenum < files; filenum++) {
+ sprintf(name, "%d", filenum);
+ close(creat(name, 0666));
+ }
+
+ starttime();
+ for (pass = 0; pass < count; pass++) {
+ for (filenum = 0; filenum < files; filenum++) {
+ sprintf(name, "%d", filenum);
+ if (stat(name, &statb) < 0) {
+ fprintf(stderr,
+ "pass %d: stat of %s failed: %s\n",
+ pass, name, strerror(errno));
+ exit(1);
+ }
+ stats++;
+ }
+ }
+ endtime(&etim);
+ elapsed = (float)etim.tv_sec + (float)etim.tv_usec / 1000000.0;
+ fprintf(stdout, "%d calls in %f seconds (%f calls/sec)\n",
+ stats, elapsed, (float)stats / elapsed);
+ exit(0);
+}
diff --git a/special/telldir.c b/special/telldir.c
new file mode 100644
index 0000000..03a688e
--- /dev/null
+++ b/special/telldir.c
@@ -0,0 +1,297 @@
+/*
+ * @(#)telldir.c 1.5 2003/12/30 Connectathon Testsuite
+ */
+
+/*
+ * Ensure that telldir and seekdir cooperate.
+ * This is done by creating lots of scratch files, walking through with
+ * telldir, and using the resulting cookies with seekdir.
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "../tests.h"
+
+static char *usage = "usage: telldir [-d] [-n nfiles]";
+
+/*
+ * Information kept for each file.
+ */
+
+typedef struct {
+ int inuse; /* is this entry initialized? */
+ long cookie; /* cookie to reach the file */
+ int numfiles; /* number of files after this one */
+} file_info_t;
+
+static int debug = 0;
+
+/*
+ * Number of scratch files to create.
+ */
+static int numfiles = 200;
+
+static char *tdirname = "telldir-test"; /* scratch directory to hold files */
+
+static file_info_t *file_info;
+
+static void alloc_file_info ARGS_((int));
+static void check_file_info ARGS_((DIR *));
+static void cleanup ARGS_((void));
+static DIR *make_files ARGS_((void));
+static void save_file_info ARGS_((int, long, int));
+static void verify ARGS_((DIR *, int, long, int));
+static void walk_dir ARGS_((DIR *));
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ DIR *dp;
+ int c;
+
+ while ((c = getopt(argc, argv, "dn:")) != EOF)
+ switch (c) {
+ case 'd':
+ debug = 1;
+ break;
+ case 'n':
+ numfiles = atoi(optarg);
+ break;
+ case '?':
+ default:
+ fprintf(stderr, "%s\n", usage);
+ exit(1);
+ break;
+ }
+
+ alloc_file_info(numfiles);
+ dp = make_files();
+ walk_dir(dp);
+ check_file_info(dp);
+ cleanup();
+
+ exit(0);
+}
+
+/*
+ * Create the test directory and scratch files. Exits if there is a
+ * problem. Returns a pointer to the opened test directory.
+ */
+
+static DIR *
+make_files()
+{
+ DIR *dp;
+ char filename[MAXPATHLEN];
+ int i;
+
+ if (mkdir(tdirname, 0777) < 0) {
+ if (errno != EEXIST) {
+ fprintf(stderr, "can't create %s: %s\n",
+ tdirname, strerror(errno));
+ exit(1);
+ }
+ }
+
+ for (i = 0; i < numfiles; i++) {
+ int fd;
+
+ sprintf(filename, "%s/%d", tdirname, i);
+ fd = creat(filename, 0666);
+ if (fd < 0) {
+ fprintf(stderr, "can't create %s: %s\n",
+ filename, strerror(errno));
+ exit(1);
+ }
+ close(fd);
+ }
+
+ dp = opendir(tdirname);
+ if (dp == NULL) {
+ fprintf(stderr, "can't open %s: %s\n",
+ tdirname, strerror(errno));
+ exit(1);
+ }
+
+ return (dp);
+}
+
+/*
+ * Walk through the test directory and make sure we find all the expected
+ * files. For each file, save the telldir information.
+ */
+
+static void
+walk_dir(dp)
+ DIR *dp;
+{
+ int files_left;
+ struct dirent *entry;
+ long cookie;
+
+ files_left = numfiles;
+ while (files_left > 0) {
+ int filenum;
+ char *filename;
+
+ cookie = telldir(dp);
+ if (cookie == -1) {
+ fprintf(stderr,
+ "warning: cookie = -1, errno=%d (%s)\n",
+ errno, strerror(errno));
+ }
+ errno = 0;
+ entry = readdir(dp);
+ if (entry == NULL) {
+ fprintf(stderr, "error reading %s: %s\n",
+ tdirname,
+ errno != 0 ? strerror(errno) :
+ "premature EOF");
+ exit(1);
+ }
+ filename = entry->d_name;
+ if (strcmp(filename, ".") == 0 ||
+ strcmp(filename, "..") == 0)
+ continue;
+ filenum = atoi(entry->d_name);
+ if (filenum < 0 || filenum >= numfiles) {
+ fprintf(stderr, "Warning: unexpected filename: %s\n",
+ filename);
+ continue;
+ }
+ save_file_info(filenum, cookie, files_left);
+ files_left--;
+ }
+}
+
+/*
+ * Check that a seekdir to each saved cookie behaves as expected.
+ * 1. we see the expected number of files starting at that cookie.
+ * 2. we see the expected first file at that cookie.
+ */
+
+static void
+check_file_info(dp)
+ DIR *dp;
+{
+ int file;
+
+ for (file = 0; file < numfiles; file++) {
+ file_info_t *ip;
+
+ ip = file_info + file;
+ if (! ip->inuse) {
+ fprintf(stderr, "no information for file %d\n", file);
+ exit(1);
+ }
+ seekdir(dp, ip->cookie);
+ verify(dp, file, ip->cookie, ip->numfiles);
+ }
+}
+
+/*
+ * The given directory should be positioned so that file "file" is next,
+ * and there should be "files_left" files left in the directory (including
+ * "file"). Verify that this is true; complain and exit if it isn't.
+ */
+
+static void
+verify(dp, file, cookie, files_left)
+ DIR *dp;
+ int file;
+ long cookie;
+ int files_left;
+{
+ struct dirent *entry;
+ int first_file = 1;
+ int files_found;
+
+ for (files_found = 0; files_found < files_left; files_found++) {
+ errno = 0;
+ entry = readdir(dp);
+ if (entry == NULL) {
+ char *errmsg = errno != 0 ?
+ strerror(errno) : NULL;
+
+ fprintf(stderr, "entry for %d (cookie %ld):\n",
+ file, cookie);
+ fprintf(stderr,
+ "expected to find %d entries, only found %d\n",
+ files_left, files_found);
+ if (errmsg)
+ fprintf(stderr, "error: %s\n", errmsg);
+ exit(1);
+ }
+ if (first_file) {
+ int file_read = atoi(entry->d_name);
+
+ if (file_read != file) {
+ fprintf(stderr,
+ "expected file %d at cookie %ld, ",
+ file, cookie);
+ fprintf(stderr, "found %s\n",
+ entry->d_name);
+ exit(1);
+ }
+ }
+ first_file = 0;
+ }
+}
+
+/*
+ * Remove the test directory and its contents.
+ */
+
+static void
+cleanup()
+{
+ char command[2 * MAXPATHLEN];
+
+ sprintf(command, "rm -rf %s", tdirname);
+ system(command);
+}
+
+/*
+ * Create and initialize the file info array.
+ */
+
+static void
+alloc_file_info(numfiles)
+ int numfiles;
+{
+ file_info = calloc(numfiles, sizeof (file_info_t));
+ if (file_info == NULL) {
+ fprintf(stderr, "can't allocate file info array: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ /* inuse fields zeroed by calloc */
+}
+
+/*
+ * Save the given information in file_info[filenum].
+ */
+
+static void
+save_file_info(filenum, cookie, files_left)
+ int filenum;
+ long cookie;
+ int files_left;
+{
+ if (debug) {
+ printf("%d 0x%lx %d\n", filenum, cookie, files_left);
+ }
+
+ file_info[filenum].inuse = 1;
+ file_info[filenum].cookie = cookie;
+ file_info[filenum].numfiles = files_left;
+}
diff --git a/special/touchn.c b/special/touchn.c
new file mode 100644
index 0000000..3038eba
--- /dev/null
+++ b/special/touchn.c
@@ -0,0 +1,37 @@
+/* @(#)touchn.c 1.2 98/10/26 Connectathon Testsuite */
+/*
+ * touch n files
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#endif
+
+#ifndef DOSorWIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#endif /* DOSorWIN32 */
+
+#include "../tests.h"
+
+main(argc,argv)
+char **argv;
+{
+ int n;
+ char buf[1024];
+
+ if (argc != 2) {
+ printf("usage: %s count\n", argv[0]);
+ exit(1);
+ }
+ n = atoi(argv[1]);
+ for (; n; n--) {
+ sprintf(buf, "name%d", n);
+ close(creat(buf, 0666));
+ }
+ exit(0);
+}
diff --git a/special/truncate.c b/special/truncate.c
new file mode 100644
index 0000000..4c4f076
--- /dev/null
+++ b/special/truncate.c
@@ -0,0 +1,70 @@
+/* @(#)truncate.c 1.2 98/10/26 Connectathon Testsuite */
+/*
+ * Test to see whether the server can handle extending a file via
+ * a setattr request.
+ */
+
+#if defined (DOS) || defined (WIN32)
+#define DOSorWIN32
+#include "../tests.h"
+#endif
+
+#ifndef DOSorWIN32
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#endif /* DOSorWIN32 */
+
+main()
+{
+ int fd;
+ struct stat statb;
+
+#ifdef DOSorWIN32
+ fprintf(stderr, "This Test Not Executable on DOS or Windows\n");
+ exit(1);
+#else
+ if ((fd = creat("testfile", 0644)) < 0) {
+ perror("creat");
+ exit(1);
+ }
+
+ if (ftruncate(fd, 0) < 0) {
+ perror("ftruncate1");
+ exit(1);
+ }
+ if (stat("testfile", &statb) < 0) {
+ perror("stat1");
+ exit(1);
+ }
+ if (statb.st_size != 0L) {
+ fprintf(stderr,
+ "truncate: testfile not zero length, but no error from ftruncate\n");
+ exit(1);
+ }
+
+ if (ftruncate(fd, 10) < 0) {
+ perror("ftruncate2");
+ exit(1);
+ }
+ if (stat("testfile", &statb) < 0) {
+ perror("stat1");
+ exit(1);
+ }
+ if (statb.st_size != 10L) {
+ fprintf(stderr,
+"truncate: testfile length not set correctly, but no error from ftruncate\n");
+ exit(1);
+ }
+
+ close(fd);
+ (void) unlink("testfile");
+
+ printf("truncate succeeded\n");
+
+ exit(0);
+#endif /* DOSorWIN32 */
+}
diff --git a/tests.h b/tests.h
new file mode 100644
index 0000000..607940c
--- /dev/null
+++ b/tests.h
@@ -0,0 +1,81 @@
+/* @(#)tests.h 1.7 2003/12/01 Connectathon Testsuite */
+/* 1.4 Lachman ONC Test Suite source */
+
+#include <errno.h>
+
+#ifdef WIN32
+#define DOSorWIN32
+#include <windows.h>
+#endif
+#ifdef DOS
+#define DOSorWIN32
+#include <dos.h>
+#endif
+#ifdef DOSorWIN32
+#define ANSI
+#include "unixdos.h"
+#endif
+
+#define DNAME "dir."
+#define FNAME "file."
+#define DDIRS 2
+#define DLEVS 5
+#define DFILS 5
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *) -1)
+#endif
+
+#ifndef DOSorWIN32
+#define TESTDIR "/mnt/nfstestdir"
+#define DCOUNT 10
+#define CHMOD_MASK 0777
+#define CHMOD_NONE 0
+#define CHMOD_RW 0666
+#else
+#define TESTDIR "o:\\nfstestd"
+#define DCOUNT 2 /* takes too long with10 */
+#define CHMOD_MASK (S_IREAD | S_IWRITE)
+#define CHMOD_NONE (S_IREAD)
+#define CHMOD_RW CHMOD_MASK
+#endif /* DOSorWIN32 */
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+extern char *Myname; /* name I was invoked with (for error msgs */
+
+#ifdef STDARG
+extern void error(char *, ...);
+#endif
+
+#ifdef __STDC__
+#define ARGS_(x) x
+#else
+#define ARGS_(x) ()
+#endif
+
+extern void starttime ARGS_((void));
+extern void endtime ARGS_((struct timeval *tv));
+extern long getparm ARGS_((char *parm, long min, char *label));
+extern void dirtree ARGS_((int lev, int files, int dirs, char *fname,
+ char *dname, int *totfiles, int *totdirs));
+extern void rmdirtree ARGS_((int lev, int files, int dirs, char *fname,
+ char *dname, int *totfiles, int *totdirs, int ignore));
+extern void testdir ARGS_((char *dir));
+extern int mtestdir ARGS_((char *dir));
+extern void complete ARGS_((void));
+
+#ifdef NEED_STRERROR
+extern char *strerror ARGS_((int));
+#endif
+
+#ifdef DOSorWIN32
+extern int unix_chdir(char *path);
+
+/* These are redfined so stderr and stdout go to the same redirected file */
+#define stdin (&_iob[0])
+#define stdout (&_iob[2])
+#define stderr (&_iob[2])
+#endif /* DOSorWIN32 */
diff --git a/tests.init b/tests.init
new file mode 100644
index 0000000..379ff4c
--- /dev/null
+++ b/tests.init
@@ -0,0 +1,225 @@
+
+#
+# @(#)tests.init 1.26 2003/12/30 Connectathon testsuite
+#
+MNTOPTIONS="rw,hard,intr"
+# Dummy MNTPOINT definition; should get overriden by server script.
+MNTPOINT="/mnt"
+
+# Use this mount command if using:
+# SVR3
+#MOUNTCMD='./domount -f NFS,$MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+# Use this mount command if using:
+# SVR4
+# Solaris 2.x
+#MOUNTCMD='./domount -F nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+#CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+# Use this mount command if using:
+# BSD
+# SunOS 4.X
+# Tru64 UNIX
+# HPUX
+# Linux
+# AIX
+# Mac OS X
+# At least some BSD systems don't recognize "hard" (since that's the
+# default), so you might also want to use this definition of MNTOPTIONS.
+MNTOPTIONS="rw,intr"
+FSOPT=nfs
+MOUNTCMD='./domount -t $FSOPT -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+#MOUNTCMD='./domount -t nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+# Use this mount command if using:
+# DG/UX
+#MOUNTCMD='./domount -t nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
+
+UMOUNTCMD='./domount -u $MNTPOINT'
+
+# Use the next two lines if using:
+# SVR3
+# SVR4
+# Solaris 2.x
+# HPUX
+#DASHN=
+#BLC=\\c
+
+# Use the next two lines if using:
+# BSD
+# SunOS 4.X
+# Linux
+# Tru64 UNIX
+# Mac OS X
+DASHN=-n
+BLC=
+
+# Use this path for:
+# Solaris 2.x
+#PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
+
+# Use this path for:
+# Solaris 2.x with GCC
+#PATH=/opt/gnu/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
+
+# Use this path for:
+# HPUX
+#PATH=/bin:/usr/bin:/etc:/usr/etc:/usr/local/bin:/usr/contrib/bin:.
+
+# Use this path for:
+# BSD
+# SunOS 4.X
+#PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/etc:.
+
+# Use this path for:
+# Tru64 UNIX
+# SVR4
+# Linux
+PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:.
+
+# Use this path for:
+# DG/UX
+#PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/etc:.
+
+# Use this path for:
+# IRIX
+#PATH=/bin:/usr/bin:/usr/bsd:/etc:/usr/etc:.
+
+# Use this path for:
+# AIX
+#PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:.
+#MOUNT=/usr/sbin/mount
+#UMOUNT=/usr/sbin/umount
+
+# Use this path for:
+# Mac OS X
+#PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:.
+
+SERVER=""
+SERVPATH="/server"
+TEST="-a"
+TESTARG="-t"
+
+# -----------------------------------------------
+# Defines for various variables used in scripts and makefiles.
+#
+# Do not remove the following three lines. They may be overridden by
+# other configuration parameters lower in this file, but these three
+# variables must be defined.
+CC=cc
+CFLAGS=
+LIBS=
+LOCKTESTS=tlock
+
+# Use with SVR3 systems.
+# Add -TR2 to CFLAGS for use on Amdahl UTS systems.
+#CFLAGS=-DSVR3
+#LIBS=`echo -lrpc -lsocket`
+
+# Use with BSD systems.
+#CC=gcc
+#CFLAGS=`echo -Duse_directs -DBSD`
+#MOUNT=/sbin/mount
+#UMOUNT=/sbin/umount
+
+# Use with SVR4 systems.
+#CFLAGS=-DSVR4
+#LIBS=`echo -lsocket -lnsl`
+
+# Use with SunOS 4.X systems
+#CC=/usr/5bin/cc
+#CFLAGS=`echo -DSUNOS4X -DNEED_STRERROR`
+
+# Use with Solaris 2.x systems. Need the 5.0 C compiler (or later)
+# for 64-bit mode.
+#CC=/opt/SUNWspro/bin/cc
+# Use this with GCC
+#CC=/opt/gnu/bin/gcc
+# Use this through Solaris 2.6. For Solaris 2.7 and later, use
+# this for 32-bit mode applications.
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG`
+# Use this with gcc (32-bit binaries):
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -mcpu=ultrasparc`
+# For Solaris 2.7 and later, use this for 64-bit mode applications
+# (Sun compiler).
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -xO0 -xarch=v9 -dalign -Xt -L/usr/lib/sparcv9`
+# Use this to make 64-bit binaries with gcc (3.1 or later; untested):
+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -m64`
+#LIBS=`echo -lsocket -lnsl`
+# Use this through Solaris 2.5.1.
+#LOCKTESTS=`echo tlock`
+# Use with 2.6 and later systems, 32-bit mode.
+#LOCKTESTS=`echo tlocklfs tlock64`
+# Use with 2.7 and later, 64-bit mode.
+#LOCKTESTS=`echo tlocklfs`
+
+# Use with Tru64 UNIX systems
+#CFLAGS=`echo -O -DTRU64 -DOSF1 -DMMAP -DSTDARG`
+# use the following instead of the above if using gcc
+#CFLAGS=`echo -O -DTRU64 -DOSF1 -DMMAP -DSTDARG -fwritable-strings`
+# 64-bit binaries with gcc (3.1 or later; untested):
+#CFLAGS=`echo -O -DTRU64 -DOSF1 -DMMAP -DSTDARG -fwritable-strings -m64`
+#MOUNT=/sbin/mount
+#UMOUNT=/sbin/umount
+
+# Use with HPUX systems, 10.00 and earlier.
+#CFLAGS=-DHPUX
+#CC=/bin/cc
+#RM=/bin/rm
+#MAKE=/bin/make
+
+# Use with HPUX 10.01.
+#CFLAGS=`echo -Ae -DHPUX`
+#CC=/opt/ansic/bin/cc
+#RM=/bin/rm
+#MAKE=/usr/bin/make
+
+# Use with HPUX 11.0, 32-bit machines.
+#CFLAGS=`echo -Ae -DHPUX -D_PSTAT64 -D_LARGEFILE64_SOURCE -DPORTMAP`
+#CC=/opt/ansic/bin/cc
+#LIBS=`echo -lnsl`
+#RM=/bin/rm
+#MAKE=/usr/bin/make
+
+# Use with HPUX 11.0, 64-bit machines.
+#CFLAGS=`echo -Ae -DHPUX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE`
+#CC=/opt/ansic/bin/cc
+#RM=/bin/rm
+#MAKE=/usr/bin/make
+
+# Use with DG/UX systems.
+#CFLAGS=-DSVR4
+#LIBS=`echo -lsocket -lnsl`
+
+# Use with IRIX systems. Use HAVE_SOCKLEN_T for IRIX >= 6.5.19.
+#CFLAGS=`echo -g -DHAVE_SOCKLEN_T -DSTDARG -DSVR4 -DIRIX -DMMAP`
+
+# Use with AIX.
+#CC=gcc
+#CFLAGS=`echo -DAIX -DSTDARG -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE`
+#LOCKTESTS=`echo tlocklfs`
+
+# Use with Linux 2.2 / GNU libc 2.0
+#CFLAGS=`echo -DLINUX -DGLIBC=20 -DMMAP -DSTDARG -fwritable-strings`
+#LIBS=`echo -lnsl`
+#MOUNT=/bin/mount
+#UMOUNT=/bin/umount
+
+# Use with Linux 2.4 / GNU libc 2.2
+#CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
+CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG`
+LIBS=`echo -lnsl`
+MOUNT=/bin/mount
+UMOUNT=/bin/umount
+LOCKTESTS=`echo tlocklfs tlock64`
+
+# Use with Linux if your distro doesn't provide a "cc".
+#CC=gcc
+
+# Use with Mac OS X
+#CFLAGS=`echo -DMACOSX -DNATIVE64 -DLARGE_LOCKS`
+#MOUNT=/sbin/mount
+#UMOUNT=/sbin/umount
+#LOCKTESTS=`echo tlock`
+
+# -----------------------------------------------
diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 0000000..ce2cbc7
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,55 @@
+#
+# @(#)Makefile 1.3 99/11/19 Connectathon Testsuite
+# 1.5 Lachman ONC Test Suite source
+#
+#
+# 'make all' makes test programs
+# 'make clean' cleans directories
+# 'make copy DESTDIR=path' copies test programs to path
+# 'make dist DESTDIR=path' copies sources to path
+
+TESTS = tcp tcpd udp udpd dirdmp dirprt pmaptst pmapbrd
+
+# dirdmp apparently doesn't work with Linux 2.2. So for Linux systems,
+# comment out the above definition and use this one.
+#TESTS = tcp tcpd udp udpd dirprt pmaptst pmapbrd
+
+include ../tests.init
+
+all: $(TESTS)
+
+tcp: tcp.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+tcpd: tcpd.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+udp: udp.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+udpd: udpd.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+dirdmp: dirdmp.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+dirprt: dirprt.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+pmaptst: pmaptst.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+pmapbrd: pmapbrd.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
+
+lint:
+ lint $(CFLAGS) tcp.c
+ lint $(CFLAGS) tcpd.c
+ lint $(CFLAGS) udp.c
+ lint $(CFLAGS) udpd.c
+ lint $(CFLAGS) dirdmp.c
+ lint $(CFLAGS) dirprt.c
+ lint $(CFLAGS) pmaptst.c
+ lint $(CFLAGS) pmapbrd.c
+
+clean:
+ rm -f *.o $(TESTS)
+
+copy: $(TESTS)
+ cp -f $(TESTS) $(DESTDIR)
+
+dist:
+ cp -f Makefile README *.c $(DESTDIR)
diff --git a/tools/README b/tools/README
new file mode 100644
index 0000000..56dc833
--- /dev/null
+++ b/tools/README
@@ -0,0 +1,21 @@
+ @(#)README 1.1 97/01/03 Connectathon Testsuite
+
+This directory contains tools which may help you out. The
+programs are very rough and may need to be customized for
+your purposes.
+
+dirdmp.c
+ dumps directory entries using hacked readdir()
+dirprt.c
+ dumps directory entries
+pmapbrd.c
+ tests portmap broadcast.
+pmaptst.c
+ tests pmap_set and pmap_unset calls
+tcp.c
+tcpd.c
+ tests tcp connection. Start tcpd on one host and
+ 'tcp host' on another.
+udp.c
+udpd.c
+ similar to tcp and tcpd
diff --git a/tools/dirdmp.c b/tools/dirdmp.c
new file mode 100644
index 0000000..76ac2c3
--- /dev/null
+++ b/tools/dirdmp.c
@@ -0,0 +1,220 @@
+/*
+ * @(#)dirdmp.c 1.8 2003/12/30 Connectathon Testsuite
+ * 1.2 Lachman ONC Test Suite source
+ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#ifdef OSF1
+#undef BSD
+#define dd_bsize dd_bufsiz
+#define dd_bbase dd_seek /* Totally bogus, but it works */
+#endif
+
+#ifndef ARGS_
+#ifdef __STDC__
+#define ARGS_(x) x
+#else
+#define ARGS_(x) ()
+#endif
+#endif
+
+static DIR * my_opendir ARGS_((char *name));
+static void print ARGS_((char *));
+static struct dirent *my_readdir ARGS_((DIR *dirp));
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#if defined(LINUX) || defined (AIX)
+ fprintf(stderr, "dirdmp is not supported on this platform.\n");
+ exit(1);
+#else
+ argv++;
+ argc--;
+ while (argc--) {
+ print(*argv++);
+ }
+#endif /* LINUX || AIX */
+}
+
+#if !(defined(LINUX) || defined(AIX))
+
+static void
+print(dir)
+ char *dir;
+{
+ DIR *dirp;
+
+ dirp = my_opendir(dir);
+ if (dirp == NULL) {
+ perror(dir);
+ return;
+ }
+ while (my_readdir(dirp) != NULL)
+ ;
+ closedir(dirp);
+}
+
+/*
+ * open a directory.
+ */
+static DIR *
+my_opendir(name)
+ char *name;
+{
+ register DIR *dirp;
+ register int fd;
+ struct stat sb;
+
+ if ((fd = open(name, 0)) == -1) {
+ printf("open failed\n");
+ return (NULL);
+ }
+ if (fstat(fd, &sb) == -1) {
+ printf("stat failed\n");
+ return (NULL);
+ }
+ /*
+ if ((sb.st_mode & S_IFMT) != S_IFDIR) {
+ printf("not a directory\n");
+ return (NULL);
+ }
+ */
+ printf("%s mode %o dir %o\n", name, (int)sb.st_mode, S_IFDIR);
+ if (((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) ||
+#if defined(SVR3) || defined(SVR4)
+ ((dirp->dd_buf = malloc(DIRBUF)) == NULL)) {
+#else
+ ((dirp->dd_buf = malloc((int)sb.st_blksize)) == NULL)) {
+#endif
+ if (dirp) {
+ if (dirp->dd_buf) {
+ free(dirp->dd_buf);
+ }
+ free(dirp);
+ }
+ close(fd);
+ return (NULL);
+ }
+#if !defined(SVR3) && !defined(SVR4) && !defined(BSD)
+ dirp->dd_bsize = sb.st_blksize;
+#if !defined(SUNOS4X)
+ dirp->dd_bbase = 0;
+#if !defined(OSF1)
+ dirp->dd_entno = 0;
+#endif
+#endif
+#endif
+ dirp->dd_fd = fd;
+ dirp->dd_loc = 0;
+ return (dirp);
+}
+
+/*
+ * get next entry in a directory.
+ */
+static
+struct dirent *
+my_readdir(dirp)
+ DIR *dirp;
+{
+ register struct dirent *dp;
+ static int header; /* 1 after header prints */
+
+ for (;;) {
+ if (dirp->dd_loc == 0) {
+#if defined(SVR3) || defined(SVR4)
+ dirp->dd_size = getdents(dirp->dd_fd,
+#if defined(__STDC__)
+ (struct dirent *) dirp->dd_buf, DIRBUF);
+#else
+ dirp->dd_buf, DIRBUF);
+#endif
+#else
+#if defined(SUNOS4X)
+ dirp->dd_size = getdents(dirp->dd_fd,
+ dirp->dd_buf, dirp->dd_bsize);
+#elif defined(MACOSX)
+ dirp->dd_size = getdirentries(dirp->dd_fd,
+ dirp->dd_buf, dirp->dd_len, &dirp->dd_seek);
+#elif defined(BSD)
+ dirp->dd_size = getdents(dirp->dd_fd,
+ dirp->dd_buf, dirp->dd_size);
+#else
+ dirp->dd_size = getdirentries(dirp->dd_fd,
+ dirp->dd_buf, dirp->dd_bsize, &dirp->dd_bbase);
+#endif
+#endif
+ if (dirp->dd_size < 0) {
+ perror("getdirentries");
+ return (NULL);
+ }
+ if (dirp->dd_size == 0) {
+ printf("EOF\n");
+ return (NULL);
+ }
+#if !defined(SVR3) && !defined(SVR4) && !defined(SUNOS4X) && \
+ !defined(OSF1) && !defined(BSD)
+ dirp->dd_entno = 0;
+#endif
+ }
+ if (dirp->dd_loc >= dirp->dd_size) {
+#ifdef BSD
+ printf("EOB offset %ld\n",
+ (long)lseek(dirp->dd_fd, 0, SEEK_CUR));
+#else
+ printf("EOB offset %ld\n", (long)tell(dirp->dd_fd));
+#endif
+ dirp->dd_loc = 0;
+ header = 0;
+ continue;
+ }
+ dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
+ if (dp->d_reclen <= 0) {
+ printf("0 reclen\n");
+ return (NULL);
+ }
+#if defined(SVR3) || defined(SVR4)
+ if (!header) {
+ header = 1;
+ printf(" loc ino reclen name\n");
+ }
+ printf("%5d %6ld %6d %s\n",
+ dirp->dd_loc, (long)dp->d_ino, dp->d_reclen,
+ dp->d_name);
+#else
+ if (!header) {
+ header = 1;
+ printf(" loc fileno reclen namelen name\n");
+ }
+ printf("%5d %6d %6d %7d %s\n",
+ dirp->dd_loc, dp->d_fileno, dp->d_reclen,
+ dp->d_namlen, dp->d_name);
+#endif
+ dirp->dd_loc += dp->d_reclen;
+#if !defined(SVR3) && !defined(SVR4) && !defined(SUNOS4X) && \
+ !defined(OSF1) && !defined(BSD)
+ dirp->dd_entno++;
+#endif
+#if defined(SVR3) || defined(SVR4)
+ if (dp->d_ino == 0) {
+#else
+ if (dp->d_fileno == 0) {
+#endif
+ continue;
+ }
+ return (dp);
+ }
+}
+
+#endif /* LINUX || AIX */
diff --git a/tools/dirprt.c b/tools/dirprt.c
new file mode 100644
index 0000000..a8b50ea
--- /dev/null
+++ b/tools/dirprt.c
@@ -0,0 +1,108 @@
+/*
+ * @(#)dirprt.c 1.6 2002/12/13 Connectathon Testsuite
+ * 1.2 Lachman ONC Test Suite source
+ */
+
+#ifdef SOLARIS2X
+/*
+ * XXX if this is lacking, i-numbers get printed as zero. Not clear why;
+ * should investigate sometime.
+ */
+#define _FILE_OFFSET_BITS 64
+#endif
+
+#include <sys/param.h>
+#ifndef major
+#include <sys/types.h>
+#endif
+#ifdef use_directs
+#include <sys/dir.h>
+#else
+#include <dirent.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+
+#ifndef ARGS_
+#ifdef __STDC__
+#define ARGS_(x) x
+#else
+#define ARGS_(x) ()
+#endif
+#endif
+
+static DIR *my_opendir ARGS_((char *));
+static void print ARGS_((char *));
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#if defined (AIX)
+ fprintf(stderr, "dirprt is not supported on this platform.\n");
+ exit(1);
+#else
+ argv++;
+ argc--;
+ while (argc--) {
+ print(*argv++);
+ }
+#endif /* AIX */
+}
+
+#if !defined(AIX)
+
+static void
+print(dir)
+ char *dir;
+{
+ DIR *dirp;
+#ifdef use_directs
+ struct direct *dp;
+#else
+ struct dirent *dp;
+#endif
+
+ dirp = my_opendir(dir);
+ if (dirp == NULL) {
+ perror(dir);
+ return;
+ }
+ while ((dp = readdir(dirp)) != NULL) {
+#if defined(SVR3) || defined(SVR4) || defined(LINUX)
+ printf("%5ld %5ld %5d %s\n", (long)telldir(dirp),
+ (long)dp->d_ino,
+ dp->d_reclen, dp->d_name);
+#else
+ printf("%5ld %5d %5d %5d %s\n", (long)telldir(dirp),
+ dp->d_fileno,
+ dp->d_reclen, dp->d_namlen, dp->d_name);
+#endif
+ }
+ closedir(dirp);
+}
+
+#include <sys/stat.h>
+
+/*
+ * open a directory.
+ */
+static DIR *
+my_opendir(name)
+ char *name;
+{
+ struct stat sb;
+
+ if (stat(name, &sb) == -1) {
+ printf("stat failed\n");
+ return (NULL);
+ }
+ if ((sb.st_mode & S_IFMT) != S_IFDIR) {
+ printf("not a directory\n");
+ return (NULL);
+ }
+ printf("%s mode %o dir %o\n", name, (int)sb.st_mode, S_IFDIR);
+ return(opendir(name));
+}
+
+#endif /* AIX */
diff --git a/tools/pmapbrd.c b/tools/pmapbrd.c
new file mode 100644
index 0000000..c447ced
--- /dev/null
+++ b/tools/pmapbrd.c
@@ -0,0 +1,462 @@
+/*
+ * @(#)pmapbrd.c 1.8 2003/12/29 Connectathon Testsuite
+ * 1.4 Lachman ONC Test Suite source
+ *
+ * Test portmap broadcast rpc facility
+ */
+
+#include <rpc/rpc.h>
+#if !(defined(SVR4) || defined(HPUX))
+#include <rpc/pmap_prot.h>
+#endif
+#include <sys/socket.h>
+#ifdef SVR3
+#include <sys/fs/nfs/time.h>
+#else
+#include <sys/time.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <arpa/inet.h>
+#ifdef SVR4
+#include <netinet/in.h>
+#include <sys/sockio.h>
+#endif
+
+#define MAX_BROADCAST_SIZE 1400
+
+static XDR xdr_stream;
+static struct sockaddr_in baddr; /* broadcast addresses */
+
+#ifndef ARGS_
+#ifdef __STDC__
+#define ARGS_(x) x
+#else
+#define ARGS_(x) ()
+#endif
+#endif
+
+#if defined(IRIX) || !(defined(SVR4) || defined(HPUX))
+typedef bool_t (*resultproc_t) ARGS_((caddr_t, ...));
+#endif
+
+static char outbuf[MAX_BROADCAST_SIZE], inbuf[MAX_BROADCAST_SIZE];
+
+#if defined(SVR4) || defined(HPUX)
+/*
+ * Copied from rpc/pmap_prot.h. We don't want to include that
+ * file because it defines some structs that we also define here.
+ * In this case, we want to use our own definitions instead of
+ * the system definitions.
+ */
+#define PMAPPORT 111
+#define PMAPPROG ((u_long)100000)
+#define PMAPVERS ((u_long)2)
+#define PMAPPROC_CALLIT ((u_long)5)
+#endif
+
+/*
+ * Structures and XDR routines for parameters to and replys from
+ * the pmapper remote-call-service.
+ */
+
+struct rmtcallargs {
+#ifdef SVR3
+ ulong prog, vers, proc, arglen;
+#else
+ u_long prog, vers, proc, arglen;
+#endif
+ caddr_t args_ptr;
+ xdrproc_t xdr_args;
+};
+static bool_t xdr_rmtcall_args();
+
+struct rmtcallres {
+#ifdef SVR3
+ ulong *port_ptr;
+ ulong resultslen;
+#else
+ u_long *port_ptr;
+ u_long resultslen;
+#endif
+ caddr_t results_ptr;
+ xdrproc_t xdr_results;
+};
+static bool_t xdr_rmtcallres ARGS_((XDR *, struct rmtcallres *));
+
+#ifdef SVR3
+#define RPROG (ulong)40000010
+#define RVERS (ulong)1
+#define RPROC_NUM (ulong)1
+#else
+#define RPROG (u_long)40000010
+#define RVERS (u_long)1
+#define RPROC_NUM (u_long)1
+#endif
+
+static enum clnt_stat clnt_broadcast ARGS_((int, unsigned long, unsigned long,
+ unsigned long, xdrproc_t, void *, xdrproc_t, void *,
+ resultproc_t, struct timeval *));
+
+static int getbroadcastnets ARGS_((int, char *));
+static bool_t eachresult();
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ struct sockaddr_in sin;
+ int pktspersec, count;
+ int sock;
+ enum clnt_stat clnt_stat;
+ struct timeval t;
+ int a, b;
+ int i;
+
+ if (argc != 3) {
+ fprintf(stderr, "usage: %s pktspersec count\n", argv[0]);
+ exit(1);
+ }
+
+ pktspersec = atoi(argv[1]);
+ if (pktspersec < 1) {
+ fprintf(stderr,
+ "%s: packet rate must greater than or equal to 1\n",
+ argv[0]);
+ exit(1);
+ }
+ count = atoi(argv[2]);
+
+ sock = socket(AF_INET,SOCK_DGRAM,0);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = INADDR_ANY;
+ sin.sin_port = htons(3300);
+
+ if(bind(sock, (struct sockaddr *)&sin, sizeof (sin)) == -1) {
+ perror("brd: bind");
+ exit(1);
+ }
+#ifdef SO_BROADCAST
+ i = 1;
+#ifdef __STDC__
+ if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (const char *)&i,
+ sizeof(i)) == -1) {
+#else
+ if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &i, sizeof(i)) == -1) {
+#endif
+ perror("brd: setsockopt");
+ exit(1);
+ }
+#endif
+ if (!getbroadcastnets(sock, inbuf))
+ exit(1);
+ baddr.sin_family = AF_INET;
+ baddr.sin_port = htons(PMAPPORT);
+ printf("broadcast addr %x\n", ntohl(baddr.sin_addr.s_addr));
+
+ if (pktspersec == 1) {
+ t.tv_sec = 1;
+ t.tv_usec = 0;
+ } else {
+ t.tv_sec = 0;
+ t.tv_usec = 1000000 / pktspersec;
+ }
+ printf("%d/sec for %d\n", pktspersec, count);
+
+ for (i=0; i<count; i++) {
+ /*
+ * modified verison of clnt_broadcast is called.
+ * XXX shouldn't have to cast eachresult?
+ */
+ clnt_stat =
+ clnt_broadcast(sock, RPROG, RVERS, RPROC_NUM, xdr_void, &a,
+ xdr_void, &b, (resultproc_t)eachresult, &t);
+ if(clnt_stat != RPC_TIMEDOUT) {
+ printf("error: clnt_stat = %d\n", clnt_stat);
+ clnt_perrno(clnt_stat);
+ exit(-1);
+ }
+ }
+}
+
+/*ARGSUSED*/
+static bool_t
+eachresult(resp, dummy)
+ caddr_t resp;
+ void *dummy;
+{
+ return(1);
+}
+
+/*
+ * XDR remote call arguments
+ * written for XDR_ENCODE direction only
+ */
+static bool_t
+xdr_rmtcall_args(xdrs, cap)
+ register XDR *xdrs;
+ register struct rmtcallargs *cap;
+{
+#ifdef SVR3
+ uint lenposition, argposition, position;
+#else
+ u_int lenposition, argposition, position;
+#endif
+
+ if (xdr_u_long(xdrs, &(cap->prog)) &&
+ xdr_u_long(xdrs, &(cap->vers)) &&
+ xdr_u_long(xdrs, &(cap->proc))) {
+ lenposition = XDR_GETPOS(xdrs);
+ if (! xdr_u_long(xdrs, &(cap->arglen)))
+ return (FALSE);
+ argposition = XDR_GETPOS(xdrs);
+ if (! (*(cap->xdr_args))(xdrs, cap->args_ptr))
+ return (FALSE);
+ position = XDR_GETPOS(xdrs);
+#ifdef SVR3
+ cap->arglen = (ulong)position - (ulong)argposition;
+#else
+ cap->arglen = (u_long)position - (u_long)argposition;
+#endif
+ XDR_SETPOS(xdrs, lenposition);
+ if (! xdr_u_long(xdrs, &(cap->arglen)))
+ return (FALSE);
+ XDR_SETPOS(xdrs, position);
+ return (TRUE);
+ }
+ return (FALSE);
+}
+
+/*
+ * XDR remote call results
+ * written for XDR_DECODE direction only
+ */
+static bool_t
+xdr_rmtcallres(xdrs, crp)
+ register XDR *xdrs;
+ register struct rmtcallres *crp;
+{
+
+#ifdef SVR3
+ if (xdr_reference(xdrs, (caddr_t *)&crp->port_ptr, sizeof (ulong), xdr_u_long) &&
+#else
+ if (xdr_reference(xdrs, (caddr_t *)&crp->port_ptr, sizeof (u_long), xdr_u_long) &&
+#endif
+ xdr_u_long(xdrs, &crp->resultslen))
+ return ((*(crp->xdr_results))(xdrs, crp->results_ptr));
+ return (FALSE);
+}
+
+/*
+ * The following is kludged-up support for simple rpc broadcasts.
+ * Someday a large, complicated system will replace these trivial
+ * routines which only support udp/ip .
+ */
+
+static int
+getbroadcastnets(sock, buf)
+ int sock; /* any valid socket will do */
+ char *buf; /* why allocxate more when we can use existing... */
+{
+ struct ifconf ifc;
+ struct ifreq ifreq, *ifr;
+ struct sockaddr_in *sin;
+ int n;
+
+ ifc.ifc_len = MAX_BROADCAST_SIZE;
+ ifc.ifc_buf = buf;
+ if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
+ perror("broadcast: ioctl (get interface configuration)");
+ return (0);
+ }
+ ifr = ifc.ifc_req;
+ for (n = ifc.ifc_len/sizeof (struct ifreq); n > 0; n--, ifr++) {
+ ifreq = *ifr;
+ if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
+ perror("broadcast: ioctl (get interface flags)");
+ continue;
+ }
+ if ((ifreq.ifr_flags & IFF_BROADCAST) &&
+ (ifreq.ifr_flags & IFF_UP) &&
+ ifr->ifr_addr.sa_family == AF_INET) {
+ sin = (struct sockaddr_in *)&ifr->ifr_addr;
+#ifdef SIOCGIFBRDADDR
+ if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
+ baddr.sin_addr = inet_makeaddr(inet_netof(sin->sin_addr),
+ INADDR_ANY);
+ } else {
+ baddr.sin_addr = ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr;
+ }
+
+#else
+ baddr.sin_addr = inet_makeaddr(inet_netof
+ (sin->sin_addr.s_addr), INADDR_ANY);
+#endif
+ break;
+ }
+ }
+
+ return (1);
+}
+
+static enum clnt_stat
+clnt_broadcast(sock, prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult, t)
+ int sock;
+#ifdef SVR3
+ ulong prog; /* program number */
+ ulong vers; /* version number */
+ ulong proc; /* procedure number */
+#else
+ u_long prog; /* program number */
+ u_long vers; /* version number */
+ u_long proc; /* procedure number */
+#endif
+ xdrproc_t xargs; /* xdr routine for args */
+ void *argsp; /* pointer to args */
+ xdrproc_t xresults; /* xdr routine for results */
+ void *resultsp; /* pointer to results */
+ resultproc_t eachresult; /* call with each result obtained */
+ struct timeval *t;
+{
+ XDR *xdrs = &xdr_stream;
+ enum clnt_stat stat;
+ AUTH *unix_auth = authunix_create_default();
+#ifdef HAVE_SOCKLEN_T
+ socklen_t fromlen;
+#else
+ size_t fromlen;
+#endif
+ long outlen, inlen;
+ int readfds;
+ register int mask;
+ bool_t done = FALSE;
+#ifdef SVR3
+ register ulong xid;
+ ulong port;
+#else
+ register u_long xid;
+ u_long port;
+#endif
+ struct sockaddr_in raddr; /* broadcast and response addresses */
+ struct rmtcallargs a;
+ struct rmtcallres r;
+ struct rpc_msg msg;
+
+ mask = (1 << sock);
+ msg.rm_xid = xid = random();
+ msg.rm_direction = CALL;
+ msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
+ msg.rm_call.cb_prog = PMAPPROG;
+ msg.rm_call.cb_vers = PMAPVERS;
+ msg.rm_call.cb_proc = PMAPPROC_CALLIT;
+ msg.rm_call.cb_cred = unix_auth->ah_cred;
+ msg.rm_call.cb_verf = unix_auth->ah_verf;
+ a.prog = prog;
+ a.vers = vers;
+ a.proc = proc;
+ a.xdr_args = xargs;
+ a.args_ptr = argsp;
+ r.port_ptr = &port;
+ r.xdr_results = xresults;
+ r.results_ptr = resultsp;
+ xdrmem_create(xdrs, outbuf, MAX_BROADCAST_SIZE, XDR_ENCODE);
+ if ((! xdr_callmsg(xdrs, &msg)) || (! xdr_rmtcall_args(xdrs, &a))) {
+ stat = RPC_CANTENCODEARGS;
+ goto done_broad;
+ }
+ outlen = (int)xdr_getpos(xdrs);
+ xdr_destroy(xdrs);
+ /*
+ * Basic loop: broadcast a packet and wait a while for response(s).
+ * The response timeout grows larger per iteration.
+ */
+
+ if (sendto(sock, outbuf, outlen, 0,
+ (struct sockaddr *)&baddr,
+ sizeof (struct sockaddr)) != outlen) {
+ perror("Cannot send broadcast packet");
+ stat = RPC_CANTSEND;
+ goto done_broad;
+ }
+recv_again:
+ msg.acpted_rply.ar_verf = _null_auth;
+ msg.acpted_rply.ar_results.where = (caddr_t)&r;
+ msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
+ readfds = mask;
+ switch (select(32, (fd_set *)&readfds, (fd_set *)NULL, (fd_set *)NULL,
+ t)) {
+
+ case 0: /* timed out */
+ stat = RPC_TIMEDOUT;
+ goto done_broad;
+
+ case -1: /* some kind of error */
+ if (errno == EINTR)
+ goto recv_again;
+ perror("Broadcast select problem");
+ stat = RPC_CANTRECV;
+ goto done_broad;
+
+ } /* end of select results switch */
+ if ((readfds & mask) == 0)
+ goto recv_again;
+try_again:
+ fromlen = sizeof(struct sockaddr);
+ inlen = recvfrom(sock, inbuf, MAX_BROADCAST_SIZE, 0,
+ (struct sockaddr *)&raddr, &fromlen);
+ if (inlen < 0) {
+ if (errno == EINTR)
+ goto try_again;
+ perror("Cannot receive reply to broadcast");
+ stat = RPC_CANTRECV;
+ goto done_broad;
+ }
+#ifdef SVR3
+ if (inlen < sizeof(ulong))
+#else
+ if (inlen < sizeof(u_long))
+#endif
+ goto recv_again;
+ /*
+ * see if reply transaction id matches sent id.
+ * If so, decode the results.
+ */
+ xdrmem_create(xdrs, inbuf, inlen, XDR_DECODE);
+ if (xdr_replymsg(xdrs, &msg)) {
+ if ((msg.rm_xid == xid) &&
+ (msg.rm_reply.rp_stat == MSG_ACCEPTED) &&
+ (msg.acpted_rply.ar_stat == SUCCESS)) {
+#ifdef SVR3
+ raddr.sin_port = htons((ushort)port);
+#else
+ raddr.sin_port = htons((u_short)port);
+#endif
+ done = (*eachresult)(resultsp, &raddr);
+ }
+ /* otherwise, we just ignore the errors ... */
+ } else {
+ /* some kind of deserialization problem ... */
+ if (msg.rm_xid == xid)
+ fprintf(stderr, "Broadcast deserialization problem");
+ /* otherwise, just random garbage */
+ }
+ xdrs->x_op = XDR_FREE;
+ msg.acpted_rply.ar_results.proc = xdr_void;
+ (void)xdr_replymsg(xdrs, &msg);
+ (void)(*xresults)(xdrs, resultsp);
+ xdr_destroy(xdrs);
+ if (done) {
+ stat = RPC_SUCCESS;
+ } else {
+ goto recv_again;
+ }
+
+done_broad:
+ AUTH_DESTROY(unix_auth);
+ return (stat);
+}
diff --git a/tools/pmaptst.c b/tools/pmaptst.c
new file mode 100644
index 0000000..668cc0e
--- /dev/null
+++ b/tools/pmaptst.c
@@ -0,0 +1,81 @@
+/*
+ * @(#)pmaptst.c 1.3 98/11/30 Connectathon Testsuite
+ * 1.3 Lachman ONC Test Suite source
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#define RPCINFO "rpcinfo -p"
+
+#ifdef SVR3
+#define PROG ((ulong)432123)
+#define VERS ((ulong)4)
+#else
+#define PROG ((u_long)432123)
+#define VERS ((u_long)4)
+#endif
+#define UPORT 2345
+#define TPORT 2346
+
+#ifndef ARGS_
+#ifdef __STDC__
+#define ARGS_(x) x
+#else
+#define ARGS_(x) ()
+#endif
+#endif
+
+extern int pmap_set ARGS_((u_int prog, u_int vers, u_int proto, u_short port));
+extern int pmap_unset ARGS_((u_int prog, u_int vers));
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int errs = 0;
+
+ printf("portmapper set/unset test.\n");
+ printf("rpcinfo before pmap_set:\n");
+ system(RPCINFO);
+
+ printf("\n--- Registering udp program %lu version %lu port %d... ",
+ (u_long)PROG, (u_long)VERS, UPORT);
+ if (pmap_set(PROG, VERS, IPPROTO_UDP, UPORT))
+ printf("done.\n");
+ else {
+ printf("failed.\n");
+ errs++;
+ }
+ printf("rpcinfo after udp pmap_set:\n");
+ system(RPCINFO);
+
+ printf("\n--- Registering tcp program %lu version %lu port %d... ",
+ (u_long)PROG, (u_long)VERS, TPORT);
+ if (pmap_set(PROG, VERS, IPPROTO_TCP, TPORT))
+ printf("done.\n");
+ else {
+ printf("failed.\n");
+ errs++;
+ }
+ printf("rpcinfo after tcp pmap_set:\n");
+ system(RPCINFO);
+
+ printf("\n--- Unregistering program %lu version %lu... ",
+ (u_long)PROG, (u_long)VERS);
+ if (pmap_unset(PROG, VERS))
+ printf("done.\n");
+ else {
+ printf("failed.\n");
+ errs++;
+ }
+ printf("rpcinfo after pmap_unset:\n");
+ system(RPCINFO);
+ if (!errs)
+ printf("Test complete ok\n");
+ exit(errs);
+}
diff --git a/tools/tcp.c b/tools/tcp.c
new file mode 100644
index 0000000..e78b588
--- /dev/null
+++ b/tools/tcp.c
@@ -0,0 +1,73 @@
+/* @(#)tcp.c 1.4 99/02/11 Connectathon Testsuite */
+/*
+ * client for simple tcp ping program.
+ * open connection with server, who will echo request back.
+ */
+#define TCP_PORT 3456
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int s, len, ret;
+ struct sockaddr_in addr; /* socket address */
+ size_t addrlen = sizeof(struct sockaddr_in);
+ struct hostent *hp;
+ char *peer;
+ char buf[BUFSIZ];
+ char *msg = "This is a test message!";
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s hostname\n", argv[0]);
+ exit(1);
+ }
+ peer = argv[1];
+
+ if ((hp = gethostbyname(peer)) == NULL) {
+ fprintf(stderr, "Can't find host %s\n", peer);
+ exit(1);
+ }
+
+ if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ xxit("socket");
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(TCP_PORT);
+ addr.sin_addr = *(struct in_addr *)hp->h_addr;
+ fprintf(stderr, "Connecting to %s (%x)\n", peer,
+ addr.sin_addr.s_addr);
+ if (connect(s, (struct sockaddr *)&addr, addrlen) < 0)
+ xxit("connect");
+
+ strcpy(buf, msg);
+ len = strlen(buf);
+
+ ret = write(s, buf, len);
+ fprintf(stderr, " write ret %d (len %d)\n", ret, len);
+ ret = read(s, buf, BUFSIZ);
+ fprintf(stderr, " read ret %d\n", ret);
+
+ if (ret != len || *buf != *msg + 1 || strcmp(buf+1, msg+1))
+ fprintf(stderr, "Message error: sent '%s' recv '%s'\n",
+ msg, buf);
+ else
+ fprintf(stderr, "tcp ping to %s ok\n", peer);
+}
+
diff --git a/tools/tcpd.c b/tools/tcpd.c
new file mode 100644
index 0000000..8ab8877
--- /dev/null
+++ b/tools/tcpd.c
@@ -0,0 +1,84 @@
+/* @(#)tcpd.c 1.6 2003/12/29 Connectathon Testsuite */
+/*
+ * server for simple tcp ping program.
+ * listens on socket for connection request, then echos back
+ * request from client.
+ */
+#define TCP_PORT 3456
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int s, ns; /* sockets */
+ struct sockaddr_in addr; /* socket address */
+ int ret;
+#ifdef HAVE_SOCKLEN_T
+ socklen_t addrlen = sizeof(struct sockaddr_in);
+#else
+ size_t addrlen = sizeof(struct sockaddr_in);
+#endif
+ struct hostent *hp;
+ char buf[BUFSIZ];
+
+ if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ xxit("socket");
+
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(TCP_PORT);
+ addr.sin_addr.s_addr = INADDR_ANY;
+
+ if (bind(s, (struct sockaddr *)&addr, addrlen) < 0)
+ xxit("bind");
+
+ if (listen(s, 5) < 0)
+ xxit("listen");
+
+ while(1) {
+ fprintf(stderr, "%s awaiting accept\n", argv[0]);
+ addrlen = sizeof(struct sockaddr_in);
+ if ((ns = accept(s, (struct sockaddr *)&addr, &addrlen)) < 0)
+ xxit("accept");
+#ifdef __STDC__
+ if (hp = gethostbyaddr((const char *)&addr.sin_addr,
+ sizeof(addr.sin_addr), AF_INET))
+#else
+ if (hp = gethostbyaddr(&addr.sin_addr, sizeof(addr.sin_addr),
+ AF_INET))
+#endif
+ fprintf(stderr, "\
+%s: accepted connection from host %s\n", argv[0], hp->h_name);
+ else
+ fprintf(stderr, "\
+%s: accepted connection from host %x\n", argv[0], addr.sin_addr.s_addr);
+
+ ret = read(ns, buf, BUFSIZ);
+ fprintf(stderr, " read ret %d\n", ret);
+ if (ret > 0) {
+ *buf = *buf + 1;
+ ret = write(ns, buf, ret);
+ fprintf(stderr, " write ret %d\n", ret);
+ }
+ sleep(5);
+ close(ns);
+ }
+}
+
diff --git a/tools/udp.c b/tools/udp.c
new file mode 100644
index 0000000..70dc495
--- /dev/null
+++ b/tools/udp.c
@@ -0,0 +1,74 @@
+/* @(#)udp.c 1.6 2003/12/29 Connectathon Testsuite */
+/*
+ * client for simple udp ping program.
+ * send request to server, who will echo request back.
+ */
+#define UDP_PORT 3457
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int s, len, ret;
+ struct sockaddr_in addr; /* socket address */
+#ifdef HAVE_SOCKLEN_T
+ socklen_t addrlen = sizeof(struct sockaddr_in);
+#else
+ size_t addrlen = sizeof(struct sockaddr_in);
+#endif
+ struct hostent *hp;
+ char *peer;
+ char buf[BUFSIZ];
+ char *msg = "This is a test message!";
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s hostname\n", argv[0]);
+ exit(1);
+ }
+ peer = argv[1];
+
+ if ((hp = gethostbyname(peer)) == NULL) {
+ fprintf(stderr, "Can't find host %s\n", peer);
+ exit(1);
+ }
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ xxit("socket");
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(UDP_PORT);
+ addr.sin_addr = *(struct in_addr *)hp->h_addr;
+ fprintf(stderr, "Sending request to %s (%x)\n", peer,
+ addr.sin_addr.s_addr);
+
+ strcpy(buf, msg);
+ len = strlen(buf);
+
+ ret = sendto(s, buf, len, 0, (struct sockaddr *)&addr, addrlen);
+ fprintf(stderr, " sendto ret %d (len %d)\n", ret, len);
+ ret = recvfrom(s, buf, BUFSIZ, 0, (struct sockaddr *)&addr, &addrlen);
+ fprintf(stderr, " recvfrom ret %d\n", ret);
+
+ if (ret != len || *buf != *msg + 1 || strcmp(buf+1, msg+1))
+ fprintf(stderr, "Message error: sent '%s' recv '%s'\n",
+ msg, buf);
+ else
+ fprintf(stderr, "udp ping to %s ok\n", peer);
+}
+
diff --git a/tools/udpd.c b/tools/udpd.c
new file mode 100644
index 0000000..17fdec5
--- /dev/null
+++ b/tools/udpd.c
@@ -0,0 +1,80 @@
+/* @(#)udpd.c 1.6 2003/12/29 Connectathon Testsuite */
+/*
+ * server for simple udp ping program.
+ * listens on socket for request, then echos back
+ * request from client.
+ */
+#define UDP_PORT 3457
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+static void
+xxit(s)
+ char *s;
+{
+ perror(s);
+ exit(1);
+}
+
+/*ARGSUSED*/
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int s; /* socket */
+ struct sockaddr_in addr; /* socket address */
+ int ret;
+#ifdef HAVE_SOCKLEN_T
+ socklen_t addrlen = sizeof(struct sockaddr_in);
+#else
+ size_t addrlen = sizeof(struct sockaddr_in);
+#endif
+ struct hostent *hp;
+ char buf[BUFSIZ];
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ xxit("socket");
+
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(UDP_PORT);
+ addr.sin_addr.s_addr = INADDR_ANY;
+
+ if (bind(s, (struct sockaddr *)&addr, addrlen) < 0)
+ xxit("bind");
+
+ while(1) {
+ fprintf(stderr, "%s awaiting request\n", argv[0]);
+ addrlen = sizeof(struct sockaddr_in);
+ ret = recvfrom(s, buf, BUFSIZ, 0, (struct sockaddr *)&addr,
+ &addrlen);
+ if (ret < 0)
+ xxit("recvfrom");
+#ifdef __STDC__
+ if (hp = gethostbyaddr((const char *)&addr.sin_addr,
+ sizeof(addr.sin_addr), AF_INET))
+#else
+ if (hp = gethostbyaddr(&addr.sin_addr, sizeof(addr.sin_addr),
+ AF_INET))
+#endif
+ fprintf(stderr, "\
+%s: accepted request from host %s\n", argv[0], hp->h_name);
+ else
+ fprintf(stderr, "\
+%s: accepted request from host %x\n", argv[0], addr.sin_addr.s_addr);
+
+ fprintf(stderr, " recvfrom ret %d\n", ret);
+ if (ret > 0) {
+ *buf = *buf + 1;
+ ret = sendto(s, buf, ret, 0, (struct sockaddr *)&addr,
+ addrlen);
+ fprintf(stderr, " sendto ret %d\n", ret);
+ }
+ }
+}
+
diff --git a/unixdos.h b/unixdos.h
new file mode 100644
index 0000000..3c66cb8
--- /dev/null
+++ b/unixdos.h
@@ -0,0 +1,109 @@
+/*
+ * @(#)unixdos.h 1.1 98/10/26 Connectathon Testsuite
+ *
+ * typedefs used in the DOSorWIN version only
+ */
+
+#if ! defined(_WINSOCKAPI_)
+struct timeval
+{
+ long tv_sec; /* seconds since midnight for DOS */
+ long tv_usec; /* and microseconds */
+};
+#endif
+
+typedef unsigned char u_char;
+
+#define MAXPATHLEN 256 /* tune later */
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+void gettimeofday(struct timeval *TV, struct timezone *TimeZone);
+int unix_chdir(char * path);
+int lstat(char *path, struct stat *buf);
+
+/************************************************************
+statfs stuff
+************************************************************/
+
+ typedef struct {
+ long val[2];
+ } fsid_t;
+ struct statfs {
+ long f_type; /* type of info, zero for now */
+ long f_bsize; /* fundamental file system block size */
+ long f_blocks; /* total blocks in file system */
+ long f_bfree; /* free blocks */
+ long f_bavail; /* free blocks available to non-super-user */
+ long f_files; /* total file nodes in file system */
+ long f_ffree; /* free file nodes in fs */
+ fsid_t f_fsid; /* file system id */
+ long f_spare[7]; /* spare for later */
+ };
+
+int statfs(char *path, struct statfs *buf);
+
+/************************************************************
+From /usr/include/directory.h, simplified:
+************************************************************/
+
+#ifndef __dirent_h
+#define __dirent_h
+
+/*
+ * Definitions for library routines operating on directories.
+ */
+typedef int DIR; /* just a dummy */
+
+DIR *opendir(char *dirname);
+struct dirent *readdir(DIR *dirp);
+void rewinddir(DIR *dirp);
+void closedir(DIR *dirp);
+#ifndef _POSIX_SOURCE
+void seekdir(DIR *dirp, long loc);
+long telldir(DIR *dirp);
+#endif /* POSIX_SOURCE */
+
+#endif /* !__dirent_h */
+
+/*************************************************************
+From /usr/include/sys/dirent.h:
+*************************************************************/
+
+/*
+ * Filesystem-independent directory information.
+ * Directory entry structures are of variable length.
+ * Each directory entry is a struct dirent containing its file number, the
+ * offset of the next entry (a cookie interpretable only the filesystem
+ * type that generated it), the length of the entry, and the length of the
+ * name contained in the entry. These are followed by the name. The
+ * entire entry is padded with null bytes to a 4 byte boundary. All names
+ * are guaranteed null terminated. The maximum length of a name in a
+ * directory is MAXNAMLEN, plus a null byte.
+ */
+
+#ifndef __sys_dirent_h
+#define __sys_dirent_h
+
+struct dirent {
+ /* just need d_name field for Cthon tests */
+ char d_name[13]; /* name (up to MAXNAMLEN + 1) */
+};
+
+#ifndef _POSIX_SOURCE
+/*
+ * It's unlikely to change, but make sure that sizeof d_name above is
+ * at least MAXNAMLEN + 1 (more may be added for padding).
+ */
+#define MAXNAMLEN 255
+/*
+ * The macro DIRSIZ(dp) gives the minimum amount of space required to represent
+ * a directory entry. For any directory entry dp->d_reclen >= DIRSIZ(dp).
+ * Specific filesystem types may use this macro to construct the value
+ * for d_reclen.
+ */
+#undef DIRSIZ
+#define DIRSIZ(dp) \
+ (((sizeof(struct dirent) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) +3) & ~3)
+
+#endif /* !_POSIX_SOURCE */
+#endif /* !__sys_dirent_h */