Finding out names in shared libraries

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 23 10:39:49 PDT 2016


On 2016-03-23 16:17, Ozan wrote:
> Hi
>
>
> If I want to use a class or a function in a shared library, it is
> necessary to use funny names like
> "D7myclass10getMyClassFZC7myclass7MyClass".
>
> Is it possible to get a list of all the names in shared library? What is
> the schema behind these names? Is there a listing for "D7", "10",
> "FZC7", "7" and so on?

Not exactly sure what you need. But it's possible to get all classes at 
runtime like this [1].

For functions, there's really no pretty way to do that. You can either 
implement runtime reflection using compile time reflection, which will 
most likely require you to modify the code you want to inspect. Or you 
can inspect the symbol table in the binary/shared library, which is a 
bit complicated and platform dependent.

[1] 
https://github.com/D-Programming-Language/druntime/blob/master/src/object.d#L973

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list