Add support for number unit suffixes

There are a number of cases in the configuration where one needs to set
a size (think buffer sizes), and counting zeroes is extremely annoying
and unintuitive. For this reason, we introduce number unit suffixes for
kilo-, mega- and giga-: K, M, G, respectively (case-insensitive,
optionally followed by a 'b' or 'B', for byte). The parser also
understands KiB, MiB, etc to indicate base-two units.

Anywhere where you can specify a number, you'll be able to specify one
with a unit suffix from now on:

 log-fifo-size(200M)

A function to parse longs already existed in basic-funcs (tf_parse_int),
which was moved to lib/parse-number.c now, and enhanced to recognise the
unit suffixes too.

This also closes #28.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
filter: Implement an in-list() filter

The in-list filter allows us to do simple file-based black- or
whitelisting. The syntax is:

 filter f_whitelist { in-list("/path/to/file.list", value("PROGRAM")); };

Implementing a blacklist is as simple as negating the in-list() filter.

The filter works by pulling in the whole file (one entry per line) and
putting it into a tree structure, and comparing against that on eval.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
basicfuncs: Add upper-case and lower-case functions

This adds two new template functions: $(upper-case) and $(lower-case)
which will upper- or lower-case their UTF-8 arguments. Based on code
from Chris Johnson <chris.johnson3@hp.com>

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
basicfuncs: Add a new $(delimit) template function

The $(delimit DELIMITERS NEW-DELIMITER HAYSTACK) template function takes
three arguments, and replaces all the delimiters from DELIMITERS in the
HAYSTACK with the NEW-DELIMITER.

For example, $(delimit x | fooxbar) would result in "foo|bar".

Based on code and ideas from Chris Johnson <chris.johnson3@hp.com>.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
basicfuncs: Add an $(env) template function

This new template function can be used to look up environment variables
and insert them into the string.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lib/: Install header files to their proper place

With header files in subdirs of lib/, they were getting installed to
${pkgincludedir} with the extra directory parts stripped. This patch
corrects that, so headers end up where they should.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Mk/Makefile.am: Install merge-grammar.pl as executable

Instead of installing merge-grammar.pl as data, install it as a script
so it becomes executable.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lib/merge-grammar.pl: Work from outside of the syslog-ng tree

Try opening cfg-grammar.y in the same directory the script is in, too,
so that the script will work when installed, and not only from the
syslog-ng source tree.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Mk/lex-rules.am: Make it work when installed too

Instead of referencing $(top_srcdir)/lib, use $(syslog_ng_tools) instead
in Mk/lex-rules.am, so that this file can be reused by external projects
too.

Define $(syslog_ng_tools) to $(top_srcdir)/lib in the top-level
Makefile, so that the same file will continue working in the syslog-ng
source tree too.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>