core: Avoid 'set-but-unused variable' warning

The temp_buffer in my_system_r() is only ever (really) used when
embedded is compiled in, so we move the declaration to inside the
conditional code from its previous location outside it.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1980 5f96b256-904b-4d8d-8c98-d829582c6739
lib/squeue: Remove unused function squeue_foreach()

It's only used in testing, so remove it for now.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1981 5f96b256-904b-4d8d-8c98-d829582c6739
Prep for installing nagios headers in system include files

This quite simple patch allows us to put Nagios' header files
from include/ in /usr/include/nagios (for example) and the
headers from lib/ in /usr/include/nagios/lib and everything
will keep on working just fine without any special build-flags
for projects that want to use either the headers or some of
the library parts.

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

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

And also add the infrastructure needed for adding more tests
following the same pattern later.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1983 5f96b256-904b-4d8d-8c98-d829582c6739
libnagios: Add key/value vector API

This is a (very) simple and straightforward api used to gather and
managed arrays of key/value pairs in a CPU-efficient manner, which
includes array-to-buffer conversion and buffer-to-array conversion,
making it highly useful for IPC.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1984 5f96b256-904b-4d8d-8c98-d829582c6739
libnagios: Add io cache api

It's actually slightly misnamed, as it basically only contains
helpers to read large chunks of data and then partition that data
into the desired bits and pieces. It currently supports getting
either fixed-size chunks or chunks by end-of-message sentinel
byte sequences.

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

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

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1986 5f96b256-904b-4d8d-8c98-d829582c6739
lib/Makefile: Remove test programs when cleaning

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1987 5f96b256-904b-4d8d-8c98-d829582c6739
libnagios: Add I/O broker library

Severely nifty for watching filedescriptors for input, and a lot
lighter on memory usage and cpu than both libev and libevent,
although only for relatively small sets of watched filedescriptors
and without support for timers, signal watchers and other jazz
that lib{ev,event} bring along and we don't need.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1988 5f96b256-904b-4d8d-8c98-d829582c6739
lib/Makefile: Avoid using test-coverage flags by default

They're nifty when writing tests, but pretty counterproductive for
production code.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1989 5f96b256-904b-4d8d-8c98-d829582c6739
libnagios: Add test coverage support to libnagios' Makefile

'make coverage' in the lib directory will now print candidates
for testing. iocache seems to be the primary candidate for
more tests.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1990 5f96b256-904b-4d8d-8c98-d829582c6739
libnagios: Add tests for and fix bugs in iobroker_strerror()

Having such easily tested functions untested was just plain dumb,
which was proven quite quickly.

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

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

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1992 5f96b256-904b-4d8d-8c98-d829582c6739
lib/squeue: Avoid name clashes with pqueue()

This lets us include the pqueue.c file directly into tests alongside
squeue.c if we want to.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1993 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-iobroker: Stop #include'ing iocache.c

It messes up coverage reports for iocache.c, so we'd best avoid it.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1994 5f96b256-904b-4d8d-8c98-d829582c6739
lib/Makefile.in: Use debugging flags when building coverage tests

And also make test-suit fail hard if some tests don't pass.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1995 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-squeue: Test squeue_add_[mu]sec() and pqueue_is_valid()

This increases coverage somewhat, which is nice.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1996 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-squeue: Compute expected event priority after adding

The squeue library can (and does) sometimes change the time we pass
it as for when the event is supposed to run, which would cause a
failed testrun about once in 100 runs (probably due to the internal
clock switching second).

This patch fixes it, using the adjustments the squeue api does for
us to calculate the expected priority.

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

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@1997 5f96b256-904b-4d8d-8c98-d829582c6739
Revert "Add #define NSCGI to all cgi programs"

This reverts commit e12af74551f8a897f6fb60c6d918b00447b56ebe. Since
NSCGI is defined on command-line when building things, we just got
a ton of warnings from this change.

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

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

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

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