Needed before use in UQM:
- documentation
- configuring for HAVE_REGEX and GLOB

Documentation:
- use doxygen
- Warning: getting (part of) the contents of a directory is fairly slow,
  as dirs need to be merged.
- It would be (theoretically) possible to add HTTP and FTP support for
  remote file systems.
- on adding extra file system types:
- open, mkdir, rmdir, and unlink should themselves make sure that
  the physical structure is kept up to date when an entry is
  removed or added.
- stream stuff is not thread safe
  writing using stream functions is not implemented.
- uio_fflush() does not accept NULL as argument to flush all streams,
  like stdio fflush() does.
- uio_close() does never fail
- The physical open function should call uio_Handle_new and store its own
  data in it.
  The physical close function should delete its own data. It's called
  Will cleanup the general Handle.
  Analogous for mount/unmount with PRoot
- (internal) arguments for uio_Bla_new are always copied as-is.
  If they are ref-counted, the counter should be incremented by the caller,
  if the caller does not need the reference itself.
  The uio_Bla_delete function decrements the ref counter of the ref-counted
  fields.
- No need to store MountHandles. They will be automatically freed
  when the repository is closed.
- You can use mount stuff from other repositories.

Bugs:
- uio_Stream file might get unaligned (not sure).
- 'openDir(repository, "dir/")' will have the trailing '/'
  in the dirHandle, which will cause problems.
- uio_rename() doesn't work on directories
  uio_GetPhysicalAccess() needs to be changed so that it works the same on
  dirs as on files. stat() can be cleaned up too then.

Extra features (not necessary for UQM):
- Make functions to use for uio_malloc, uio_free and uio_realloc
  configurable at init.
- add uio_mmap()
- add match_MATCH_ALL and match_MATCH_NONE
- automounting
  - Unmount automounted filesystems when the originating filesystem
    is unmounted.
- when doing stat() on a directory, merge the stat info of the underlying
  physical dirs.
- read directory information from zip files.
- implement ungetc()
- make fileblocks public
- setmode() for windows?
- prevent aliasing of files/dirs, both between two physical file
  systems (where possible), as within the same filesystem (in particular
  stdio). On Windows, aliasing can occur easilly when a file or dir
  is accessed with the long vs the short ("PROGRA~1") name, or when
  capitalisation is involved.
- accept non-dir, non-regular-file dir entries in stdio.
- Add non-merging mounts. Make 'merging' an option for the mount.
- make uio_rename() work cross-fs, or provide a wrapper which does that.
  (the system rename() doesn't work cross-fs either, so keeping uio_rename()
  as it is makes sense, as I'm trying to stay close to the system functions,
  even though hiding file systems from the user would be nicer)

Optimisations (not necessary for UQM):
- use mmap for fileBlocks
- Use a pre-allocated pool of hash table entries for allocHashEntry.
- optimise certain strings (specifically directory entries) by making
  a string type which has pointers to a shared char array.
  Invariant: if two strings are the same, they point to the same
  character array. Consequence: string comparison is pointer comparison.
  Making a new string would imply checking the existing strings.
  Existing strings should be in a hash table.
- optimise paths
  Encode all paths internally as (double-linked) chains of path components
  This way, operations like going up one path component, are cheap.
  Each path component could either be represented by a pointer to a string,
  (possibly shared as above), or as a pair of begin and end pointers
  (or begin pointer and length). In the latter case, there's no need for
  copying strings when parsing a user-supplied string, but sharing of strings
  would not be possible.
  It's probably possible to use both methods next to eachother;
  shared strings for stored paths, and pointers into a path for user-supplied
  strings (which would be freed when the call returns).
  Instead of a linked list, perhaps an array can be used, as paths rarely
  change. It would be a problem if for some reason, recursively path
  components are added to a path.
- (maybe) keep track of already issued handles, so that the ref counter
  could just be incremented, instead of issuing a new one.
  (uio_getPDirEntryHandle)
- Make it possible for people to add their own file system, without giving
  away the internals. (no wanton including of .h files)
- Don't cache stdio dir structure
  (and don't read the dir leading up to the dir that is actually needed)
- mounting foo to /Foo and foo/bar to /Foo/Bar should result in only one
  physical structure. Preferably, it shouldn't even lead to two mountInfo
  structures for /Foo/Bar, so that merging the dirs is not unnecessarilly
  expensive.
- add uio_access()
  (uqm fileExists can be redone then)
- implement the physical function cleanup() to clean up the physical
  structure. Int argument that specifies how thoroughly.
  On it depends whether cache is cleaned, whether stuff is realloc'ed
  to defragment memory, etc.

Cleanups (not necessary for UQM):
- rename function names to be more like class names for as far as that's
  not already done.
  uio_PRoot_unref etc
- Add uio_fatal(), uio_error(), uio_warning()
- Clean up the include structure


