Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9aa3d137
Kaydet (Commit)
9aa3d137
authored
Ock 21, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
renamed Get routines to PyMac_Get; added macfs to config.c
üst
796b259a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
20 deletions
+17
-20
macglue.h
Mac/Include/macglue.h
+0
-4
config.c
Mac/Modules/config.c
+2
-2
macfsmodule.c
Mac/Modules/macfsmodule.c
+4
-4
macosmodule.c
Mac/Modules/macosmodule.c
+4
-4
macglue.c
Mac/Python/macglue.c
+7
-6
No files found.
Mac/Include/macglue.h
Dosyayı görüntüle @
9aa3d137
...
@@ -10,7 +10,3 @@ int PyMac_GetStr255 Py_PROTO((PyObject *, Str255)); /* argument parser for Str25
...
@@ -10,7 +10,3 @@ int PyMac_GetStr255 Py_PROTO((PyObject *, Str255)); /* argument parser for Str25
int
PyMac_GetFSSpec
Py_PROTO
((
PyObject
*
,
FSSpec
*
));
/* argument parser for FSSpec */
int
PyMac_GetFSSpec
Py_PROTO
((
PyObject
*
,
FSSpec
*
));
/* argument parser for FSSpec */
PyObject
*
PyMac_BuildFSSpec
Py_PROTO
((
FSSpec
*
));
/* Convert FSSpec to PyObject */
PyObject
*
PyMac_BuildFSSpec
Py_PROTO
((
FSSpec
*
));
/* Convert FSSpec to PyObject */
PyObject
*
PyMac_BuildOSType
Py_PROTO
((
OSType
));
/* Convert OSType to PyObject */
PyObject
*
PyMac_BuildOSType
Py_PROTO
((
OSType
));
/* Convert OSType to PyObject */
#define GetOSType PyMac_GetOSType
#define GetStr255 PyMac_GetStr255
#define GetFSSpec PyMac_GetFSSpec
Mac/Modules/config.c
Dosyayı görüntüle @
9aa3d137
...
@@ -261,10 +261,9 @@ extern void initnew();
...
@@ -261,10 +261,9 @@ extern void initnew();
extern
void
initdl
();
extern
void
initdl
();
extern
void
initsyslog
();
extern
void
initsyslog
();
extern
void
initgestalt
();
extern
void
initgestalt
();
#ifdef THINK_C
extern
void
initmacconsole
();
extern
void
initmacconsole
();
#endif
extern
void
initctb
();
extern
void
initctb
();
extern
void
initmacfs
();
extern
void
initmacspeech
();
extern
void
initmacspeech
();
extern
void
initmacdnr
();
extern
void
initmacdnr
();
extern
void
initmactcp
();
extern
void
initmactcp
();
...
@@ -302,6 +301,7 @@ struct {
...
@@ -302,6 +301,7 @@ struct {
{
"macconsole"
,
initmacconsole
},
{
"macconsole"
,
initmacconsole
},
#endif
#endif
{
"ctb"
,
initctb
},
{
"ctb"
,
initctb
},
{
"macfs"
,
initmacfs
},
#ifdef __MWERKS__
#ifdef __MWERKS__
/* This is really "Jack Jansen" specific for now :-) */
/* This is really "Jack Jansen" specific for now :-) */
{
"macspeech"
,
initmacspeech
},
{
"macspeech"
,
initmacspeech
},
...
...
Mac/Modules/macfsmodule.c
Dosyayı görüntüle @
9aa3d137
...
@@ -48,7 +48,7 @@ mfs_NewAlias(self, args)
...
@@ -48,7 +48,7 @@ mfs_NewAlias(self, args)
FSSpec
src
,
dst
,
*
dstptr
;
FSSpec
src
,
dst
,
*
dstptr
;
src
.
name
[
0
]
=
0
;
src
.
name
[
0
]
=
0
;
if
(
!
newgetargs
(
args
,
"O&|O&"
,
GetFSSpec
,
&
dst
,
GetFSSpec
,
&
src
))
if
(
!
newgetargs
(
args
,
"O&|O&"
,
PyMac_GetFSSpec
,
&
dst
,
PyMac_
GetFSSpec
,
&
src
))
return
NULL
;
return
NULL
;
/* XXXX */
/* XXXX */
...
@@ -90,7 +90,7 @@ mfs_StandardPutFile(self, args)
...
@@ -90,7 +90,7 @@ mfs_StandardPutFile(self, args)
StandardFileReply
reply
;
StandardFileReply
reply
;
dft
[
0
]
=
0
;
dft
[
0
]
=
0
;
if
(
!
newgetargs
(
args
,
"O&|O&"
,
GetStr255
,
&
prompt
,
GetStr255
,
&
dft
)
)
if
(
!
newgetargs
(
args
,
"O&|O&"
,
PyMac_GetStr255
,
&
prompt
,
PyMac_
GetStr255
,
&
dft
)
)
return
NULL
;
return
NULL
;
StandardPutFile
(
prompt
,
dft
,
&
reply
);
StandardPutFile
(
prompt
,
dft
,
&
reply
);
return
mkvalue
(
"(iO)"
,
reply
.
sfGood
,
PyMac_BuildFSSpec
(
&
reply
.
sfFile
));
return
mkvalue
(
"(iO)"
,
reply
.
sfGood
,
PyMac_BuildFSSpec
(
&
reply
.
sfFile
));
...
@@ -126,7 +126,7 @@ mfs_FSSpecNormalize(self, args)
...
@@ -126,7 +126,7 @@ mfs_FSSpecNormalize(self, args)
{
{
FSSpec
fss
;
FSSpec
fss
;
if
(
!
newgetargs
(
args
,
"O&"
,
GetFSSpec
,
&
fss
))
if
(
!
newgetargs
(
args
,
"O&"
,
PyMac_
GetFSSpec
,
&
fss
))
return
NULL
;
return
NULL
;
return
PyMac_BuildFSSpec
(
&
fss
);
return
PyMac_BuildFSSpec
(
&
fss
);
}
}
...
@@ -140,7 +140,7 @@ mfs_FSSpecPath(self, args)
...
@@ -140,7 +140,7 @@ mfs_FSSpecPath(self, args)
char
strbuf
[
257
];
char
strbuf
[
257
];
OSErr
err
;
OSErr
err
;
if
(
!
newgetargs
(
args
,
"O&"
,
GetFSSpec
,
&
fss
))
if
(
!
newgetargs
(
args
,
"O&"
,
PyMac_
GetFSSpec
,
&
fss
))
return
NULL
;
return
NULL
;
err
=
nfullpath
(
&
fss
,
strbuf
);
err
=
nfullpath
(
&
fss
,
strbuf
);
if
(
err
)
{
if
(
err
)
{
...
...
Mac/Modules/macosmodule.c
Dosyayı görüntüle @
9aa3d137
...
@@ -157,7 +157,7 @@ MacOS_GetResource(PyObject *self, PyObject *args)
...
@@ -157,7 +157,7 @@ MacOS_GetResource(PyObject *self, PyObject *args)
ResType
rt
;
ResType
rt
;
int
id
;
int
id
;
Handle
h
;
Handle
h
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&i"
,
GetOSType
,
&
rt
,
&
id
))
if
(
!
PyArg_ParseTuple
(
args
,
"O&i"
,
PyMac_
GetOSType
,
&
rt
,
&
id
))
return
NULL
;
return
NULL
;
h
=
GetResource
(
rt
,
id
);
h
=
GetResource
(
rt
,
id
);
return
(
PyObject
*
)
Rsrc_FromHandle
(
h
);
return
(
PyObject
*
)
Rsrc_FromHandle
(
h
);
...
@@ -169,7 +169,7 @@ MacOS_GetNamedResource(PyObject *self, PyObject *args)
...
@@ -169,7 +169,7 @@ MacOS_GetNamedResource(PyObject *self, PyObject *args)
ResType
rt
;
ResType
rt
;
Str255
name
;
Str255
name
;
Handle
h
;
Handle
h
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&O&"
,
GetOSType
,
&
rt
,
GetStr255
,
&
name
))
if
(
!
PyArg_ParseTuple
(
args
,
"O&O&"
,
PyMac_GetOSType
,
&
rt
,
PyMac_
GetStr255
,
&
name
))
return
NULL
;
return
NULL
;
h
=
GetNamedResource
(
rt
,
name
);
h
=
GetNamedResource
(
rt
,
name
);
return
(
PyObject
*
)
Rsrc_FromHandle
(
h
);
return
(
PyObject
*
)
Rsrc_FromHandle
(
h
);
...
@@ -186,7 +186,7 @@ MacOS_GetFileType(PyObject *self, PyObject *args)
...
@@ -186,7 +186,7 @@ MacOS_GetFileType(PyObject *self, PyObject *args)
PyObject
*
type
,
*
creator
,
*
res
;
PyObject
*
type
,
*
creator
,
*
res
;
OSErr
err
;
OSErr
err
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&"
,
GetStr255
,
&
name
))
if
(
!
PyArg_ParseTuple
(
args
,
"O&"
,
PyMac_
GetStr255
,
&
name
))
return
NULL
;
return
NULL
;
if
((
err
=
GetFInfo
(
name
,
0
,
&
info
))
!=
noErr
)
{
if
((
err
=
GetFInfo
(
name
,
0
,
&
info
))
!=
noErr
)
{
errno
=
err
;
errno
=
err
;
...
@@ -210,7 +210,7 @@ MacOS_SetFileType(PyObject *self, PyObject *args)
...
@@ -210,7 +210,7 @@ MacOS_SetFileType(PyObject *self, PyObject *args)
OSErr
err
;
OSErr
err
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&O&O&"
,
if
(
!
PyArg_ParseTuple
(
args
,
"O&O&O&"
,
GetStr255
,
&
name
,
GetOSType
,
&
type
,
GetOSType
,
&
creator
))
PyMac_GetStr255
,
&
name
,
PyMac_GetOSType
,
&
type
,
PyMac_
GetOSType
,
&
creator
))
return
NULL
;
return
NULL
;
if
((
err
=
GetFInfo
(
name
,
0
,
&
info
))
!=
noErr
)
{
if
((
err
=
GetFInfo
(
name
,
0
,
&
info
))
!=
noErr
)
{
errno
=
err
;
errno
=
err
;
...
...
Mac/Python/macglue.c
Dosyayı görüntüle @
9aa3d137
...
@@ -31,6 +31,8 @@ Pstring(char *str)
...
@@ -31,6 +31,8 @@ Pstring(char *str)
int
len
;
int
len
;
len
=
strlen
(
str
);
len
=
strlen
(
str
);
if
(
len
>
255
)
len
=
255
;
buf
[
0
]
=
(
unsigned
char
)
len
;
buf
[
0
]
=
(
unsigned
char
)
len
;
strncpy
((
char
*
)
buf
+
1
,
str
,
len
);
strncpy
((
char
*
)
buf
+
1
,
str
,
len
);
return
buf
;
return
buf
;
...
@@ -147,20 +149,19 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
...
@@ -147,20 +149,19 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
if
(
PyString_Check
(
v
)
)
{
if
(
PyString_Check
(
v
)
)
{
/* It's a pathname */
/* It's a pathname */
if
(
!
PyArg_Parse
(
v
,
"O&"
,
GetStr255
,
&
path
)
)
if
(
!
PyArg_Parse
(
v
,
"O&"
,
PyMac_
GetStr255
,
&
path
)
)
return
0
;
return
0
;
refnum
=
0
;
/* XXXX Should get CurWD here... */
refnum
=
0
;
/* XXXX Should get CurWD here... */
parid
=
0
;
parid
=
0
;
}
else
{
}
else
{
PyErr_Clear
();
if
(
!
PyArg_Parse
(
v
,
"(hlO&); FSSpec should be fullpath or (vrefnum,dirid,path)"
,
if
(
!
PyArg_Parse
(
v
,
"(hlO&); FSSpec should be fullpath or (int,int,string)"
,
&
refnum
,
&
parid
,
PyMac_GetStr255
,
&
path
))
{
&
refnum
,
&
parid
,
GetStr255
,
&
path
))
return
0
;
return
0
;
}
}
}
err
=
FSMakeFSSpec
(
refnum
,
parid
,
path
,
fs
);
err
=
FSMakeFSSpec
(
refnum
,
parid
,
path
,
fs
);
if
(
err
&&
err
!=
fnfErr
)
{
if
(
err
&&
err
!=
fnfErr
)
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_Mac
(
PyExc_ValueError
,
err
);
"FSMakeFSSpec error"
);
return
0
;
return
0
;
}
}
return
1
;
return
1
;
...
...
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