There are several ways to loaded shared libraries into the Python
process. One way is to instantiate one of the following classes:
-\begin{classdesc}{CDLL}{name, mode=RTLD_LOCAL, handle=None}
+\begin{classdesc}{CDLL}{name, mode=DEFAULT_MODE, handle=None}
Instances of this class represent loaded shared libraries.
Functions in these libraries use the standard C calling
convention, and are assumed to return \code{int}.
\end{classdesc}
-\begin{classdesc}{OleDLL}{name, mode=RTLD_LOCAL, handle=None}
+\begin{classdesc}{OleDLL}{name, mode=DEFAULT_MODE, handle=None}
Windows only: Instances of this class represent loaded shared
libraries, functions in these libraries use the \code{stdcall}
calling convention, and are assumed to return the windows specific
failure, an \class{WindowsError} is automatically raised.
\end{classdesc}
-\begin{classdesc}{WinDLL}{name, mode=RTLD_LOCAL, handle=None}
+\begin{classdesc}{WinDLL}{name, mode=DEFAULT_MODE, handle=None}
Windows only: Instances of this class represent loaded shared
libraries, functions in these libraries use the \code{stdcall}
calling convention, and are assumed to return \code{int} by default.
The Python GIL is released before calling any function exported by
these libraries, and reaquired afterwards.
-\begin{classdesc}{PyDLL}{name, mode=RTLD_LOCAL, handle=None}
+\begin{classdesc}{PyDLL}{name, mode=DEFAULT_MODE, handle=None}
Instances of this class behave like \class{CDLL} instances, except
that the Python GIL is \emph{not} released during the function call,
and after the function execution the Python error flag is checked.
available, it is the same as \var{RTLD{\_}GLOBAL}.
\end{datadescni}
+\begin{datadescni}{DEFAULT_MODE}
+The default mode which is used to load shared libraries. On OSX
+10.3, this is \var{RTLD{\_}GLOBAL}, otherwise it is the same as
+\var{RTLD{\_}LOCAL}.
+\end{datadescni}
+
Instances of these classes have no public methods, however
\method{{\_}{\_}getattr{\_}{\_}} and \method{{\_}{\_}getitem{\_}{\_}} have special behaviour: functions
exported by the shared library can be accessed as attributes of by
return the same library each time.
\end{classdesc}
-\begin{methoddesc}{LoadLibrary}{name, mode=RTLD_LOCAL, handle=None}
+\begin{methoddesc}{LoadLibrary}{name}
Load a shared library into the process and return it. This method
-always creates a new instance of the library. All three
-parameters are passed to the constructor of the library object.
+always returns a new instance of the library.
\end{methoddesc}
These prefabricated library loaders are available: