:: [Libbitcoin] Coding style - libbitc…
Top Page
Delete this message
Reply to this message
Author: William Swanson
Date:  
To: libbitcoin
Subject: [Libbitcoin] Coding style - libbitcoin-*
Hello,
When we were in Toronto, we talked about renaming all our libraries to
use the libbitcoin-* scheme, like libbitcoin-wallet,
libbitcoin-client, etc.. Well, I have started working on a
libbitcoin-client library, and have run into a few questions.

First, where should the headers go? Right now, we have
/usr/include/bitcoin/*, /usr/include/wallet/*, etc., but this doesn't
seem right for the new system. Eric has been moving things towards a
single master header per library, so it's somewhat redundant having
the library name in the path as well. Perhaps the layout should go
like this:

/usr/include/bitcoin/client.hpp (master library include)
/usr/include/bitcoin/wallet.hpp (master library include)
/usr/include/bitcoin/client/*.hpp (internal headers)
/usr/include/bitcoin/wallet/*.hpp (internal headers)

The second question is, what should we do with the namespaces? Right
now, we have libbitcoin::, bc:: (which maps to libbitcoin::),
libwallet::, and so forth. Maybe we should do what boost does, and
have bitcoin::wallet, bitcoin::client, and such for the various child
libraries? Otherwise, we could do the stl thing and just put them all
in one big namespace.

Finally, what should we do with the dllexport macros? They aren't
contained in any namespace, and yet we want them to stay short. Right
now we have BC_API, BCW_API, and so forth, one for each library. Would
it make sense to have a single BC_API macro, defined in a central
place, that we use for all libs? Or is the one-macro-per-library thing
accomplishing something I am not aware of?

Thanks.

-William