get symbols out of a dylib and map the C++ ones to their demangled names

release
Joe Groff 2010-04-14 15:52:46 -07:00
parent b7307c2dd6
commit 0f028feb22
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
! (c)2010 Joe Groff bsd license
USING: alien.cxx.demangle assocs combinators fry io.pathnames
kernel macho sequences ;
IN: alien.cxx.scaffold
: library-symbols ( file -- symbols )
dup file-extension {
{ "dylib" [ dylib-exports ] }
{ f [ dylib-exports ] }
} case ;
: c++-library-symbols ( file abi -- symbols )
[ library-symbols ] dip
[ '[ _ c++-symbol? ] filter ]
[ '[ dup _ demangle ] H{ } map>assoc ] bi ;