About libprefixdb
-----------------
Libprefixdb is a library for dynamic discovery of application prefixes at
runtime.


The problem
-----------
Currently, applications prefixes are hardcoded into the binary, which makes it
impossible to move directories. If an application is configure with
./configure --prefix=/foo, then you can never rename or move /foo.

Libprefixdb is part of the autopackage project (http://autopackage.org).
Autopackage provides a feature that allows the user to select the
installation target directory, just like Microsoft(r) Windows(tm)
installers. Because of this, applications must be relocatable.


The solution
------------
Libprefixdb tries to solve this problem by providing an easy API to replace
hardcoded path macros. Instead of using the path macros, you use the
functions provided by libprefixdb.


How does it work?
-----------------
Path information is stored in a file, which is by default
/var/packages/rootname/prefixes. Libprefixdb reads path
information from that file. You also pass hardcoded paths to libprefixdb,
which will be used as fallback paths in case something goes wrong.

The libprefixdb functions will return the correct path based on the path
information file. If the path information file doesn't exist, or if the
path information is wrong (the paths don't exist), the hardcoded paths
will be returned. This ensures that the application will not depend on
the path information file.


Example code
------------
Currently, applications and libraries use code like this (this piece is 
taken from GnomeICU):
MainData->xml = glade_xml_new (GNOMEICU_GLADEDIR "main.glade", "app", NULL);
GNOMEICU_GLADEDIR is a macro, defined in the Makefile.

By using libprefixdb, the code changes to something like this:

PrefixDB *db = pdbAutoInit ("@gnome.org");
gchar *filename;
filename = g_strdup_printf ("%s/gnomeicu/main.glade", pdbGetShare (db));
MainData->xml = glade_xml_new (filename, "app", NULL);
