[Python-checkins] CVS: python/dist/src/Mac/Modules hfsplusmodule.c,1.1,1.2

Jack Jansen jackjansen@users.sourceforge.net
Tue, 06 Nov 2001 04:06:41 -0800


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

Modified Files:
	hfsplusmodule.c 
Log Message:
First couple of fixes to make it compile with Universal 3.3.2.

Index: hfsplusmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/hfsplusmodule.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hfsplusmodule.c	2001/11/06 11:10:13	1.1
--- hfsplusmodule.c	2001/11/06 12:06:39	1.2
***************
*** 1,6 ****
  /*
    $Log$
!   Revision 1.1  2001/11/06 11:10:13  jackjansen
!   HFS+ API contributed by Nitin Ganatra. This checkin is identical to what he sent me, except for the namechange (fmgr->hfsplus).
  
    Revision 1.8  2001/10/03 17:29:01  ganatra
--- 1,6 ----
  /*
    $Log$
!   Revision 1.2  2001/11/06 12:06:39  jackjansen
!   First couple of fixes to make it compile with Universal 3.3.2.
  
    Revision 1.8  2001/10/03 17:29:01  ganatra
***************
*** 16,21 ****
  
  
- #include <CoreServices/CoreServices.h>
  #include "Python.h"
  
  static PyObject *
--- 16,25 ----
  
  
  #include "Python.h"
+ #ifdef WITHOUT_FRAMEWORKS
+ #include <Files.h>
+ #else
+ #include <CoreServices/CoreServices.h>
+ #endif
  
  static PyObject *
***************
*** 1060,1064 ****
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef(path, &ref, NULL);
  	Py_END_ALLOW_THREADS
  	if (err != noErr) 
--- 1064,1068 ----
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef((UInt8 *)path, &ref, NULL);
  	Py_END_ALLOW_THREADS
  	if (err != noErr) 
***************
*** 1097,1101 ****
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef(path, &ref, &isdir);
  	Py_END_ALLOW_THREADS
  
--- 1101,1105 ----
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef((UInt8 *)path, &ref, &isdir);
  	Py_END_ALLOW_THREADS
  
***************
*** 1129,1133 ****
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef(path, &ref, &isdir);
  	Py_END_ALLOW_THREADS
  
--- 1133,1137 ----
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef((UInt8 *)path, &ref, &isdir);
  	Py_END_ALLOW_THREADS
  
***************
*** 1167,1171 ****
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef(path, &ref, &isdir);
  	Py_END_ALLOW_THREADS
  
--- 1171,1175 ----
  
  	Py_BEGIN_ALLOW_THREADS
! 	err = FSPathMakeRef((UInt8 *)path, &ref, &isdir);
  	Py_END_ALLOW_THREADS
  
***************
*** 1194,1201 ****
  
  //__________________________________________________________________________________________________
! // Initialization function for the module (*must* be called initfmgr)
  //
  DL_EXPORT(void)
! initfmgr(void)
  {
  	PyObject *m, *d;
--- 1198,1205 ----
  
  //__________________________________________________________________________________________________
! // Initialization function for the module (*must* be called inithfsplus)
  //
  DL_EXPORT(void)
! inithfsplus(void)
  {
  	PyObject *m, *d;
***************
*** 1406,1410 ****
--- 1410,1416 ----
  {
  	UInt32 storage;
+ #if UNIVERSAL_INTERFACES_VERSION > 0x0332
  	FSPermissionInfo *permissions;
+ #endif
  	
  	// Dates
***************
*** 1415,1418 ****
--- 1421,1425 ----
  	if (fetch_utcdatetime(bitmap, kFSCatInfoBackupDate, dict, _kFSCatInfoBackupDate, &info->backupDate)) return NULL;
  
+ #if UNIVERSAL_INTERFACES_VERSION > 0x0332
  	// Permissions
  	permissions = (FSPermissionInfo *) info->permissions;
***************
*** 1423,1427 ****
  	if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, &storage)) return NULL;
  	permissions->userAccess = (UInt8) storage;
! 
  	// IDs
  	if (fetch_long(bitmap, kFSCatInfoTextEncoding, dict, _kFSCatInfoTextEncoding, &info->textEncodingHint)) return NULL;
--- 1430,1434 ----
  	if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, &storage)) return NULL;
  	permissions->userAccess = (UInt8) storage;
! #endif
  	// IDs
  	if (fetch_long(bitmap, kFSCatInfoTextEncoding, dict, _kFSCatInfoTextEncoding, &info->textEncodingHint)) return NULL;
***************
*** 1454,1458 ****
--- 1461,1467 ----
  	PyObject *dict;
  	PyObject *id;
+ #if UNIVERSAL_INTERFACES_VERSION > 0x0332
  	FSPermissionInfo *permissions;
+ #endif
  	char buffer[1024];
  
***************
*** 1484,1487 ****
--- 1493,1497 ----
  	if (insert_longlong(bitmap, kFSCatInfoRsrcSizes, dict, _kFSCatInfoRsrcPhysical, info->rsrcPhysicalSize)) return NULL;
  
+ #if UNIVERSAL_INTERFACES_VERSION > 0x0332
  	// Permissions
  	permissions = (FSPermissionInfo *) info->permissions;
***************
*** 1490,1493 ****
--- 1500,1504 ----
  	if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, permissions->userAccess)) return NULL;
  	if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoMode, permissions->mode)) return NULL;
+ #endif
  
  	// Dates