Mercurial > pub > dyncall > dyncall
comparison doc/manual/manual_dynload_api.tex @ 0:3e629dc19168
initial from svn dyncall-1745
author | Daniel Adler |
---|---|
date | Thu, 19 Mar 2015 22:24:28 +0100 |
parents | |
children | f8a6e60598cc |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3e629dc19168 |
---|---|
1 %////////////////////////////////////////////////////////////////////////////// | |
2 % | |
3 % Copyright (c) 2007,2009 Daniel Adler <dadler@uni-goettingen.de>, | |
4 % Tassilo Philipp <tphilipp@potion-studios.com> | |
5 % | |
6 % Permission to use, copy, modify, and distribute this software for any | |
7 % purpose with or without fee is hereby granted, provided that the above | |
8 % copyright notice and this permission notice appear in all copies. | |
9 % | |
10 % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 % WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 % MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 % ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 % WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 % ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 % OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 % | |
18 %////////////////////////////////////////////////////////////////////////////// | |
19 | |
20 \newpage | |
21 \section{\product{Dynload} C library API} | |
22 | |
23 The \product{dynload} library encapsulates dynamic loading mechanisms and | |
24 gives access to functions in foreign dynamic libraries and code modules. | |
25 | |
26 \subsection{Loading code} | |
27 | |
28 \begin{lstlisting}[language=c,label=dl-load] | |
29 void* dlLoadLibrary(const char* libpath); | |
30 void dlFreeLibrary(void* libhandle); | |
31 \end{lstlisting} | |
32 | |
33 \lstinline{dlLoadLibrary} loads a dynamic library at \lstinline{libpath} | |
34 and returns a handle to it for use in \lstinline{dlFreeLibrary} and | |
35 \lstinline{dlFindSymbol} calls. | |
36 | |
37 \lstinline{dlFreeLibrary} frees the loaded library with handle \lstinline{pLib}. | |
38 | |
39 \subsection{Retrieving functions} | |
40 | |
41 \begin{lstlisting}[language=c] | |
42 void* dlFindSymbol(void* libhandle, const char* symbol); | |
43 \end{lstlisting} | |
44 | |
45 returns a pointer to a symbol with name \lstinline{pSymbolName} in the | |
46 library with handle \lstinline{pLib}, or returns a null pointer if the symbol cannot | |
47 be found. |