[Numpy-discussion] Passing a Null pointer after ndarray prototype definition

Nicholas nicholasinparis@gmail....
Sun Dec 30 02:42:18 CST 2007


I have a problem in that I have a DLL function which accepts several numpy
double arrays, but you need to pass a NULL pointer for the ones from which
you do not require results. The prototype is as follows:

T_ndDp = numpy.ctypeslib.ndpointer(dtype=float, ndim=1,
flags='C_CONTIGUOUS')
Prototype_example = CFUNCTYPE(None, c_long, T_ndDp, T_ndDp, T_ndDp)

In ctypes None is equivelent to NULL, though in order to get past the
prototype argchecks you need to cast the object to None. If for example the
pointer was to a simple double one could write something like: cast(None,
POINTER(c_double))

the problem is in casting to None for the above (T_ndDp) type

Any help would be greatly appreciated

Nicholas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20071230/ab8c2152/attachment.html 


More information about the Numpy-discussion mailing list