Macros: fix of invalid free for TOTALHOSTSERVICES* macros

The $TOTALHOSTSERVICES*$ macros were computed all at the same time, with the
result stashed in mac->x using the mkstr method (from worker.c? why worker.c?)

The mkstr uses an static internal buffer of usally 256 strings, of each 32
bytes, for generation of strings, used in macros. When computing
TOTALHOSTSERVICES*, the valuse is, as said, stashed in mac->x[], which is freed
 at cleanup, with some exceptions, and this isn't one of them.

Those needs to be exceptions, so static function variables isn't freed

Signed-off-by: Max Sikström <msikstrom@op5.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2693 5f96b256-904b-4d8d-8c98-d829582c6739
worker manager: Introduce wproc_run_callback()

This lets modules run checks and external helper commands without
them necessarily passing through Nagios check-handling routines,
which was earlier the only way modules could see the result of the
external command they wished to run.

It's also neat in that it allows one to write a small module that
manually tests a particular command by using Nagios' internal escaping
mechanisms, which can be incredibly handy when configuring commands
that look more like awk scripts than normal unix commands.

Original-patch-by: Max Sikström <msikstrom@op5.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2694 5f96b256-904b-4d8d-8c98-d829582c6739
core: Log an error when we fail to parse a worker buffer to a kvvec

A fixme comment with an actual oneline fix. That's just plain odd.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2695 5f96b256-904b-4d8d-8c98-d829582c6739
libnagios: Add the 'fanout' api

Fanouts are useful to hold expiring 'long'-indexed data where
the span between smallest and largest key can be too large and
change too often for it to be practical to maintain a "real" array.

For Nagios, that currently matches downtime, comments, and jobs
assigned to worker processes, where either linked lists or some
form of dynamic array lookup is done today.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2696 5f96b256-904b-4d8d-8c98-d829582c6739
base/workers: Assign job-list management to libfanout

It was by far the clumsiest code in the worker manager, and since
clumsy code tends to harbor bugs, we replace it with the elegant
and obviously correct code in libfanout.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2697 5f96b256-904b-4d8d-8c98-d829582c6739