libfunctions

Return information on functions in shared library

Syntax

  • libfunctions libname
  • m = libfunctions(libname)
  • ___ = libfunctions(___,'-full') example

Description

libfunctions libname displays names of functions defined in library, libname. If you called loadlibrary using the alias option, then you must use the alias name for the libname argument.

m = libfunctions(libname) returns names of functions in cell array m.

example

___ = libfunctions(___,'-full') returns function signatures.

Examples

expand all

Display Function Signatures

Load the example library, shrlibsample, and list the functions.

if not(libisloaded('shrlibsample'))
  addpath(fullfile(matlabroot,'extern','examples','shrlib'))
  loadlibrary('shrlibsample')
end
m = libfunctions('shrlibsample','-full')
m = 

    '[double, doublePtr] addDoubleRef(double, doublePtr, double)'
    'double addMixedTypes(int16, int32, double)'
    '[double, c_structPtr] addStructByRef(c_structPtr)'
    'double addStructFields(c_struct)'
    'c_structPtrPtr allocateStruct(c_structPtrPtr)'
    'voidPtr deallocateStruct(voidPtr)'
    'lib.pointer exportedDoubleValue'
    'lib.pointer getListOfStrings'
    'doublePtr multDoubleArray(doublePtr, int32)'
    '[lib.pointer, doublePtr] multDoubleRef(doublePtr)'
    'int16Ptr multiplyShort(int16Ptr, int32)'
    'doublePtr print2darray(doublePtr, int32)'
    'printExportedDoubleValue'
    'cstring readEnum(Enum1)'
    '[cstring, cstring] stringToUpper(cstring)'

Input Arguments

expand all

libname — Name of shared librarystring

Name of shared library, specified as a string. Do not include the path or file extension in libname.

If you call loadlibrary using the alias option, then you must use the alias name for the libname argument.

Data Types: char

Output Arguments

expand all

m — Function namescell array

Functions names, returned as a cell array.

Limitations

  • Use with libraries that are loaded using the loadlibrary function.

Was this topic helpful?