[Libvir] [PATCH] export virConf* symbols (second version)

Second version of that patch. Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 "[Negative numbers] darken the very whole doctrines of the equations and make dark of the things which are in their nature excessively obvious and simple" (Francis Maseres FRS, mathematician, 1759)

Hi Rich, On Wed, 2007-02-28 at 17:33 +0000, Richard W.M. Jones wrote:
+#define virConfNew() (_virConfNew())
I wouldn't bother doing this, it just adds confusion - e.g. it helps to know that the symbol is private from the calling site too, so just use _virConfNew() everywhere ... Also suggest surrounding everything with: #ifdef LIBVIRT_PRIVATE_API_DO_NOT_USE in src/conf.h (even though it's not installed) so that people have no excuse if they use this ... Cheers, Mark.

Mark McLoughlin wrote:
Hi Rich,
On Wed, 2007-02-28 at 17:33 +0000, Richard W.M. Jones wrote:
+#define virConfNew() (_virConfNew())
I wouldn't bother doing this, it just adds confusion - e.g. it helps to know that the symbol is private from the calling site too, so just use _virConfNew() everywhere ...
Also suggest surrounding everything with:
#ifdef LIBVIRT_PRIVATE_API_DO_NOT_USE
in src/conf.h (even though it's not installed) so that people have no excuse if they use this ...
Thanks Mark. I'll put up a third version later (probably tomorrow in fact, I'm building & fixing computers today). Rich.

On Thu, Mar 01, 2007 at 09:25:54AM +0000, Mark McLoughlin wrote:
Hi Rich,
On Wed, 2007-02-28 at 17:33 +0000, Richard W.M. Jones wrote:
+#define virConfNew() (_virConfNew())
I wouldn't bother doing this, it just adds confusion - e.g. it helps to know that the symbol is private from the calling site too, so just use _virConfNew() everywhere ...
The libvirtd or other in-tree code doesn't really care about this - any in-tree code is fair game for use really. The distinction public/private is only relevant to out-of-tree code. None of the other in-tree private code has an underscore, so I don't see any real benefit to making all the in-tree code prefix an underscore on these symbols. So I'm inclined to just apply Rich's patch as is, since its the minimal change which makes it clear to out-of-tree people this is private, while not impacting in-tree code.
Also suggest surrounding everything with:
#ifdef LIBVIRT_PRIVATE_API_DO_NOT_USE
in src/conf.h (even though it's not installed) so that people have no excuse if they use this ...
I think that's overkill - we're not installing src/conf.h into the /usr/include, so its merely going to clutter up the libvirt codebase. Having an _ on the symbol name & not listing them in any public header file is already making it clear enough that these are not for public use. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (3)
-
Daniel P. Berrange
-
Mark McLoughlin
-
Richard W.M. Jones