Sharp.Augeas/CodeLiturgy.Augeas/AugeasExtern.cs

28 lines
1.4 KiB
C#
Raw Normal View History

2022-11-04 03:40:02 +03:00
using System.Numerics;
using System.Runtime.InteropServices;
using System.Security;
2022-11-05 05:07:41 +03:00
using System.Text;
2022-11-04 20:09:06 +03:00
using CodeLiturgy.Augeas.Test;
2022-11-04 03:40:02 +03:00
2022-11-04 20:09:06 +03:00
namespace CodeLiturgy.Augeas
2022-11-04 03:40:02 +03:00
{
[SuppressUnmanagedCodeSecurity]
2022-11-04 20:09:06 +03:00
public static unsafe partial class AugeasExtern
2022-11-04 03:40:02 +03:00
{
2022-11-05 19:45:48 +03:00
[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);
2022-11-04 03:40:02 +03:00
/// <summary>
/// Used by DllImport to load the native library
/// </summary>
2022-11-05 05:07:41 +03:00
private const string _libName = "clAugeas";
2022-11-04 03:40:02 +03:00
/// <summary>Test calling</summary>
2022-11-05 05:07:41 +03:00
[DllImport(_libName)] public static extern void print_preview(IntPtr augeas, [MarshalAs(UnmanagedType.LPStr)] string matchPath);
[DllImport(_libName)] public static extern void print_tree(IntPtr augeas, [MarshalAs(UnmanagedType.LPStr)] string matchPath);
[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);
2022-11-04 03:40:02 +03:00
}
}