diff dvd_input.c @ 20:fce16251755c src

Remove all trailing whitespace, patch by Erik Hovland *erik$hovland dot org%
author rathann
date Sat, 06 Sep 2008 21:55:51 +0000
parents 7f7e87bd7536
children 4aa618ae094f
line wrap: on
line diff
--- a/dvd_input.c	Mon Sep 01 21:05:17 2008 +0000
+++ b/dvd_input.c	Sat Sep 06 21:55:51 2008 +0000
@@ -6,7 +6,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -32,7 +32,7 @@
 dvd_input_t (*dvdinput_open)  (const char *);
 int         (*dvdinput_close) (dvd_input_t);
 int         (*dvdinput_seek)  (dvd_input_t, int);
-int         (*dvdinput_title) (dvd_input_t, int); 
+int         (*dvdinput_title) (dvd_input_t, int);
 int         (*dvdinput_read)  (dvd_input_t, void *, int, int);
 char *      (*dvdinput_error) (dvd_input_t);
 
@@ -59,7 +59,7 @@
 static dvdcss_handle (*DVDcss_open)  (const char *);
 static int           (*DVDcss_close) (dvdcss_handle);
 static int           (*DVDcss_seek)  (dvdcss_handle, int, int);
-static int           (*DVDcss_title) (dvdcss_handle, int); 
+static int           (*DVDcss_title) (dvdcss_handle, int);
 static int           (*DVDcss_read)  (dvdcss_handle, void *, int, int);
 static char *        (*DVDcss_error) (dvdcss_handle);
 #endif
@@ -68,7 +68,7 @@
 struct dvd_input_s {
   /* libdvdcss handle */
   dvdcss_handle dvdcss;
-  
+
   /* dummy file input */
   int fd;
 };
@@ -80,14 +80,14 @@
 static dvd_input_t css_open(const char *target)
 {
   dvd_input_t dev;
-    
+
   /* Allocate the handle structure */
   dev = (dvd_input_t) malloc(sizeof(*dev));
   if(dev == NULL) {
     fprintf(stderr, "libdvdread: Could not allocate memory.\n");
     return NULL;
   }
-  
+
   /* Really open it with libdvdcss */
   dev->dvdcss = DVDcss_open(target);
   if(dev->dvdcss == 0) {
@@ -95,7 +95,7 @@
     free(dev);
     return NULL;
   }
-  
+
   return dev;
 }
 
@@ -155,14 +155,14 @@
 static dvd_input_t file_open(const char *target)
 {
   dvd_input_t dev;
-  
+
   /* Allocate the library structure */
   dev = (dvd_input_t) malloc(sizeof(*dev));
   if(dev == NULL) {
     fprintf(stderr, "libdvdread: Could not allocate memory.\n");
     return NULL;
   }
-  
+
   /* Open the device */
 #ifndef WIN32
   dev->fd = open(target, O_RDONLY);
@@ -174,7 +174,7 @@
     free(dev);
     return NULL;
   }
-  
+
   return dev;
 }
 
@@ -217,20 +217,20 @@
 {
   size_t len;
   ssize_t ret;
-  
+
   len = (size_t)blocks * DVD_VIDEO_LB_LEN;
-  
+
   while(len > 0) {
-    
+
     ret = read(dev->fd, buffer, len);
-    
+
     if(ret < 0) {
       /* One of the reads failed, too bad.  We won't even bother
        * returning the reads that went OK, and as in the POSIX spec
        * the file position is left unspecified after a failure. */
       return ret;
     }
-    
+
     if(ret == 0) {
       /* Nothing more to read.  Return all of the whole blocks, if any.
        * Adjust the file position back to the previous block boundary. */
@@ -240,7 +240,7 @@
       /* should have pos % 2048 == 0 */
       return (int) (bytes / DVD_VIDEO_LB_LEN);
     }
-    
+
     len -= ret;
   }
 
@@ -309,11 +309,11 @@
       dlsym(dvdcss_library, U_S "dvdcss_read");
     DVDcss_error = (char* (*)(dvdcss_handle))
       dlsym(dvdcss_library, U_S "dvdcss_error");
-    
+
     dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
 
     if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
-      fprintf(stderr, 
+      fprintf(stderr,
 	      "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
 	      "libdvdread: You should get the latest version from "
 	      "http://www.videolan.org/\n" );
@@ -327,7 +327,7 @@
     }
   }
 #endif /* HAVE_DVDCSS_DVDCSS_H */
-  
+
   if(dvdcss_library != NULL) {
     /*
     char *psz_method = getenv( "DVDCSS_METHOD" );
@@ -337,7 +337,7 @@
     */
     fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
 	    dvdcss_version ? *dvdcss_version : "");
-    
+
     /* libdvdcss wrapper functions */
     dvdinput_open  = css_open;
     dvdinput_close = css_close;
@@ -346,7 +346,7 @@
     dvdinput_read  = css_read;
     dvdinput_error = css_error;
     return 1;
-    
+
   } else {
     fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");