libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

include <elektra/kdb.h>

Open markus2330 opened this issue 8 years ago • 11 comments

We could install all header files also to /usr/include/elektra, which allows us to include <elektra/kdb.h> without any include path.

markus2330 avatar Jun 30 '16 21:06 markus2330

@domhof Is this a 1.0 issue?

markus2330 avatar Feb 08 '17 18:02 markus2330

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?

sanssecours avatar Feb 08 '17 20:02 sanssecours

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.

markus2330 avatar Feb 09 '17 09:02 markus2330

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.

sanssecours avatar Feb 09 '17 10:02 sanssecours

lets do it

markus2330 avatar Mar 16 '17 18:03 markus2330

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.

kodebach avatar Mar 03 '21 15:03 kodebach

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>.

markus2330 avatar May 01 '21 15:05 markus2330

To proceed with this, we have to move all the header files into the src/include/elektra folder, is that correct?

Janldeboer avatar Dec 01 '22 10:12 Janldeboer

This issue is a bit outdated. We now have a few decisions that describe what the everything should look like:

There are also some decisions that are tangentially related:

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.

kodebach avatar Dec 01 '22 10:12 kodebach

Thank you for the feedback, I will continue with that!

Janldeboer avatar Dec 01 '22 11:12 Janldeboer

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:

github-actions[bot] avatar May 02 '24 01:05 github-actions[bot]

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:

github-actions[bot] avatar May 16 '24 01:05 github-actions[bot]