[Pyrex] opaque types, constructors, assignment - help please

Jani Hakala jani.j.hakala at jyu.fi
Fri Feb 26 15:22:21 CET 2010


Jose Nazario <jose at monkey.org> writes:

> working with FastBit, specifically it's C API:
>
> 	http://crd.lbl.gov/~kewu/fastbit/doc/html/group__FastBitCAPI.html
>
First definition there is
 'typedef struct FastBitQuery * FastBitQueryHandle'

> cdef extern from "../src/capi.h":
>     ctypedef extern struct FastBitQueryHandle
>
FastBitQueryHandle is not a struct but a pointer to a struct. 

------------------------------------------------------------------------
cdef extern from "capi.h":
    ctypedef struct FastBitQuery
    ctypedef FastBitQuery * FastBitQueryHandle

    FastBitQueryHandle fastbit_build_query(char * selectClause,
                                           char * indexLocation,
                                           char * queryConditions)

def test(selectClause, indexLocation, queryConditions):
    cdef FastBitQueryHandle qh

    qh = fastbit_build_query(selectClause, indexLocation, queryConditions)
------------------------------------------------------------------------

Jani Hakala




More information about the Pyrex mailing list