Without this, the hook code creates functions with empty parameter lists
like "void hook_something()", which is not a proper C prototype. It
needs to be "void hook_something(void)". Add some macro shenanigans to
handle that.
... and make the plumbing functions "inline" too.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Some CPP compilers don't support these designated initializers, since
we're just zero initializing don't need em
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
hook_register() invocations generally are in some initialization
function and not looped over or similar. We can use a static struct
hookent variable for the hook list entry in 99.999% of cases, so let's
do that and not malloc() memory.
Signed-off-by: David Lamparter <equinox@diac24.net>
These are necessary to use functions defined in these headers from C++.
Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
I accidentally put MIT headers on these; the intent was ISC. It doesn't
really make a difference, but let's get it consistent.
Signed-off-by: David Lamparter <equinox@diac24.net>
Allow registering callbacks with a priority value used to order them
relative to each other. Plus a reverse variant that just flips the
direction on priorities.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This reverts commit c14777c6bf.
clang 5 is not widely available enough for people to indent with. This
is particularly problematic when rebasing/adjusting branches.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>