Hi yet again,

so I managed to add a function to libid that exports, upon request, the static libid structure that is maintained in there. I hope it's the right thing to do.

Here are the details:

* in id.h, in the definition of struct __libid, I replaced "void *unused31;" with
     struct __libid *(*libid_p)(void);

* in libid.c, I added this function's implementation
     struct __libid *_libid_libid_p(void) {
       return &_libid;
     }

* and its initialisation (in _libid_init())
     _libid.libid_p    = _libid_libid_p;

Now, using the idiom

(define libid-p (dlsym "_libid_libid_p"))
(define mylibhandle (dlopen "MyLib"))
(define initmylib (_dlsym mylibhandle "__id__init__"))
(initmylib (libid-p))
(define MyPrototype (import "MyPrototype"))

works, but only after uncommenting the declarations and definitions of v_LargePositiveInteger, v_WordArray, and v_ImmutableString in the C file generated for MyLib.st (and manually recompiling it to a shared library).

I'm pretty sure this is because Jolt uses a different objects library that does not define those three prototypes (other than st80). I'm thinking about how to find a good working solution that does not require manual twiddling. (Perhaps defining some dummy prototypes would do the trick, but that looks pretty ugly to me.)

Off to the party now,
happy new year to you all,

Michael

--
Dr.-Ing. Michael Haupt                [email protected]
Software Architecture Group           Phone:  ++49 (0) 331-5509-542
Hasso Plattner Institute for          Fax:    ++49 (0) 331-5509-229
Software Systems Engineering          http://www.hpi.uni-potsdam.de/swa/
Prof.-Dr.-Helmert-Str. 2-3, D-14482 Potsdam, Germany

Hasso-Plattner-Institut für Softwaresystemtechnik GmbH, Potsdam
Amtsgericht Potsdam, HRB 12184
Geschäftsführung: Prof. Dr. Christoph Meinel






_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc

Reply via email to