summaryrefslogtreecommitdiff
path: root/lib/hook.h
AgeCommit message (Collapse)Author
2024-02-15lib: always call new notification hooks tooChristian Hopps
- call the new notification hooks when backends call the old notification posting API. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-05lib: fix spelling nits in more lib filesewlumpkin
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2021-09-02lib: fix hook defs for -Wstrict-prototypesDavid Lamparter
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>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-05-05lib: make hook.h cpp-compatibleQuentin Young
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>
2020-04-01lib/hook: use static hook entry when possibleDavid Lamparter
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>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
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>
2018-12-14lib: flip to ISC on hook & module codeDavid Lamparter
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>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-08-15lib: hooks: support priority ordering & reversingDavid Lamparter
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>
2017-07-22Revert "*: reindent pt. 2"David Lamparter
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. 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>
2017-07-17*: reindent pt. 2whitespace / reindent
w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-25lib: add hook infrastructureDavid Lamparter
Please refer to lib/hook.h for a description/documentation. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>