[ctypes-commit] ctypes/docs/manual tutorial.txt,1.15,1.16 mkpydoc.py,1.9,NONE
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-04-19 17:16:38
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3286 Modified Files: tutorial.txt Removed Files: mkpydoc.py Log Message: mkpydoc.py Index: tutorial.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/manual/tutorial.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tutorial.txt 13 Apr 2006 20:26:54 -0000 1.15 --- tutorial.txt 19 Apr 2006 17:16:34 -0000 1.16 *************** *** 1,4 **** ctypes tutorial ! +++++++++++++++ This tutorial describes version 0.9.9 of ``ctypes``. --- 1,6 ---- + ``ctypes`` is a foreign function library for Python. + ctypes tutorial ! =============== This tutorial describes version 0.9.9 of ``ctypes``. *************** *** 516,530 **** >>> r = RECT((1, 2), (3, 4)) ! XXX Fields descriptors can be retrieved from the *class*, they ! have readonly ``size`` and ``offset`` attributes describing the size ! in bytes and the offset of this field from the beginning of the ! internal memory buffer:: ! >>> print POINT.x.size, POINT.x.offset ! 4 0 ! >>> print POINT.y.size, POINT.y.offset ! 4 4 >>> By default, Structure and Union fields are aligned in the same way the C compiler does it. It is possible to override this behaviour be --- 518,534 ---- >>> r = RECT((1, 2), (3, 4)) ! Fields descriptors can be retrieved from the *class*, they are useful ! for debugging because they can provide useful information:: ! >>> print POINT.x ! <Field type=c_int, ofs=0, size=4> ! >>> print POINT.y ! <Field type=c_int, ofs=4, size=4> >>> + + Structure/Union Alignment and Byte Order + ---------------------------------------- + By default, Structure and Union fields are aligned in the same way the C compiler does it. It is possible to override this behaviour be *************** *** 534,539 **** also does in MSVC. ! **New in version 0.6.2**: Structures and unions can also be passed *by ! value* to function calls. Arrays --- 538,565 ---- also does in MSVC. ! ``ctypes`` uses the native byte order for Structures and Unions. To ! build structures with non-native byte order, you can use one of the ! BigEndianStructure, LittleEndianStructure, BigEndianUnion, and ! LittleEndianUnion base classes. These classes cannot contain pointer ! fields. ! ! ! Bit Fields in Structures and Unions ! ----------------------------------- ! ! It is possible to create structures and unions containing bit fields. ! Bit fields are only possible for integer fields, the bit width is ! specified as the third item in the ``_fields_`` tuples:: ! ! >>> class Int(Structure): ! ... _fields_ = [("first_16", c_int, 16), ! ... ("second_16", c_int, 16)] ! ... ! >>> print Int.first_16 ! <Field type=c_int, ofs=0:0, bits=16> ! >>> print Int.second_16 ! <Field type=c_int, ofs=0:16, bits=16> ! >>> ! Arrays --- mkpydoc.py DELETED --- |