Well, I would imagine that if Perl can do it, so can you. You have the source; I would start looking at Dynaloader since that seems to be the guts behind everything.
I admit that I'm not sure how well that would work; you might need to do some dynamic linking tricks to get the address of your function *after* the .so is loaded by Perl.
--Stevie-O
$"=$,,$_=q>|\p4<6 8p<M/_|<('=>
.q>.<4-KI<l|2$<6%s!<qn#F<>;$,
.=pack'N*',"@{[unpack'C*',$_]
}"for split/</;$_=$,,y[A-Z a-z]
{}cd;print lc
| [reply] [d/l] |
I can't find how to get at dl_find_symbol_anywhere() either :(
My C is being compiled using ExtUtils::Embed ldopts which links it against libperl and DynaLoader.a, which doesn't seem to include the dl_find_symbol_anywhere() symbol. Nor does "require DynaLoader" allow me to call it from Perl.
I'm stumped :(
| [reply] |
I've now managed to get a CODEREF to the routine I was after like this:
eval_pv(
"use DynaLoader;" \
"use XML::LibXML;" \
"my $pnts_symref = DynaLoader::dl_find_symbol_anywhere('PmmNod
+eToSv');" \
"my $coderef = DynaLoader::dl_install_xsub('kousei::PmmNodeToS
+v', $pnts_symref);"
TRUE
);
Trouble is, now I can't find how to call it from C with the args I need to pass. Calling it from perl is fine via &$coderef(), but the xmlNode I want to pass to it is in C.
Any clues? | [reply] [d/l] |