-----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
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to