Note that you can declare at foo_t to be a member of Bar directly, so  
you don't even need to allocate it (this works if you're not getting  
it as a pointer from elsehwhere). For example

cdef extern from "foo.h":
        ctypedef struct foo_t:
                int fd
         cdef some_c_func(foo_t*)

cdef class Bar:
     cdef foo_t foo

     cdef __init__(self, n):
         self.foo.fd = n

def call_something_on_foo(Bar b):
     some_c_func(&b.foo)


- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to