Makefile.am: Create the destination directory for the manpage

When generating the manual page, make sure that the target directory
exists first.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
.travis.yml: Add ruby-ronn to the requirement list

This is so we test the man page building too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
.travis.yml: Install the ronn gem, instead of the package

Due to the environment at Travis CI, the package does not work, at all,
as it conflicts with the user-local ruby install.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
riemann-c-client: Fixed two format strings on 32-bit systems

On 32-bit systems, %lu is not the appropriate way to print int64_t
things. Use the PRId64 macro instead.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
configure.ac: Move the pkg-config checks to the end

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
src/riemann-client.c: Fixed the PRId64 usage

Oops, it needs a % in front!

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
riemann-client: Add support for JSON formatted output

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
riemann-client: Code cleanup

Moved the query dumper code into their own functions, and instead of
setting a flag when --json is passed, set a dumper function instead.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge branch 'f/riemann-client/json-output'
riemann-client: Make the JSON output optional

Since we require a fairly recent json-c, make the JSON output optional,
so the library can still be compiled without it. The library does not
depend on it anyway, just an example tool, so making it a hard
dependency would be counter productive.

Also remove the json-c installation from the Travis control file, as
Precise does not have a new enough version.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Makefile.am: Add $(AM_CFLAGS) to the riemann-client CFLAGS

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
configure.ac: Disable the tar.gz dist build

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
src/riemann-client.ronn: Force markdown-mode

Add a comment at the top, to help Emacs realize this is in Markdown.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
src/riemann-client.c: Handle optional properies with JSON output

When using the JSON output mode, don't choke on missing properties.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
src/riemann-client.c: Fix a few signed<->unsigned comparsions

A few functions got size_t as argument, and were comparing it against an
int. Fix that, by using a size_t as the loop variable too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
src/riemann-client.c: Remove a few unused variables

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
.travis.yml: Use -Wall -Wextra -O3 as CFLAGS

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
src/riemann-client.c: Mark a few more arguments unused

In case we're compiling without json-c, mark both arguments of
query_dump_event_json() as unused.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Move the library sources to lib/riemann/ too

Having the headers and the sources separate was a bit awkward, so move
the sources into the same subdirectory.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
client: Move the connection type logic to the connect function

Instead of recording the connection type in the riemann_client_t
structure, store function pointers instead. This way the only function
that needs to know about the connection type is the connect function
itself.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>