iOS Guides | Samples

ObjCRuntime.Dlfcn Class

Provides access to the dynamic linker

See Also: Dlfcn

Syntax

public static class Dlfcn

Remarks

The methods in this class are used to access the iOS/OSX 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.

Requirements

Namespace: ObjCRuntime
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0

The members of ObjCRuntime.Dlfcn are listed below.

See Also: Object

Public Methods

static
CachePointer(IntPtr, String, IntPtr*) : IntPtr
static
dlclose(IntPtr) : Int32
Closes and unloads the native shared library referenced by the handle.
static
dlerror() : String
Returns a diagnostics message for the last failure when using any of the methods in this class.
static
dlopen(String, Int32) : IntPtr
Loads the specified dynamic library into memory.
static
dlsym(Dlfcn+RTLD, String) : IntPtr
Returns the address of the specified symbol in the current process.
static
dlsym(IntPtr, String) : IntPtr
Returns the address of the specified symbol in the dynamic library.
static
GetCGRect(IntPtr, String) : CGRect
static
GetCGSize(IntPtr, String) : CGSize
Gets the CGSize value exposed with the given symbol from the dynamic library.
static
GetDouble(IntPtr, String) : Double
Gets the double value exposed with the given symbol from the dynamic library.
static
GetFloat(IntPtr, String) : Single
Gets the float value exposed with the given symbol from the dynamic library.
static
GetIndirect(IntPtr, String) : IntPtr
Gets the pointer in memory to the specified symbol.
static
GetInt32(IntPtr, String) : Int32
Gets the Int32 value exposed with the given symbol from the dynamic library.
static
GetInt64(IntPtr, String) : Int64
Gets the Int64 value exposed with the given symbol from the dynamic library.
static
GetIntPtr(IntPtr, String) : IntPtr
Gets the IntPtr value exposed with the given symbol from the dynamic library.
static
GetNFloat(IntPtr, String) : nfloat
Gets the System.nfloat value exposed with the given symbol from the dynamic library.
static
GetNInt(IntPtr, String) : nint
Gets the System.nint value exposed with the given symbol from the dynamic library.
static
GetNSNumber(IntPtr, String) : NSNumber
Gets an NSNumber value exposed with the given symbol from the dynamic library.
static
GetNUInt(IntPtr, String) : nuint
Gets the System.nuint value exposed with the given symbol from the dynamic library.
static
GetStringConstant(IntPtr, String) : NSString
Gets the NSString value exposed with the given symbol from the dynamic library.
static
GetUInt32(IntPtr, String) : UInt32
static
GetUInt64(IntPtr, String) : UInt64
static
SetArray(IntPtr, String, NSArray)
Sets the specific symbol in the library handle to point to the passed array.
static
SetCGSize(IntPtr, String, CGSize)
Gets the CGSize value exposed with the given symbol from the dynamic library.
static
SetDouble(IntPtr, String, Double)
Sets the specific symbol in the library handle to contain the specified double value.
static
SetFloat(IntPtr, String, Single)
Sets the specific symbol in the library handle to contain the specified float value.
static
SetInt32(IntPtr, String, Int32)
Sets the specific symbol in the library handle to contain the specified Int32 value.
static
SetInt64(IntPtr, String, Int64)
Sets the specific symbol in the library handle to contain the specified Int64 value.
static
SetIntPtr(IntPtr, String, IntPtr)
Sets the specific symbol in the library handle to contain the specified IntPtr value.
static
SetNFloat(IntPtr, String, nfloat)
static
SetNInt(IntPtr, String, nint)
static
SetNUInt(IntPtr, String, nuint)
static
SetString(IntPtr, String, NSString)
Sets the specific symbol in the library handle to point to the specified string.
static
SetString(IntPtr, String, String)
Sets the specific symbol in the library handle to point to the specified string.
static
SetUInt32(IntPtr, String, UInt32)
static
SetUInt64(IntPtr, String, Int64)
static
SetUInt64(IntPtr, String, UInt64)