versioning: introduce syslog-ng version 3.7

This patch changes the default config version to 3.7 and adds related
defines.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
templates.h: add inclusion of plugin.h

Macros in templates.h may use the plugin API, which is thus a dependency,
include that so that the call-site doesn't need to.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
cfg-grammar.y: allow additional top-level blocks parsed by plugins
system-source: parse @cim marked messages by json-parser automatically

This allows any local applications to submit JSON formatted messages
through the syslog() API, which will automatically be parsed. A ".cim."
prefix will be added to the fields extracted.

The same values can be reconstructed using a value-pairs expression,
something like:

  $(format-json --key .cim.* --shift 5)

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
cfg.c: create separate method for registering builtin plugins

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_template_compile: create get_template_function_ops()

This new function makes it easier to describe LTE_FUNC elements.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
templates.c: extract log_template_prepare_function_call()

In order to make log_template_add_func_elem() easier to read (and to prepare
a new feature there), extract log_template_prepare_function_call()
that sets up the template function invocation given the implementing
plugin.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
templates.c: extract log_template_lookup_and_setup_function_call()

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
templates: fix testcase that got broken by a recent change in error message

The unit test validates the error messages returned by log_template_compile()
and a recent change wasn't completely followed up by a unit test. Fix that.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>