The version of Elektra is handeled with the kdb.\+h macros {\ttfamily K\+D\+B\+\_\+\+V\+E\+R\+S\+I\+ON} which is a string and {\ttfamily K\+D\+B\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+A\+J\+OR}, {\ttfamily K\+D\+B\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+I\+N\+OR} and {\ttfamily K\+D\+B\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+M\+I\+C\+RO} which are numbers. They represent the public announced version information.

The same information can be retrieved at run-\/time using \begin{DoxyVerb}    system/elektra/version/constants/KDB_VERSION
    system/elektra/version/constants/KDB_VERSION_MAJOR
    system/elektra/version/constants/KDB_VERSION_MICRO
    system/elektra/version/constants/KDB_VERSION_MINOR
\end{DoxyVerb}


This is the A\+PI to programs using Elektra. Its interface is defined in src/include/kdb.h. Both applications and plugins use this A\+PI.

Additionally there is also a very small A\+PI to plugins. It consists of only 5 functions and is described in \href{/home/markus/Projekte/Elektra/current/src/plugins/doc/doc.c}{\tt src/plugins/doc/doc.\+c}.

\subsection*{Compatibility}

This section describes under which circumstances A\+PI and A\+BI incompatiblities may occur. As developer from Elektra your mission is to avoid that. The tool icheck against the interfaces mentioned above may help you too.

In 0.\+8.$\ast$ the A\+PI and A\+BI must be always forward-\/compatible, but not backwards-\/compatible. That means that a program written and compiled against 0.\+8.\+0 compiles and links against 0.\+8.\+1. But because it is not necessarily backendwards-\/compatible a program written for 0.\+8.\+1 may not link or compile against elektra 0.\+8.\+0 (but it may do when you use the compatible subset, maybe with \#ifdefs).

Following points are allowed\+: When you add a new function you break A\+BI and A\+PI backward-\/ compatibility, but not forward, so you are allowed to do so.

In the signature you are only allowed to add const to any parameter. You are {\itshape not} allowed to use subtypes to the objects, in C means you are not allowed to call any functions of an object which appear new. C does {\itshape not} typecheck that, it\textquotesingle{}s your responsibility.

What C also does not check are the pre and postconditions. That means you are not allowed to demand more client code (e.\+g. first accept a N\+U\+LL pointer and in the next version you crash on it) and you are not allowed to return values that the previous version did not return. It is a complex topic, so better don\textquotesingle{}t underestimate it, but generally said the methods should behave on the same data the same way.

References\+: \href{http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html}{\tt http\+://tldp.\+org/\+H\+O\+W\+T\+O/\+Program-\/\+Library-\/\+H\+O\+W\+T\+O/shared-\/libraries.\+html} \href{http://packages.debian.org/de/sid/icheck}{\tt http\+://packages.\+debian.\+org/de/sid/icheck}

\subsection*{Increment}

This section describes how to increment the {\ttfamily K\+D\+B\+\_\+\+V\+E\+R\+S\+I\+ON}. It consists of a triplet integer {\ttfamily current\+:revision\+:age}.

{\ttfamily revision} is something which will always incremented when there is a new bugfix release.

{\ttfamily current} and {\ttfamily age} will be incremented by one when you release a compatible but changed A\+PI. The revision is set back to zero then.

Note\+: All 3 versioning infos are handled separately!

\href{http://www.gnu.org/software/libtool/manual/libtool.html#Versioning}{\tt http\+://www.\+gnu.\+org/software/libtool/manual/libtool.\+html\#\+Versioning} \href{http://semver.org/}{\tt http\+://semver.\+org/}

\begin{quote}
T\+O\+DO write about S\+O\+\_\+\+V\+E\+R\+S\+I\+ON and rest version\end{quote}
