[x1, ... , xN] = dlcall(dlsym_handle, arg1, ..., argN)
| Paramètre | Description |
|---|---|
| dlsym_handle | un handle dlsym. |
| arg1, ..., argN | arguments d'entrée. |
| Paramètre | Description |
|---|---|
| [x1, ... , xN] | valeurs de sortie. |
dlcall appelle une fonction externe C ou Fortran chargée depuis une bibliothèque partagée.
dlcall valide les types des arguments d'entrée avant l'appel, en se basant sur la définition du handle dlsym.
lib = dlopen([modulepath('nelson', 'builtin'), '/libnlsDynamic_link', getdynlibext()]);
V = double([1 2;3 4]);
% C prototype:
% int dynlibTestMultiplyDoubleArrayWithReturn(double *x, int size)
f = dlsym(lib, 'dynlibTestMultiplyDoubleArrayWithReturn', 'int32', {'doublePtr', 'int32'});
[r1, r2] = dlcall(f, V, int32(numel(V)))
delete(f);
delete(lib);
run([modulepath('dynamic_link'), '/examples/call_c.m']);
run([modulepath('dynamic_link'), '/examples/call_fortran.m']);
| Version | Description |
|---|---|
| 1.0.0 | version initiale |