In the lib, we should only #include "sigrok.h" or "sigrok-internal.h",
but not the (possibly installed and thus different/older versions) via
<sigrok.h> or <sigrok-internal.h>.
Frontends should of course use <sigrok.h> and <sigrok-internal.h>.
- Add Doxygen comments for all functions (some TODOs remain).
- Check for invalid input parameters (such as NULL pointers etc).
- Return SR_ERR_ARG upon invalid input parameters.
- Make sr_datastore_put() return int instead of void, so we can pass
an error code (SR_OK, SR_ERR_MALLOC, and so on) to the caller.
The g_malloc()/g_malloc0() versions exit/segfault if not enough memory
is available, which is not a good thing in libsigrok.
Instead, we use the g_try_malloc()/g_try_malloc0() variants, which
return NULL if not enough memory is available, so that the caller can
handle the error properly.