[Pyrex] Problem with void*

Geoffrey Bantle hairbat at yahoo.com
Sun Jun 15 02:13:11 CEST 2003


I meant to post this to the mailing list but replied
directly instead (sorry Mike!):


> Unfortunately you posted the code in such way that
> my OE newsreader is
> unable to detect indentation.
> 

Thank you for the prompt reply.  I did as you
suggested and everything seems to be fine on that
front now. However I am running into another problem.
The library I am wrapping has typedef'd void as
VSession, and is used to hold references to network
connections. I need to be able to wrap VSession into
something that python can hold somewhere so it can
pass it around. Unfortunatley I am having problems
with the compiler telling me it cannot convert 'void
*' to PyObject. Heres the pyrex code...


ctypedef void* VSession
#the function I am trying to access...
void vll_send_connect(char *name, char *password, char
*address, VSession **connection)
#I made this since theres no way to declare VSession
#in python....
cdef VSession createSession():
	cdef VSession Connection
	return &Connection
#this part may be redundant down the road but for now
#I want to be able to store VSession's in Python
#somewhere...
cdef class pvlSession:
	def __init__(self):
		self.Connection = createSession()
#heres the code I would use the value of
#pvlSession.Connection to pass as the Session var
def pvl_send_connect(User,Password,Address,Session):
	vll_send_connect    (User,Password,Address,*Session)

Any help on this, or ideas of how I would go about
this in a better way would be much appreciated.

Cheers,
Geoffrey Bantle.

 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com




More information about the Pyrex mailing list