Everything related to a backend.
More...
|
int | elektraBackendSetMountpoint (Backend *backend, KeySet *elektraConfig, Key *errorKey) |
| sets mountpoint More...
|
|
Backend * | backendOpen (KeySet *elektraConfig, KeySet *modules, KeySet *global, Key *errorKey) |
| Builds a backend out of the configuration supplied from: More...
|
|
Backend * | backendOpenDefault (KeySet *modules, KeySet *global, const char *file, Key *errorKey) |
| Opens a default backend using the plugin named KDB_RESOLVER and KDB_STORAGE. More...
|
|
Backend * | backendOpenModules (KeySet *modules, KeySet *global, Key *errorKey) |
|
Backend * | backendOpenVersion (KeySet *global, Key *errorKey) |
| Opens the internal version backend. More...
|
|
int | backendUpdateSize (Backend *backend, Key *parent, int size) |
| Update internal size in backend. More...
|
|
Everything related to a backend.
- Copyright
- BSD License (see LICENSE.md or https://www.libelektra.org)
◆ backendOpen()
Backend* backendOpen |
( |
KeySet * |
elektraConfig, |
|
|
KeySet * |
modules, |
|
|
KeySet * |
global, |
|
|
Key * |
errorKey |
|
) |
| |
Builds a backend out of the configuration supplied from:
system/elektra/mountpoints/<name>
The root key must be like the above example. You do not need to rewind the keyset. But every key must be below the root key.
The internal consistency will be checked in this function. If necessary parts are missing, like no plugins, they cant be loaded or similar 0 will be returned.
ksCut() is perfectly suitable for cutting out the configuration like needed.
- Note
- The given KeySet will be deleted within the function, don't use it afterwards.
- Parameters
-
elektraConfig | the configuration to work with. It is used to build up this backend. |
modules | used to load new modules or get references to existing one |
global | the global keyset of the KDB instance |
errorKey | the key where an error and warnings are added |
- Returns
- a pointer to a freshly allocated backend this could be the requested backend or a so called "missing backend".
- Return values
-
◆ backendOpenDefault()
Backend* backendOpenDefault |
( |
KeySet * |
modules, |
|
|
KeySet * |
global, |
|
|
const char * |
file, |
|
|
Key * |
errorKey |
|
) |
| |
Opens a default backend using the plugin named KDB_RESOLVER and KDB_STORAGE.
- Parameters
-
modules | the modules to work with |
global | the global keyset of the KDB instance |
errorKey | the key to issue warnings and errors to |
- Returns
- the fresh allocated default backend or 0 if it failed
◆ backendOpenModules()
Backend* backendOpenModules |
( |
KeySet * |
modules, |
|
|
KeySet * |
global, |
|
|
Key * |
errorKey |
|
) |
| |
- Returns
- a backend which gives plugin configuration of the module which is currently point to.
- Parameters
-
modules | the modules to work with |
global | the global keyset of the KDB instance |
errorKey | the key to issue warnings and errors to |
◆ backendOpenVersion()
Backend* backendOpenVersion |
( |
KeySet * |
global, |
|
|
Key * |
errorKey |
|
) |
| |
Opens the internal version backend.
- Parameters
-
global | the global keyset of the KDB instance |
errorKey | the key to issue warnings and errors to |
- Returns
- the fresh allocated default backend or 0 if it failed
◆ backendUpdateSize()
int backendUpdateSize |
( |
Backend * |
backend, |
|
|
Key * |
parent, |
|
|
int |
size |
|
) |
| |
Update internal size in backend.
- Parameters
-
backend | the backend to update |
parent | for parent |
size | to update (-1 default, 0 empty, >0 otherwise) |
- Precondition
- parent must be serializable namespace
- Return values
-
-1 | if invalid parent (assert) |
0 | on success |
◆ elektraBackendSetMountpoint()
int elektraBackendSetMountpoint |
( |
Backend * |
backend, |
|
|
KeySet * |
elektraConfig, |
|
|
Key * |
errorKey |
|
) |
| |
sets mountpoint
- Parameters
-
| backend | where the mountpoint should be set |
| elektraConfig | the config where the mountpoint can be found |
[out] | errorKey | the name also has the mountpoint set |
- Precondition
- ksCurrent() is root key
- Postcondition
- ksCurrent() is root key
- Return values
-
-1 | if no mountpoint is found or memory allocation problem |
0 | on success |