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
a762f4ca
Kaydet (Commit)
a762f4ca
authored
Şub 01, 2002
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Got rid of an extra level of {} and funny formatting that was still
there because of the NeXT history.
üst
3b388ec8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
58 deletions
+56
-58
dynload_next.c
Python/dynload_next.c
+56
-58
No files found.
Python/dynload_next.c
Dosyayı görüntüle @
a762f4ca
...
...
@@ -36,83 +36,81 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
{
dl_funcptr
p
=
NULL
;
char
funcname
[
258
];
NSObjectFileImageReturnCode
rc
;
NSObjectFileImage
image
;
NSModule
newModule
;
NSSymbol
theSym
;
const
char
*
errString
;
char
errBuf
[
512
];
PyOS_snprintf
(
funcname
,
sizeof
(
funcname
),
"_init%.200s"
,
shortname
);
{
NSObjectFileImageReturnCode
rc
;
NSObjectFileImage
image
;
NSModule
newModule
;
NSSymbol
theSym
;
const
char
*
errString
;
char
errBuf
[
512
];
#ifdef USE_DYLD_GLOBAL_NAMESPACE
if
(
NSIsSymbolNameDefined
(
funcname
))
{
theSym
=
NSLookupAndBindSymbol
(
funcname
);
p
=
(
dl_funcptr
)
NSAddressOfSymbol
(
theSym
);
return
p
;
}
if
(
NSIsSymbolNameDefined
(
funcname
))
{
theSym
=
NSLookupAndBindSymbol
(
funcname
);
p
=
(
dl_funcptr
)
NSAddressOfSymbol
(
theSym
);
return
p
;
}
#endif
rc
=
NSCreateObjectFileImageFromFile
(
pathname
,
&
image
);
switch
(
rc
)
{
default:
case
NSObjectFileImageFailure
:
case
NSObjectFileImageFormat
:
rc
=
NSCreateObjectFileImageFromFile
(
pathname
,
&
image
);
switch
(
rc
)
{
default:
case
NSObjectFileImageFailure
:
case
NSObjectFileImageFormat
:
/* for these a message is printed on stderr by dyld */
errString
=
"Can't create object file image"
;
break
;
case
NSObjectFileImageSuccess
:
break
;
case
NSObjectFileImageSuccess
:
errString
=
NULL
;
break
;
case
NSObjectFileImageInappropriateFile
:
case
NSObjectFileImageInappropriateFile
:
errString
=
"Inappropriate file type for dynamic loading"
;
break
;
case
NSObjectFileImageArch
:
case
NSObjectFileImageArch
:
errString
=
"Wrong CPU type in object file"
;
break
;
case
NSObjectFileImageAccess
:
case
NSObjectFileImageAccess
:
errString
=
"Can't read object file (no access)"
;
break
;
}
if
(
errString
==
NULL
)
{
newModule
=
NSLinkModule
(
image
,
pathname
,
LINKOPTIONS
);
if
(
newModule
==
NULL
)
{
int
errNo
;
char
*
fileName
,
*
moreErrorStr
;
NSLinkEditErrors
c
;
NSLinkEditError
(
&
c
,
&
errNo
,
&
fileName
,
&
moreErrorStr
);
PyOS_snprintf
(
errBuf
,
512
,
"Failure linking new module: %s: %s"
,
fileName
,
moreErrorStr
);
errString
=
errBuf
;
}
if
(
errString
==
NULL
)
{
newModule
=
NSLinkModule
(
image
,
pathname
,
LINKOPTIONS
);
if
(
newModule
==
NULL
)
{
int
errNo
;
char
*
fileName
,
*
moreErrorStr
;
NSLinkEditErrors
c
;
NSLinkEditError
(
&
c
,
&
errNo
,
&
fileName
,
&
moreErrorStr
);
PyOS_snprintf
(
errBuf
,
512
,
"Failure linking new module: %s: %s"
,
fileName
,
moreErrorStr
);
errString
=
errBuf
;
}
}
if
(
errString
!=
NULL
)
{
PyErr_SetString
(
PyExc_ImportError
,
errString
);
return
NULL
;
}
}
if
(
errString
!=
NULL
)
{
PyErr_SetString
(
PyExc_ImportError
,
errString
);
return
NULL
;
}
#ifdef USE_DYLD_GLOBAL_NAMESPACE
if
(
!
NSIsSymbolNameDefined
(
funcname
))
{
/* UnlinkModule() isn't implemented in current versions, but calling it does no harm */
NSUnLinkModule
(
newModule
,
FALSE
);
PyErr_Format
(
PyExc_ImportError
,
"Loaded module does not contain symbol %.200s"
,
funcname
);
return
NULL
;
}
theSym
=
NSLookupAndBindSymbol
(
funcname
);
if
(
!
NSIsSymbolNameDefined
(
funcname
))
{
/* UnlinkModule() isn't implemented in current versions, but calling it does no harm */
NSUnLinkModule
(
newModule
,
FALSE
);
PyErr_Format
(
PyExc_ImportError
,
"Loaded module does not contain symbol %.200s"
,
funcname
);
return
NULL
;
}
theSym
=
NSLookupAndBindSymbol
(
funcname
);
#else
theSym
=
NSLookupSymbolInModule
(
newModule
,
funcname
);
if
(
theSym
==
NULL
)
{
NSUnLinkModule
(
newModule
,
FALSE
);
PyErr_Format
(
PyExc_ImportError
,
"Loaded module does not contain symbol %.200s"
,
funcname
);
return
NULL
;
}
#endif
p
=
(
dl_funcptr
)
NSAddressOfSymbol
(
theSym
);
theSym
=
NSLookupSymbolInModule
(
newModule
,
funcname
);
if
(
theSym
==
NULL
)
{
NSUnLinkModule
(
newModule
,
FALSE
);
PyErr_Format
(
PyExc_ImportError
,
"Loaded module does not contain symbol %.200s"
,
funcname
);
return
NULL
;
}
#endif
p
=
(
dl_funcptr
)
NSAddressOfSymbol
(
theSym
);
}
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