2019-10-24 06:01:50 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2019 by its authors. See AUTHORS.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
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
|
|
|
|
2019-10-17 10:36:15 -07:00
|
|
|
public static partial class FunctionInterop
|
2019-01-15 23:29:56 -08:00
|
|
|
{
|
|
|
|
[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
|
|
|
}
|
|
|
|
|
|
|
|
}
|