Hello,
I am trying to figure out the best way how to access C code composed of several shared libraries.
I would like to minimize the code compiled through cffi, because the shared libraries would be compiled from source through Makefile.
1) One obvious way is to write C program prog.c which uses all the shared libraries e.g library libtest2.so, and libtest3.so.
and use ffi.verify(source_prog).
Which means that test2 and test3 are independent and connected through prog.c.
prog.c
libtest2.so
libtest3.so
In my case the prog.c is rather large and complicated. So I would prefer the method number 2)
2) The other idea is to write the glue code in C and compile the glue code as libtest1.so.
The C glue code would have very simple API and the methods would be used directly from Python.
The hierarchy would change
prog.c
libtest2.so
libtest3.so
I have written the prototype with verify function. See:
The code
Simple instruction how to compile it
Actually, for me it would be sufficient to use dlopen if I just could open all three libraries at once!
Thanks for any hints
Ondra