That's a very interesting concept.

Are you using http://www.cython.org/ or something else to "create" the library 
wrapper

Neville

On 24 Sep 2013, at 22:39, Roger Binns <rog...@rogerbinns.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 24/09/13 12:56, Neville Dastur wrote:
>> Searching around on Google it seems that namespacing in c / obj-c is
>> not possible for the sqlite3 library.
> 
> There is another approach that I use.  I produce a Python C extension.
> The final shared library with my extension contains only one exported
> symbol as expected by Python, with all my symbols and SQLite private inside.
> 
> What I do is make everything one compilation unit.  SQLite is already
> setup for this.  For example in single.c:
> 
>   #define SQLITE_API static
>   #define SQLITE_EXTERN static
>   #include "sqlite3.c"
> 
>   #include my other C files
> 
> All my methods are declared static too.  This approach has the advantage
> that it works really well and has no expectations or dependencies on the
> rest of the system.  It even works if another copy of SQLite is loaded
> into the process (eg CoreData on Mac likes to do that).  As another bonus
> it is also a bit faster too as the compiler ends up inlining SQLite code
> into your methods that call it.
> 
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> 
> iEYEARECAAYFAlJCBoIACgkQmOOfHg372QRRsQCePzIDcnfYiXf3c/RHyqhnlsdz
> pZcAoNrIRsMoScmoR3c10py9mynosLmm
> =KTqr
> -----END PGP SIGNATURE-----
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to