Then your Cython definition does not match the C definition. Could you
try to fake things in the Cython side like below: ?
cdef extern ... :
ctypedef struct iovec "struct iovec":
void *iov_base
size_t iov_len
If this fails, you will likely have to define like this:
cdef extern ... :
cdef struct iovec:
void *iov_base
size_t iov_len
and always use "struct iovec" as the type, like this:
cdef struct iovec *hdr_names=NULL
hdr_names=<struct iovec*>malloc(total_count * sizeof(struct iovec))
Hope any of all this work. If it does not, come back.
On Thu, May 14, 2009 at 11:04 PM, Mohamed Lrhazi <[email protected]> wrote:
> On Thu, May 14, 2009 at 10:01 PM, Mohamed Lrhazi <[email protected]> wrote:
>> On Thu, May 14, 2009 at 9:58 PM, Mohamed Lrhazi <[email protected]> wrote:
>>> On Thu, May 14, 2009 at 9:49 PM, Lisandro Dalcin <[email protected]> wrote:
>>>> Could you tell me the EXACT type definition for "iovec" in your C header
>>>> file?
>
>
>>>>
>>>
>>> I defined it like this:
>>>
>>> ctypedef struct iovec:
>>> void *iov_base
>>> size_t iov_len
>>
>> and the C header file does not actually define it.. it must be in a
>> standard system includes?
>>
>
>
> Yes.. it must be:
>
> /* Structure for scatter/gather I/O. */
> struct iovec
> {
> void *iov_base; /* Pointer to data. */
> size_t iov_len; /* Length of data. */
> };
>
>
> >From : /usr/include/bits/uio.h
>
> Thanks a lot
> Mohamed.
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev