Share via


Dlfcn.GetStruct<T>(IntPtr, String) Method

Definition

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

public static T GetStruct<T>(IntPtr handle, string symbol) where T : struct;
static member GetStruct : nativeint * string -> 'T (requires 'T : struct)

Type Parameters

T

Parameters

handle
IntPtr

nativeint

Handle to the dynamic library previously opened with dlopen(String, Int32).

symbol
String

Name of the public symbol in the dynamic library to look up.

Returns

T

The struct from the library, or an empty struct (default(T)) if the symbol couldn't be found.

Applies to