Handle malloc failures.
configure: fix issues that 'autoupdate' detected

- AC_HELP_STRING is an obsolete macro and has been replaced with
  AS_HELP_STRING, so use it instead.

- AC_OUTPUT accepts arguments, but this use is deprecated. Instead, use
  AC_CONFIG_FILES and run AC_OUTPUT with no args.
autogen: enable all warnings for autoreconf

An extra option is needed for autoreconf to make autoconf warnings
visible, helping to detect issues like those fixed in the previous
commit.
autogen: Fix #2, add configure option for iniparser

Adds config option "--with-local-iniparser" [default=yes], which,
when set, will build using our built-in version of iniparser.

If explicitly unset, will perform a pkg-config check for iniparser,
which will fall back to our built-in version if not found.

Signed-off-by: Shane Bryan <shane.bryan@intel.com>
Merge pull request #3 from sbryan/master

autogen: Fix #2, add configure option for iniparser
core: Use correct fd from pollfds
Take advantage of c99 to have loop local vars
core: Add client entry for each concurrent client

Allocate a client_list_item for each connected client and add it to
a connected client list.
Typo, test the pointer not the struct
autogen: Test for minimum version of iniparser

Signed-off-by: Shane Bryan <shane.bryan@intel.com>
Fix make check/distcheck for non-local users of libini

The pkg-config build variables needed to be passed in

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
autogen: fail configure if gdbm.h is missing

Signed-off-by: Shane Bryan <shane.bryan@intel.com>
move memset until after checking for dlsym error

Bail out before memcpy, not the other way around.

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
fail out dlsym on error even if there is no actual dlsym error

There aren't really any good answers at that point.

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
autogen: fixup include for iniparser

Signed-off-by: Shane Bryan <shane.bryan@intel.com>
Check for return of 0 or -1 from sd_listen_fds

 0: manual mode
-1: error; bail
>1: fd's to listen to from systemd

Fixes https://github.com/sofar/buxton/issues/1

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
Begin implementation of direct backend manipulation

Both daemon and client will use the same methods to directly manipulate
backends, however only root may do this in the case of the client. Otherwise
they are required to use the wire protocol.

This code is meant to demonstrate how we could handle various backends,
but will require new initialisation code to read all layers from their
configuration files, so that we can load a backend dependent on the
layer configuration.

The gdbm module (and all future modules) should have a Hashmap containing
the layer as the key, and their specific implementation (GDBM_FILE) as
the value, allowing us to restrict module use to one instance per format.

systemd cleanup macros should also be imported to ensure static variables
are appropriately cleaned up. Alternatively we may rely on atexit type
helpers.
Use BuxtonClient instead of struct BuxtonClient

We already typedef BuxtonBackend for improved readability, BuxtonClient
should also adhere to this convention.
Add skeleton for memory backend

Memory backend will be used as the primary test for further backend
implementation within Buxton, and will cause various API changes to
ensure the system is well integrated.

The following commits will have to restructure the existing API to
make backends unaware of explicit datatypes, migrating to set/get
value methods, typed via struct/union keys.

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

This commit adds the basic data types we will use in Buxton. There will be
no get/set_string type methods, just get/set_value, using the data struct
BuxtonData.

In order to use BuxtonData, you must set the BuxtonDataType to a valid type
such as string:
    BuxtonData data;
    data.type = STRING;

It is not desirable for backends to explicitly handle types, they should
store and return data per the requests in libbuxton. Buxton will then handle
sanity and verification of data + types.

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