BUILT-IN MATHEMATICA SYMBOL
LibraryFunctionLoad
LibraryFunctionLoad[lib, fun, argtype, rettype]
loads Wolfram Library lib and makes the library function fun available in Mathematica.
- Arguments of LibraryFunctionLoad are:
-
| lib | library to be loaded |
| fun | function name as specified in the library file |
| argtypes | list of argument types |
| rettype | return type |
- Possible argument and return types, and their corresponding C type, include:
-
| True|False | mbool | Boolean |
| _Integer | mint | machine integer |
| _Real | double | machine double |
| _Complex | mcomplex | machine complex double |
| {base,rank} | MTensor | tensor of specified base type and rank |
| "UTF8String" | char* | string in UTF-8 encoding |
| LinkObject | MLINK | arguments and result passed over MathLink |
| "Void" | void | no result (return only) |
- LibraryFunctionLoad returns the LibraryFunction object.
- LibraryFunctionLoad can be called more than once with the same arguments returning the same LibraryFunction object.
- LibraryFunctionLoad uses FindLibrary to locate libraries found on $LibraryPath.
- When a Wolfram Library is loaded, an initialization function in the library is called.
- When a Wolfram Library is unloaded, an uninitialization function in the library is called.
- Libraries loaded by LibraryFunctionLoad run in the same process as the Mathematica kernel.
- Functions in libraries loaded by LibraryFunctionLoad can make callbacks to Mathematica.
- Libraries loaded by LibraryFunctionLoad can share data with the Mathematica kernel.
- LibraryFunctionUnload unloads a LibraryFunction so that it can no longer be used.
- Libraries loaded by LibraryFunctionLoad are unloaded when the Mathematica kernel exits.
- Libraries loaded by LibraryFunctionLoad must be written as a dynamic library for the platform on which they run.
New in 8