
PFS (Packed filesystem)
-----------------------

You use MKPFS.EXE to pack files to one big file (like PKZIP). This big
file is a filesystem. Each filesystem has it's own number (fsnumber) and
it's own file directory. 

MKPFS.EXE works much like Doom's utility to create the DEMO.DAT files.
You create a files.lst with the filenames of all files to be added.
Then do:  MKPFS.EXE  files.lst demo.000
Note that you must specify an output file.
Type MKPFS.EXE to get more parameters.

In files.lst you specify which files to pack using lzss.
Example files.lst:

 script/exit.scr
 script/script0.scr
 anim1/back.pcx
 anim1/bump.pcx
 anim1/env.pal          no
 anim1/env.pcx          lzss
 anim1/env.tra          lzss


Note that you don't need to specify the packing parameter. Default
is to pack using lzss. You can override the parameters in files.lst
if you specify -LZSS or -NO to MKPFS.EXE.


You can create many filesystems and append them all to one big file
using DOS copy command (Note that it must be a binary copy). You can
even append the filesystems to the exe file. If you append more than
one filesystem to a file you MUST give each filesystem different
fsnumber. This is because when a filesystem is initialized, the file
will be scanned from the beginning, searching for the filesystem
signature with the given fsnumber. The first filesystem with the
correct fsnumber will be opened.



Technical stuff
---------------

You must only load files from the filesystem using the functions
in DFS.H. This makes the filesystem very generic and easy to
modify later on. See DFS.H for details.

Safe ways to use the functions are:

    #include "dfs.h"

    // Get the filesize of a file
    int filesize;
    if((filesize = FSFileSize("effect/light.dat")) == -1) {
        // error!
    }    

    // Load a file into a buffer
    char buffer[768];
    if(FSReadFile(buffer, 768, "effect/back.pal") != 768) {
        // error!
    }

    // Load a file
    void * pic;
    int filesize;
    if((pic = FSLoadFile(&filesize, "effect/back.raw")) == 0) {
        // error!
    }
    // Use the pic here....
    free(pic);    

