$darkmode
Elektra 0.11.0
|
Only libelektra-core
is supposed to access private data, but this contradicts the goal to keep the library minimal. kdbprivate.h
was too generic, it contained many other parts next to the struct definitions of Key/KeySet. Theoretically everything in kdbprivate.h
is supposed to be private, but lots of code still uses it when it shouldn't. kdb.h
is also the only header that is definitely public. All other headers are anybody's guess.
libelektra-operations
) to access non-public API. Such libraries need to have a good reason (e.g. performance, impossible otherwise, etc.) why they access non-public API and they need to be kept up-to-date. If a library cannot provide a stable API on top of the unstable non-public API, it clearly needs to state which APIs are not stable.extern const
version constant(s) can be used for compatibility checks. In most cases, compatibility should be ensured via package management systems or manually by the user. Sometimes it may be possible to write code (e.g. in a third-party library) such that it is compatible with multiple versions of Elektra. In those cases, we need to know what version of Elektra is installed, so that the correct code can be executed. For example, if a new version accepts an argument to foo()
that previously wasn't allowed. An external library may be able to use this when available and use other code as a fallback in older versions.libelektra-operations
) it might be easiest to require a specific version of libelektra-core
. This cannot easily be enforced, so it must be well documented.