]> git.proxmox.com Git - mirror_frr.git/blobdiff - doc/developer/hooks.rst
doc: add libtool note
[mirror_frr.git] / doc / developer / hooks.rst
index 0afa297aa713b4f6db09e40af9b2e6b35dc2d4de..10fe6b9c43605b656e94978a6df37455128eec61 100644 (file)
@@ -6,32 +6,32 @@ Hooks
 Libfrr provides type-safe subscribable hook points where other pieces of
 code can add one or more callback functions.  "type-safe" in this case
 applies to the function pointers used for subscriptions.  The
-implementations checks (at compile-time) wheter a callback to be added has
+implementations checks (at compile-time) whether a callback to be added has
 the appropriate function signature (parameters) for the hook.
 
 Example:
 
 .. code-block:: c
-     :caption: mydaemon.h
+   :caption: mydaemon.h
 
-     #include "hook.h"
-     DECLARE_HOOK(some_update_event, (struct eventinfo *info), (info))
+   #include "hook.h"
+   DECLARE_HOOK(some_update_event, (struct eventinfo *info), (info))
 
 .. code-block:: c
-     :caption: mydaemon.c
+   :caption: mydaemon.c
 
-     #include "mydaemon.h"
-     DEFINE_HOOK(some_update_event, (struct eventinfo *info), (info))
-     ...
-     hook_call(some_update_event, info);
+   #include "mydaemon.h"
+   DEFINE_HOOK(some_update_event, (struct eventinfo *info), (info))
+   ...
+   hook_call(some_update_event, info);
 
 .. code-block:: c
-     :caption: mymodule.c
+   :caption: mymodule.c
 
-     #include "mydaemon.h"
-     static int event_handler(struct eventinfo *info);
-     ...
-     hook_register(some_update_event, event_handler);
+   #include "mydaemon.h"
+   static int event_handler(struct eventinfo *info);
+   ...
+   hook_register(some_update_event, event_handler);
 
 Do not use parameter names starting with "hook", these can collide with
 names used by the hook code itself.