[Python-checkins] CVS: python/dist/src/Mac/Modules/cf cfscan.py,1.1,1.2

Jack Jansen jackjansen@users.sourceforge.net
Wed, 27 Jun 2001 15:00:53 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/cf
In directory usw-pr-cvs1:/tmp/cvs-serv26821/Python/Mac/Modules/cf

Modified Files:
	cfscan.py 
Log Message:
CFArray, CFData and CFDictonary are now covered, but mainly opaque.
CFStrings are in better shape, but Unicode support and automatic conversion to/from Python strings remains to be done.

Index: cfscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/cfscan.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** cfscan.py	2001/06/26 21:51:14	1.1
--- cfscan.py	2001/06/27 22:00:50	1.2
***************
*** 10,25 ****
  LONG = "CoreFoundation"
  SHORT = "cf"
! OBJECTS = ("CFTypeRef", "CFStringRef")
  
  def main():
  	input = [
  		"CFBase.h",
! ###		"CFArray.h",
  ##		"CFBag.h",
  ##		"CFBundle.h",
  ##		"CFCharacterSet.h",
! ###		"CFData.h",
  ##		"CFDate.h",
! ###		"CFDictionary.h",
  ##		"CFNumber.h",
  ##		"CFPlugIn.h",
--- 10,31 ----
  LONG = "CoreFoundation"
  SHORT = "cf"
! OBJECTS = ("CFTypeRef", 
! 		"CFArrayRef", "CFMutableArrayRef",
! 		"CFDataRef", "CFMutableDataRef",
! 		"CFDictionaryRef", "CFMutableDictionaryRef",
! 		"CFStringRef", "CFMutableStringRef", 
! 		)
! # ADD object typenames here
  
  def main():
  	input = [
  		"CFBase.h",
! 		"CFArray.h",
  ##		"CFBag.h",
  ##		"CFBundle.h",
  ##		"CFCharacterSet.h",
! 		"CFData.h",
  ##		"CFDate.h",
! 		"CFDictionary.h",
  ##		"CFNumber.h",
  ##		"CFPlugIn.h",
***************
*** 27,31 ****
  ##		"CFPropertyList.h",
  ##		"CFSet.h",
! ###		"CFString.h",
  ##		"CFStringEncodingExt.h",
  ##		"CFTimeZone.h",
--- 33,37 ----
  ##		"CFPropertyList.h",
  ##		"CFSet.h",
! 		"CFString.h",
  ##		"CFStringEncodingExt.h",
  ##		"CFTimeZone.h",
***************
*** 66,69 ****
--- 72,86 ----
  			"CFAllocatorDeallocate",
  			"CFGetAllocator",
+ 			# Array functions we skip for now.
+ 			"CFArrayGetValueAtIndex",
+ 			# Data pointer functions. Skip for now.
+ 			"CFDataGetBytePtr",
+ 			"CFDataGetMutableBytePtr",
+ 			"CFDataGetBytes",   # XXXX Should support this one
+ 			# String functions
+ 			"CFStringGetPascalString", # Use the C-string methods.
+ 			"CFStringGetPascalStringPtr", # TBD automatically
+ 			"CFStringGetCStringPtr", 
+ 			"CFStringGetCharactersPtr", 
  			]
  
***************
*** 73,81 ****
  	def makeblacklisttypes(self):
  		return [
! 			"CFAllocatorContext",
  			]
  
  	def makerepairinstructions(self):
  		return [
  			]
  			
--- 90,112 ----
  	def makeblacklisttypes(self):
  		return [
! 			"CFComparatorFunction", # Callback function pointer
! 			"CFAllocatorContext", # Not interested in providing our own allocator
! 			"void_ptr_ptr",  # Tricky. This is the initializer for arrays...
! 			"void_ptr", # Ditto for various array lookup methods
! 			"CFArrayApplierFunction", # Callback function pointer
! 			"CFDictionaryApplierFunction", # Callback function pointer
! 			"UniChar_ptr", # XXXX To be done
! 			"const_UniChar_ptr", # XXXX To be done
! 			"UniChar", # XXXX To be done
! 			"va_list", # For printf-to-a-cfstring. Use Python.
! 			"const_CFStringEncoding_ptr", # To be done, I guess
  			]
  
  	def makerepairinstructions(self):
  		return [
+ 			([("UInt8_ptr", "*", "InMode"), ("CFIndex", "*", "InMode")],
+ 			 [("UcharInBuffer", "*", "*")]),
+ 			([("const_char_ptr", "*", "ReturnMode")],
+ 			 [("return_stringptr", "*", "*")]),
  			]