checkpoint

This commit is contained in:
2020-04-30 17:27:50 -04:00
parent 9bc522180d
commit 9aa367e9f5
16 changed files with 176 additions and 98 deletions

View File

@@ -5,29 +5,5 @@ namespace Foodsoft.Alpm
public static class API
{
public static readonly string Version = alpm.alpm_version();
internal static void WrapError(SafeAlpmHandle h, Func<int> f)
{
var err = f();
if (err != 0)
{
throw new AlpmException(h);
}
}
/*
* Handles the pattern where <0 is exceptional, but 1 is some "false"
* condition.
*/
internal static bool WrapErrorBool(SafeAlpmHandle h, Func<int> f)
{
var err = f();
if (err < 0)
{
throw new AlpmException(h);
}
return err == 0;
}
}
}