$darkmode
Elektra 0.11.0
Functions
hooks.c File Reference
#include <kdbinternal.h>
Include dependency graph for hooks.c:

Functions

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

Detailed Description

Function Documentation

◆ elektraFindInternalNotificationPlugin()

Plugin* elektraFindInternalNotificationPlugin ( KDB *  kdb)

This method looks for the hook plugin 'internalnotification'.

Parameters
kdbthe 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
kdbthe KDB handle where the hooks should be freed
errorKeythe 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
kdbthe KDB instance where the hooks should be initialized
configKeySet containing the current config in system:/elektra namespace
modulesthe current list of loaded modules
contractthe contract passed to kdbOpen
errorKeythe key which holds errors and warnings which were issued
Returns
0 on success, -1 on failure