.TH "backend.c" 3elektra "Sat Oct 8 2022" "Version 0.9.11" "Elektra" \" -*- nroff -*-
.ad l
.nh
.SH NAME
backend.c \- Everything related to a backend\&.  

.SH SYNOPSIS
.br
.PP
\fC#include <kdbassert\&.h>\fP
.br
\fC#include <kdbinternal\&.h>\fP
.br

.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBelektraBackendSetMountpoint\fP (Backend *backend, KeySet *elektraConfig, Key *errorKey)"
.br
.RI "sets mountpoint "
.ti -1c
.RI "Backend * \fBbackendOpen\fP (KeySet *elektraConfig, KeySet *modules, KeySet *global, Key *errorKey)"
.br
.RI "Builds a backend out of the configuration supplied from: "
.ti -1c
.RI "Backend * \fBbackendOpenDefault\fP (KeySet *modules, KeySet *global, const char *file, Key *errorKey)"
.br
.RI "Opens a default backend using the plugin named KDB_RESOLVER and KDB_STORAGE\&. "
.ti -1c
.RI "Backend * \fBbackendOpenModules\fP (KeySet *modules, KeySet *global, Key *errorKey, elektraCursor pos)"
.br
.ti -1c
.RI "Backend * \fBbackendOpenVersion\fP (KeySet *global, Key *errorKey)"
.br
.RI "Opens the internal version backend\&. "
.ti -1c
.RI "int \fBbackendUpdateSize\fP (Backend *backend, Key *parent, int size)"
.br
.RI "Update internal size in backend\&. "
.in -1c
.SH "Detailed Description"
.PP 
Everything related to a backend\&. 


.PP
\fBCopyright\fP
.RS 4
BSD License (see LICENSE\&.md or https://www.libelektra.org) 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "Backend* backendOpen (KeySet * elektraConfig, KeySet * modules, KeySet * global, Key * errorKey)"

.PP
Builds a backend out of the configuration supplied from: 
.PP
.nf
system:/elektra/mountpoints/<name>

.fi
.PP
.PP
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\&.
.PP
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\&.
.PP
\fBksCut()\fP is perfectly suitable for cutting out the configuration like needed\&.
.PP
\fBNote\fP
.RS 4
The given KeySet will be deleted within the function, don't use it afterwards\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIelektraConfig\fP the configuration to work with\&. It is used to build up this backend\&. 
.br
\fImodules\fP used to load new modules or get references to existing one 
.br
\fIglobal\fP the global keyset of the KDB instance 
.br
\fIerrorKey\fP the key where an error and warnings are added
.RE
.PP
\fBReturns\fP
.RS 4
a pointer to a freshly allocated backend this could be the requested backend or a so called 'missing backend'\&. 
.RE
.PP
\fBReturn values\fP
.RS 4
\fI0\fP if out of memory 
.RE
.PP

.SS "Backend* backendOpenDefault (KeySet * modules, KeySet * global, const char * file, Key * errorKey)"

.PP
Opens a default backend using the plugin named KDB_RESOLVER and KDB_STORAGE\&. 
.PP
\fBParameters\fP
.RS 4
\fImodules\fP the modules to work with 
.br
\fIglobal\fP the global keyset of the KDB instance 
.br
\fIerrorKey\fP the key to issue warnings and errors to 
.RE
.PP
\fBReturns\fP
.RS 4
the fresh allocated default backend or 0 if it failed 
.RE
.PP

.SS "Backend* backendOpenModules (KeySet * modules, KeySet * global, Key * errorKey, elektraCursor pos)"

.PP
\fBReturns\fP
.RS 4
a backend which gives plugin configuration of the module which is currently point to\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fImodules\fP the modules to work with 
.br
\fIglobal\fP the global keyset of the KDB instance 
.br
\fIerrorKey\fP the key to issue warnings and errors to 
.br
\fIpos\fP the position of plugin the use in \fCmodules\fP 
.RE
.PP

.SS "Backend* backendOpenVersion (KeySet * global, Key * errorKey)"

.PP
Opens the internal version backend\&. 
.PP
\fBParameters\fP
.RS 4
\fIglobal\fP the global keyset of the KDB instance 
.br
\fIerrorKey\fP the key to issue warnings and errors to 
.RE
.PP
\fBReturns\fP
.RS 4
the fresh allocated default backend or 0 if it failed 
.RE
.PP

.SS "int backendUpdateSize (Backend * backend, Key * parent, int size)"

.PP
Update internal size in backend\&. 
.PP
\fBParameters\fP
.RS 4
\fIbackend\fP the backend to update 
.br
\fIparent\fP for parent 
.br
\fIsize\fP to update (-1 default, 0 empty, >0 otherwise)
.RE
.PP
\fBPrecondition\fP
.RS 4
parent must be serializable namespace
.RE
.PP
\fBReturn values\fP
.RS 4
\fI-1\fP if invalid parent (assert) 
.br
\fI0\fP on success 
.RE
.PP

.SS "int elektraBackendSetMountpoint (Backend * backend, KeySet * elektraConfig, Key * errorKey)"

.PP
sets mountpoint 
.PP
\fBParameters\fP
.RS 4
\fIbackend\fP where the mountpoint should be set 
.br
\fIelektraConfig\fP the config where the mountpoint can be found 
.br
\fIerrorKey\fP the name also has the mountpoint set
.RE
.PP
\fBReturn values\fP
.RS 4
\fI-1\fP if no mountpoint is found or memory allocation problem 
.br
\fI0\fP on success 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Elektra from the source code\&.
