[bind10-dev] use of installed headers versus headers from tree; naming of include headers

Shane Kerr shane at isc.org
Mon Feb 22 11:01:51 UTC 2010


Jeremy,

On Fri, 2010-02-19 at 14:14 -0600, Jeremy C. Reed wrote:

> So my suggestion is to use top level include directory name like:
> 
> #include <bind10/cc/data.h>
> #include <bind10/auth/data_source_static.h>
> #include <bind10/config/ccsession.h>

I think this is okay, although it depends on how "unbundled" we want our
libraries to be.

> Maybe also for libdns headers.

I'm not sure. In principle everything should be able to be used with
only the things it depends on, right? So "config" should be able to live
without being in <bind10/config/...>. But I agree that the name "config"
is too generic for widespread consumption, so having <bind10/config/...>
makes sense. How is "dns" different really?

I note that this will become fixed... not in stone, but maybe mud that
is getting increasingly like clay... as time goes on and people use
these libraries for other purposes. We still have some flexibility now,
but it is good that we think about this!

> Since we want to build everything from our source tree and also want to 
> be able (in the future) be able to build somethings using installed 
> headers, maybe we should keep the public to-be-installed headers in 
> subdirectories like:
> 
> src/lib/libauth/include/auth/data_source_static.h
> 
> src/lib/libcc/include/cc/data.h
> 
> src/lib/libdns/include/dns/buffer.h
> 
> src/lib/libcfgclient/include/config/ccsession.h
> 
> (Notice the new naming scheme above doesn't include the language. I 
> wrote another email about this but never sent yet as realized we have 
> these header problems anyways.)
> 
> Any thoughts on this?

This is strictly my opinion, so I am quite willing to let consensus
rule, but I *hate* having to traverse extra directories to work with
code.

I like the idea of omitting the language. For Python stuff we can use a
nomenclature to indicate the language, if we care:

src/lib/pymsgq
src/lib/pydns

For the C++, I think it is better to have something like:

src/lib/auth/data_source_static.h

This means that we can have "-I src/lib" and our code with:

#include <auth/data_source_static.h> 

Will work fine, and it means that I don't have to type "cd .." 500 extra
times a day. :)

--
Shane




More information about the bind10-dev mailing list