Packed file IO
--------------

  Pack file IO is a set of functions that allow you to access pre-packed
files from one PAK (or PAH) file.
  This means all the grafix and sound files (or whatever) can be kept in
one file and then accessed normally thru the standard IO functions
(ie: open,close,read,etc.)
  These packed files are created using a utility called PACKIT.
To make a packed file just use PACKIT within a directory of files to pack.
Give it a parameter of a file to output to.
  Eg:
    packit ..\data.pak
    packit ..\data.pah ..\header.dat
  Then use the following functions to load in data.pak and the files within.
When you provide the second parameter to PACKIT, it will output the header
that is usually placed into the pack file and instead place it into the
second file.  This way you can place the header into your program directly
and protect this vital information if need be.  When this option is used
the output is a PAH file, otherwise it is a PAK file.
PACKIT.C is included if you need the source.

pack_open
---------

  Loads a packed file so that the files within can be used.

word pack_open(char *filename,...);

In:
  filename - ASCIIZ filename
  ... - offset of header if Pack file is a PAH file
        must point to the header of the pack file header which must already
        be loaded into memory.  You can pack files and have the header
        saved into a another file rather than the pack file itself.
        See help before for more info.

Out:
  word - a handle(word) that can be used with pack_close()

pack_close
----------

  Closes a packed file making all files within the pack file no longer
accessable and frees the DOS file handle used with the pack file.

void pack_close(word hand);

In:
  hand - handle that was returned from pack_open()


Notes:

  Each pack file opened is kept open until you use pack_close()
so that means each pack file will need a file handle (so don't open too
many file handles).   Most systems have about 40 handles so opening more
than 30 pack files would be too many.

  Once you've opened pack files simply use open() to open the
files within.  What happens is that if open() cannot find the file in any 
packed file it then allows DOS to attempt to open the file as usually.
If it does find it in a packed file , it returns the already open handle
and lseeks the file to
the begining of that file within the pack file.  If an attempt is made to
close the file it is just ignored and returned successful.  This is very
useful because you can use other routines such as 'g_loadfnt' with a file
within a packed file and it will use it just like any other file.  One last
note, the packed files are opened in read only.  All attempts to write to
the files are ignored (returns error code).

NOTE: Pack.asm keeps internal vars set to the current file opened and therefore
  only one file can be opened at a time from with in the packed files.  The
  actual handles for each packed file are kept open.  When anything tries
  to open one of them pack.asm just returns the handle and lseeks the pack file
  to the proper position.  Plus any lseek done on the file is handled properly.
  If a file is contained in two or more packed files the most recently opened
  pack file will be used instead.  This is good for adding patches to games
  and other stuff. (like how DOOM adds wads which simply overides files)
  If a file exists within a packed file and this file also exists in the
  current directory then you will only be able to load the one in the
  packed file, unless you have not called pack_init() and pack_open() yet.

