Mercurial > pub > dyncall > dyncall
annotate dynload/dynload.3 @ 228:f8a6e60598cc
- completed dynload API doc
author | Tassilo Philipp |
---|---|
date | Sun, 16 Apr 2017 13:34:39 +0200 |
parents | 7076f551faf5 |
children | 2a77747a5496 |
rev | line source |
---|---|
216
28bf0b231bce
- dynload man page clarification about resolving own symbols
Tassilo Philipp
parents:
93
diff
changeset
|
1 .\" Copyright (c) 2007-2017 Daniel Adler <dadler AT uni-goettingen DOT de>, |
0 | 2 .\" Tassilo Philipp <tphilipp AT potion-studios DOT com> |
3 .\" | |
4 .\" Permission to use, copy, modify, and distribute this software for any | |
5 .\" purpose with or without fee is hereby granted, provided that the above | |
6 .\" copyright notice and this permission notice appear in all copies. | |
7 .\" | |
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
15 .\" | |
16 .Dd $Mdocdate$ | |
17 .Dt dynload 3 | |
18 .Sh NAME | |
19 .Nm dynload | |
20 .Nd encapsulates dynamic loading mechanisms and | |
21 gives access to functions in foreign dynamic libraries and code modules. | |
22 .Sh SYNOPSIS | |
23 .In dynload.h | |
24 .Ft DLLib * | |
25 .Fn dlLoadLibrary "const char * libpath" | |
26 .Ft void | |
27 .Fn dlFreeLibrary "DLLib * pLib" | |
28 .Ft void * | |
216
28bf0b231bce
- dynload man page clarification about resolving own symbols
Tassilo Philipp
parents:
93
diff
changeset
|
29 .Fn dlFindSymbol "DLLib * pLib" "const char * pSymbolName" |
228 | 30 .Ft DLSyms* |
31 .Fn dlSymsInit "const char * libPath" | |
32 .Ft void | |
33 .Fn dlSymsCleanup "DLSyms * pSyms" | |
34 .Ft int | |
35 .Fn dlSymsCount "DLSyms * pSyms" | |
36 .Ft const char* | |
37 .Fn dlSymsName "DLSyms * pSyms" "int index" | |
38 .Ft const char* | |
39 .Fn dlSymsNameFromValue "DLSyms * pSyms" "void * value" | |
0 | 40 .Sh DESCRIPTION |
41 The | |
42 .Nm | |
43 library provides an interface to load foreign dynamic libraries and access | |
44 to their symbols. | |
45 .Pp | |
46 .Fn dlLoadLibrary | |
47 loads a dynamic library at | |
48 .Ar libpath | |
49 and returns a handle to it for use in | |
50 .Fn dlFreeLibrary | |
51 and | |
52 .Fn dlFindSymbol | |
216
28bf0b231bce
- dynload man page clarification about resolving own symbols
Tassilo Philipp
parents:
93
diff
changeset
|
53 calls. Passing a null pointer for the |
28bf0b231bce
- dynload man page clarification about resolving own symbols
Tassilo Philipp
parents:
93
diff
changeset
|
54 .Ar libpath |
28bf0b231bce
- dynload man page clarification about resolving own symbols
Tassilo Philipp
parents:
93
diff
changeset
|
55 argument is valid, and returns a handle to the main executable of the calling code. Returns a null pointer on error. |
0 | 56 .Pp |
57 .Fn dlFreeLibrary | |
58 frees the loaded library with handle | |
59 .Ar pLib . | |
60 .Pp | |
61 .Fn dlFindSymbol | |
62 returns a pointer to a symbol with name | |
63 .Ar pSymbolName | |
64 in the library with handle | |
65 .Ar pLib , | |
223
7076f551faf5
- dynload mach-o handling fixes for 64bit platforms
Tassilo Philipp
parents:
216
diff
changeset
|
66 or returns a null pointer if the symbol cannot be found. The name is specified as it would appear in C source code (mangled if C++, etc.). |
228 | 67 .Pp |
68 The dlSyms* functions can be used to iterate over symbols. Note that they are made | |
69 for symbol name lookups, not to get a symbol's address. For that refer to | |
70 .Fn dlFindSymbol . | |
71 .Fn dlSymsInit | |
72 will return a handle (or null pointer on error) to the shared object specified by | |
73 .Ar libPath . | |
74 The returned handle is to be used with the other dlSyms* functions. The handle must be freed with | |
75 .Fn dlSymsCleanup . | |
76 .Fn dlSymsCount | |
77 returns the number of symbols in the shared object, | |
78 .Fn dlSymsName | |
79 and | |
80 .Fn dlSymsNameFromValue | |
81 are used to lookup symbol names using an index or symbol's address, respectively, returning a null pointer on error. The names are returned as they would appear in C source code (mangled if C++, etc.). The address passed to | |
82 .Fn dlSymsNameFromValue | |
83 must point to a loaded symbol. | |
0 | 84 .Sh SEE ALSO |
85 .Xr dyncall 3 , | |
86 .Xr dyncallback 3 | |
93 | 87 and the dyncall manual (available in HTML and PDF format) for more information. |
0 | 88 .Sh AUTHORS |
89 .An "Daniel Adler" Aq dadler@uni-goettingen.de | |
90 .An "Tassilo Philipp" Aq tphilipp@potion-studios.com |