using System;
using System.Runtime.InteropServices;
namespace Math.Gmp.Native
{
///
/// Represents a file stream.
///
///
public struct FILE
{
///
/// File pointer in unmanaged memory.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")]
public IntPtr Value;
///
/// Returns a value indicating whether this instance is equal to a specified object.
///
/// An object to compare with this instance.
/// True if is an instance of FILE and equals the value of this instance; otherwise, False.
public override bool Equals(object obj)
{
if (!(obj is FILE))
return false;
return Equals((FILE)obj);
}
///
/// Returns a value indicating whether this instance is equal to a specified FILE value.
///
/// A FILE value to compare to this instance.
/// True if has the same value as this instance; otherwise, False.
public bool Equals(FILE other)
{
return Value == other.Value;
}
///
/// Returns the hash code for this instance.
///
/// A 32-bit signed integer hash code.
public override int GetHashCode()
{
return Value.GetHashCode();
}
///
/// Gets a value that indicates whether the two argument values are equal.
///
/// A FILE value.
/// A FILE value.
/// True if the two values are equal, and False otherwise.
public static bool operator ==(FILE value1, FILE value2)
{
return value1.Equals(value2);
}
///
/// Gets a value that indicates whether the two argument values are different.
///
/// A FILE value.
/// A FILE value.
/// True if the two FILE are different, and False otherwise.
public static bool operator !=(FILE value1, FILE value2)
{
return !value1.Equals(value2);
}
}
}