You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
@@ -47,6 +47,12 @@ namespace Mono.Btls
|
||||
[DllImport (MonoBtlsObject.BTLS_DYLIB)]
|
||||
extern static void mono_btls_error_clear_error ();
|
||||
|
||||
[DllImport (MonoBtlsObject.BTLS_DYLIB)]
|
||||
extern static int mono_btls_error_peek_error_line (out IntPtr file, out int line);
|
||||
|
||||
[DllImport (MonoBtlsObject.BTLS_DYLIB)]
|
||||
extern static int mono_btls_error_get_error_line (out IntPtr file, out int line);
|
||||
|
||||
[DllImport (MonoBtlsObject.BTLS_DYLIB)]
|
||||
extern static void mono_btls_error_get_error_string_n (int error, IntPtr buf, int len);
|
||||
|
||||
@@ -78,6 +84,28 @@ namespace Mono.Btls
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public static int PeekError (out string file, out int line)
|
||||
{
|
||||
IntPtr filePtr;
|
||||
var error = mono_btls_error_peek_error_line (out filePtr, out line);
|
||||
if (filePtr != IntPtr.Zero)
|
||||
file = Marshal.PtrToStringAnsi (filePtr);
|
||||
else
|
||||
file = null;
|
||||
return error;
|
||||
}
|
||||
|
||||
public static int GetError (out string file, out int line)
|
||||
{
|
||||
IntPtr filePtr;
|
||||
var error = mono_btls_error_get_error_line (out filePtr, out line);
|
||||
if (filePtr != IntPtr.Zero)
|
||||
file = Marshal.PtrToStringAnsi (filePtr);
|
||||
else
|
||||
file = null;
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user