win32.c: fill in read_data_blocks (use mmc routine)

iso-info.c: lint cast on output
iso9660.c: deal with struct tm's that don't have gmt_off.
This commit is contained in:
rocky
2005-02-27 20:16:08 +00:00
parent a63bca7440
commit 602be8e5c6
3 changed files with 24 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32.c,v 1.19 2005/02/11 02:18:15 rocky Exp $ $Id: win32.c,v 1.20 2005/02/27 20:16:08 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: win32.c,v 1.19 2005/02/11 02:18:15 rocky Exp $"; static const char _rcsid[] = "$Id: win32.c,v 1.20 2005/02/27 20:16:08 rocky Exp $";
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/sector.h> #include <cdio/sector.h>
@@ -768,6 +768,7 @@ cdio_open_am_win32 (const char *psz_orig_source, const char *psz_access_mode)
_funcs.lseek = NULL; _funcs.lseek = NULL;
_funcs.read = NULL; _funcs.read = NULL;
_funcs.read_audio_sectors = _cdio_read_audio_sectors; _funcs.read_audio_sectors = _cdio_read_audio_sectors;
_funcs.read_data_sectors = read_data_sectors_mmc;
_funcs.read_mode1_sector = _cdio_read_mode1_sector; _funcs.read_mode1_sector = _cdio_read_mode1_sector;
_funcs.read_mode1_sectors = _cdio_read_mode1_sectors; _funcs.read_mode1_sectors = _cdio_read_mode1_sectors;
_funcs.read_mode2_sector = _cdio_read_mode2_sector; _funcs.read_mode2_sector = _cdio_read_mode2_sector;

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.c,v 1.11 2005/02/26 14:58:53 rocky Exp $ $Id: iso9660.c,v 1.12 2005/02/27 20:16:08 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -48,7 +48,7 @@ const char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'};
#include <errno.h> #include <errno.h>
#endif #endif
static const char _rcsid[] = "$Id: iso9660.c,v 1.11 2005/02/26 14:58:53 rocky Exp $"; static const char _rcsid[] = "$Id: iso9660.c,v 1.12 2005/02/27 20:16:08 rocky Exp $";
/* Variables to hold debugger-helping enumerations */ /* Variables to hold debugger-helping enumerations */
enum iso_enum1_s iso_enums1; enum iso_enum1_s iso_enums1;
@@ -135,7 +135,6 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
p_tm->tm_min = idr_date->dt_minute; p_tm->tm_min = idr_date->dt_minute;
p_tm->tm_sec = idr_date->dt_second; p_tm->tm_sec = idr_date->dt_second;
p_tm->tm_isdst = -1; /* information not available */ p_tm->tm_isdst = -1; /* information not available */
#ifdef HAVE_TM_GMTOFF
{ {
time_t t = 0; time_t t = 0;
struct tm *p_temp_tm = localtime(&t); struct tm *p_temp_tm = localtime(&t);
@@ -143,7 +142,23 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
/* Recompute tm_wday and tm_yday via mktime. Also adjust for /* Recompute tm_wday and tm_yday via mktime. Also adjust for
time-zone differences */ time-zone differences */
t = mktime(p_tm); t = mktime(p_tm);
t -= idr_date->dt_gmtoff * (15 * 60) - p_temp_tm->tm_gmtoff; t -= idr_date->dt_gmtoff * (15 * 60);
#ifdef HAVE_TM_GMTOFF
t += p_temp_tm->tm_gmtoff;
#else
{
static bool i_first_time = true;
static time_t gmt_off;
if (i_first_time) {
struct tm tm_local, tm_gmt;
memcpy(&tm_local, localtime(&t), sizeof(struct tm));
memcpy(&tm_gmt , gmtime(&t) , sizeof(struct tm));
gmt_off = mktime(&tm_local) - mktime(&tm_gmt);
i_first_time = false;
}
t += gmt_off;
}
#endif
p_temp_tm = localtime(&t); p_temp_tm = localtime(&t);
@@ -155,7 +170,6 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
memcpy(p_tm, p_temp_tm, sizeof(struct tm)); memcpy(p_tm, p_temp_tm, sizeof(struct tm));
} }
#endif
return true; return true;
} }

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso-info.c,v 1.28 2005/02/21 09:00:53 rocky Exp $ $Id: iso-info.c,v 1.29 2005/02/27 20:16:08 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -227,7 +227,7 @@ print_iso9660_recurse (iso9660_t *p_iso, const char pathname[])
psz_iso_name, translated_name); psz_iso_name, translated_name);
} else } else
if ( strcmp (psz_iso_name, ".") && strcmp (psz_iso_name, "..")) if ( strcmp (psz_iso_name, ".") && strcmp (psz_iso_name, ".."))
printf("%9u %s%s\n", p_statbuf->size, pathname, printf("%9u %s%s\n", (unsigned int) p_statbuf->size, pathname,
yep == p_statbuf->rr.b3_rock yep == p_statbuf->rr.b3_rock
? psz_iso_name : translated_name); ? psz_iso_name : translated_name);
if (p_statbuf->rr.i_symlink) { if (p_statbuf->rr.i_symlink) {