From 502e13687bf3d48e2fb7534fa9bc3f5288f1721b Mon Sep 17 00:00:00 2001 From: Wvader <34067397+wvader@users.noreply.github.com> Date: Sat, 5 Nov 2022 16:45:48 +0000 Subject: [PATCH] aug pointer life-cycle --- CodeLiturgy.Augeas/AugeasExtern.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CodeLiturgy.Augeas/AugeasExtern.cs b/CodeLiturgy.Augeas/AugeasExtern.cs index 4c37b61..fded817 100644 --- a/CodeLiturgy.Augeas/AugeasExtern.cs +++ b/CodeLiturgy.Augeas/AugeasExtern.cs @@ -9,6 +9,9 @@ namespace CodeLiturgy.Augeas [SuppressUnmanagedCodeSecurity] public static unsafe partial class AugeasExtern { + [DllImport(_libName)] public static extern IntPtr init_aug( AugSettings settings, int flags); + [DllImport(_libName)] public static extern void close_aug (IntPtr aug); + [DllImport(_libName)] public static extern void free_str (char* str); /// /// Used by DllImport to load the native library /// @@ -20,12 +23,5 @@ namespace CodeLiturgy.Augeas [DllImport(_libName)] public static extern char* get_tree(IntPtr augeas, [MarshalAs(UnmanagedType.LPStr)] string matchPath); [DllImport(_libName)] public static extern void defNode( AugSettings settings, [MarshalAs(UnmanagedType.LPStr)] string matchPath); [DllImport(_libName)] public static extern void load_file(IntPtr augeas, [MarshalAs(UnmanagedType.LPStr)] string filePath); - [DllImport(_libName)] public static extern IntPtr init_aug( AugSettings settings, int flags); - [DllImport(_libName)] public static extern void close_aug (IntPtr aug); - [DllImport(_libName)] public static extern void free_str (char* str); - - - - } }