This directory contains the part of moftpd that accesses files,
converts strings from/to UTF-8, and a garbage collecting memory
handler. These files can easily be extracted into another
project (provided it's GPL compatible). Here's how:

After copying the files, edit the system.h file to contain relevant
header files. By default it just #includes "../system.h". I'm not sure
exactly what files are needed, perhaps I'll check it out sometime.
The reason all system headers are included from this file is for
precompiling to work.

Add a call to mem_init() early in your main file. Currently this
initiates the hash indexes used by pstring () to random values.

Add a call to tfree_all() in your main loop.

That's it. Perhaps I'll add some API documentation later. It's the
full_path () function that converts and checks for UTF-8 paths (it
also does ~-expansion and other stuff). Other things to note is if you
call palloc () with the parent argument set to NULL, it will never be
garbage collected (it's a root object), but as soon as you pattach()
it as child to a parent, it loses that property. pfree() is actually
just a detach, the child will not be freed until tfree_all() is called
(and only if it lost all its parents). The collector does not scan the
whole memory, it just follows the attachment links, so you do still
need to call pfree () (at least on the root objects).
It's also safe to call all the memory functions with a NULL child
(NULL will be returned).

// Pelle Johansson <morth@morth.org>
