25 lines
594 B
C#
25 lines
594 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Foodsoft.Alpm
|
|
{
|
|
public struct Backup
|
|
{
|
|
public string Name { get; }
|
|
public string Hash { get; }
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
private readonly unsafe struct NativeBackup
|
|
{
|
|
internal readonly sbyte* name;
|
|
internal readonly sbyte* hash;
|
|
}
|
|
|
|
internal unsafe Backup(IntPtr ptr)
|
|
{
|
|
var native = (NativeBackup*) ptr;
|
|
Name = new string(native->name);
|
|
Hash = new string(native->hash);
|
|
}
|
|
}
|
|
} |