[Pyrex] Pointers

Javier Correa javier.correa at gmail.com
Tue Nov 9 19:03:45 CET 2010


Defining:
   ctypedef struct _CMesaDevice
   ctypedef _CMesaDevice * SRCAM

got rid of some problems, sorry I wasn't getting how to use the incomplet
types.

I still have a problem with the void* return type:
 Cannot convert 'void *' to Python object
when I try to do:
...
      cdef void * images
...
      image = SR_GetImage(self.cam, 0)


On Tue, Nov 9, 2010 at 5:56 PM, Javier Correa <javier.correa at gmail.com>wrote:

> The C typedef is:
>
> typedef struct _CMesaDevice *SRCAM;
>
> and I don't have access to _CMesaDevice declaration.
>
> I was trying to use an incomplete type as in
> http://ldots.org/pyrex-guide/4-functions.html#incomplete_types
>
>
> On Tue, Nov 9, 2010 at 5:39 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>
>> Javier Correa, 09.11.2010 18:16:
>>
>>  I-m new to pyrex and I'm trying to use it to have access to a library
>>> (MesaSR, http://www.mesa-imaging.ch/drivers.php), but I can't make use
>>> of
>>> pointers.
>>>
>>> I can't seem to define a function that one of its arguments it's a
>>> pointer
>>> (a function that initialize the structure). I'm also having troubles with
>>> using the SR_GetImage that returns a void* pointer.
>>>
>>> My code is as follows:
>>>
>>> import numpy
>>>
>>> cdef extern from "libMesaSR.h":
>>>    ctypedef SRCAM
>>>
>>
>> ctypedef SCRAM *what*?
>>
>> Stefan
>>
>
>
>
> --
> Javier Correa
>
> Por favor, no imprimas este e-mail si realmente no lo necesitas...
> Conservar el medio ambiente es nuestra tarea...
> Please, don't print this e-mail if it's not needed... preserve the
> environment is our task...
>
>


-- 
Javier Correa

Por favor, no imprimas este e-mail si realmente no lo necesitas... Conservar
el medio ambiente es nuestra tarea...
Please, don't print this e-mail if it's not needed... preserve the
environment is our task...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.copyleft.no/pipermail/pyrex/attachments/20101109/35edbf0b/attachment.html>


More information about the Pyrex mailing list