Add BuxtonArray

BuxtonArray is a dynamically allocated self-managing array, which is
also reusable. We can use the BuxtonArray (made easier via its len
member) to easily deal with lists of BuxtonData's, for instance.

This will primarily be used to easily facilitate the listing of keys
within a given layer in Buxton.

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

This begins a global switch to BuxtonArray, to replace the use of
varargs within the serialize function. Doing so will both clean
up the code and facilitate the introduction of list_keys.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Implement client side of buxton list-keys command

This will enable clients to query all keys found in a given layer.
The array struct declaration was moved into bt-daemon.h to prevent
any issue in inclusion order (one needs the other)

This commit does not add backend or wire protocol support for
the list-keys command.
Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
db/gdbm: Implement buxton_list_keys

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Implement wire-protocol part of list-keys

This enables us to send a LIST command over the wire protocol, and
recieve the results in a BuxtonArray. The client can use this
command to list all key names (but not content or label) within
a given layer.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
test: Modify tests to use new array based serialization

This commit corrects the checks and API usage within 3 of the 4 test
suites in order to correctly pass all existing tests. A couple of
now redundant parameter count based checks have also been removed.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
test/check_shared_lib: Add test case for BuxtonArray

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
test: Fix compiler warning by casting

Signed-off-by: William Douglas <william.douglas@intel.com>
shared: Remove check for negative values since index is unsigned
test: Add more coverage for BuxtonArray functions

Signed-off-by: William Douglas <william.douglas@intel.com>
shared: Remove backend functions for direct

These functions are no longer needed with the current intended use of
direct.

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Readd tests for Array length checks in serialize

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Fail when array allocation fails

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Fail if array add fails

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Fix check for get with one parameter

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Free list

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Add more checks for BuxtonArray helper failures

Signed-off-by: William Douglas <william.douglas@intel.com>
core: Bail out when buxton_array_new fails
core: Don't leak arrays on notify

Signed-off-by: William Douglas <william.douglas@intel.com>
shared: Add proper handling for buxton_array_add usage failure

When calling buxton_array_add it is best to make a check per add in
order to aid testing (it is best to make one check per if anyway).
This change adds additional testing and splits out testing in the
daemon and protocol.

Signed-off-by: William Douglas <william.douglas@intel.com>