[Python-checkins] CVS: python/dist/src/Tools/bgen/bgen macsupport.py,1.25,1.26
Jack Jansen
jackjansen@users.sourceforge.net
Tue, 01 Jan 2002 14:40:00 -0800
Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen
In directory usw-pr-cvs1:/tmp/cvs-serv9253/Python/Tools/bgen/bgen
Modified Files:
macsupport.py
Log Message:
Added some support for Uicode arguments. Still leaves something to be desired, especially because of poor unicode support in PyArg_ParseTuple.
Index: macsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/macsupport.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** macsupport.py 2001/12/18 15:48:28 1.25
--- macsupport.py 2002/01/01 22:39:58 1.26
***************
*** 48,51 ****
--- 48,53 ----
FSSpec_ptr = OpaqueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
FSSpec = OpaqueByValueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
+ FSRef_ptr = OpaqueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
+ FSRef = OpaqueByValueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
# OSType and ResType: 4-byte character strings
***************
*** 111,114 ****
--- 113,129 ----
VarOutBuffer = VarHeapOutputBufferType('char', 'long', 'l') # (buf, &len)
VarVarOutBuffer = VarVarHeapOutputBufferType('char', 'long', 'l') # (buf, len, &len)
+
+ # Unicode arguments sometimes have reversed len, buffer (don't understand why Apple did this...)
+ class VarUnicodeInputBufferType(VarInputBufferType):
+
+ def getargsFormat(self):
+ return "u#"
+
+ class VarUnicodeReverseInputBufferType(ReverseInputBufferMixin, VarUnicodeInputBufferType):
+ pass
+
+ UnicodeInBuffer = VarUnicodeInputBufferType('UniChar', 'UniCharCount', 'l')
+ UnicodeReverseInBuffer = VarUnicodeReverseInputBufferType('UniChar', 'UniCharCount', 'l')
+ UniChar_ptr = InputOnlyType("UniCharPtr", "u")