$darkmode
Elektra 0.11.0
Functions
kdbrecord.h File Reference

Defines for record. More...

#include <kdb.h>
#include <kdbdiff.h>
#include <kdbplugin.h>
#include <kdbtypes.h>
Include dependency graph for kdbrecord.h:

Functions

bool elektraRecordEnableRecording (KDB *handle, const Key *parentKey, Key *errorKey)
 Enable session recording. More...
 
bool elektraRecordDisableRecording (KDB *handle, Key *errorKey)
 Disable session recording. More...
 
bool elektraRecordResetSession (KDB *handle, Key *errorKey)
 Clears all recorded data. More...
 
bool elektraRecordRecord (KDB *handle, KDB *sessionStorageHandle, KeySet *newKeys, Key *parentKey, Key *errorKey)
 Diff and record changes to the KDB instance in handle. More...
 
bool elektraRecordUndo (KDB *handle, KDB *sessionStorageHandle, Key *parentKey, Key *errorKey)
 Undo changes that were recorded in the current recording session. More...
 
bool elektraRecordRemoveKeys (KDB *handle, KeySet *toRemove, bool recursive, Key *errorKey)
 Removes the provided keys from the recording session. More...
 
bool elektraRecordIsActive (KDB *handle)
 Check whether session recording is active in the given KDB instance. More...
 

Detailed Description

Defines for record.

Function Documentation

◆ elektraRecordDisableRecording()

bool elektraRecordDisableRecording ( KDB *  handle,
Key *  errorKey 
)

Disable session recording.

This affects both the given handle as well as every KDB instance that will be created after this method has been called.

Parameters
handlethe KDB instance to use
errorKeyused for reporting errors and warnings. As usual, they will be found as meta keys attached to this key.
Return values
true- recording has been disabled successfully @retfal false - there was an error disabling recording - see errorKey for further details

◆ elektraRecordEnableRecording()

bool elektraRecordEnableRecording ( KDB *  handle,
const Key *  parentKey,
Key *  errorKey 
)

Enable session recording.

This affects both the given handle as well as every KDB instance that will be created after this method has been called.

Parameters
handlethe KDB instance to use
parentKeyrecording will be enabled for every key that is same or below this key
errorKeyused for reporting errors and warnings. As usual, they will be found as meta keys attached to this key.
Return values
true- recording has been enabled successfully @retfal false - there was an error enabling recording - see errorKey for further details

◆ elektraRecordIsActive()

bool elektraRecordIsActive ( KDB *  handle)

Check whether session recording is active in the given KDB instance.

Parameters
handlethe KDB instance to check
Return values

◆ elektraRecordRecord()

bool elektraRecordRecord ( KDB *  handle,
KDB *  sessionStorageHandle,
KeySet *  newKeys,
Key *  parentKey,
Key *  errorKey 
)

Diff and record changes to the KDB instance in handle.

This function is mainly intended for use in the recorder plugin.

Parameters
handlethe KDB instance that changes occured on
sessionStorageHandlethe KDB instances that shall be used to persist the session diff. You can use the same as for handle.
newKeysthe keyset with changed keys
parentKeyonly changes same or below this key will be determined
errorKeyused for reporting errors and warnings. As usual, they will be found as meta keys attached to this key.
Return values
true- changes were recorded successfully @retfal false - there was an error during recording - see errorKey for further details

◆ elektraRecordRemoveKeys()

bool elektraRecordRemoveKeys ( KDB *  handle,
KeySet *  toRemove,
bool  recursive,
Key *  errorKey 
)

Removes the provided keys from the recording session.

Parameters
handlethe KDB instance to use for accessing recording data.
toRemovethe keys in this keyset will be removed.
recursiveif true, also the keys below every specified key will be removed.
errorKeyused for reporting errors and warnings. As usual, they will be found as meta keys attached to this key.
Return values
true- removal was successful @retfal false - there was an error during the removal operation - see errorKey for further details

◆ elektraRecordResetSession()

bool elektraRecordResetSession ( KDB *  handle,
Key *  errorKey 
)

Clears all recorded data.

Parameters
handlethe KDB instance to use
errorKeyused for reporting errors and warnings. As usual, they will be found as meta keys attached to this key.
Return values
true- recording session has been cleared successfully @retfal false - there was an error clearing the recording session - see errorKey for further details

◆ elektraRecordUndo()

bool elektraRecordUndo ( KDB *  handle,
KDB *  sessionStorageHandle,
Key *  parentKey,
Key *  errorKey 
)

Undo changes that were recorded in the current recording session.

After executing this function, the state of KDB should be the same as it was before starting the recording session.

Parameters
handlethe KDB instance to use for accessing configuration data
sessionStorageHandlethe KDB instance to use for accessing recording data. This can be the same as for handle
parentKeyonly changes same or below this key are undone.
errorKeyused for reporting errors and warnings. As usual, they will be found as meta keys attached to this key.
Return values
true- changes were undone successfully @retfal false - there was an error during the undo operation - see errorKey for further details