2019-01-15 23:29:56 -08:00
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
namespace Efl
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace Eo
|
|
|
|
{
|
2019-01-15 23:29:56 -08:00
|
|
|
|
|
|
|
public partial class FunctionInterop
|
|
|
|
{
|
|
|
|
[DllImport(efl.Libs.Libdl)]
|
2019-03-20 03:26:49 -07:00
|
|
|
private static extern IntPtr dlsym(IntPtr handle, string symbol);
|
|
|
|
|
|
|
|
///<summary>Loads a function pointer from the given module.</summary>
|
|
|
|
///<param name="nativeLibraryHandle">The module containing the function.</param>
|
|
|
|
///<param name="functionName">The name of the function to search for.</param>
|
|
|
|
///<returns>A function pointer that can be used with delegates.</returns>
|
2019-01-15 23:29:56 -08:00
|
|
|
public static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName)
|
|
|
|
{
|
2019-06-27 15:21:28 -07:00
|
|
|
Eina.Log.Debug($"searching {nativeLibraryHandle} for {functionName}");
|
2019-01-15 23:29:56 -08:00
|
|
|
var s = FunctionInterop.dlsym(nativeLibraryHandle, functionName);
|
2019-06-27 15:21:28 -07:00
|
|
|
Eina.Log.Debug($"searching {nativeLibraryHandle} for {functionName}, result {s}");
|
2019-01-15 23:29:56 -08:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|