]> git.sesse.net Git - mlt/blobdiff - src/melt/io.c
Initial port to Windows using MinGW.
[mlt] / src / melt / io.c
index 520d74fc0d48b962cd0828c471a5080a7aa2c409..8499a6cbda5dbdb11f3bcc866783299f594b574e 100644 (file)
@@ -27,7 +27,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#ifndef WIN32
 #include <termios.h>
+#endif
 #include <unistd.h>
 #include <sys/time.h>
 
@@ -102,11 +104,13 @@ static int mode = 0;
 
 void term_exit(void)
 {
+#ifndef WIN32
        if ( mode == 1 )
        {
                tcsetattr( 0, TCSANOW, &oldtty );
                mode = 0;
        }
+#endif
 }
 
 /** Init terminal so that we can grab keys without blocking.
@@ -114,6 +118,7 @@ void term_exit(void)
 
 void term_init( )
 {
+#ifndef WIN32
        struct termios tty;
 
        tcgetattr( 0, &tty );
@@ -132,6 +137,7 @@ void term_init( )
        mode = 1;
 
        atexit( term_exit );
+#endif
 }
 
 /** Check for a keypress without blocking infinitely.
@@ -140,6 +146,7 @@ void term_init( )
 
 int term_read( )
 {
+#ifndef WIN32
     int n = 1;
     unsigned char ch;
     struct timeval tv;
@@ -158,6 +165,7 @@ int term_read( )
             return ch;
         return n;
     }
+#endif
     return -1;
 }