
\begin{DoxyItemize}
\item infos = Information about ni plugin is in keys below
\item infos/author = Markus Raab \href{mailto:elektra@libelektra.org}{\tt elektra@libelektra.\+org}
\item infos/licence = B\+S\+D
\item infos/provides = storage
\item infos/needs =
\item infos/placements = getstorage setstorage
\item infos/status = maintained libc
\item infos/description = Reads and writes the nickel ini format
\end{DoxyItemize}

This plugin uses the nickel library in order to read/write \hyperlink{md_doc_help_elektra-meta-data_doc_help_elektra-meta-data_md}{metakeys} in the nickel ini format. It's purpose is to be used in the {\ttfamily spec}-\/namespace or when any metadata should be stored.

For ini files for applications, e.\+g. smb.\+conf you should prefer the ini plugin.

\subsection*{Usage}

To mount a ni plugin you can simply use\+: \begin{DoxyVerb}kdb mount file.ini spec/ni ni
\end{DoxyVerb}


The strength and usage of this plugin is that it supports arbitrary meta data and is still human readable. E.\+g. \begin{DoxyVerb}[key]
meta=foo
\end{DoxyVerb}


creates the key with meta data key {\ttfamily meta} and meta data value {\ttfamily foo}\+: \begin{DoxyVerb}$ kdb getmeta user/ni/key meta
foo
\end{DoxyVerb}


the meta data for the parent key has following syntax\+: \begin{DoxyVerb}[]
meta=foo
\end{DoxyVerb}


Line continuation works by ending the line with {\ttfamily \textbackslash{}\textbackslash{}}.

Exporting a Key\+Set to the nickel format\+: \begin{DoxyVerb}kdb export spec/ni ni > example.ni
\end{DoxyVerb}


For in-\/detail explanation of the syntax (nested keys are not supported by the plugin, however) \href{/home/markus/Projekte/Elektra/current/src/plugins/ni/nickel-1.1.0/include/bohr/ni.h}{\tt see /src/plugins/ni/nickel-\/1.1.\+0/include/bohr/ni.h}

\subsection*{Limitations}


\begin{DoxyItemize}
\item Supports most Key\+Sets, but {\ttfamily kdb test} currently reports some errors (likely because of the U\+T\+F-\/8 handling happening within ni).
\item Keys have a random order when written out.
\item No comments are preserved, they are simply removed.
\item Parse errors simply result to ignoring (and removing) these parts.
\end{DoxyItemize}

\subsection*{Nickel}

This plugin is based on the Nickel Library written by author\+: \href{mailto:charles@chaoslizard.org}{\tt charles@chaoslizard.\+org}

Nickel (Ni) has its strength in building up a hierarchical recursive Node structure which is perfect for parsing and generating ini files. With them arbitrary deep nested hierarchy are possible, but limited in a keyname of a fixed size.

The A\+P\+I of nickel is very suited for elektra, it can use {\ttfamily F\+I\+L\+E$\ast$} pointers (using that elektra could open and lock files), the node-\/hierarchy can be transformed to keysets, but it lacks of many features like comments and types.

The format is more general then the kde-\/ini format, it can handle their configuration well, when the section names do not exceed the specified length. Nesting is only required in the first depth, any deeper is not understood by kde config parser.

The memory footprint is for a 190.\+000 (reduced to 35.\+000 when rewrote first ) line ini file with 1.\+1\+M\+B size is 16.\+88 M\+B. The sort order is not stable, even not with the same file rewritten again.

\href{https://github.com/chazomaticus/bohr}{\tt bohr libraries} 