Dlfcn Dlfcn Class

Definition

Provides access to the dynamic linker

public static class Dlfcn
type Dlfcn = class
Inheritance
DlfcnDlfcn

Remarks

The methods in this class are used to access the iOS/macOS dynamic linker. You can use the methods in this class to get a handle to native shared libraries and looking up public symbols from them as well as looking up constants defined in a dynamic library.

You can use dlopen to bring a library into memory and dlclose to close the library and dlerror to diagnose problems with calls to dlopen.

There are various methods exposed to read and write the values of symbols exposed by the dynamic linker. Typically these are used to access global variables from a library.

The GetCGSize, GetDouble, GetFloat, GetIndirect, GetInt32, GetInt64, GetIntPtr, GetNSNumber, GetStringConstant methods can be used to retrieve the value of a global symbol.

The SetArray, SetCGSize, SetDouble, SetFloat, SetInt32, SetInt64, SetIntPtr, SetString can be used to set global symbols to a specified value.

Methods

CachePointer(IntPtr, String, IntPtr*) CachePointer(IntPtr, String, IntPtr*)

Looks up the specified constant symbol in the specified library, and stores it in the specified storage (unless the storage already contains a value, in which case that value is returned)

dlclose(IntPtr) dlclose(IntPtr)

Closes and unloads the native shared library referenced by the handle.

dlerror() dlerror()

Returns a diagnostics message for the last failure when using any of the methods in this class.

dlopen(String, Int32) dlopen(String, Int32)

Loads the specified dynamic library into memory.

dlsym(Dlfcn+RTLD, String) dlsym(Dlfcn+RTLD, String)

Returns the address of the specified symbol in the current process.

dlsym(IntPtr, String) dlsym(IntPtr, String)

Returns the address of the specified symbol in the dynamic library.

GetCGRect(IntPtr, String) GetCGRect(IntPtr, String)

Gets the CGRect value exposed with the given symbol from the dynamic library.

GetCGSize(IntPtr, String) GetCGSize(IntPtr, String)

Gets the CGSize value exposed with the given symbol from the dynamic library.

GetDouble(IntPtr, String) GetDouble(IntPtr, String)

Gets the double value exposed with the given symbol from the dynamic library.

GetFloat(IntPtr, String) GetFloat(IntPtr, String)

Gets the float value exposed with the given symbol from the dynamic library.

GetIndirect(IntPtr, String) GetIndirect(IntPtr, String)

Gets the pointer in memory to the specified symbol.

GetInt32(IntPtr, String) GetInt32(IntPtr, String)

Gets the int value exposed with the given symbol from the dynamic library.

GetInt64(IntPtr, String) GetInt64(IntPtr, String)

Gets the long value exposed with the given symbol from the dynamic library.

GetIntPtr(IntPtr, String) GetIntPtr(IntPtr, String)

Gets the IntPtr value exposed with the given symbol from the dynamic library.

GetNFloat(IntPtr, String) GetNFloat(IntPtr, String)

Gets the nfloat value exposed with the given symbol from the dynamic library.

GetNInt(IntPtr, String) GetNInt(IntPtr, String)

Gets the nint value exposed with the given symbol from the dynamic library.

GetNSNumber(IntPtr, String) GetNSNumber(IntPtr, String)

Gets an NSNumber value exposed with the given symbol from the dynamic library.

GetNUInt(IntPtr, String) GetNUInt(IntPtr, String)

Gets the nuint value exposed with the given symbol from the dynamic library.

GetStringConstant(IntPtr, String) GetStringConstant(IntPtr, String)

Gets the NSString value exposed with the given symbol from the dynamic library.

GetUInt32(IntPtr, String) GetUInt32(IntPtr, String)

Gets the uint value exposed with the given symbol from the dynamic library.

GetUInt64(IntPtr, String) GetUInt64(IntPtr, String)

Gets the ulong value exposed with the given symbol from the dynamic library.

SetArray(IntPtr, String, NSArray) SetArray(IntPtr, String, NSArray)

Sets the specified symbol in the library handle to the specified array value.

SetCGSize(IntPtr, String, CGSize) SetCGSize(IntPtr, String, CGSize)

Gets the CGSize value exposed with the given symbol from the dynamic library.

SetDouble(IntPtr, String, Double) SetDouble(IntPtr, String, Double)

Sets the specified symbol in the library handle to the specified double value.

SetFloat(IntPtr, String, Single) SetFloat(IntPtr, String, Single)

Sets the specified symbol in the library handle to the specified float value.

SetInt32(IntPtr, String, Int32) SetInt32(IntPtr, String, Int32)

Sets the specified symbol in the library handle to the specified int value.

SetInt64(IntPtr, String, Int64) SetInt64(IntPtr, String, Int64)

Sets the specified symbol in the library handle to the specified long value.

SetIntPtr(IntPtr, String, IntPtr) SetIntPtr(IntPtr, String, IntPtr)

Sets the specified symbol in the library handle to the specified IntPtr value.

SetNFloat(IntPtr, String, nfloat) SetNFloat(IntPtr, String, nfloat)

Sets the specified symbol in the library handle to the specified nfloat value.

SetNInt(IntPtr, String, nint) SetNInt(IntPtr, String, nint)

Sets the specified symbol in the library handle to the specified nint value.

SetNUInt(IntPtr, String, nuint) SetNUInt(IntPtr, String, nuint)

Sets the specified symbol in the library handle to the specified nuint value.

SetString(IntPtr, String, NSString) SetString(IntPtr, String, NSString)

Sets the specified symbol in the library handle to the specified string value.

SetString(IntPtr, String, String) SetString(IntPtr, String, String)

Sets the specified symbol in the library handle to the specified string value.

SetUInt32(IntPtr, String, UInt32) SetUInt32(IntPtr, String, UInt32)

Sets the specified symbol in the library handle to the specified uint value.

SetUInt64(IntPtr, String, Int64) SetUInt64(IntPtr, String, Int64)

Sets the specified symbol in the library handle to the specified long value.

SetUInt64(IntPtr, String, UInt64) SetUInt64(IntPtr, String, UInt64)

Sets the specified symbol in the library handle to the specified ulong value.

Applies to