From: Rob M. <Rob...@ig...> - 2010-03-26 22:15:04
|
Hi, I'm new to SWIG and I'm trying to use Python to access a C library. One of the variables is defined as: typedef void db_store; When connecting to the database the call is: db_connect(char *name, db_store **store) When I create the shared library the definition of db_store is never created, so when I try to do the following in python: >>> store = db_store I get: NameError: name 'db_store' is not defined And if I simply try to call the connect I get: >>> db_connect("",store) NameError: name 'store' is not defined BTW, db_store ends up getting pointed at an internal struct, db_store_internal, that has members and does show up, but I can't use: >>> store = db_store_internal >>> store <class 'db.db_store_internal'> >>> db_connect("",store) because it then says: TypeError: in method 'db_connect', argument 2 of type 'db_store **' How do I do this? Thanks, Rob |