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
61963220
Kaydet (Commit)
61963220
authored
Kas 19, 2003
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
MacOS9 support is gone.
üst
d338b6e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
113 deletions
+0
-113
dynload_mac.c
Python/dynload_mac.c
+0
-113
No files found.
Python/dynload_mac.c
deleted
100644 → 0
Dosyayı görüntüle @
d338b6e3
/* Support for dynamic loading of extension modules */
#include "Python.h"
#include "importdl.h"
#include <Aliases.h>
#include <CodeFragments.h>
#ifdef USE_GUSI1
#include "TFileSpec.h"
/* for Path2FSSpec() */
#endif
#include <Files.h>
#include <TextUtils.h>
#include "macdefs.h"
#include "macglue.h"
const
struct
filedescr
_PyImport_DynLoadFiletab
[]
=
{
{
".slb"
,
"rb"
,
C_EXTENSION
},
{
".carbon.slb"
,
"rb"
,
C_EXTENSION
},
{
0
,
0
}
};
dl_funcptr
_PyImport_GetDynLoadFunc
(
const
char
*
fqname
,
const
char
*
shortname
,
const
char
*
pathname
,
FILE
*
fp
)
{
dl_funcptr
p
;
char
funcname
[
258
];
/*
** Dynamic loading of CFM shared libraries on the Mac. The
** code has become more convoluted than it was, because we
** want to be able to put multiple modules in a single
** file. For this reason, we have to determine the fragment
** name, and we cannot use the library entry point but we have
** to locate the correct init routine "by hand".
*/
FSSpec
libspec
;
CFragConnectionID
connID
;
Ptr
mainAddr
;
Str255
errMessage
;
OSErr
err
;
#ifndef USE_GUSI1
Boolean
isfolder
,
didsomething
;
#endif
char
buf
[
512
];
Str63
fragname
;
Ptr
symAddr
;
CFragSymbolClass
class
;
/* First resolve any aliases to find the real file */
#ifdef USE_GUSI1
err
=
Path2FSSpec
(
pathname
,
&
libspec
);
#else
c2pstrcpy
((
unsigned
char
*
)
buf
,
pathname
);
(
void
)
FSMakeFSSpec
(
0
,
0
,
(
unsigned
char
*
)
buf
,
&
libspec
);
err
=
ResolveAliasFile
(
&
libspec
,
1
,
&
isfolder
,
&
didsomething
);
#endif
if
(
err
)
{
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"%.200s: %.200s"
,
pathname
,
PyMac_StrError
(
err
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
return
NULL
;
}
/* Next, determine the fragment name,
by stripping '.slb' and 'module' */
memcpy
(
fragname
+
1
,
libspec
.
name
+
1
,
libspec
.
name
[
0
]);
fragname
[
0
]
=
libspec
.
name
[
0
];
if
(
strncmp
((
char
*
)(
fragname
+
1
+
fragname
[
0
]
-
4
),
".slb"
,
4
)
==
0
)
fragname
[
0
]
-=
4
;
if
(
strncmp
((
char
*
)(
fragname
+
1
+
fragname
[
0
]
-
6
),
"module"
,
6
)
==
0
)
fragname
[
0
]
-=
6
;
/* Load the fragment
(or return the connID if it is already loaded */
err
=
GetDiskFragment
(
&
libspec
,
0
,
0
,
fragname
,
kLoadCFrag
,
&
connID
,
&
mainAddr
,
errMessage
);
if
(
err
==
cfragImportTooOldErr
||
err
==
cfragImportTooNewErr
)
{
/*
** Special-case code: if PythonCore is too old or too new this means
** the dynamic module was meant for a different Python.
*/
if
(
errMessage
[
0
]
==
10
&&
strncmp
((
char
*
)
errMessage
+
1
,
"PythonCore"
,
10
)
==
0
)
{
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"Dynamic module was built for %s version of MacPython"
,
(
err
==
cfragImportTooOldErr
?
"a newer"
:
"an older"
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
return
NULL
;
}
}
if
(
err
)
{
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"%.*s: %.200s"
,
errMessage
[
0
],
errMessage
+
1
,
PyMac_StrError
(
err
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
return
NULL
;
}
/* Locate the address of the correct init function */
PyOS_snprintf
(
funcname
,
sizeof
(
funcname
),
"init%.200s"
,
shortname
);
err
=
FindSymbol
(
connID
,
Pstring
(
funcname
),
&
symAddr
,
&
class
);
if
(
err
)
{
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"%s: %.200s"
,
funcname
,
PyMac_StrError
(
err
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
return
NULL
;
}
p
=
(
dl_funcptr
)
symAddr
;
return
p
;
}
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