libpcp_web: JSON API coding consistency, small improvements and fixes
commit94f0c9fa2c7271bf8c8d517ecc119ed2604da210
authorNathan Scott <nathans@redhat.com>
Mon, 16 Jan 2017 05:59:34 +0000 (16 16:59 +1100)
committerLukas Berk <lberk@redhat.com>
Tue, 17 Jan 2017 01:13:00 +0000 (16 20:13 -0500)
treea57898556d3afd5ffb4678b7623cd02616e47295
parent0c9e04600d9daac00a600db9026e56bb3954e430
libpcp_web: JSON API coding consistency, small improvements and fixes

Mainly work on the iterable routine to get the callback to match the
simpler semantics of read(2) as originally intended.  Rename routine
for the long-term, as the former was too much of a mouthful (my poor
naming choice earlier).  Update and use the typedef that was earlier
added to pmjson.h for callback function.

Fix compiler warning - json_helpers.c:376:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     int fd = (int)extra;

Fix memleak of buffers in several locations.  Numerous cleanups in
terms of using static routines, switching pmdaroot over to pmjsonGet
use and use fread since its using that sort of file I/O not fds, and
so on.  Make variable names shorter sometimes for better code layout
and consistency with rest of PCP, without losing clarity I hope.

Fixed typo in the libpcp_web exports file.  Update the pmjson(3) man
page as it was out of date in some places before starting tidying,
but also add in the new API tweaks there.
12 files changed:
debian/libpcp-web1-dev.install
man/man3/pmjsonget.3 [moved from man/man3/pmjsoninit.3 with 63% similarity]
src/include/pcp/pmjson.h
src/libpcp_web/src/exports
src/libpcp_web/src/json_helpers.c
src/libpcp_web/src/private.h
src/pmdas/docker/.gitignore [new file with mode: 0644]
src/pmdas/docker/Remove
src/pmdas/docker/docker.c
src/pmdas/docker/pmns
src/pmdas/root/docker.c
src/pmdas/root/root.h