[ctypes-commit] ctypes/docs/manual reference.txt,1.15,1.16
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-05-31 18:28:32
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8359 Modified Files: reference.txt Log Message: Index: reference.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/manual/reference.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** reference.txt 31 May 2006 18:02:31 -0000 1.15 --- reference.txt 31 May 2006 18:28:27 -0000 1.16 *************** *** 230,240 **** ! data types ---------- ``_CData`` : classdesc* This non-public class is the base class of all ctypes data types. ! Among other things, a ctypes type instance contains a memory block ! that contains C compatible data. Common methods of ctypes data types, these are all class methods (to --- 230,244 ---- ! Data types ---------- ``_CData`` : classdesc* This non-public class is the base class of all ctypes data types. ! Among other things, all ctypes type instances contain a memory ! block that hold C compatible data; the address of the memory block ! is returned by the ``addressof()`` helper function. Another ! instance variable is exposed as ``_objects``; this contains other ! Python objects that need to be kept alive in case the memory block ! contains pointers. Common methods of ctypes data types, these are all class methods (to *************** *** 250,255 **** ``in_dll(name, library)`` : methoddesc This method returns a ctypes type instance exported by a shared ! library. name is the name of the symbol that exports the data, ! library is the loaded shared library. Fundamental data types --- 254,277 ---- ``in_dll(name, library)`` : methoddesc This method returns a ctypes type instance exported by a shared ! library. ``name`` is the name of the symbol that exports the data, ! ``library`` is the loaded shared library. ! ! Common instance variables of ctypes data types: ! ! ``_b_base_`` : memberdesc ! Sometimes ctypes data instances do not own the memory block they ! contain, instead they share part of the memory block of a base ! object. The ``_b_base_`` readonly member is the root ctypes ! object that owns the memory block. ! ! ``_b_needsfree_`` : memberdesc ! This readonly variable is true when the ctypes data instance has ! allocated the memory block itself, false otherwise. ! ! ``_objects`` : memberdesc ! This member is either ``None`` or a dictionary containing Python ! objects that need to be kept alive so that the memory block ! contents is kept valid. This object is only exposed for ! debugging; never modify the contents of this dictionary. Fundamental data types *************** *** 259,263 **** This non-public class is the base class of all fundamental ctypes data types. It is mentioned here because it contains the common ! attributes of the ctypes data types. Instances have a single attribute: --- 281,287 ---- This non-public class is the base class of all fundamental ctypes data types. It is mentioned here because it contains the common ! attributes of the fundamental ctypes data types. ``_SimpleCData`` ! is a subclass of ``_CData``, so it inherits the methods and ! attributes of that. Instances have a single attribute: *************** *** 265,269 **** ``value`` : memberdesc This attribute contains the actual value of the instance. For ! integer types, it is an integer. These are the fundamental ctypes data types: --- 289,313 ---- ``value`` : memberdesc This attribute contains the actual value of the instance. For ! integer and pointer types, it is an integer, for character types, ! it is a single character string, for character pointer types it ! is a Python string or unicode string. ! ! When the ``value`` attribute is retrieved from a ctypes instance, ! usually a new object is returned each time. ``ctypes`` does *not* ! implement original object return, always a new object is ! constructed. The same is true for all other ctypes object ! instances. ! ! Fundamental data types, whether returned as result of foreign function ! calls, or, for example, by retrieving structure field members, are ! transparently converted to native Python types. In other words, if a ! foreign function has a ``restype`` of ``c_char_p``, you will always ! receive a Python string, *not* a ``c_char_p`` instance. ! ! Subclasses of fundamental data types do *not* inherit this behaviour. ! So, if a foreign functions ``restype`` is a subclass of ``c_void_p``, ! you will receive an instance of this subclass from the function call. ! Of course, you can get the value of the pointer by accessing the ! ``value`` attribute. These are the fundamental ctypes data types: *************** *** 298,301 **** --- 342,349 ---- ``c_long``. + ``c_int8`` : classdesc* + Represents the C 8-bit ``signed int`` datatype. Usually an alias for + ``c_byte``. + ``c_int16`` : classdesc* Represents the C 16-bit signed int datatype. Usually an alias for *************** *** 310,317 **** for ``c_longlong``. - ``c_int8`` : classdesc* - Represents the C 8-bit ``signed int`` datatype. Usually an alias for - ``c_byte``. - ``c_long`` : classdesc* Represents the C ``signed long`` datatype. The constructor accepts an --- 358,361 ---- *************** *** 340,343 **** --- 384,391 ---- ``c_ulong``. + ``c_uint8`` : classdesc* + Represents the C 8-bit unsigned int datatype. Usually an alias for + ``c_ubyte``. + ``c_uint16`` : classdesc* Represents the C 16-bit unsigned int datatype. Usually an alias for *************** *** 352,374 **** ``c_ulonglong``. - ``c_uint8`` : classdesc* - Represents the C 8-bit unsigned int datatype. Usually an alias for - ``c_ubyte``. - ``c_ulong`` : classdesc* ! Represents the C unsigned long datatype. The constructor accepts an optional integer initializer; no overflow checking is done. ``c_ulonglong`` : classdesc* ! Represents the C unsigned long long datatype. The constructor accepts an optional integer initializer; no overflow checking is done. ``c_ushort`` : classdesc* ! Represents the C unsigned short datatype. The constructor accepts an optional integer initializer; no overflow checking is done. ``c_void_p`` : classdesc* ! Represents the C void * type. The value is represented as integer. The constructor accepts an optional integer initializer. --- 400,418 ---- ``c_ulonglong``. ``c_ulong`` : classdesc* ! Represents the C ``unsigned long`` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. ``c_ulonglong`` : classdesc* ! Represents the C ``unsigned long long`` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. ``c_ushort`` : classdesc* ! Represents the C ``unsigned short`` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. ``c_void_p`` : classdesc* ! Represents the C ``void *`` type. The value is represented as integer. The constructor accepts an optional integer initializer. *************** *** 385,389 **** ``HRESULT`` : classdesc* ! Windows only: Represents a HRESULT value, which contains success or error information for a function or method call. --- 429,433 ---- ``HRESULT`` : classdesc* ! Windows only: Represents a ``HRESULT`` value, which contains success or error information for a function or method call. |