More patches from the pbatard branch.

This commit is contained in:
R. Bernstein
2012-03-04 14:37:07 -05:00
parent 14f6f505ce
commit d0b09d15ef
14 changed files with 58 additions and 138 deletions

View File

@@ -1,4 +1,9 @@
Files in this directory are for compiling with Microsoft Visual C.
They are courtesy of John Oseman (mog).
They are courtesy of John Oseman (mog) and Pete Batard <pete@akeo.ie>.
$Id: README,v 1.1 2004/10/30 14:18:17 rocky Exp $
The extract, driver, iso9660 and udf projects require Visual Studio 2010
or later.
To compile your own project, you will probably need to add the missing/
directory to your include path, as it provides stdint.h, inttypes.h and
unistd.h that provide some of the missing types required by libcdio.

View File

@@ -31,12 +31,19 @@
# include "NtScsi.h"
# include "undocumented.h"
#else
#if defined (__MINGW64__)
# define _NTSRB_ /* Bad things happen if srb.h gets included */
# include <windows.h>
# include <ntddcdrm.h>
# include <ntddscsi.h>
#else
# include <ddk/ntddcdrm.h>
# include <ddk/ntddscsi.h>
#endif
# include <ddk/scsi.h>
#endif
#ifdef WIN32
#if defined (_WIN32)
#include <windows.h>
#endif

View File

@@ -46,7 +46,7 @@
# include <string.h>
#endif
#ifdef HAVE_UNISTD_H // readlink
#ifdef HAVE_UNISTD_H /* readlink */
# include <unistd.h>
#endif

View File

@@ -28,7 +28,9 @@
#include "cdio_assert.h"
#include "portable.h"
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif

View File

@@ -26,7 +26,9 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>

View File

@@ -1,6 +1,4 @@
# $Id: Makefile.am,v 1.18 2008/10/20 01:25:15 rocky Exp $
#
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012
# Rocky Bernstein <rocky@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -135,13 +133,13 @@ libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags) -Wl,--version-script=libiso9660
libiso9660_la_DEPENDENCIES = $(libcdio9660_la_dependencies) libiso9660.la.ver
libiso9660.la.ver: $(libiso9660_la_OBJECTS) $(srcdir)/libiso9660.sym
echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@
objs=`for obj in $(libiso9660_la_OBJECTS); do sed -ne "s/^pic_object='\(.*\)'$$/\1/p" $$obj; done`;
@echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@
@objs=`for obj in $(libiso9660_la_OBJECTS); do sed -ne "s/^pic_object='\(.*\)'$$/\1/p" $$obj; done`; \
if test -n "$$objs" ; then \
nm $${objs} | sed -n -e 's/^.*[ ][ABCDGIRSTW][ABCDGIRSTW]*[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libiso9660.sym; then if test $$first = true; then echo " global:"; first=false; fi; echo " $${symbol};"; fi; done; } >> $@; \
nm $${objs} | sed -n -e 's/^.*[ ][ABCDGIRSTW][ABCDGIRSTW]*[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libiso9660.sym; then :; else if test $$first = true; then echo " local:"; first=false; fi; echo " $${symbol};"; fi; done; } >> $@; \
fi
echo '};' >> $@
@echo '};' >> $@
MOSTLYCLEANFILES = libiso9660.la.ver
else

View File

