[Pyrex] passing method's args to extern func

Bartosz SKOWRON getxsick at gmail.com
Tue Jun 9 18:44:46 CEST 2009


hi,

i have a question which the answer is described here:
http://ldots.org/pyrex-guide/5-python-wrapper.html#std

The problem is, what with more complex data types than char* ? e.g.
defined structures or unsigned char *?
i need both and get this:
pyrexc pcap.pyx
/home/xsx/__usrsrc__/pypcap/pcap.pyx:235:18: Cannot convert Python
object to 'pcap_pkthdr *'
/home/xsx/__usrsrc__/pypcap/pcap.pyx:236:16: Cannot convert Python
object to 'unsigned char *'

here is a code
    def dump(self, hdr, sp):
        cdef pcap_pkthdr *chdr
        cdef unsigned char *csp
        chdr = hdr
        csp = sp
        pcap_dump(self.__dump, chdr, csp)

the errors lines are chdr=hdr and csp=sp

any suggestions?



More information about the Pyrex mailing list