/*
$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.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
add parent method to FSRef class
*/
-#include <CoreServices/CoreServices.h>
#include "Python.h"
+#ifdef WITHOUT_FRAMEWORKS
+#include <Files.h>
+#else
+#include <CoreServices/CoreServices.h>
+#endif
static PyObject *
dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo *info, HFSUniStr255 *uni);
return NULL;
Py_BEGIN_ALLOW_THREADS
- err = FSPathMakeRef(path, &ref, NULL);
+ err = FSPathMakeRef((UInt8 *)path, &ref, NULL);
Py_END_ALLOW_THREADS
if (err != noErr)
return macos_error_for_call(err, "FSPathMakeRef", path);
return NULL;
Py_BEGIN_ALLOW_THREADS
- err = FSPathMakeRef(path, &ref, &isdir);
+ err = FSPathMakeRef((UInt8 *)path, &ref, &isdir);
Py_END_ALLOW_THREADS
if (err != noErr)
return NULL;
Py_BEGIN_ALLOW_THREADS
- err = FSPathMakeRef(path, &ref, &isdir);
+ err = FSPathMakeRef((UInt8 *)path, &ref, &isdir);
Py_END_ALLOW_THREADS
if (err != noErr)
return NULL;
Py_BEGIN_ALLOW_THREADS
- err = FSPathMakeRef(path, &ref, &isdir);
+ err = FSPathMakeRef((UInt8 *)path, &ref, &isdir);
Py_END_ALLOW_THREADS
if (err != noErr) {
};
//__________________________________________________________________________________________________
-// Initialization function for the module (*must* be called initfmgr)
+// Initialization function for the module (*must* be called inithfsplus)
//
DL_EXPORT(void)
-initfmgr(void)
+inithfsplus(void)
{
PyObject *m, *d;
int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const PyObject *dict)
{
UInt32 storage;
+#if UNIVERSAL_INTERFACES_VERSION > 0x0332
FSPermissionInfo *permissions;
+#endif
// Dates
if (fetch_utcdatetime(bitmap, kFSCatInfoCreateDate, dict, _kFSCatInfoCreateDate, &info->createDate)) return NULL;
if (fetch_utcdatetime(bitmap, kFSCatInfoAccessDate, dict, _kFSCatInfoAccessDate, &info->accessDate)) return NULL;
if (fetch_utcdatetime(bitmap, kFSCatInfoBackupDate, dict, _kFSCatInfoBackupDate, &info->backupDate)) return NULL;
+#if UNIVERSAL_INTERFACES_VERSION > 0x0332
// Permissions
permissions = (FSPermissionInfo *) info->permissions;
if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserID, &permissions->userID)) return NULL;
permissions->mode = (UInt16) storage;
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;
if (fetch_long(bitmap, kFSCatInfoNodeFlags, dict, _kFSCatInfoNodeFlags, &storage)) return NULL;
{
PyObject *dict;
PyObject *id;
+#if UNIVERSAL_INTERFACES_VERSION > 0x0332
FSPermissionInfo *permissions;
+#endif
char buffer[1024];
dict = PyDict_New();
if (insert_longlong(bitmap, kFSCatInfoRsrcSizes, dict, _kFSCatInfoRsrcLogical, info->rsrcLogicalSize)) return NULL;
if (insert_longlong(bitmap, kFSCatInfoRsrcSizes, dict, _kFSCatInfoRsrcPhysical, info->rsrcPhysicalSize)) return NULL;
+#if UNIVERSAL_INTERFACES_VERSION > 0x0332
// Permissions
permissions = (FSPermissionInfo *) info->permissions;
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserID, permissions->userID)) return NULL;
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoGroupID, permissions->groupID)) return NULL;
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, permissions->userAccess)) return NULL;
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoMode, permissions->mode)) return NULL;
+#endif
// Dates
if (insert_utcdatetime(bitmap, kFSCatInfoCreateDate, dict, _kFSCatInfoCreateDate, &info->createDate)) return NULL;