@@ -34,16 +34,10 @@
# include <sys/stat.h>
#endif
#ifndef HAVE_S_ISLNK
# define S_ISLNK(s) ((void)s,0)
#endif
#ifndef HAVE_S_ISSOCK
# define S_ISSOCK(s) ((void)s,0)
#endif
#include <cdio/iso9660.h>
#include <cdio/logging.h>
#include <cdio/bytesex.h>
#include "filemode.h"
#define CDIO_MKDEV(ma,mi) ((ma)<<16 | (mi))
@@ -112,7 +106,7 @@ realloc_symlink(/*in/out*/ iso9660_stat_t *p_stat, uint8_t i_grow)
#define SETUP_ROCK_RIDGE(DE,CHR,LEN) \
{ \
LEN= sizeof(iso9660_dir_t) + DE->filename_len; \
LEN= sizeof(iso9660_dir_t) + DE->filename.len; \
if(LEN & 1) LEN++; \
CHR = ((unsigned char *) DE) + LEN; \
LEN = *((unsigned char *) DE) - LEN; \
@@ -185,10 +179,10 @@ get_rock_ridge_filename(iso9660_dir_t * p_iso9660_dir,
break;
case SIG('C','E'):
{
iso711_t i_fname = from_711(p_iso9660_dir->filename_len);
if ('\0' == p_iso9660_dir->filename[0] && 1 == i_fname)
iso711_t i_fname = from_711(p_iso9660_dir->filename.len);
if ('\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname)
break;
if ('\1' == p_iso9660_dir->filename[0] && 1 == i_fname)
if ('\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname)
break;
}
CHECK_CE;
@@ -465,7 +459,7 @@ parse_rock_ridge_stat_internal(iso9660_dir_t *p_iso9660_dir,
case SIG('R','E'):
cdio_warn("Attempt to read p_stat for relocated directory");
goto out;
#if FINISHED
#ifdef FINISHED
case SIG('C','L'):
{
iso9660_stat_t * reloc;

View File

@@ -43,6 +43,7 @@ const char ISO_XA_MARKER_STRING[] = {'C', 'D', '-', 'X', 'A', '0', '0', '1'};
/* Private headers */
#include "cdio_assert.h"
#include "filemode.h"
/** The below variable is trickery to force enum symbol values to be
recorded in debug symbol tables. It is used to allow one to refer

View File

@@ -1,7 +1,7 @@
/*
filemode.c -- make a string describing file modes
Copyright (C) 2005, 2008, 2011 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@@ -28,98 +28,7 @@
#endif
#include <cdio/udf.h>
#if !S_IRUSR
# if S_IREAD
# define S_IRUSR S_IREAD
# else
# define S_IRUSR 00400
# endif
#endif
#if !S_IWUSR
# if S_IWRITE
# define S_IWUSR S_IWRITE
# else
# define S_IWUSR 00200
# endif
#endif
#if !S_IXUSR
# if S_IEXEC
# define S_IXUSR S_IEXEC
# else
# define S_IXUSR 00100
# endif
#endif
#if !S_IRGRP
# define S_IRGRP (S_IRUSR >> 3)
#endif
#if !S_IWGRP
# define S_IWGRP (S_IWUSR >> 3)
#endif
#if !S_IXGRP
# define S_IXGRP (S_IXUSR >> 3)
#endif
#if !S_IROTH
# define S_IROTH (S_IRUSR >> 6)
#endif
#if !S_IWOTH
# define S_IWOTH (S_IWUSR >> 6)
#endif
#if !S_IXOTH
# define S_IXOTH (S_IXUSR >> 6)
#endif
#ifdef STAT_MACROS_BROKEN
# undef S_ISBLK
# undef S_ISCHR
# undef S_ISDIR
# undef S_ISFIFO
# undef S_ISLNK
# undef S_ISMPB
# undef S_ISMPC
# undef S_ISNWK
# undef S_ISREG
# undef S_ISSOCK
#endif /* STAT_MACROS_BROKEN. */
#if !defined S_ISBLK && defined S_IFBLK
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#endif
#if !defined S_ISCHR && defined S_IFCHR
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
#if !defined S_ISDIR && defined S_IFDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#if !defined S_ISREG && defined S_IFREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
#if !defined S_ISFIFO && defined S_IFIFO
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#endif
#if !defined S_ISLNK && defined S_IFLNK
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif
#if !defined S_ISSOCK && defined S_IFSOCK
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
#endif
#if !defined S_ISMPB && defined S_IFMPB /* V7 */
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
#endif
#if !defined S_ISNWK && defined S_IFNWK /* HP/UX */
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
#endif
#if !defined S_ISDOOR && defined S_IFDOOR /* Solaris 2.5 and up */
# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)
#endif
#if !defined S_ISCTG && defined S_IFCTG /* MassComp */
# define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)
#endif
#include "filemode.h"
/* Set the 's' and 't' flags in file attributes string CHARS,

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2005, 2006, 2008, 2011 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,13 +31,12 @@
/* Implementation of opaque types */
struct udf_s {
bool b_stream; /* Use stream pointer, else use
p_cdio. */
ssize_t i_position; /* Position in file if positive. */
CdioDataSource_t *stream; /* Stream pointer if stream */
CdIo_t *cdio; /* Cdio pointer if read device */
bool b_stream; /* Use stream pointer, else use p_cdio */
off_t i_position; /* Position in file if positive */
CdioDataSource_t *stream; /* Stream pointer if stream */
CdIo_t *cdio; /* Cdio pointer if read device */
anchor_vol_desc_ptr_t anchor_vol_desc_ptr;
uint32_t pvd_lba; /* sector of Primary Volume Descriptor */
uint32_t pvd_lba; /* sector of Primary Volume Descriptor */
partition_num_t i_partition; /* partition number */
uint32_t i_part_start; /* start of Partition Descriptor */
uint32_t lvd_lba; /* sector of Logical Volume Descriptor */

View File

@@ -99,7 +99,7 @@ struct option
#define optional_argument 2
#if defined (__STDC__) && __STDC__
#ifdef __GNU_LIBRARY__
#if defined (__GNU_LIBRARY__) || defined (__MINGW32__)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */

View File

@@ -1,7 +1,5 @@
/*
$Id: iso-info.c,v 1.40 2008/06/19 15:44:16 flameeyes Exp $
Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2004, 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,21 +30,26 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/bytesex.h>
#include <cdio/cdio.h>
#include <cdio/ds.h>
#include <cdio/iso9660.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <errno.h>
#if 0
#define STRONG "\033[1m"

View File

@@ -23,12 +23,15 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -38,9 +41,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "getopt.h"

View File

@@ -17,11 +17,12 @@
/* A program to using the MMC interface to list CD and drive features
from the MMC GET_CONFIGURATION command . */
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#endif
#include "util.h"
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -34,7 +35,6 @@
#include <cdio/cdio.h>
#include <cdio/mmc.h>
#include <cdio/mmc_cmds.h>
#include "util.h"
#include "getopt.h"
static void