Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
24aa3cea
Commit
24aa3cea
authored
Nov 06, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First couple of fixes to make it compile with Universal 3.3.2.
parent
e9b2a059
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
Mac/Modules/hfsplusmodule.c
Mac/Modules/hfsplusmodule.c
+21
-10
No files found.
Mac/Modules/hfsplusmodule.c
View file @
24aa3cea
/*
/*
$Log$
$Log$
Revision 1.
1 2001/11/06 11:10:13
jackjansen
Revision 1.
2 2001/11/06 12:06:39
jackjansen
HFS+ API contributed by Nitin Ganatra. This checkin is identical to what he sent me, except for the namechange (fmgr->hfsplus)
.
First couple of fixes to make it compile with Universal 3.3.2
.
Revision 1.8 2001/10/03 17:29:01 ganatra
Revision 1.8 2001/10/03 17:29:01 ganatra
add parent method to FSRef class
add parent method to FSRef class
...
@@ -15,8 +15,12 @@
...
@@ -15,8 +15,12 @@
*/
*/
#include <CoreServices/CoreServices.h>
#include "Python.h"
#include "Python.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Files.h>
#else
#include <CoreServices/CoreServices.h>
#endif
static
PyObject
*
static
PyObject
*
dict_from_cataloginfo
(
FSCatalogInfoBitmap
bitmap
,
const
FSCatalogInfo
*
info
,
HFSUniStr255
*
uni
);
dict_from_cataloginfo
(
FSCatalogInfoBitmap
bitmap
,
const
FSCatalogInfo
*
info
,
HFSUniStr255
*
uni
);
...
@@ -1059,7 +1063,7 @@ PyObject *fmgrmodule_getcatinfo(PyObject *self, PyObject *args)
...
@@ -1059,7 +1063,7 @@ PyObject *fmgrmodule_getcatinfo(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
err
=
FSPathMakeRef
(
path
,
&
ref
,
NULL
);
err
=
FSPathMakeRef
(
(
UInt8
*
)
path
,
&
ref
,
NULL
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
err
!=
noErr
)
if
(
err
!=
noErr
)
return
macos_error_for_call
(
err
,
"FSPathMakeRef"
,
path
);
return
macos_error_for_call
(
err
,
"FSPathMakeRef"
,
path
);
...
@@ -1096,7 +1100,7 @@ PyObject *fmgrmodule_opendir(PyObject *self, PyObject *args)
...
@@ -1096,7 +1100,7 @@ PyObject *fmgrmodule_opendir(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
err
=
FSPathMakeRef
(
path
,
&
ref
,
&
isdir
);
err
=
FSPathMakeRef
(
(
UInt8
*
)
path
,
&
ref
,
&
isdir
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
err
!=
noErr
)
if
(
err
!=
noErr
)
...
@@ -1128,7 +1132,7 @@ PyObject *fmgrmodule_fsref(PyObject *self, PyObject *args)
...
@@ -1128,7 +1132,7 @@ PyObject *fmgrmodule_fsref(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
err
=
FSPathMakeRef
(
path
,
&
ref
,
&
isdir
);
err
=
FSPathMakeRef
(
(
UInt8
*
)
path
,
&
ref
,
&
isdir
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
err
!=
noErr
)
if
(
err
!=
noErr
)
...
@@ -1166,7 +1170,7 @@ PyObject *fmgrmodule_openfork(PyObject *self, PyObject *args)
...
@@ -1166,7 +1170,7 @@ PyObject *fmgrmodule_openfork(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
err
=
FSPathMakeRef
(
path
,
&
ref
,
&
isdir
);
err
=
FSPathMakeRef
(
(
UInt8
*
)
path
,
&
ref
,
&
isdir
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
err
!=
noErr
)
{
if
(
err
!=
noErr
)
{
...
@@ -1193,10 +1197,10 @@ static PyMethodDef fmgrmodule_methods[] = {
...
@@ -1193,10 +1197,10 @@ static PyMethodDef fmgrmodule_methods[] = {
};
};
//__________________________________________________________________________________________________
//__________________________________________________________________________________________________
// Initialization function for the module (*must* be called init
fmgr
)
// Initialization function for the module (*must* be called init
hfsplus
)
//
//
DL_EXPORT
(
void
)
DL_EXPORT
(
void
)
init
fmgr
(
void
)
init
hfsplus
(
void
)
{
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
...
@@ -1405,7 +1409,9 @@ static
...
@@ -1405,7 +1409,9 @@ static
int
cataloginfo_from_dict
(
FSCatalogInfoBitmap
bitmap
,
FSCatalogInfo
*
info
,
const
PyObject
*
dict
)
int
cataloginfo_from_dict
(
FSCatalogInfoBitmap
bitmap
,
FSCatalogInfo
*
info
,
const
PyObject
*
dict
)
{
{
UInt32
storage
;
UInt32
storage
;
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
FSPermissionInfo
*
permissions
;
FSPermissionInfo
*
permissions
;
#endif
// Dates
// Dates
if
(
fetch_utcdatetime
(
bitmap
,
kFSCatInfoCreateDate
,
dict
,
_kFSCatInfoCreateDate
,
&
info
->
createDate
))
return
NULL
;
if
(
fetch_utcdatetime
(
bitmap
,
kFSCatInfoCreateDate
,
dict
,
_kFSCatInfoCreateDate
,
&
info
->
createDate
))
return
NULL
;
...
@@ -1414,6 +1420,7 @@ int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const
...
@@ -1414,6 +1420,7 @@ int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const
if
(
fetch_utcdatetime
(
bitmap
,
kFSCatInfoAccessDate
,
dict
,
_kFSCatInfoAccessDate
,
&
info
->
accessDate
))
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
(
fetch_utcdatetime
(
bitmap
,
kFSCatInfoBackupDate
,
dict
,
_kFSCatInfoBackupDate
,
&
info
->
backupDate
))
return
NULL
;
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
// Permissions
// Permissions
permissions
=
(
FSPermissionInfo
*
)
info
->
permissions
;
permissions
=
(
FSPermissionInfo
*
)
info
->
permissions
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserID
,
&
permissions
->
userID
))
return
NULL
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserID
,
&
permissions
->
userID
))
return
NULL
;
...
@@ -1422,7 +1429,7 @@ int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const
...
@@ -1422,7 +1429,7 @@ int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const
permissions
->
mode
=
(
UInt16
)
storage
;
permissions
->
mode
=
(
UInt16
)
storage
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserAccess
,
&
storage
))
return
NULL
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserAccess
,
&
storage
))
return
NULL
;
permissions
->
userAccess
=
(
UInt8
)
storage
;
permissions
->
userAccess
=
(
UInt8
)
storage
;
#endif
// IDs
// IDs
if
(
fetch_long
(
bitmap
,
kFSCatInfoTextEncoding
,
dict
,
_kFSCatInfoTextEncoding
,
&
info
->
textEncodingHint
))
return
NULL
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoTextEncoding
,
dict
,
_kFSCatInfoTextEncoding
,
&
info
->
textEncodingHint
))
return
NULL
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoNodeFlags
,
dict
,
_kFSCatInfoNodeFlags
,
&
storage
))
return
NULL
;
if
(
fetch_long
(
bitmap
,
kFSCatInfoNodeFlags
,
dict
,
_kFSCatInfoNodeFlags
,
&
storage
))
return
NULL
;
...
@@ -1453,7 +1460,9 @@ PyObject *dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo
...
@@ -1453,7 +1460,9 @@ PyObject *dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo
{
{
PyObject
*
dict
;
PyObject
*
dict
;
PyObject
*
id
;
PyObject
*
id
;
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
FSPermissionInfo
*
permissions
;
FSPermissionInfo
*
permissions
;
#endif
char
buffer
[
1024
];
char
buffer
[
1024
];
dict
=
PyDict_New
();
dict
=
PyDict_New
();
...
@@ -1483,12 +1492,14 @@ PyObject *dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo
...
@@ -1483,12 +1492,14 @@ PyObject *dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo
if
(
insert_longlong
(
bitmap
,
kFSCatInfoRsrcSizes
,
dict
,
_kFSCatInfoRsrcLogical
,
info
->
rsrcLogicalSize
))
return
NULL
;
if
(
insert_longlong
(
bitmap
,
kFSCatInfoRsrcSizes
,
dict
,
_kFSCatInfoRsrcLogical
,
info
->
rsrcLogicalSize
))
return
NULL
;
if
(
insert_longlong
(
bitmap
,
kFSCatInfoRsrcSizes
,
dict
,
_kFSCatInfoRsrcPhysical
,
info
->
rsrcPhysicalSize
))
return
NULL
;
if
(
insert_longlong
(
bitmap
,
kFSCatInfoRsrcSizes
,
dict
,
_kFSCatInfoRsrcPhysical
,
info
->
rsrcPhysicalSize
))
return
NULL
;
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
// Permissions
// Permissions
permissions
=
(
FSPermissionInfo
*
)
info
->
permissions
;
permissions
=
(
FSPermissionInfo
*
)
info
->
permissions
;
if
(
insert_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserID
,
permissions
->
userID
))
return
NULL
;
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
,
_kFSCatInfoGroupID
,
permissions
->
groupID
))
return
NULL
;
if
(
insert_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserAccess
,
permissions
->
userAccess
))
return
NULL
;
if
(
insert_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoUserAccess
,
permissions
->
userAccess
))
return
NULL
;
if
(
insert_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoMode
,
permissions
->
mode
))
return
NULL
;
if
(
insert_long
(
bitmap
,
kFSCatInfoPermissions
,
dict
,
_kFSCatInfoMode
,
permissions
->
mode
))
return
NULL
;
#endif
// Dates
// Dates
if
(
insert_utcdatetime
(
bitmap
,
kFSCatInfoCreateDate
,
dict
,
_kFSCatInfoCreateDate
,
&
info
->
createDate
))
return
NULL
;
if
(
insert_utcdatetime
(
bitmap
,
kFSCatInfoCreateDate
,
dict
,
_kFSCatInfoCreateDate
,
&
info
->
createDate
))
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment