[Pythonmac-SIG] dynload_next

Marcel Prastawa prastawa@cs.unc.edu
Sun, 27 Jan 2002 16:42:33 -0500 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1744662849-2028139461-1012167753=:4093
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Sun, 27 Jan 2002, Jack Jansen wrote:
> A fallback solution I had in mind (in case my mod to the core
> wasn't accepted) which might work for VTK was to put this glue
> code in a separate shared library, and then link all my modules
> against it. For my problem this wouldn't have been a 100%
> solution (there's a bit of other stuff in mactoolboxglue.c as
> well), but for the problem of getting access at each others
> routine pointers it would be.

The problem with building a wrapper is that VTK is a huge C++ library,
where the Python wrappers are built automatically. I could do it, but it
would be painful. Also, if/when the API changes I will probably bang my
head against the wall, repeatedly. :)

I've hacked the sys module. Now I could do something like:
import sys
sys.setdyldpublic()
... import things globally ...
sys.setdyldprivate() # revert to default, NSLINKMODULE_OPTION_PRIVATE set

The intrepreter state already has a slot for dlopen flags so I "borrowed"
it for dyld. What do you guys think? FWIW, I haven't tested this one with
VTK yet, only with a dummy case (I am doing things through SSH now).

I've attached the source files, I didn't generate patches because our
code may not be in sync (Steve had problems with my earlier patch).

Marcel

---1744662849-2028139461-1012167753=:4093
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="sysmodule.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.OSX.4.33.0201271642330.4093@mac-prastawa.cs.unc.edu>
Content-Description: 
Content-Disposition: attachment; filename="sysmodule.c"

DQovKiBTeXN0ZW0gbW9kdWxlICovDQoNCi8qDQpWYXJpb3VzIGJpdHMgb2Yg
aW5mb3JtYXRpb24gdXNlZCBieSB0aGUgaW50ZXJwcmV0ZXIgYXJlIGNvbGxl
Y3RlZCBpbg0KbW9kdWxlICdzeXMnLg0KRnVuY3Rpb24gbWVtYmVyOg0KLSBl
eGl0KHN0cyk6IHJhaXNlIFN5c3RlbUV4aXQNC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YXQsIC4uLikNCnsNCgl2YV9saXN0IHZhOw0K
DQoJdmFfc3RhcnQodmEsIGZvcm1hdCk7DQoJbXl3cml0ZSgic3RkZXJyIiwg
c3RkZXJyLCBmb3JtYXQsIHZhKTsNCgl2YV9lbmQodmEpOw0KfQ0K
---1744662849-2028139461-1012167753=:4093
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="pystate.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.OSX.4.33.0201271642331.4093@mac-prastawa.cs.unc.edu>
Content-Description: 
Content-Disposition: attachment; filename="pystate.c"

DQovKiBUaHJlYWQgYW5kIGludGVycHJldGVyIHN0YXRlIHN0cnVjdHVyZXMg
YW5kIHRoZWlyIGludGVyZmFjZXMgKi8NCg0KI2luY2x1ZGUgIlB5dGhvbi5o
Ig0KDQojaWZkZWYgSEFWRV9ETE9QRU4NCiNpZmRlZiBIQVZFX0RMRkNOX0gN
CiNpbmNsdWRlIDxkbGZjbi5oPg0KI2VuZGlmDQojaWZuZGVmIFJUTERfTEFa
WQ0KI2RlZmluZSBSVExEX0xBWlkgMQ0KI2VuZGlmDQojZW5kaWYNCg0KDQoj
ZGVmaW5lIFpBUCh4KSB7IFwNCglQeU9iamVjdCAqdG1wID0gKFB5T2JqZWN0
ICopKHgpOyBcDQoJKHgpID0gTlVMTDsgXA0KCVB5X1hERUNSRUYodG1wKTsg
XA0KfQ0KDQoNCiNpZmRlZiBXSVRIX1RIUkVBRA0KI2luY2x1ZGUgInB5dGhy
ZWFkLmgiDQpzdGF0aWMgUHlUaHJlYWRfdHlwZV9sb2NrIGhlYWRfbXV0ZXgg
PSBOVUxMOyAvKiBQcm90ZWN0cyBpbnRlcnAtPnRzdGF0ZV9oZWFkICovDQoj
ZGVmaW5lIEhFQURfSU5JVCgpICh2b2lkKShoZWFkX211dGV4IHx8IChoZWFk
X211dGV4ID0gUHlUaHJlYWRfYWxsb2NhdGVfbG9jaygpKSkNCiNkZWZpbmUg
SEVBRF9MT0NLKCkgUH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ASE64
Content-ID: <Pine.OSX.4.33.0201271642332.4093@mac-prastawa.cs.unc.edu>
Content-Description: 
Content-Disposition: attachment; filename="dynload_next.c"

DQovKiBTdXBwb3J0IGZvciBkeW5hbWljIGxvYWRpbmcgb2YgZXh0ZW5zaW9u
IG1vZHVsZXMgKi8NCg0KI2luY2x1ZGUgIlB5dGhvbi5oIg0KI2luY2x1ZGUg
ImltcG9ydGRsLmgiDQoNCg0KI2lmZGVmIFdJVEhfRFlMRA0KDQojZGVmaW5l
IFVTRV9EWUxEDQoNCiNpbmNsdWRlIDxtYWNoLW8vZHlsZC5oPg0KDQojZWxz
ZSAvKiBXSVRIX0RZTEQgKi8NCg0KI2RlZmluZSBVU0VfUkxEDQovKiBEZWZp
bmUgdGhpcyB0byAxIGlmIHlvdSB3YW50IGJlIGFibGUgdG8gbG9hZCBPYmpD
IG1vZHVsZXMgYXMgd2VsbDoNCiAgIGl0IHN3aXRjaGVzIGJldHdlZW4gdHdv
IGRpZmZlcmVudCB3YXkgb2YgbG9hZGluZyBtb2R1bGVzIG9uIHRoZSBOZVhU
LA0KICAgb25lIHRoYXQgZGlyZWN0bHkgaW50ZXJmYWNlcyB3aXRoIHRoZSBk
eW5hbWljIGxvYWRlciAocmxkX2xvYWQoKSwgd2hpY2gNCiAgIGRvZXMgbm90
IGNvcnJlY3RseSBsb2FkIE9iakMgb2JqZWN0IGZpbGVzKSwgYW5kIGFub3Ro
ZXIgdGhhdCB1c2VzIHRoZQ0KICAgT2JqQyBydW50aW1lIChvYmpjX2xvYWRN
b2R1bGVzKCkpIHRvIGRvIHRoZSBqb2IuDQogICBZb3UnbGwgaGF2ZSB0byBh
ZGQgYGAtT2JqQycnIHRvIHRoZSBjb21waWxlciBmbGFncyBpZiB5b3Ugc2V0
IHRoaXMgdG8gMS4NCiovDQojZGVmaW5lIEhBTkRMRV9PQkpDX01PRFVMRVMg
MQ0KI2lmIEhBTkRMRV9PQkpDX01PRFVMRVMNCiNpbmNsdWRlIDxvYmpjL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