[Pyrex] Pyrex struct syntax question

Simon Frost sdfrost at ucsd.edu
Wed Jul 9 19:18:42 CEST 2003


Dear Pyrex List,

I'm trying to wrap the GNU libavl library 
(http://www.msu.edu/~pfaffben/avl/) using Pyrex. For example, in the tavl.h 
file, I have a structure that looks like this:

/* Memory allocator. */
struct libavl_allocator
   {
     void *(*libavl_malloc) (struct libavl_allocator *, size_t libavl_size);
     void (*libavl_free) (struct libavl_allocator *, void *libavl_block);
   };

I think that the Pyrex version looks something (but not quite) like this:

cdef extern from "tavl.h":
     ctypedef size_t int
     ctypedef struct libavl_allocator:
         *(*libavl_malloc) (libavl_allocator *, size_t libavl_size)
         (*libavl_free) (libavl_allocator *, *libavl_block)

Any ideas on how to correct this?

Best
Simon 





More information about the Pyrex mailing list