Search
lxdream.org :: lxdream/src/gdrom/gdrom.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/gdrom.c
changeset 736:a02d1475ccfd
prev709:18c39a8e504c
next759:f16975739abc
author nkeynes
date Mon Jul 14 07:44:42 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Re-indent everything consistently
Fix include guards for consistency as well
file annotate diff log raw
1.1 --- a/src/gdrom/gdrom.c Wed Jun 25 10:40:45 2008 +0000
1.2 +++ b/src/gdrom/gdrom.c Mon Jul 14 07:44:42 2008 +0000
1.3 @@ -37,13 +37,13 @@
1.4 }
1.5
1.6 gdrom_image_class_t gdrom_image_classes[] = { &cdrom_device_class,
1.7 - &nrg_image_class,
1.8 - &cdi_image_class,
1.9 - &gdi_image_class,
1.10 - NULL };
1.11 + &nrg_image_class,
1.12 + &cdi_image_class,
1.13 + &gdi_image_class,
1.14 + NULL };
1.15
1.16 char *gdrom_mode_names[] = { "Mode 0", "Mode 1", "Mode 2", "Mode 2 Form 1", "Mode 2 Form 2", "Audio",
1.17 - "Mode 2 semiraw", "XA Raw", "Non-XA Raw" };
1.18 + "Mode 2 semiraw", "XA Raw", "Non-XA Raw" };
1.19 uint32_t gdrom_sector_size[] = { 0, 2048, 2336, 2048, 2324, 2352, 2336, 2352, 2352 };
1.20
1.21 gdrom_disc_t gdrom_image_open( const gchar *inFilename )
1.22 @@ -64,7 +64,7 @@
1.23 gchar method[method_len + 1];
1.24 memcpy( method, filename, method_len );
1.25 method[method_len] = '\0';
1.26 -
1.27 +
1.28 if( strcasecmp( method, "file" ) == 0 ) {
1.29 filename = path;
1.30 } else if( strcasecmp( method, "dvd" ) == 0 ||
1.31 @@ -76,7 +76,7 @@
1.32 return NULL;
1.33 }
1.34 }
1.35 -
1.36 +
1.37 fd = open( filename, O_RDONLY | O_NONBLOCK );
1.38 if( fd == -1 ) {
1.39 return NULL;
1.40 @@ -87,31 +87,31 @@
1.41
1.42 /* try extensions */
1.43 if( ext != NULL ) {
1.44 - ext++; /* Skip the '.' */
1.45 - for( i=0; gdrom_image_classes[i] != NULL; i++ ) {
1.46 - if( gdrom_image_classes[i]->extension != NULL &&
1.47 - strcasecmp( gdrom_image_classes[i]->extension, ext ) == 0 ) {
1.48 - extclz = gdrom_image_classes[i];
1.49 - if( extclz->is_valid_file(f) ) {
1.50 - disc = extclz->open_image_file(filename, f);
1.51 - if( disc != NULL )
1.52 - return disc;
1.53 - }
1.54 - break;
1.55 - }
1.56 - }
1.57 + ext++; /* Skip the '.' */
1.58 + for( i=0; gdrom_image_classes[i] != NULL; i++ ) {
1.59 + if( gdrom_image_classes[i]->extension != NULL &&
1.60 + strcasecmp( gdrom_image_classes[i]->extension, ext ) == 0 ) {
1.61 + extclz = gdrom_image_classes[i];
1.62 + if( extclz->is_valid_file(f) ) {
1.63 + disc = extclz->open_image_file(filename, f);
1.64 + if( disc != NULL )
1.65 + return disc;
1.66 + }
1.67 + break;
1.68 + }
1.69 + }
1.70 }
1.71
1.72 /* Okay, fall back to magic */
1.73 gboolean recognized = FALSE;
1.74 for( i=0; gdrom_image_classes[i] != NULL; i++ ) {
1.75 - if( gdrom_image_classes[i] != extclz &&
1.76 - gdrom_image_classes[i]->is_valid_file(f) ) {
1.77 - recognized = TRUE;
1.78 - disc = gdrom_image_classes[i]->open_image_file(filename, f);
1.79 - if( disc != NULL )
1.80 - return disc;
1.81 - }
1.82 + if( gdrom_image_classes[i] != extclz &&
1.83 + gdrom_image_classes[i]->is_valid_file(f) ) {
1.84 + recognized = TRUE;
1.85 + disc = gdrom_image_classes[i]->open_image_file(filename, f);
1.86 + if( disc != NULL )
1.87 + return disc;
1.88 + }
1.89 }
1.90
1.91 fclose(f);
.