| Elektra 0.11.0

Functions
hooks.c File Reference
`#include <kdbinternal.h>`

## Functions
void | freeHooks (KDB *kdb, Key *errorKey)
| Uninitializes and frees all hooks in the passed KDB handle.
Plugin * | elektraFindInternalNotificationPlugin (KDB *kdb)
| This method looks for the hook plugin 'internalnotification'.
int | initHooks (KDB *kdb, const KeySet *config, KeySet *modules, const KeySet *contract, Key *errorKey)
| Initializes the hooks stored in the passed KDB handle.

## Detailed Description

Copyright
  BSD License (see LICENSE.md or https://www.libelektra.org)

## Function Documentation

## ◆ elektraFindInternalNotificationPlugin()

Plugin * elektraFindInternalNotificationPlugin | ( | KDB * | kdb | ) |

This method looks for the hook plugin 'internalnotification'.

Parameters

  kdb | the KDB instance in which to search

Returns
  NULL if not loaded, pointer to the plugin otherwise

## ◆ freeHooks()

void freeHooks | ( | KDB * | kdb,
|  | Key * | errorKey
| ) |  |

Uninitializes and frees all hooks in the passed KDB handle.

Parameters

  kdb | the KDB handle where the hooks should be freed
  errorKey | the key which holds errors and warnings which were issued

## ◆ initHooks()

int initHooks | ( | KDB * | kdb,
|  | const KeySet * | config,
|  | KeySet * | modules,
|  | const KeySet * | contract,
|  | Key * | errorKey
| ) |  |

Initializes the hooks stored in the passed KDB handle.

If the handle already contains initialized hooks, they will be reinitialized, including unloading and loading of their plugins. Parameters `config` and `contract` will be used to determine which hooks to populate.

Parameters

  kdb | the KDB instance where the hooks should be initialized
  config | KeySet containing the current config in `system:/elektra` namespace
  modules | the current list of loaded modules
  contract | the contract passed to `kdbOpen`
  errorKey | the key which holds errors and warnings which were issued

Returns
  0 on success, -1 on failure