Current kdelibs class list

Lubos Lunak l.lunak at suse.cz
Fri Jun 1 08:46:23 BST 2007


On Wednesday 30 of May 2007, Thiago Macieira wrote:
> I have attached the full dump of the exported class list in kdelibs (it
> includes some namespaces too). By "exported" I understand at least one
> KDE_EXPORT symbol in the class.
>
> I generated this list with the following zsh command:
> for f in lib*.so.*(.); do nm -CD --defined-only $f |
> perl -n -e 'm/^[0-9a-f]* T ([^(]*)::([^:]*)$/ && print "'$f': $1\n";' |
> sort; done | uniq > classlist.txt
> [Note: (.) is zsh-specific and means "normal files"]
>
> From the list, the following classes are problematic:
...
> - all classes in libkdeprint.so.5.0.0 because they don't have a namespace.
> Worse are: DrBase, DrFloatOption, DrGroup, DrIntegerOption, DriverView,
> DrListOption, DrMain, DrStringOption, Foomatic2Loader, MarginWidget,
> MessageWindow, PluginComboBox, PPDLoader (no K prefix)

 These sound a lot like internal classes ... they're used outside of kdelibs, 
right (lxr is down)?

> There are also a few class names that could be improved (like KTempDir →
> KTemporaryDir), but I guess it's too late for KDE 4. Maybe in KDE 5...

 Why? It's still half a year and it's only a simple find/replace. Especially 
given that above you've already written a list of classes that will be 
renamed anyway.

> It looks to me like both KDEPrint libraries had all their classes
> KDE_EXPORTed, including the internal ones.
>
> Finally, these are only exported classes. If you check the non-exported
> class list, you'll see some scary names.

 Can't beat my all-time favourite "struct X" :).

> Some platforms do not support hidden visibility, so those classes get
> exported and may therefore clash with user code.
> (I can't post that list because it contains too many false positives due
> to inlined methods)

 You can filter out inlines by ignoring weak symbols, although that may filter 
out too much. Hmm ... that brings memories of old times ... as old as when I 
tried to write in perl :-/ . KDE3's admin/ has a script called nmcheck which 
should handle this (too bad I can't quite read the source anymore). I created 
it somewhen in the KDE3 times and checked the libs with it, but then it got 
forgotten somehow (one can't do that much with stable libs anyway).

 I think I could resurrect this, with a make target or whatever, the list of 
symbols to allow could be these days easily generated directly from the .h 
files.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz




More information about the kde-core-devel mailing list