Elektra
0.9.2
|
This plugin is a storage plugin that supports full Elektra semantics. Combined with a resolver plugin it already assembles a fully featured backend. No other plugins are needed.
The file format edf (Elektra dump format) consists of a simple command language with arguments. When an argument is binary or string data the length needs to be passed first. Because the size is known in advance, any binary dump is accepted. Terminating characters present no problem. The commands are assembled similar to the ones present in Elektra’s API.
The file starts with the magic word kdbOpen
followed by a version number. Processing can be stopped immediately when it is not in Elektra’s dump format at all. A wrong version number most likely indicates that the version of the plugin is too old to recognize all commands in the file. The basic idea of the dump plugin is to write out the way that the KeySet needs to be constructed. The dump plugin interprets such a file. The file also looks similar to C code that would create the KeySet. Keys can contain any binary values and arbitrary metadata and are still stored and parsed correctly. The dump plugin can even reconstruct pointers to metadata to save memory. When a pointer to the same region of memory is found, a special command keyCopyMeta
is written out that is able to reconstruct the data structure the way it was before. The commands were designed to make parsing of the file an easy task.
The serialized configuration can look like (0 bytes at end of strings are omitted):
(status -1000)
Export a KeySet using dump
:
Import a KeySet using dump
:
Using grep/diff or other Unix tools on the dump file. Make sure that you treat it as text file, e.g.: