[Python-checkins] python/dist/src/Mac/Modules/file _Filemodule.c,1.1,1.2 filescan.py,1.1,1.2 filesupport.py,1.1,1.2

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
2002年12月13日 15:16:03 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/file
In directory sc8-pr-cvs1:/tmp/cvs-serv29743
Modified Files:
	_Filemodule.c filescan.py filesupport.py 
Log Message:
Tweaks to make this module OS9-compatible.
Index: _Filemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/file/_Filemodule.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** _Filemodule.c	22 Nov 2002 14:58:35 -0000	1.1
--- _Filemodule.c	13 Dec 2002 23:16:00 -0000	1.2
***************
*** 1200,1204 ****
 	PyObject *_res = NULL;
 	OSStatus _err;
! 	char* path;
 	FSRef ref;
 	Boolean isDirectory;
--- 1200,1204 ----
 	PyObject *_res = NULL;
 	OSStatus _err;
! 	UInt8 * path;
 	FSRef ref;
 	Boolean isDirectory;
***************
*** 1216,1219 ****
--- 1216,1221 ----
 }
 
+ #if TARGET_API_MAC_OSX
+ 
 static PyObject *File_FNNotify(PyObject *_self, PyObject *_args)
 {
***************
*** 1236,1239 ****
--- 1238,1244 ----
 	return _res;
 }
+ #endif
+ 
+ #if TARGET_API_MAC_OSX
 
 static PyObject *File_FNNotifyByPath(PyObject *_self, PyObject *_args)
***************
*** 1241,1245 ****
 	PyObject *_res = NULL;
 	OSStatus _err;
! 	char* path;
 	FNMessage message;
 	OptionBits flags;
--- 1246,1250 ----
 	PyObject *_res = NULL;
 	OSStatus _err;
! 	UInt8 * path;
 	FNMessage message;
 	OptionBits flags;
***************
*** 1257,1260 ****
--- 1262,1268 ----
 	return _res;
 }
+ #endif
+ 
+ #if TARGET_API_MAC_OSX
 
 static PyObject *File_FNNotifyAll(PyObject *_self, PyObject *_args)
***************
*** 1275,1278 ****
--- 1283,1287 ----
 	return _res;
 }
+ #endif
 
 static PyObject *File_FSRefMakePath(PyObject *_self, PyObject *_args)
***************
*** 1412,1422 ****
 	 PyDoc_STR("() -> (HFSUniStr255 resourceForkName)")},
 	{"FSPathMakeRef", (PyCFunction)File_FSPathMakeRef, 1,
! 	 PyDoc_STR("(char* path) -> (FSRef ref, Boolean isDirectory)")},
 	{"FNNotify", (PyCFunction)File_FNNotify, 1,
 	 PyDoc_STR("(FSRef ref, FNMessage message, OptionBits flags) -> None")},
 	{"FNNotifyByPath", (PyCFunction)File_FNNotifyByPath, 1,
! 	 PyDoc_STR("(char* path, FNMessage message, OptionBits flags) -> None")},
 	{"FNNotifyAll", (PyCFunction)File_FNNotifyAll, 1,
 	 PyDoc_STR("(FNMessage message, OptionBits flags) -> None")},
 	{"FSRefMakePath", (PyCFunction)File_FSRefMakePath, 1,
 	 PyDoc_STR("(FSRef) -> string")},
--- 1421,1440 ----
 	 PyDoc_STR("() -> (HFSUniStr255 resourceForkName)")},
 	{"FSPathMakeRef", (PyCFunction)File_FSPathMakeRef, 1,
! 	 PyDoc_STR("(UInt8 * path) -> (FSRef ref, Boolean isDirectory)")},
! 
! #if TARGET_API_MAC_OSX
 	{"FNNotify", (PyCFunction)File_FNNotify, 1,
 	 PyDoc_STR("(FSRef ref, FNMessage message, OptionBits flags) -> None")},
+ #endif
+ 
+ #if TARGET_API_MAC_OSX
 	{"FNNotifyByPath", (PyCFunction)File_FNNotifyByPath, 1,
! 	 PyDoc_STR("(UInt8 * path, FNMessage message, OptionBits flags) -> None")},
! #endif
! 
! #if TARGET_API_MAC_OSX
 	{"FNNotifyAll", (PyCFunction)File_FNNotifyAll, 1,
 	 PyDoc_STR("(FNMessage message, OptionBits flags) -> None")},
+ #endif
 	{"FSRefMakePath", (PyCFunction)File_FSRefMakePath, 1,
 	 PyDoc_STR("(FSRef) -> string")},
Index: filescan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/file/filescan.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** filescan.py	22 Nov 2002 14:58:35 -0000	1.1
--- filescan.py	13 Dec 2002 23:16:00 -0000	1.2
***************
*** 90,93 ****
--- 90,101 ----
 			]
 
+ 	def makegreylist(self):
+ 		return [
+ 			('#if TARGET_API_MAC_OSX', [
+ 				'FNNotifyAll',
+ 				'FNNotifyByPath',
+ 				'FNNotify',
+ 			])]
+ 			
 	def makeblacklisttypes(self):
 		return [
***************
*** 128,135 ****
 		return [
 			# Various ways to give pathnames
- 			([('UInt8_ptr', 'path', 'InMode')],
- 			 [('stringptr', 'path', 'InMode')]
- 			),
- 			 
 			([('char_ptr', '*', 'InMode')],
 			 [('stringptr', '*', 'InMode')]
--- 136,139 ----
Index: filesupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/file/filesupport.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** filesupport.py	22 Nov 2002 14:58:35 -0000	1.1
--- filesupport.py	13 Dec 2002 23:16:00 -0000	1.2
***************
*** 47,55 ****
 SInt64 = Type("SInt64", "L")
 UInt64 = Type("UInt64", "L")
! #UInt8_ptr
! #UniCharCount
! #char_ptr
! #void_ptr
! 
 
 includestuff = includestuff + """
--- 47,51 ----
 SInt64 = Type("SInt64", "L")
 UInt64 = Type("UInt64", "L")
! UInt8_ptr = InputOnlyType("UInt8 *", "s")
 
 includestuff = includestuff + """

AltStyle によって変換されたページ (->オリジナル) /