From 11e09f477480531487cd12b5c107ac1d8352a7a5 Mon Sep 17 00:00:00 2001 From: Joel Stålnacke Date: Sun, 6 Oct 2024 11:25:49 +0300 Subject: Initial commit --- lib/Djup.Native/.gitignore | 2 ++ lib/Djup.Native/Djup.Native.csproj | 27 +++++++++++++++++++++++++++ lib/Djup.Native/LibDjup.cs | 12 ++++++++++++ lib/Djup.Native/Program.cs | 2 ++ 4 files changed, 43 insertions(+) create mode 100644 lib/Djup.Native/.gitignore create mode 100644 lib/Djup.Native/Djup.Native.csproj create mode 100644 lib/Djup.Native/LibDjup.cs create mode 100644 lib/Djup.Native/Program.cs (limited to 'lib/Djup.Native') diff --git a/lib/Djup.Native/.gitignore b/lib/Djup.Native/.gitignore new file mode 100644 index 0000000..c6e49ef --- /dev/null +++ b/lib/Djup.Native/.gitignore @@ -0,0 +1,2 @@ +obj/ +bin/ diff --git a/lib/Djup.Native/Djup.Native.csproj b/lib/Djup.Native/Djup.Native.csproj new file mode 100644 index 0000000..7184efb --- /dev/null +++ b/lib/Djup.Native/Djup.Native.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + + enable + enable + true + + + + runtimes/linux-x64/native/libdjup.so + PreserveNewest + runtimes/linux-x64/native/ + true + + + + + PreserveNewest + + + + + + + diff --git a/lib/Djup.Native/LibDjup.cs b/lib/Djup.Native/LibDjup.cs new file mode 100644 index 0000000..5e6db83 --- /dev/null +++ b/lib/Djup.Native/LibDjup.cs @@ -0,0 +1,12 @@ +using System.Runtime.InteropServices; + +namespace Djup.Native; + +public static partial class LibDjup +{ + const string LibraryName = "djup"; + const string Prefix = "dp_"; + + [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(hello_world))] + public static partial void hello_world(); +} diff --git a/lib/Djup.Native/Program.cs b/lib/Djup.Native/Program.cs new file mode 100644 index 0000000..2667048 --- /dev/null +++ b/lib/Djup.Native/Program.cs @@ -0,0 +1,2 @@ +/*using Djup.Native;*/ +/*LibDjup.hello_world();*/ -- cgit v1.2.3