<< configuremsvc | Dynamic link | dlclose >> |
[x1, ... , xN] = dlcall(dlsym_handle, arg1, ..., argN) |
a dlsym handle.
input arguments.
output values.
dlcall calls an external C or Fortran function loaded from an shared library.
dlcall validates input argument types before calling based on dlsym handle definition.
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);
Call C getpid function
run([modulepath('dynamic_link'), '/examples/call_c.m']);
Call fortran DASUM (blas) function
run([modulepath('dynamic_link'), '/examples/call_fortran.m']);
dlsym, C/Nelson equivalent data types.
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET