Reference
Wolfram LibraryLink allows dynamic libraries to be directly loaded into the Wolfram Language kernel so that functions in the libraries can be immediately called from the Wolfram Language. You can exchange not only C-like data types such as integers, reals, packed arrays, and strings, but also arbitrary Wolfram Language expressions. In addition, there are useful functions such as sending errors and calling back to the Wolfram Language.
This section summarizes the functionality.
Wolfram Language Functions
This section summarizes the functions used to interact with Wolfram Libraries from the Wolfram Language.
LibraryFunctionLoad | load a function from a library |
LibraryFunction | representation of a handle to a function loaded from a library |
LibraryFunctionUnload | unload a function that was previously loaded from a library |
LibraryUnload | unload all functions previously loaded from a library |
Wolfram Language functions for loading and unloading functions from Wolfram Libraries.
LibraryFunctionInformation | returns information about a LibraryFunction |
Wolfram Language function for getting information about a function loaded from a Wolfram Library.
$LibraryPath | the path used to find libraries |
FindLibrary | find a library on the library path |
Wolfram Language functions for locating Wolfram Libraries.
LibraryLoad | load a library without calling any functions |
Wolfram Language function for loading a library to resolve dependencies.
CreateManagedLibraryExpression | create an expression that may be associated with library data |
ManagedLibraryExpressionQ | test if an expression is a managed library expression |
ManagedLibraryExpressionID | give the positive integer ID associated with a managed library expression |
Wolfram Language functions for managed library expressions.
$LibraryError | system-dependent errors from loading libraries |
LibraryVersionInformation | rules containing information about the version of a library |
LibraryVersionString | a string of library version information |
Wolfram Language functions in the LibraryLink` package.
Library Callback Functions
This section summarizes C language callback functions used to implement libraries.
MTensor_new | create a new MTensor |
MTensor_free | free an MTensor |
MTensor_disown | allow a shared MTensor to be freed |
MTensor_disownAll | allow all shared MTensors to be freed |
MTensor_clone | copy an MTensor |
Callback functions for creating and freeing an MTensor.
MTensor_getRank | get the rank of an MTensor |
MTensor_getDimensions | get the dimensions of an MTensor |
MTensor_getFlattenedLength | get the number of elements of an MTensor |
MTensor_getType | get the type of an MTensor |
Callback functions for getting structural information from an MTensor.
MTensor_getInteger | get an element from an MTensor of integers |
MTensor_getReal | get an element from an MTensor of reals |
MTensor_getComplex | get an element from an MTensor of complex numbers |
MTensor_getMTensor | get an MTensor sub-part from an MTensor |
MTensor_getIntegerData | get the data of an integer MTensor |
MTensor_getRealData | get the data of a real MTensor |
MTensor_getComplexData | get the data of a complex MTensor |
Callback functions for getting elements from an MTensor.
MTensor_setInteger | set an element in an MTensor of integers |
MTensor_setReal | set an element in an MTensor of reals |
MTensor_setComplex | set an element in an MTensor of complex numbers |
MTensor_setMTensor | set an MTensor subpart in an MTensor |
Callback functions for setting elements in an MTensor.
Callback functions for handling errors in library functions.
UTF8String_disown | called when a string argument is no longer used |
Callback functions for working with strings.
getWSLINK | set the error handling buffer |
processWSLINK | send a message in the Wolfram Language |
Callback functions for using WSTP in a library function.
registerLibraryExpressionManager | register a library expression manager |
unregisterLibraryExpressionManager | unregister a library expression manager |
releaseManagedLibraryExpression | release a managed library expression |
Callback functions for managed library expressions.
registerLibraryCallbackManager | register a library callback manager |
unregisterLibraryCallbackManager | unregister a library callback manager |
callLibraryCallbackFunction | call a connected library callback function |
releaseLibraryCallbackFunction | release a library callback function |
Callback functions for library callback functions.
MSparseArray_fromExplicitPositions | create a new MSparseArray from specified positions and values |
MSparseArray_fromMTensor | create a new MSparseArray from an MTensor |
MSparseArray_clone | copy an MSparseArray |
MSparseArray_free | free an MSparseArray |
MSparseArray_disown | allow a shared MSparseArray to be freed |
MSparseArray_disownAll | allow all shared MSparseArrays to be freed |
Callback functions for creating and freeing an MSparseArray.
MSparseArray_getRank | get the rank of an MSparseArray |
MSparseArray_getDimensions | get the dimensions of an MSparseArray |
MSparseArray_getExplicitPositions | get the positions with explicit values from an MSparseArray |
MSparseArray_getColumnIndices | get the column indices from an MSparseArray |
MSparseArray_getRowPointers | get the row pointer array from an MSparseArray |
Callback functions for getting structural information from an MSparseArray.
MSparseArray_getExplicitValues | get the values corresponding to the explicitly specified positions from an MSparseArray |
MSparseArray_getImplicitValue | get the value used for positions not explicitly specified from an MSparseArray |
Callback functions for getting values from an MSparseArray.
MSparseArray_toMTensor | convert from an MSparseArray to an ordinary MTensor |
MSparseArray_resetImplicitValue | reset the implicit value and recompute which positions are explicitly stored in an MSparseArray |
Callback functions for converting MSparseArrays.
MNumericArray_new | create a new MNumericArray |
MNumericArray_free | free an MNumericArray |
MNumericArray_disown | allow a shared MNumericArray to be freed |
MNumericArray_disownAll | allow all shared MNumericArrays to be freed |
MNumericArray_clone | copy an MNumericArray |
MNumericArray_shareCount | get the number of shared references to MNumericArrays |
Callback functions for creating and freeing an MNumericArray.
MNumericArray_getRank | get the rank of an MNumericArray |
MNumericArray_getDimensions | get the dimensions of an MNumericArray |
MNumericArray_getFlattenedLength | get the number of elements of an MNumericArray |
MNumericArray_getType | get the type of an MNumericArray |
Callback functions for getting structural information from an MNumericArray.
MNumericArray_getData | get the data from an MNumericArray |
Callback function for getting elements from an MNumericArray.
MNumericArray_convertType | converts the data type of an MNumericArray |
Callback function for converting the type of an MNumericArray.
MImage_new2D | create a new 2D MImage |
MImage_new3D | create a new 3D MImage |
MImage_free | free an MImage |
MImage_disown | allow a shared MImage to be freed |
MImage_disownAll | allow all shared MImages to be freed |
MImage_clone | copy an MImage |
MImage_shareCount | get the number of shared references to MImages |
Callback functions for creating and freeing an MImage.
MImage_getDataType | get the data type of an MImage |
MImage_getRowCount | get the number of rows of an MImage |
MImage_getColumnCount | get the number of columns of an MImage |
MImage_getSliceCount | get the number of slices of an MImage |
MImage_getRank | get the rank of an MImage |
MImage_getChannels | get the number of channels of an MImage |
MImage_alphaChannelQ | test if an MImage has an alpha channel |
MImage_interleavedQ | test if pixels in an MImage are stored in an interleaved manner |
MImage_getColorSpace | get the color space of an MImage |
MImage_getFlattenedLength | get the number of elements of an MImage |
Callback functions for getting structural information from an MImage.
MImage_getBit | get an element from an MImage of type "Bit" |
MImage_getByte | get an element from an MImage of type "Byte" |
MImage_getBit16 | get an element from an MImage of type "Bit16" |
MImage_getReal32 | get an element from an MImage of type "Real32" |
MImage_getReal | get an element from an MImage of type "Real64" |
MImage_getRawData | get the data of a an MImage |
MImage_getBitData | get the data of a "Bit" MImage |
MImage_getByteData | get the data of a "Byte" MImage |
MImage_getBit16Data | get the data of a "Bit16" MImage |
MImage_getReal32Data | get the data of a "Real32" MImage |
MImage_getRealData | get the data of a "Real64" MImage |
Callback functions for getting elements from an MImage.
MImage_setBit | set an element in an MImage of type "Bit" |
MImage_setByte | set an element in an MImage of type "Byte" |
MImage_setBit16 | set an element in an MImage of type "Bit16" |
MImage_setReal32 | set an element in an MImage of type "Real32" |
MImage_setReal | set an element in an MImage of type "Real64" |
Callback functions for setting elements in an MImage.
MImage_convertType | converts the data type of an MImage |