This module implements the ability to access symbols from shared libraries. On POSIX this uses the dlsym
mechanism, on Windows LoadLibrary
.
LibHandle = pointer
proc raiseInvalidLibrary(name: cstring) {.noinline, noreturn, raises: [LibraryError], tags: [].}
proc checkedSymAddr(lib: LibHandle; name: cstring): pointer {. raises: [Exception, LibraryError], tags: [RootEffect].}
proc libCandidates(s: string; dest: var seq[string]) {.raises: [], tags: [].}
proc loadLibPattern(pattern: string; global_symbols = false): LibHandle {. raises: [Exception], tags: [RootEffect].}
proc loadLib(path: string; global_symbols = false): LibHandle {.gcsafe, raises: [], tags: [].}
proc loadLib(): LibHandle {.gcsafe, raises: [], tags: [].}
proc unloadLib(lib: LibHandle) {.gcsafe, raises: [], tags: [].}
proc symAddr(lib: LibHandle; name: cstring): pointer {.gcsafe, raises: [], tags: [].}
© 2006–2017 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/dynlib.html