dlsym

Loads a C/Fortran symbol for an dynamic library.

📝 Syntax

  • f = dlsym(lib, symbol_name, return_type, params_types)

📥 Input argument

  • lib - a dllib handle.

  • symbolname - a string: symbol to load.

  • return_type - a string: return type of the C/Fortran function.

  • params_types - a cell of strings: arguments using a special syntax with differents data types.

📤 Output argument

  • f - a dlsym handle.

📄 Description

dlsym retrieves the address of an exported function as an dlsym handle.

ifsymbolname not found, nelson try to find symbol equivalent based on these rules and in this order:

_symbolname

symbolname

symbolname_

_symbolname_

_SYMBOLNAME

SYMBOLNAME

SYMBOLNAME_

_SYMBOLNAME_

symbol name used is available in prototype field of the returned handle.

If multiple symbol names found, an error is raised with possible names.

Warning: Uses wrong datatype definitions a foreign function can terminate unexpectedly.

💡 Examples

Call C getpid function

Call fortran DASUM (blas) function

🔗 See also

dlcall, C/Nelson equivalent data types.

🕔 History

Version
📄 Description

1.0.0

initial version

Last updated

Was this helpful?