obj) |
obj
must
be an instance of a ctypes type.
obj_or_type) |
obj_or_type
must be a ctypes type or instance.
obj) |
obj
, which must be an
instance of a ctypes type. The returned object can only be used as
a foreign function call parameter. It behaves similar to
pointer(obj)
, but the construction is a lot faster.
obj, type) |
type
which points to the same memory block as
obj
. type
must be a pointer type, and obj
must be an
object that can be interpreted as a pointer.
init_or_size[, size]) |
init_or_size
must be an integer which specifies the size of
the array, or a string which will be used to initialize the array
items.
If a string is specified as first argument, the buffer is made one item larger than the length of the string so that the last element in the array is a NUL termination character. An integer can be passed as second argument which allows to specify the size of the array if the length of the string should not be used.
If the first parameter is a unicode string, it is converted into an 8-bit string according to ctypes conversion rules.
init_or_size[, size]) |
init_or_size
must be an integer which specifies the size of
the array, or a unicode string which will be used to initialize
the array items.
If a unicode string is specified as first argument, the buffer is made one item larger than the length of the string so that the last element in the array is a NUL termination character. An integer can be passed as second argument which allows to specify the size of the array if the length of the string should not be used.
If the first parameter is a 8-bit string, it is converted into an unicode string according to ctypes conversion rules.
) |
) |
_ctypes
extension dll exports.
[code]) |
) |
dst, src, count) |
src
to dst. dst and src
must be
integers or ctypes instances that can be converted to pointers.
dst, c, count) |
type) |
obj) |
obj
. The returned object is of the type POINTER(type(obj)).
Note: If you just want to pass a pointer to an object to a foreign
function call, you should use byref(obj)
which is much faster.
obj, size) |
encoding, errors) |
'utf-8'
or
'mbcs'
, errors must be a string specifying the error handling
on encoding/decoding errors. Examples of possible values are
"strict"
, "replace"
, or "ignore"
.
set_conversion_mode
returns a 2-tuple containing the previous
conversion rules. On windows, the initial conversion rules are
('mbcs', 'ignore')
, on other systems ('ascii', 'strict')
.
obj_or_type) |
sizeof()
function.
address[, size]) |
code=None, descr=None) |
GetLastError
is called to determine the error
code. If descr
is not spcified, FormatError is called to
get a textual description of the error.
address) |
address
as unicode string. If size
is specified,
it is used as the number of characters of the string, otherwise
the string is assumed to be zero-terminated.
See About this document... for information on suggesting changes.