Hi All,<br><br>I am using Pyrex version 0.9.3.<br><br>for the following pyrex code<br><br>====================================================<br>ctypedef unsigned int size_t<br>cdef extern from "def.h":<br> ctypedef enum RESULT:
<br> SUCCESS<br> FAILURE<br> ctypedef enum bool_t:<br> FALSE<br> TRUE<br>cdef extern from "client.h":<br> ctypedef struct RSA:<br> pass<br> ctypedef struct xmlrpc_server_info:<br> pass
<br> ctypedef struct xmlrpc_env:<br> pass<br> ctypedef struct ServerCTX:<br> RSA *rsaPublicPtr<br> xmlrpc_server_info *ServerInfoPtr<br> xmlrpc_env ClientEnv<br>
int calloced<br> ctypedef struct SessionCTX:<br> ServerCTX *ServerPtr<br> unsigned char *keyEnc<br> size_t keyEncLen<br> <br> RESULT Connect(SessionCTX **Sessionctx, char *serverHost, unsigned short serverPort,unsigned char *key, size_t keylen)
<br><br>cdef class MyClass:<br> cdef SessionCTX *___Session___<br> def __init__(self,server="<a href="http://127.0.0.1">127.0.0.1</a>",port=8080,key="abcdefgh0123456789"):<br> self.Server=server
<br> self.Port=port<br> self.Key=key<br> self.Keylen=len(self.Key)<br> self.res=None<br> def connect(self):<br> self.res=Connect(&self.__Session__,self.Server,self.Port,<unsigned char *>
self.Key,self.Keylen)<br> return self.res<br>==========================================================================================<br>and ypically while calling Connect ie<br>self.res=Connect(&self.__Session__,
self.Server,self.Port,<unsigned char *>self.Key,self.Keylen)<br>i get the following errors/warnings from pyrex<br>test.pyx:37:23: Cannot take address of Python variable<br>test.pyx:37:63: Casting temporary Python object to non-Python type
<br>test.pyx:37:45: Obtaining char * from temporary Python value<br><br><br>I have download and searched through the previous mailing list archievs, however i did not found a post pertaining to same issue, there is one in Jan 2004, which is quite diff.
<br><br><br>Here i would like to highlight one thing. the library for which i am writing the wrapper initializes and uses SessionCTX * automatically, so basically when i call Connect() SesstionCTX * is initialized.<br><br>
secondly, the c code is generated and compiles with warning, however when i import the module in Python and create an instance of MyClass, it raises AttributeError Exception saying object has no attribute 'Server'.<br><br>
Can anybody pls point to what i am doing wrong here?<br><br>TIA<br>TD6<br>