8000 GitHub - 3F/Conari at v1.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ Conari Public

🧬 One-touch unmanaged memory, runtime dynamic use of the unmanaged native C/C++ in .NET world, related P/Invoke features, and …

License

Notifications You must be signed in to change notification settings

3F/Conari

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conari

Binder of Unmanaged code for .NET

The Conari represents a flexible platform to work with any exported functions of libraries (a library or executable module). The lightweight and powerful binding from unmanaged code now is much more easier !

Did you know: The LunaRoad project works over Conari.

Build status release-src License NuGet package

Easy to start:

using(IConari c = new ConariL("Library.dll")) {
    // ...
}

Conari is ready for any exported functions via lambda-functions, immediately:

using(var c = new ConariL("Library.dll"))
{
    c.bind<Action<int, int>>("call")(2, 1); 
    double num = c.bind<Func<IntPtr, int, double>>("tonumber")(L, 4);
}

It does not require the creation of any additional delegate. The Conari will do it automatically instead of you.

Just use bind<> methods and have fun !

c.bind<...>("function")

you already may invoke it immediately as above:

c.bind<Action<int, string>>("set")(-1, "Hello from Conari !");

or later:

var set = c.bind<Action<int, string>>("set");
...
set(-1, "Hello from Conari !");

Lazy loading:

using(var l = new ConariL(
                    new Config("Library.dll") {
                        LazyLoading = true
                    }))
{
    ...
}

Calling Convention:

using(var l = new ConariL("Library.dll", CallingConvention.Cdecl))
{
    //...
    l.Convention = CallingConvention.StdCall;
}

Additional types:

size_t len;
CharPtr name = c.bind<FuncOut3<int, size_t, IntPtr>>("to")(1, out len);
...
string myName += name; // (IntPtr)name; .Raw; .Ansi; .Utf8; ...
...
uint_t v = dll.getU(2);

and more ...


License

The MIT License (MIT)

Copyright (c) 2016  Denis Kuzmin <entry.reg@gmail.com>

How to Get

Available variants:

  • NuGet PM: Install-Package Conari
  • GetNuTool: msbuild gnt.core /p:ngpackages="Conari" or gnt /p:ngpackages="Conari"
  • NuGet Commandline: nuget install Conari
  • /releases ( latest )
  • Nightly builds (/artifacts page). But remember: It can be unstable or not work at all. Use this for tests of latest changes.

About

🧬 One-touch unmanaged memory, runtime dynamic use of the unmanaged native C/C++ in .NET world, related P/Invoke features, and …

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

0