Merge pull request #2216 from akoeplinger/fix-array-sort
[mono.git] / mcs / class / corlib / System / ConsoleDriver.cs
index 488161e40e9e2374000a5ca673af69bff376a508..cf1faa8da1028708951c04e175ad55a97b9343e2 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if (NET_2_0||BOOTSTRAP_NET_2_0) && !NET_2_1
+#if !NET_2_1
 using System.IO;
 using System.Runtime.CompilerServices;
 
 namespace System {
-       class ConsoleDriver {
+       static class ConsoleDriver {
                internal static IConsoleDriver driver;
                static bool is_console;
                static bool called_isatty;
@@ -177,6 +177,24 @@ namespace System {
                        set { driver.WindowWidth = value; }
                }
 
+               public static bool IsErrorRedirected {
+                       get {
+                               return !Isatty (MonoIO.ConsoleError);
+                       }
+               }
+
+               public static bool IsOutputRedirected {
+                       get {
+                               return !Isatty (MonoIO.ConsoleOutput);
+                       }
+               }
+
+               public static bool IsInputRedirected {
+                       get {
+                               return !Isatty (MonoIO.ConsoleInput);
+                       }
+               }
+
                public static void Beep (int frequency, int duration)
                {
                        driver.Beep (frequency, duration);
@@ -265,7 +283,7 @@ namespace System {
                internal static extern int InternalKeyAvailable (int ms_timeout);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               unsafe internal static extern bool TtySetup (string keypadXmit, string teardown, out byte verase, out byte vsusp, out byte intr, out int *address);
+               unsafe internal static extern bool TtySetup (string keypadXmit, string teardown, out byte [] control_characters, out int *address);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal static extern bool SetEcho (bool wantEcho);