Dirk Koopman
2006-01-31 15:18:08 UTC
Is there some 'official' perl way of setting global variables in a .xs
wrapped global library at runtime?
I have a (huge) legacy app that is (now) a shared library. I need to
call various routines in this shared library under the control of the
usual .xs wrapper mechanism and this is all just fine.
However some of this code relies on certain global variables in the app
being set up (you need to know that this app has several 100 potential
entry points, each requiring a different set of global variables to be
set [just don't ask, ok?]).
I know what these variables are called (or at least I can work it out)
and these are therefore findable thru things like dlsym() and its
friends.
So how do I find them and then set them (probably thru DynaLoader)? They
are (at least for now) just simple ints.
wrapped global library at runtime?
I have a (huge) legacy app that is (now) a shared library. I need to
call various routines in this shared library under the control of the
usual .xs wrapper mechanism and this is all just fine.
However some of this code relies on certain global variables in the app
being set up (you need to know that this app has several 100 potential
entry points, each requiring a different set of global variables to be
set [just don't ask, ok?]).
I know what these variables are called (or at least I can work it out)
and these are therefore findable thru things like dlsym() and its
friends.
So how do I find them and then set them (probably thru DynaLoader)? They
are (at least for now) just simple ints.
--
Dirk Koopman <***@tobit.co.uk>
--
Dirk Koopman <***@causeway.com>
Dirk Koopman <***@tobit.co.uk>
--
Dirk Koopman <***@causeway.com>