libpcp_web: JSON API coding consistency, small improvements and fixes
commit1cb48d1e584b15b48f91edaa5a309cffad74799e
authorNathan Scott <nathans@redhat.com>
Mon, 16 Jan 2017 05:59:34 +0000 (16 16:59 +1100)
committerNathan Scott <nathans@redhat.com>
Mon, 16 Jan 2017 05:59:34 +0000 (16 16:59 +1100)
treea57898556d3afd5ffb4678b7623cd02616e47295
parenta626caec8f53d2c80fc1cab7f450539f94541982
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