libbuxton: pass pointer to pid rather than the pid itself.
Allow more options to be set during configuration

Add ability to change the configuration file location and the module
location from the configuration step (to be used for testing).
Add testing configuration entry

Make entry for testing and update check tests to use it.
libbuxton: Add newline to log message

Signed-off-by: William Douglas <william.douglas@intel.com>
libbuxton: Use asprintf to do string concatenation
Switch to only use pragma once
shared: Move function defintion to c file
libbuxton: Make use of malloc0
libbuxton: Fix potentional memory leak
libbuxton: Add more checking to config parsing
Alter database API to suit returning whole structs

This has most benefit in the gdbm backend where we store the entire struct
and union member in the database with no modification.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Add the buxton database path to config.h automatically

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Begin switching to BuxtonLayer struct throughout

This is the first of a few commits that are required within Buxton
to correctly refer to layers.

We introduce two new enums, BuxtonBackendType, and BuxtonLayerType,
to allow identification of these types and ensure we limit ourselves
to these cases, instead of attempting to parse random layer names
or indeed back names, so that we do not accidently load a 3rd
party module as a backend.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Add utility method to form database path

Each of the database modules will need to be able to determine
the path of the database to open/create.

It should be noted that when using user layers, the uid should
already of the layer should already be set. This is relatively
simple as the next commit will switch the backends to accept
BuxtonLayer instead of char* references.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Migrate more code to BuxtonLayer

We need to reduce the amount of string transfering and rely more
on the BuxtonLayer struct. This commit switches the database modules
to use a BuxtonLayer instead of passing char*

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Begin implementing gdbm backend

Using set-value should now operate cleanly, however we're limited right
now to named layers, this should be switched for layer struct's as keys
in our _resources hashmap.

Before we continue to implement the get_value code, we should add
a copy method to copy a BuxtonData (instead of returning internal
pointers) and modify the backend loading code so that we have
global references to our d_func pointers, enabling us to test the
backends more accurately.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Implement exit handlers

This commit ensures we always perform a cleanup on exit, closing any opened
backend modules and free the hashmaps. We also now store the destroy
function globally so that we can call it in iteration using destroy_module.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>