Mercurial > pub > dyncall > bindings
annotate R/scratch/dynamic_loading.R @ 34:2682a627168c
- breaking changes:
* restrict 'Z' conversions to immutable types
* restrict 'p' to mutable types (and handles)
author | Tassilo Philipp |
---|---|
date | Sun, 12 Apr 2020 19:37:37 +0200 |
parents | 0cfcc391201f |
children |
rev | line source |
---|---|
0 | 1 # |
2 # GOAL: | |
3 # automatic unloading when all symbols from a library are free'ed. | |
4 # | |
5 # | |
6 # | |
7 # loading a shared library | |
8 | |
9 # low-level R | |
10 x <- dyn.load("/lib/libc.so.6") | |
11 handle <- x[["handle"]] | |
12 | |
13 | |
14 | |
15 | |
16 # high-level R in conjunction with R packages | |
17 library.dynam() | |
18 | |
19 prot = library | |
20 R_MakeExternalPtr(addr, tag, prot) | |
21 | |
22 | |
23 | |
24 | |
25 x <- .dynload("/lib/libc.so.6") | |
26 y <- .dynsym(x, "glBegin") | |
27 |