
                                   Make Patch

  This program creates patches collecting the differences between  two  binary
files of the same size. The output patch file can be used with File Patch.



  1. Usage

  The parameter syntax is the following:

  MAKPATCH <original-file> <changed-file> [<patch-file>]

  <original-file>:
  This is the full name of the file containing the original data. You can make
a patch of only two files at a time, you may not use wildcards.

  <changed-file>:
  This is the full name of the file you have already changed. This  file  must
have the same size as that of the original file.

  <patch-file>:
  The full name of the patch file. When omitted, it defaults to 'PATCH.DAT' in
the current directory.

  The program reads through the two  files  in  parallel  and  collects  their
differences into the patch file. The first four bytes in the patch  file  hold
the length of the original file. The remaining part contains patches. A  patch
has the following structure:

  +-------------+---------------------------------------+
  | POSITION    | DESCRIPTION                           |
  +-------------+---------------------------------------+
  | 0 - 3       | Offset of patch in the file (4 bytes) |
  | 4 - 5       | Length of patch (LEN) (2 bytes)       |
  | 6 - (LEN+5) | Patch data (LEN bytes)                |
  +-------------+---------------------------------------+

  You can't create patches out of too different files, which have about  64000
or more different bytes. If two differences are within 6 bytes then the  bytes
between them will be stored, as well so that the patch file  is  as  small  as
possible. You may change this behavior by changing the source and  recompiling
it.



  2. Error messages

  - FILENAME.EXT not found
    The specified file does not exist.
  - Cannot create FILENAME.EXT
    The file could not be created for some reason.
  - FILE1.EXT and FILE2.EXT have a different size
    You can only create patches out of files of the same size.
  - Out of memory
    The program could not allocate buffers for the comparison  and  the  patch
    file. Try freeing up memory by uninstalling some resident programs.



  3. Copyright and legal issues

  The source of this program is public domain and provided here "as  is"  -  I
don't feel like commenting it but if you have problems then feel free  to  ask
me. If you derive your own program from the source or put a part of the source
into your own program, please, give me a credit and send a copy to me.



  4. The author

  If you're interested in some similarly useful utilities you can  contact  me
at sta@c64.org or visit my homepage at http://sta.c64.org.

  Joe Forster/STA
  5th November, 2000
