I'm VERY close to having cython bindings to the sphinxbase ad_rec and cont_ad
APIs. The only problem is that in the cont_ad_t is considered opaque and thus,
I can't access the read_ts attribute from the extension class I wrap it with.
I can see 2 solutions to the problem:
1) in the sphinxbase.pxd file, instead of merely stating
cdef extern from "sphinxbase/cont_ad.h":
ctypedef struct cont_ad_t
I'd have to define all of the fields to cont_ad_t. I don't like this solution,
because if there is a change to this structure in the .h file, the code will
break
2) add an accessor fuction, say cont_ad_get_read_ts() to cont_ad.h cont_ad.c,
etc. which would only be necessary to use when creating bindings for scripting
language wrappers
I'm more comfortable with option 2. Do the developers have a preference for my
upcoming patch?
-Scott
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm VERY close to having cython bindings to the sphinxbase ad_rec and cont_ad
APIs. The only problem is that in the cont_ad_t is considered opaque and thus,
I can't access the read_ts attribute from the extension class I wrap it with.
I can see 2 solutions to the problem:
1) in the sphinxbase.pxd file, instead of merely stating
cdef extern from "sphinxbase/cont_ad.h":
ctypedef struct cont_ad_t
I'd have to define all of the fields to cont_ad_t. I don't like this solution,
because if there is a change to this structure in the .h file, the code will
break
2) add an accessor fuction, say cont_ad_get_read_ts() to cont_ad.h cont_ad.c,
etc. which would only be necessary to use when creating bindings for scripting
language wrappers
I'm more comfortable with option 2. Do the developers have a preference for my
upcoming patch?
-Scott
I also like 2.
Thanks. I uploaded my patch last night. let me know what you think.