libelektra
libelektra copied to clipboard
include <elektra/kdb.h>
We could install all header files also to /usr/include/elektra
, which allows us to include <elektra/kdb.h>
without any include path.
@domhof Is this a 1.0 issue?
If the alternative “Macro magic to support both inclusion options“ means that we do not need to install each header file twice, then I am for that option.
How about creating a link /usr/include/elektra/legacy
that points to /usr/include/elektra
. Would that also work?
means that we do not need to install each header file twice, then I am for that option.
What is so bad about installing the files twice? They are not really large... (388K)
How about creating a link /usr/include/elektra/legacy that points to /usr/include/elektra. Would that also work?
You are right, actually we do not need to install them twice. (even the symlink does not seem to be necessary.) We simply internally always use <elektra/file.h>
and if the user sets the include path to /usr/include/elektra
the internal elektra/kdb.h
should still work?
Within the source repo, however, we would need to create a folder called elektra
, so the include files would be in `src/include/elektra.
What is so bad about installing the files twice? They are not really large... (388K)
It’s not that bad, but I am usually a fan of keeping things small and tidy.
Within the source repo, however, we would need to create a folder called elektra, so the include files would be in
src/include/elektra
.
Provided that this solution works, creating an additional subfolder does not sound that bad. I certainly could live with it.
lets do it
I think a big issue here is also that we often use e.g. #include <kdbmacros.h>
with <>
. AFAIK the C standard doesn't have an opinion on this, but most compilers will start only look in include paths with <>
. But with #include "kdbmacros.h"
they first look in the directory the current file is in, so that way it should work no matter where we put our headers, as long as the have the same relative layout as in the source tree.
As discussed in #3813 we do not need any legacy header files. The only supported way to include files should be <elektra/NAME.h>
, where NAME usually does not start with "kdb", so e.g. it would be <elektra/macros.h>
.
To proceed with this, we have to move all the header files into the src/include/elektra
folder, is that correct?
This issue is a bit outdated. We now have a few decisions that describe what the everything should look like:
- doc/decisions/3_decided/header_file_structure.md: Describes where the various header files should be located in the repo.
-
doc/decisions/3_decided/header_include.md: Describes how the headers should be
#include
d into other files.
There are also some decisions that are tangentially related:
-
doc/decisions/3_decided/private_api.md: Requires
kdbprivate.h
to be split up. - doc/decisions/3_decided/library_split.md: Describes how the API should be defined into libraries, which has an impact on the headers.
For this issue I'd say the main part is header_file_structure.md
. Fully implementing that, also requires updating includes and CMake config. So doing everything at once might a bit much. Maybe start with moving things to src/include/elektra
and src/include/internal
and updating the CMake config.
Thank you for the feedback, I will continue with that!
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart: