cvs server: Diffing .
Index: configure.in
===================================================================
RCS file: /cvsroot/ogle/libdvdread/configure.in,v
retrieving revision 1.22
diff -u -r1.22 configure.in
--- configure.in	2003/03/24 16:07:00	1.22
+++ configure.in	2003/04/18 18:48:40
@@ -15,6 +15,9 @@
     CFLAGS="${CFLAGS} -no-cpp-precomp"
     AC_DEFINE(__DARWIN__, 1, Have a Mac OS X system)
     ;;
+  x*mingw32* | x*cygwin*)
+    CFLAGS="${CFLAGS} -Dssize_t=long"
+    ;;
   x*)
     ;;
 esac
@@ -74,6 +77,11 @@
       [ ],
       AC_MSG_ERROR(You need libdvdcss (dvdcss.h))
     )
+    case "x${host}" in
+    x*mingw32* | x*cygwin*)
+    CSS_LIBS=-ldvdcss
+    ;;
+    x*)
     AC_MSG_CHECKING([for dvdcss_interface_2 in -ldvdcss])
     saved_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -ldvdcss"
@@ -85,6 +93,8 @@
         ] )
     LDFLAGS=$saved_LDFLAGS
     AC_MSG_RESULT([yes])
+    ;;
+    esac
   else
     dnl -w added to shutup GCC3.1's cpp warning about -I/usr/local
     saved_CPPFLAGS=$CPPFLAGS
@@ -96,6 +106,12 @@
     CPPFLAGS=$saved_CPPFLAGS
     saved_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -I$dvdcss_path/include -L$dvdcss_path/lib -ldvdcss"
+    case "x${host}" in
+    x*mingw32* | x*cygwin*)
+    CSS_LIBS="-L$dvdcss_path/lib -R$dvdcss_path/lib -ldvdcss"
+    CSS_CFLAGS=-I$dvdcss_path/include
+    ;;
+    x*)
     AC_MSG_CHECKING([for dvdcss_interface_2 in -ldvdcss])
     AC_TRY_LINK([#include <dvdcss/dvdcss.h>], 
                 [if(!dvdcss_interface_2) { return 1; }],
@@ -106,6 +122,8 @@
         ] )
     CFLAGS=$saved_CFLAGS
     AC_MSG_RESULT([yes])
+    ;;
+    esac
   fi
 fi
 
@@ -122,7 +140,7 @@
 dnl Checks for header files.
 dnl
 AC_CHECK_HEADERS([byteswap.h sys/bswap.h sys/endian.h sys/param.h limits.h])
-
+AC_CHECK_HEADERS([sys/ioctl.h])
 
 AC_C_BIGENDIAN
 AC_C_CONST
cvs server: Diffing dvdread
Index: dvdread/bswap.h
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/bswap.h,v
retrieving revision 1.9
diff -u -r1.9 bswap.h
--- dvdread/bswap.h	2003/03/13 15:33:45	1.9
+++ dvdread/bswap.h	2003/04/18 18:48:40
@@ -77,7 +77,7 @@
  * functionality! 
  */
 
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__)
+#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32)
 #define B2N_16(x) \
  x = ((((x) & 0xff00) >> 8) | \
       (((x) & 0x00ff) << 8))
Index: dvdread/dvd_reader.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/dvd_reader.c,v
retrieving revision 1.30
diff -u -r1.30 dvd_reader.c
--- dvdread/dvd_reader.c	2003/02/13 22:34:37	1.30
+++ dvdread/dvd_reader.c	2003/04/18 18:48:41
@@ -51,6 +51,19 @@
 
 #define DEFAULT_UDF_CACHE_LEVEL 1
 
+#ifdef WIN32
+/* gettimeofday implementation */
+#include <sys/timeb.h>
+int gettimeofday( struct timeval *tv, void *tz )
+{
+  struct timeb t;
+  ftime( &t );
+  tv->tv_sec = t.time;
+  tv->tv_usec = t.millitm * 1000;
+  return 0;
+}
+#endif
+
 struct dvd_reader_s {
     /* Basic information. */
     int isImageFile;
@@ -303,13 +316,23 @@
     if( path == NULL )
       return 0;
 
-    ret = stat( path, &fileinfo );
-    if( ret < 0 ) {
-	/* If we can't stat the file, give up */
-	fprintf( stderr, "libdvdread: Can't stat %s\n", path );
-	perror("");
-	return 0;
+#ifdef WIN32
+    if( path[0] && path[1] == ':' && path[2] == '\0' )
+    {
+        /* Don't try to stat the file */
+        fileinfo.st_mode = S_IFBLK;
     }
+    else
+#endif
+    {
+        ret = stat( path, &fileinfo );
+        if( ret < 0 ) {
+	    /* If we can't stat the file, give up */
+	    fprintf( stderr, "libdvdread: Can't stat %s\n", path );
+	    perror("");
+	    return 0;
+	}
+    }
 
     /* Try to open libdvdcss or fall back to standard functions */
     have_css = dvdinput_setup();
@@ -342,6 +365,7 @@
 	/* XXX: We should scream real loud here. */
 	if( !(path_copy = strdup( path ) ) ) return 0;
 
+#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
 	/* Resolve any symlinks and get the absolut dir name. */
 	{
 	    char *new_path;
@@ -358,6 +382,7 @@
 		}
 	    }
 	}
+#endif
 	
 	/**
 	 * If we're being asked to open a directory, check if that directory
Index: dvdread/dvd_udf.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/dvd_udf.c,v
retrieving revision 1.13
diff -u -r1.13 dvd_udf.c
--- dvdread/dvd_udf.c	2003/02/13 22:06:55	1.13
+++ dvdread/dvd_udf.c	2003/04/18 18:48:41
@@ -33,11 +33,20 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#if defined(HAVE_SYS_IOCTL_H)
 #include <sys/ioctl.h>
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+
+#if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include "dvd_reader.h"
 #include "dvd_udf.h"
Index: dvdread/dvd_udf.h
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/dvd_udf.h,v
retrieving revision 1.8
diff -u -r1.8 dvd_udf.h
--- dvdread/dvd_udf.h	2003/01/22 12:25:46	1.8
+++ dvdread/dvd_udf.h	2003/04/18 18:48:41
@@ -31,7 +31,11 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+#if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include "dvd_reader.h"
 
Index: dvdread/ifo_print.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/ifo_print.c,v
retrieving revision 1.17
diff -u -r1.17 ifo_print.c
--- dvdread/ifo_print.c	2003/02/13 22:09:02	1.17
+++ dvdread/ifo_print.c	2003/04/18 18:48:42
@@ -23,9 +23,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <inttypes.h>
 #include <string.h>
 #include <ctype.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include "ifo_types.h"
 #include "ifo_read.h"
Index: dvdread/ifo_read.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/ifo_read.c,v
retrieving revision 1.23
diff -u -r1.23 ifo_read.c
--- dvdread/ifo_read.c	2003/01/17 21:31:50	1.23
+++ dvdread/ifo_read.c	2003/04/18 18:48:43
@@ -22,7 +22,13 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+
+#if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
+
 #include <string.h>
 
 #include "bswap.h"
Index: dvdread/ifo_types.h
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/ifo_types.h,v
retrieving revision 1.11
diff -u -r1.11 ifo_types.h
--- dvdread/ifo_types.h	2003/01/17 21:31:50	1.11
+++ dvdread/ifo_types.h	2003/04/18 18:48:43
@@ -20,7 +20,12 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
+
 #include <dvdread/dvd_reader.h>
 
 
Index: dvdread/nav_print.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/nav_print.c,v
retrieving revision 1.5
diff -u -r1.5 nav_print.c
--- dvdread/nav_print.c	2003/01/06 20:13:07	1.5
+++ dvdread/nav_print.c	2003/04/18 18:48:43
@@ -26,7 +26,12 @@
 #include "config.h"
 
 #include <stdio.h>
+
+#if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include "nav_types.h"
 #include "nav_print.h"
Index: dvdread/nav_read.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/nav_read.c,v
retrieving revision 1.9
diff -u -r1.9 nav_read.c
--- dvdread/nav_read.c	2003/01/06 20:13:07	1.9
+++ dvdread/nav_read.c	2003/04/18 18:48:43
@@ -20,7 +20,11 @@
 
 #include <stdio.h>
 #include <string.h>
+#if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include "bswap.h"
 #include "nav_types.h"
Index: dvdread/nav_types.h
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/nav_types.h,v
retrieving revision 1.8
diff -u -r1.8 nav_types.h
--- dvdread/nav_types.h	2003/01/02 20:13:11	1.8
+++ dvdread/nav_types.h	2003/04/18 18:48:43
@@ -29,7 +29,6 @@
  * USA
  */
 
-#include <inttypes.h>
 #include <dvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */
 
 
cvs server: Diffing src
Index: src/disc_id.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/src/disc_id.c,v
retrieving revision 1.2
diff -u -r1.2 disc_id.c
--- src/disc_id.c	2003/01/12 09:33:50	1.2
+++ src/disc_id.c	2003/04/18 18:48:43
@@ -18,9 +18,17 @@
  * USA
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include <dvdread/ifo_print.h>
 
Index: src/ifo_dump.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/src/ifo_dump.c,v
retrieving revision 1.4
diff -u -r1.4 ifo_dump.c
--- src/ifo_dump.c	2003/01/22 00:25:28	1.4
+++ src/ifo_dump.c	2003/04/18 18:48:43
@@ -18,9 +18,17 @@
  * USA
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include <dvdread/ifo_print.h>
 
Index: src/play_title.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/src/play_title.c,v
retrieving revision 1.6
diff -u -r1.6 play_title.c
--- src/play_title.c	2003/01/06 20:13:07	1.6
+++ src/play_title.c	2003/04/18 18:48:44
@@ -16,9 +16,17 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include <dvdread/dvd_reader.h>
 #include <dvdread/ifo_types.h>
Index: src/title_info.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/src/title_info.c,v
retrieving revision 1.3
diff -u -r1.3 title_info.c
--- src/title_info.c	2003/01/06 20:13:07	1.3
+++ src/title_info.c	2003/04/18 18:48:44
@@ -17,7 +17,15 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "config.h"
+
 #include <stdio.h>
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
 
 #include <dvdread/dvd_reader.h>
 #include <dvdread/ifo_types.h>
