[issue7569] ctypes doc improvement: c_char_p

Nikolaus Rath report at bugs.python.org
Mon Dec 28 16:19:08 CET 2009


Nikolaus Rath <Nikolaus at rath.org> added the comment:

I don't want to judge if the best way to represent binary data in C is a
void* or char*, but there is a lot of C code out there that uses char*,
and if we want to interface with such a library we need to use
POINTER(c_char).

Note that my docpatch doesn't say anything about using void_p or not:
"For a general *character* pointer that may point to binary data,
POINTER(c_char) must be used". This refers only to char*, so if the C
code uses void* instead, we can of course also use c_void_p on the
Python side.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7569>
_______________________________________


More information about the Python-bugs-list mailing list