pax_global_header00006660000000000000000000000064147405113040014511gustar00rootroot0000000000000052 comment=3922b045fa3dfa7c8e062641ac619a344e23c0a9 libcdio-2.2.0/000077500000000000000000000000001474051130400131175ustar00rootroot00000000000000libcdio-2.2.0/.gitattributes000066400000000000000000000001631474051130400160120ustar00rootroot00000000000000*.sh eol=lf *.ac eol=lf *.am eol=lf *.regex eol=lf config.rpath eol=lf libcdio-2.2.0/.github/000077500000000000000000000000001474051130400144575ustar00rootroot00000000000000libcdio-2.2.0/.github/workflows/000077500000000000000000000000001474051130400165145ustar00rootroot00000000000000libcdio-2.2.0/.github/workflows/macos.yml000066400000000000000000000005231474051130400203410ustar00rootroot00000000000000name: MacOS, gcc on: [push, pull_request] jobs: build-and-test: runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Setup run: brew install automake libtool help2man texinfo - name: Build run: | ./autogen.sh make -j4 - name: Test run: make check libcdio-2.2.0/.github/workflows/mingw.yml000066400000000000000000000012461474051130400203630ustar00rootroot00000000000000name: Windows, MinGW on: [push, pull_request] jobs: build-and-test: runs-on: windows-latest strategy: matrix: include: - { sys: mingw64, env: x86_64 } - { sys: mingw32, env: i686 } defaults: run: shell: msys2 {0} steps: - uses: actions/checkout@v4 - name: Setup uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.sys }} update: true install: >- mingw-w64-${{ matrix.env }}-toolchain base-devel autotools help2man - name: Build run: | ./autogen.sh make -j4 - name: Test run: make check libcdio-2.2.0/.github/workflows/ubuntu.yml000066400000000000000000000005651474051130400205670ustar00rootroot00000000000000name: Linux, gcc on: [push, pull_request] jobs: build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup run: | sudo apt-get update sudo sudo apt-get install -y help2man - name: Build run: | ./autogen.sh make -j4 - name: Test run: make check libcdio-2.2.0/.github/workflows/vs2022.yml000066400000000000000000000010711474051130400201740ustar00rootroot00000000000000name: Windows, VS2022 on: [push, pull_request] env: SOLUTION_FILE_PATH: ./libcdio.sln jobs: build: runs-on: windows-latest strategy: matrix: TARGET_PLATFORM: [x86, x64] BUILD_CONFIGURATION: [Debug, Release] steps: - uses: actions/checkout@v4 - name: Setup uses: microsoft/setup-msbuild@v2 with: msbuild-architecture: x64 - name: Build shell: cmd run: msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ matrix.BUILD_CONFIGURATION }},Platform=${{ matrix.TARGET_PLATFORM }} libcdio-2.2.0/.gitignore000066400000000000000000000006711474051130400151130ustar00rootroot00000000000000*.exe *.lo *.log *.o *.stackdump *.trs *~ .deps .dirstamp /.python-version /ChangeLog /Makefile /Makefile.in /aclocal.m4 /autom4te.cache /compile /config.guess /config.h /config.h.in /config.log /config.rpath /config.status /config.sub /configure /cov-int /depcomp /dist /install-sh /libcdio++.pc /libcdio-* /libcdio.pc /libcdio_cdda.pc /libiso9660++.pc /libiso9660.pc /libtool /libudf.pc /ltmain.sh /m4 /missing /stamp-h1 /test-driver /tmp libcdio-2.2.0/.vs/000077500000000000000000000000001474051130400136255ustar00rootroot00000000000000libcdio-2.2.0/.vs/README.txt000066400000000000000000000002131474051130400153170ustar00rootroot00000000000000Files in this directory are for compiling with Visual Studio 2022. They are courtesy of John Oseman (mog) and Pete Batard . libcdio-2.2.0/.vs/cd-info.vcxproj000066400000000000000000000262321474051130400165660ustar00rootroot00000000000000 Debug Win32 Release Win32 Debug x64 Release x64 17.0 {8E55CFDB-5E38-4A07-84F8-36939C825735} cd-info Win32Proj 10.0 Application v143 Unicode Application v143 Unicode Application v143 Unicode Application v143 Unicode <_ProjectFileVersion>17.0.35527.80 ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ .;..\include;..\lib\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ .;..\include;..\lib\driver $(Configuration)\ $(Configuration)\ true $(Configuration)\ $(Configuration)\ false .;..\include;..\lib\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ .;..\include;..\lib\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions) $(ProjectName)/$(IntDir) $(ProjectName)/$(IntDir)vc70.pdb MultiThreadedDebug true Console libcdio.lib;winmm.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) ..\$(PlatformShortName)\$(Configuration)\libcdio WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions) $(ProjectName)/$(IntDir) $(ProjectName)/$(IntDir)vc70.pdb MultiThreaded ..\$(PlatformShortName)\$(Configuration)\libcdio false Console libcdio.lib;winmm.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) Disabled include;src;lib;lib\XBOX;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Level3 EditAndContinue libcdiod.lib;winmm.lib;%(AdditionalDependencies) $(OutDir)cd-info.exe Debug;%(AdditionalLibraryDirectories) true $(OutDir)cd-info.pdb Console MachineX86 include;src;lib;lib\XBOX;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase libcdio.lib;winmm.lib;%(AdditionalDependencies) $(OutDir)cd-info.exe Release;%(AdditionalLibraryDirectories) true Console true true MachineX86 WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions) MultiThreadedDebug Console true libcdio.lib;winmm.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) ..\$(PlatformShortName)\$(Configuration)\libcdio WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions) MultiThreaded Console false libcdio.lib;winmm.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) ..\$(PlatformShortName)\$(Configuration)\libcdio libcdio-2.2.0/.vs/cd-info.vcxproj.filters000066400000000000000000000021031474051130400202240ustar00rootroot00000000000000 {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hpp;hxx;hm;inl;inc;xsd Source Files Source Files Source Files Source Files Header Files libcdio-2.2.0/.vs/config.h000066400000000000000000000123531474051130400152470ustar00rootroot00000000000000/* config.h for Visual Studio compilation */ /* compiler does lsbf in struct bitfields */ #undef BITFIELD_LSBF /* Define 1 if you are compiling using cygwin */ #undef CYGWIN /* what to put between the brackets for empty arrays */ #define EMPTY_ARRAY_SIZE /* Define 1 if you have BSDI-type CD-ROM support */ #undef HAVE_BSDI_CDROM /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define this if you have libcddb installed */ #undef HAVE_CDDB /* Define to 1 if you have the header file. */ #undef HAVE_COREFOUNDATION_CFBASE_H /* Define 1 if you have Darwin OS X-type CD-ROM support */ #undef HAVE_DARWIN_CDROM /* Define if time.h defines extern long timezone and int daylight vars. */ #undef HAVE_DAYLIGHT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DVD_H /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define 1 if you have FreeBSD CD-ROM support */ #undef HAVE_FREEBSD_CDROM /* Define to 1 if you have the header file. */ #undef HAVE_GLOB_H /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the header file. */ #undef HAVE_IOKIT_IOKITLIB_H /* Supports ISO _Pragma() macro */ #undef HAVE_ISOC99_PRAGMA /* Define 1 if you want ISO-9660 Joliet extension support. You must have also libiconv installed to get Joliet extension support. */ #define HAVE_JOLIET 1 /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define 1 if you have Linux-type CD-ROM support */ #undef HAVE_LINUX_CDROM /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CDROM_H /* Define 1 if timeout is in cdrom_generic_command struct */ #undef HAVE_LINUX_CDROM_TIMEOUT /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VERSION_H /* Define to 1 if you have the `memcpy' function. */ #define HAVE_MEMCPY 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if you have the Windows SCSI layer. */ #define HAVE_NTDDSCSI_H 1 /* Define to 1 if you have the Windows CD-ROM layer. */ #define HAVE_NTDDCDRM_H 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define 1 if you have Solaris CD-ROM support */ #undef HAVE_SOLARIS_CDROM /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CDIO_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if struct tm has the tm_gmtoff member. */ #undef HAVE_TM_GMTOFF /* Define if time.h defines extern extern char *tzname[2] variable */ #undef HAVE_TZNAME /* Define to 1 if you have the `tzset' function. */ #undef HAVE_TZSET /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define this if you have libvcdinfo installed */ #undef HAVE_VCDINFO /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define 1 if you have MinGW CD-ROM support */ #define HAVE_WIN32_CDROM 1 /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define 1 if you are compiling using MinGW */ #undef MINGW32 /* Name of package */ #define PACKAGE "libcdio" /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #define PACKAGE_NAME "libcdio" /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #define PACKAGE_VERSION 1 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #define inline __inline /* Some parts of libcdio reference alloca(), which isn't portable */ #define alloca _alloca libcdio-2.2.0/.vs/libcdio.vcxproj000066400000000000000000000272451474051130400166610ustar00rootroot00000000000000 Debug Win32 Release Win32 Debug x64 Release x64 17.0 {E465056A-C6F3-45EE-B791-CAF8E0CE629D} Win32Proj 10.0 StaticLibrary v143 Unicode StaticLibrary v143 Unicode StaticLibrary v143 Unicode StaticLibrary v143 Unicode <_ProjectFileVersion>17.0.35527.80 .;..\include;..\lib\driver;..\libcdio\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ .;..\include;..\lib\driver;..\libcdio\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ true .;..\include;..\lib\driver;..\libcdio\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ true .;..\include;..\lib\driver;..\libcdio\driver ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ ..\$(PlatformShortName)\$(Configuration)\$(ShortProjectName)\ WIN32;HAVE_CONFIG_H;_CONSOLE;_MBCS;_DEBUG;%(PreprocessorDefinitions) MultiThreadedDebug 4018;4133;4333;4996;28159 powershell.exe -File "$(ProjectDir)set_version.ps1" Create version.h WIN32;HAVE_CONFIG_H;_CONSOLE;_MBCS;NDEBUG;%(PreprocessorDefinitions) MultiThreaded 4018;4133;4333;4996;28159 powershell.exe -File "$(ProjectDir)set_version.ps1" Create version.h Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Use Level3 EditAndContinue $(OutDir)libcdio.exe true $(OutDir)libcdio.pdb Console MachineX86 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug Use Level3 EditAndContinue $(OutDir)libcdio.exe true $(OutDir)libcdio.pdb Console MachineX86 4018;4133;4333;4996;28159 WIN32;HAVE_CONFIG_H;_CONSOLE;_MBCS;_DEBUG;%(PreprocessorDefinitions) MultiThreadedDebug powershell.exe -File "$(ProjectDir)set_version.ps1" Create version.h 4018;4133;4333;4996;28159 WIN32;HAVE_CONFIG_H;_CONSOLE;_MBCS;NDEBUG;%(PreprocessorDefinitions) MultiThreaded powershell.exe -File "$(ProjectDir)set_version.ps1" Create version.h libcdio-2.2.0/.vs/libcdio.vcxproj.filters000066400000000000000000000152731474051130400203260ustar00rootroot00000000000000 {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx {cc097599-3e09-4cd4-a069-68d0dd597158} {bee2bd70-0dcc-4954-8a5b-e586ef41e789} {106ac12b-23f0-4c9a-b538-9639704b3a36} {510a1cd4-e148-44b9-90f5-10f4533eed30} {93e38c63-15b7-48d2-b96b-bcbadf536956} {19906772-b11c-4b29-91f5-742d5e943094} {fe9fd78d-4800-46d3-baa6-00bd3070419b} Source Files\driver\win32 Source Files\driver\win32 Source Files\driver\win32 Source Files\image Source Files\image Source Files\image Source Files\iso9660 Source Files\iso9660 Source Files\iso9660 Source Files\iso9660 Source Files\udf Source Files\udf Source Files\udf Source Files\udf Source Files\udf Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver\mmc Source Files\driver\mmc Source Files\driver\mmc Source Files\driver\mmc Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver Source Files\driver\win32 Source Files\driver\win32 Include Files Include Files libcdio-2.2.0/.vs/set_version.ps1000066400000000000000000000011221474051130400166060ustar00rootroot00000000000000# This PowerShell script creates 'version.h' if not present if (!(Test-Path ..\include\cdio\version.h)) { $VERSION = Select-String -Path ..\configure.ac "^define\(RELEASE_NUM,\s*(.*)\)" | Foreach-Object {$_.Matches.Groups[1].Value} $LIBCDIO_VERSION_NUM = Select-String -Path ..\configure.ac "^LIBCDIO_VERSION_NUM=(.*)" | Foreach-Object {$_.Matches.Groups[1].Value} (Get-Content ..\include\cdio\version.h.in) -replace "@LIBCDIO_VERSION_NUM@", "$LIBCDIO_VERSION_NUM" -replace "@VERSION@", "$VERSION" -replace "@build@", "Windows" | Out-File -FilePath ..\include\cdio\version.h -NoClobber } libcdio-2.2.0/.vs/unistd.h000066400000000000000000000013531474051130400153060ustar00rootroot00000000000000/** * This file has no copyright assigned and is placed in the Public Domain. * This file was originally part of the w64 mingw-runtime package. */ /* Workaround unistd.h for MS compilers */ #ifndef _MSC_VER #error This header should only be used with Microsoft compilers #endif #include #ifndef _UNISTD_H_ #define _UNISTD_H_ /* mode_t is used in the libcdio headers */ #ifndef _MODE_T_DEFINED #define _MODE_T_DEFINED typedef unsigned short mode_t; #endif /* _MODE_T_DEFINED */ /* ssize_t is also not available (copy/paste from MinGW) */ #ifndef _SSIZE_T_DEFINED #define _SSIZE_T_DEFINED #undef ssize_t #ifdef _WIN64 typedef __int64 ssize_t; #else typedef int ssize_t; #endif /* _WIN64 */ #endif /* _SSIZE_T_DEFINED */ #endif libcdio-2.2.0/AUTHORS000066400000000000000000000001051474051130400141630ustar00rootroot00000000000000Herbert Valerio Riedel Rocky Bernstein libcdio-2.2.0/COPYING000066400000000000000000001045131474051130400141560ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . libcdio-2.2.0/ChangeLog-spell-corrected.diff000066400000000000000000002524071474051130400206770ustar00rootroot00000000000000--- ChangeLog 2025-01-01 20:41:58.487111821 -0500 +++ ChangeLog.spell-corrected 2025-01-01 20:58:59.433825699 -0500 @@ -14,7 +14,7 @@ 2024-12-24 Pete Batard * .vs/libcdio.vcxproj, lib/driver/MSWindows/aspi32.c, - lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c: + lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c: Use non widestring API calls for MSVC where required When compiling for MSVC with Unicode enabled, the compiler tries to use widestring API calls unless otherwise specified. So make sure we enforce the use of non widestring (A suffixed) calls when we pass @@ -35,7 +35,7 @@ {MSVC => .vs}/config.h, .vs/libcdio.vcxproj, .vs/libcdio.vcxproj.filters, .vs/set_version.ps1, .vs/unistd.h, MSVC/README, MSVC/cd-info.vcproj, MSVC/libcdio.sln, - MSVC/libcdio.vcproj, Makefile.am, include/cdio/types.h, libcdio.sln: + MSVC/libcdio.vcproj, Makefile.am, include/cdio/types.h, libcdio.sln: Add Visual Studio 2022 project files Move and update the MSVC project files to a .vs/ directory since it gets created by Visual Studio. Also remove the XBox specific configuration. @@ -113,7 +113,7 @@ 2024-05-21 R. Bernstein - * lib/udf/udf_fs.c: Merge mismatch... remove unneded test, when type becomes unsigned + * lib/udf/udf_fs.c: Merge mismatch... remove unneeded test, when type becomes unsigned 2024-05-21 R. Bernstein @@ -283,7 +283,7 @@ * src/cdda-player.c: src/cdda-player.c: always use "%s"-style format for printf()-style functions `ncuses-6.3` added printf-style function attributes and now makes it - easier to catch cases when user input is used in palce of format + easier to catch cases when user input is used in place of format string when built with CFLAGS=-Werror=format-security: cdda-player.c:1032:31: error: format not a string literal and no format arguments [-Werror=format-security] 1032 | mvprintw(i_line++, 0, line); | ^~~~ Let's wrap all the missing places with "%s" format. @@ -596,7 +596,7 @@ 2019-01-14 Thomas Schmitt * src/cd-info.c, test/Makefile.am, test/cdda_4_5.right, - test/check_cue.sh.in, test/data/Makefile.am, test/data/cdda_4_5.cue: + test/check_cue.sh.in, test/data/Makefile.am, test/data/cdda_4_5.cue: Added test about cdda_4_5.cue which checks for proper display of track start number > 1 @@ -768,7 +768,7 @@ * conf9AaqoM/subs.awk, conf9AaqoM/subs1.awk, config_extract.sh, example/read-disc-struct.c, example/read-disc-struct.sh, - test/driver/abs_path.dSYM/Contents/Info.plist: + test/driver/abs_path.dSYM/Contents/Info.plist: fc94b050dcd361b6f18dbef3886384ee520a4d4b 2018-06-05 Pete Batard @@ -835,7 +835,7 @@ 2018-05-18 R. Bernstein - * configure.ac: Remove some obsolte macros + * configure.ac: Remove some obsolete macros 2018-02-16 rocky @@ -910,7 +910,7 @@ 2017-12-20 R. Bernstein - * src/Makefile.am, test/check_common_fn.in, test/driver/realpath.c: + * src/Makefile.am, test/check_common_fn.in, test/driver/realpath.c: Correct realpath for memleaks and MinGW; fix src/Makefile clean target @@ -1022,7 +1022,7 @@ 2017-12-02 R. Bernstein - * example/C++/eject.cpp, example/eject.c, lib/driver/device.c: + * example/C++/eject.cpp, example/eject.c, lib/driver/device.c: Remove memory leak in cdio_eject_media_drive 2017-12-01 R. Bernstein @@ -1164,7 +1164,7 @@ 2017-11-20 R. Bernstein * include/cdio/ds.h, lib/driver/device.c, lib/iso9660/iso9660_fs.c, - test/testisocd.c: Reduce memory leaks... remove depricated things in dh.h Note: a reworking of ds.h is needed to handle data which has alloc + test/testisocd.c: Reduce memory leaks... remove deprecated things in dh.h Note: a reworking of ds.h is needed to handle data which has alloc memory. 2017-11-20 R. Bernstein @@ -1223,7 +1223,7 @@ 2017-11-18 R. Bernstein - * include/cdio/types.h, lib/driver/netbsd.c, src/cdda-player.c: + * include/cdio/types.h, lib/driver/netbsd.c, src/cdda-player.c: NetBSD fixes 2017-11-18 R. Bernstein @@ -1309,7 +1309,7 @@ 2017-09-15 R. Bernstein - * lib/driver/osx.c, test/check_cdtext.sh: (High) Sierra compatiablity... osx.c: Use libcdio version of assert, not OSX's. check_cdtext.sh: + * lib/driver/osx.c, test/check_cdtext.sh: (High) Sierra compatibility... osx.c: Use libcdio version of assert, not OSX's. check_cdtext.sh: return should only be used inside functions 2017-08-25 R. Bernstein @@ -1374,7 +1374,7 @@ 2016-11-20 R. Bernstein - * lib/driver/MSWindows/win32_ioctl.c, lib/iso9660/iso9660_fs.c: + * lib/driver/MSWindows/win32_ioctl.c, lib/iso9660/iso9660_fs.c: Remove minor print cast warnings From Ozkan Sezer 2016-11-20 R. Bernstein @@ -1441,9 +1441,9 @@ 2016-07-11 R. Bernstein - * Makefile.am, lib/driver/abs_path.c, lib/driver/cdio_private.h: - conditional GIT2CL; host stndup replacment GIT2CL only if --maintainer-mode stndump in cdio_private.h for those - systems that don't ahve it Changes suggested by Thomas Schmitt + * Makefile.am, lib/driver/abs_path.c, lib/driver/cdio_private.h: + conditional GIT2CL; host stndup replacement GIT2CL only if --maintainer-mode stndump in cdio_private.h for those + systems that don't have it Changes suggested by Thomas Schmitt 2016-06-04 Leon Merten Lohse @@ -1453,7 +1453,7 @@ 2016-06-03 Leon Merten Lohse * test/Makefile.am, test/cdtext-libburnia.right, test/cdtext.right, - test/check_cdtext.sh, test/data/Makefile.am, test/data/cdtext.cue: + test/check_cdtext.sh, test/data/Makefile.am, test/data/cdtext.cue: Add dedicated unit test for the CD-Text parser Adds a dedicated test script (bash) for the CD-Text parser, using one of the example tools (cdtext-raw) to call libcdio's CD-Text parser and display the fields. Tests are performed for two files, @@ -1469,7 +1469,7 @@ * include/cdio/mmc.h, lib/driver/_cdio_generic.c, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_private.h: Expose mmc_read_cdtext as a publicly - accessable function Removes some redundant error reporting in mmc_read_cdtext (was + accessible function Removes some redundant error reporting in mmc_read_cdtext (was mmc_read_cdtext_private) and make the function public. Also fixes some incorrect lengths for isrc and mcn. @@ -1617,7 +1617,7 @@ 2015-05-26 R. Bernstein * lib/driver/logging.c: Document better the cdio_logv recursion - situtation + situation 2015-05-26 R. Bernstein @@ -1685,7 +1685,7 @@ 2014-10-19 R. Bernstein - * doc/how-to-make-a-release.txt, lib/driver/mmc/mmc_hl_cmds.c: + * doc/how-to-make-a-release.txt, lib/driver/mmc/mmc_hl_cmds.c: mmc_set_drive_speed: GNU/Linux ioctl treats <= 0 as max speed, so we'll do that here as well. Savannah bug #43428 @@ -1713,7 +1713,7 @@ 2014-09-24 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/device.c, - lib/driver/image/bincue.c, lib/driver/mmc/mmc.c, src/cd-drive.c: + lib/driver/image/bincue.c, lib/driver/mmc/mmc.c, src/cd-drive.c: Silence more gcc warnings 2014-09-24 R. Bernstein @@ -1721,7 +1721,7 @@ * NEWS, lib/driver/Makefile.am, lib/driver/mmc/mmc.c, lib/iso9660/Makefile.am, lib/udf/Makefile.am, src/cd-info.c, test/Makefile.am: lib/*/Makefile.am: bump version in preparation of - relase 0.93 test/Makefile.am: add proper dependency on test/example + release 0.93 test/Makefile.am: add proper dependency on test/example NEWS: not coverty work 2014-09-24 R. Bernstein @@ -1815,7 +1815,7 @@ 2014-06-20 R. Bernstein - * example/extract.c, lib/driver/image/bincue.c, src/iso-info.c: + * example/extract.c, lib/driver/image/bincue.c, src/iso-info.c: Reduce coverty-found errors 2014-06-20 R. Bernstein @@ -1855,7 +1855,7 @@ 2014-06-14 enzo1982 - * src/getopt.c, src/getopt.h, src/getopt1.c, src/getopt_int.h: + * src/getopt.c, src/getopt.h, src/getopt1.c, src/getopt_int.h: Updated getopt to the version included with glibc 2.19. 2014-06-14 enzo1982 @@ -2023,7 +2023,7 @@ 2013-12-12 R. Bernstein - * lib/driver/_cdio_generic.c, test/driver/mmc_read.c: + * lib/driver/_cdio_generic.c, test/driver/mmc_read.c: _cdio_generic.c: correct confusing debug message test/driver/mmc_read.c: skip until someone understand what to do here. @@ -2187,7 +2187,7 @@ 2013-10-14 rocky - * include/cdio/udf.h, lib/udf/udf_fs.c: From Pete Batard: * Add udf_get_logical_valume_id to retreive a UDF Logical Volume + * include/cdio/udf.h, lib/udf/udf_fs.c: From Pete Batard: * Add udf_get_logical_valume_id to retrieve a UDF Logical Volume Identifier string * Fix a possible NULL deref in udf_ff_traverse() * Fix comments that were referencing wrong variable names 2013-10-09 R. Bernstein @@ -2305,7 +2305,7 @@ 2013-05-28 Brendan O'Dea * src/cd-drive.help2man, src/cd-info.help2man, - src/cd-read.help2man, src/iso-info.help2man, src/iso-read.help2man: + src/cd-read.help2man, src/iso-info.help2man, src/iso-read.help2man: Fix NAME paragraph in man pages. Closes #39095 2013-05-16 R. Bernstein @@ -2314,7 +2314,7 @@ 2013-05-15 R. Bernstein - * lib/driver/image_common.c: Test whther TOC is init'd and init if + * lib/driver/image_common.c: Test whether TOC is init'd and init if not when asking for track number. 2013-05-15 R. Bernstein @@ -2328,7 +2328,7 @@ test/driver/.gitignore, test/driver/Makefile.am, test/driver/track.c.in, test/testpregap.c.in: lib/driver/track.c: was returning last_track+1 for leadout LSN, Use - CDIO_CROM_LEADOUT_TRACK instaead. ltest/driver/track.c.in: start + CDIO_CROM_LEADOUT_TRACK instead. ltest/driver/track.c.in: start test of lib/driver/track.c. cdda.toc: CDRDAO CD-DA image. Trim blanks off of varousl files. @@ -2409,7 +2409,7 @@ 2012-11-20 R. Bernstein - * doc/libcdio.texi: Try to clearify LBA versus LSN in libcdio. + * doc/libcdio.texi: Try to clarify LBA versus LSN in libcdio. 2012-11-04 R. Bernstein @@ -2580,7 +2580,7 @@ 2012-09-27 R. Bernstein - * configure.ac, test/testisocd2.c.in, test/testpregap.c.in: + * configure.ac, test/testisocd2.c.in, test/testpregap.c.in: Recalculate native_top_srcdir one more time 2012-09-27 rocky @@ -2640,7 +2640,7 @@ * include/cdio/types.h, lib/iso9660/iso9660.c, lib/iso9660/iso9660_private.h: Make bool be 8-bit. Rather switch - than find where in ISO9660 there was a discrepency between stdbool + than find where in ISO9660 there was a discrepancy between stdbool and the type.h definition. 2012-09-23 R. Bernstein @@ -2655,7 +2655,7 @@ * lib/driver/MSWindows/win32_ioctl.c, lib/driver/device.c, lib/driver/disc.c, lib/driver/generic.h, lib/driver/image.h, lib/driver/image/nrg.c, lib/driver/mmc/mmc.c, - lib/driver/mmc/mmc_ll_cmds.c, lib/driver/read.c, lib/driver/track.c: + lib/driver/mmc/mmc_ll_cmds.c, lib/driver/read.c, lib/driver/track.c: Make sure stdbool is used in driver when it is defined. I think this fixes bug #37394 @@ -2682,8 +2682,8 @@ * lib/driver/image/bincue.c, test/driver/mmc_read.c, test/driver/mmc_write.c: image/bincue.c: remove gcc warning. - mmc_read.c, mmc_write.c: use usleep if that's avalable; fall back to - "for" loop if sleep, usleep, and MSwindows Sleep isn't avialable. + mmc_read.c, mmc_write.c: use usleep if that's available; fall back to + "for" loop if sleep, usleep, and MSwindows Sleep isn't available. 2012-04-29 rocky @@ -2843,8 +2843,8 @@ 2012-03-25 R. Bernstein - * example/Makefile.am, lib/driver/gnu_linux.c, lib/driver/track.c: - track.c, gnu_linux.c: Test for exceding max track limit but allow + * example/Makefile.am, lib/driver/gnu_linux.c, lib/driver/track.c: + track.c, gnu_linux.c: Test for exceeding max track limit but allow specifying the leadout track in some cases. Makefile.am: need to build extract unconditionally since that is used in testing @@ -2925,8 +2925,8 @@ 2012-03-25 R. Bernstein - * example/Makefile.am, lib/driver/gnu_linux.c, lib/driver/track.c: - track.c, gnu_linux.c: Test for exceding max track limit but allow + * example/Makefile.am, lib/driver/gnu_linux.c, lib/driver/track.c: + track.c, gnu_linux.c: Test for exceeding max track limit but allow specifying the leadout track in some cases. Makefile.am: need to build extract unconditionally since that is used in testing @@ -3009,7 +3009,7 @@ * example/C++/OO/cdtext.cpp, example/cdtext.c, include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/disc.hpp, include/cdio/cdtext.h, - lib/driver/cdtext.c, lib/driver/libcdio.sym, src/cd-info.c: + lib/driver/cdtext.c, lib/driver/libcdio.sym, src/cd-info.c: [renamed] cdtext_languages_available to cdtext_list_languages [fixed] C++ CD-Text API [fixed] C++ CD-Text example @@ -3113,7 +3113,7 @@ 2012-03-05 Pete Batard - * example/extract.c, lib/driver/utf8.c, lib/iso9660/iso9660_fs.c: + * example/extract.c, lib/driver/utf8.c, lib/iso9660/iso9660_fs.c: Joliet improvements * support discs with more than one secondary volume descriptors * add Joliet support for extract sample * add fallback to non-Joliet if non-Joliet may be longer 2012-03-05 Pete Batard @@ -3274,12 +3274,12 @@ 2012-03-03 R. Bernstein - * lib/driver/MSWindows/win32.c, lib/udf/udf.c, lib/udf/udf_time.c: + * lib/driver/MSWindows/win32.c, lib/udf/udf.c, lib/udf/udf_time.c: More pbatard patches 2012-03-03 R. Bernstein - * lib/driver/portable.h: Forgot to add back in protable.h + * lib/driver/portable.h: Forgot to add back in portable.h 2012-03-03 R. Bernstein @@ -3292,14 +3292,14 @@ 2012-03-03 R. Bernstein - * lib/driver/MSWindows/win32.c: Reduce complation warnings via + * lib/driver/MSWindows/win32.c: Reduce compilation warnings via changes in pbatard branch 2012-03-03 R. Bernstein * lib/driver/MSWindows/aspi32.c, lib/driver/cdtext.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, - lib/driver/mmc/mmc.c: Reduce complation warnings via changes in + lib/driver/mmc/mmc.c: Reduce compilation warnings via changes in pbatard branch 2012-03-03 R. Bernstein @@ -3315,7 +3315,7 @@ 2012-03-03 R. Bernstein - * test/check_common_fn.in, test/check_legal.regex: + * test/check_common_fn.in, test/check_legal.regex: check_legal.regex: allow matching cd-info.exe. check_common_fn.in: don't erase file cd-info_legal.dump if there is an error. @@ -3352,7 +3352,7 @@ 2012-03-03 R. Bernstein - * include/cdio/ecma_167.h, lib/udf/udf_file.c, lib/udf/udf_fs.c: + * include/cdio/ecma_167.h, lib/udf/udf_file.c, lib/udf/udf_fs.c: pbatard flexible array for ecma_167.h header 2012-03-03 R. Bernstein @@ -3412,12 +3412,12 @@ example/isofile2.c, example/isofuzzy.c, example/isolist.c, example/isolsn.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/sample3.c, example/sample4.c, - example/tracks.c, example/udf1.c, example/udf2.c, example/udffile.c: + example/tracks.c, example/udf1.c, example/udf2.c, example/udffile.c: Harmonize source headers: C examples (Patch 4/5) 2012-03-02 R. Bernstein - * lib/iso9660/iso9660_fs.c, test/check_common_fn.in: + * lib/iso9660/iso9660_fs.c, test/check_common_fn.in: check_common_fn.in: show command name when we hit an error 2012-03-02 R. Bernstein @@ -3767,7 +3767,7 @@ 2011-12-05 R. Bernstein - * include/cdio/Makefile.am, src/util.h, test/check_common_fn.in: + * include/cdio/Makefile.am, src/util.h, test/check_common_fn.in: Incorporate patch #7628 for building outside of source tree. Check for locale en-US. @@ -3810,14 +3810,14 @@ 2011-11-27 R. Bernstein - * lib/driver/image/cdrdao.c, test/data/cdda.cue, test/data/vcd2.toc: + * lib/driver/image/cdrdao.c, test/data/cdda.cue, test/data/vcd2.toc: Move a little bit forward in implementing SILENCE in cdrdao. cdrdao tests now work while being a little more strict. 2011-11-25 R. Bernstein * lib/driver/image/cdrdao.c, test/data/Makefile.am: Add Leon Merten - Lohse's cdtext test images. cdrdao.c reduse severity of not finding + Lohse's cdtext test images. cdrdao.c reduce severity of not finding source - may change my mind later about this... 2011-11-25 rocky @@ -3867,7 +3867,7 @@ * configure.ac, include/cdio/device.h, lib/driver/image/cdrdao.c, test/data/Makefile.am, test/data/data5.toc, test/data/data6.toc, - test/data/data7.toc, test/data/t10.toc, test/driver/cdrdao.c.in: + test/data/data7.toc, test/data/t10.toc, test/driver/cdrdao.c.in: Don't error out on handling "NO PRE_EMPHASIS" in cdrdao TOC. Savannah bug #34826: @@ -3928,7 +3928,7 @@ 2011-10-20 R. Bernstein - * include/cdio/Makefile.am, src/cd-paranoia/Makefile.am: + * include/cdio/Makefile.am, src/cd-paranoia/Makefile.am: src/cd-paranoia.h and include/cdio/cdio_config.h are derived files, so don't include them in the distribution. @@ -4010,7 +4010,7 @@ 2011-10-19 R. Bernstein * README.develop, example/sample3.c, include/cdio++/iso9660.hpp, - src/cd-drive.c, src/cd-paranoia/Makefile.am, test/check_legal.regex: + src/cd-drive.c, src/cd-paranoia/Makefile.am, test/check_legal.regex: Remove CVS $Id$ line which is no longer automatically updated. ios9660.hpp under FS because of Solaris macro conflict as suggested by Thomas Schmitt. cd-drive.c: add some casts to remove gcc @@ -4215,7 +4215,7 @@ 2010-11-10 R. Bernstein - * lib/cdda_interface/scan_devices.c: Memoery leak reported in + * lib/cdda_interface/scan_devices.c: Memory leak reported in paranoia-dev. Fix from billy.donahue. 2010-10-26 R. Bernstein @@ -4386,7 +4386,7 @@ 2010-02-08 R. Bernstein * lib/driver/mmc/mmc_cmd_helper.h, lib/driver/mmc/mmc_hl_cmds.c, - lib/driver/mmc/mmc_ll_cmds.c, test/driver/mmc.c: Fix all fo the bugs + lib/driver/mmc/mmc_ll_cmds.c, test/driver/mmc.c: Fix all of the bugs I introduced "improving" the code of others. mmc_ll_cmds.c: mmc_mode_select and mmc_get_configuration now work. mmc_hl_cmds.c: bug introduced by turning a var into a pointer to that variable. @@ -4539,7 +4539,7 @@ 2010-02-03 R. Bernstein - * include/cdio/mmc.h, include/cdio/types.h, lib/driver/gnu_linux.c: + * include/cdio/mmc.h, include/cdio/types.h, lib/driver/gnu_linux.c: Add type definition for SCSI sense data. 2010-02-02 R. Bernstein @@ -4616,7 +4616,7 @@ 2010-01-28 R. Bernstein - * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/bincue.c.in: + * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/bincue.c.in: Regularis some of the mmc Doxygen comments. 2010-01-27 R. Bernstein @@ -4751,7 +4751,7 @@ * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, test/driver/win32.c: Extend win32 test to check - get_arg("mmc-supported?"). Turn ASPI load failer into an info + get_arg("mmc-supported?"). Turn ASPI load failure into an info message 2010-01-18 R. Bernstein @@ -4769,7 +4769,7 @@ * example/cdchange.c, example/paranoia.c, lib/driver/aix.c, lib/driver/image_common.c, lib/driver/netbsd.c, test/driver/gnu_linux.c: driver/*.c: Add response for - get_arg("mmc-supported?") example/*.c: remove compiler wranings. + get_arg("mmc-supported?") example/*.c: remove compiler warnings. 2010-01-17 R. Bernstein @@ -4894,7 +4894,7 @@ 2009-12-31 R. Bernstein - * lib/driver/mmc.c, test/driver/Makefile.am, test/driver/mmc.c: + * lib/driver/mmc.c, test/driver/Makefile.am, test/driver/mmc.c: lib/driver/mmc.c: remove bug in dereferencing NULL pointer. (Found in testing ;-) test/driver/mmc.c: MMC command testing code from Thomas Schmitt. @@ -4916,7 +4916,7 @@ * example/cdtext.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/paranoia.c, - example/paranoia2.c, example/sample4.c, test/testiso9660.c: + example/paranoia2.c, example/sample4.c, test/testiso9660.c: example/* change failures so the record as skipped tests when running 'make check'. @@ -4924,7 +4924,7 @@ * configure.ac, include/cdio/version.h.in, test/Makefile.am, test/driver/.gitignore, test/driver/Makefile.am, test/{testlinux.c - => driver/gnu_linux.c}, test/{testsolaris.c => driver/solaris.c}: + => driver/gnu_linux.c}, test/{testsolaris.c => driver/solaris.c}: Move driver tests into a separate directory. 2009-12-26 WIndows XP @@ -4961,7 +4961,7 @@ 2009-12-25 R. Bernstein - * NEWS, THANKS, lib/driver/gnu_linux.c, lib/driver/solaris.c: + * NEWS, THANKS, lib/driver/gnu_linux.c, lib/driver/solaris.c: Recording and retrieval of SCSI sense reply for GNU/Linux. 2009-12-25 R. Bernstein @@ -5125,12 +5125,12 @@ * config.rpath, lib/driver/FreeBSD/freebsd.c: Perhaps adding a real config.rpath will help some of the iconv problems. Remove a - compiler warning when not compling in FreeBSD. + compiler warning when not compiling in FreeBSD. 2009-10-22 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h: Remove - dupicated code caused by mixup with existing get-media-changed code. + duplicated code caused by mixup with existing get-media-changed code. 2009-10-21 R. Bernstein @@ -5203,7 +5203,7 @@ 2009-05-14 R. Bernstein - * lib/driver/cdtext.c: Guard against dereferncing a null cdtext + * lib/driver/cdtext.c: Guard against dereferencing a null cdtext pointer. 2009-04-23 rocky @@ -5248,7 +5248,7 @@ 2009-04-19 rocky - * .gitignore, example/C++/.gitignore, example/C++/OO/.gitignore: + * .gitignore, example/C++/.gitignore, example/C++/OO/.gitignore: Administrivia 2009-04-05 rocky @@ -5330,7 +5330,7 @@ 2008-12-06 R. Bernstein - * example/.gitignore, lib/driver/.gitignore, test/.gitignore: + * example/.gitignore, lib/driver/.gitignore, test/.gitignore: Resolve conflicted files. 2008-12-06 R. Bernstein @@ -5361,7 +5361,7 @@ src/cd-paranoia/doc/.gitignore, src/cd-paranoia/doc/en/.cvsignore, src/cd-paranoia/doc/en/.gitignore, src/cd-paranoia/doc/ja/.cvsignore, - src/cd-paranoia/doc/ja/.gitignore, test/.cvsignore, test/.gitignore: + src/cd-paranoia/doc/ja/.gitignore, test/.cvsignore, test/.gitignore: Makefile.am: Redo target for ChangeLog to use git2cl. NEWS: Note NetBSD driver added. Reset: git administrivia. @@ -5614,7 +5614,7 @@ since we don't seem to use this at compile time and it fouls up cross compilation. cd-paranoia has tests at run-time. libcdio inherited this from vcdimager which needs it in writing images. It is possible that when - libcdio does writing this may come back. Untill then, simplify. + libcdio does writing this may come back. Until then, simplify. 2008-11-23 R. Bernstein @@ -5767,7 +5767,7 @@ * lib/driver/Makefile.am, lib/driver/gnu_linux.c: Was accessing outside of check2list causing wild looping. Turn all sprintf's to snprintf's and check the return. Turn check1list and check2list looping into a fixed constant number - of iterations rather than rely on a sentinal. + of iterations rather than rely on a sentinel. 2008-06-19 flameeyes @@ -5775,7 +5775,7 @@ src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/pod2c.pl, src/cd-read.c, src/cdda-player.c, - src/iso-info.c, src/iso-read.c, src/mmc-tool.c, test/testparanoia.c: + src/iso-info.c, src/iso-read.c, src/mmc-tool.c, test/testparanoia.c: Mark variables and constant as static in source tools, examples and tests. Also replace some char pointers with char arrays. @@ -5846,7 +5846,7 @@ lib/cdda_interface/scsi_interface.c, lib/cdda_interface/test_interface.c: Make drive exceptions non-static objects that are shared between multiple units. Also - replace the three Dummy functions wth dummy_exception (also common). Bump the revision. This reduces the memory footprint of libcdda_interface of about 200 + replace the three Dummy functions with dummy_exception (also common). Bump the revision. This reduces the memory footprint of libcdda_interface of about 200 bytes. 2008-06-13 flameeyes @@ -5910,7 +5910,7 @@ 2008-05-28 rocky - * include/cdio/iso9660.h, lib/iso9660/iso9660.c, test/testiso9660.c: + * include/cdio/iso9660.h, lib/iso9660/iso9660.c, test/testiso9660.c: iso9660.h: parameter name change to match implementation. iso9660.c: use reentrant version of localtime and gettime (most of the time) Patch from Nicolas Boullis. testiso9660.c: Change a memcmp for a test_compare which gives more @@ -6389,7 +6389,7 @@ 2007-12-28 rocky * NEWS, configure.ac, test/check_cd_read.sh, test/check_cue.sh.in, - test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh: + test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh: Build outside of source fixes for TEST. We're in 0.80 land now. 2007-12-28 rocky @@ -6421,7 +6421,7 @@ * include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c: Run a Multimedia command (MMC) specifying the CDB length. The - motivation here is for example ot use in is an undocumented debug + motivation here is, for example, to use in is an undocumented debug command for LG drives (namely E7), whose length is being miscalculated by mmc_get_cmd_len(); it doesn't follow the usual code number to length conventions. Patch supplied by SukkoPera. @@ -6461,7 +6461,7 @@ 2007-11-16 flameeyes * test/check_cd_read.sh, test/check_cue.sh.in, - test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh: + test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh: check_common_fn is in the current dir (build dir), not in $srcdir. 2007-11-16 flameeyes @@ -6522,7 +6522,7 @@ * NEWS, configure.ac, lib/cdda_interface/Makefile.am, lib/cdio++/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am, - lib/udf/Makefile.am, src/Makefile.am, src/cd-paranoia/Makefile.am: + lib/udf/Makefile.am, src/Makefile.am, src/cd-paranoia/Makefile.am: Remove := in Makefiles for portability. autoconf 1.10 complains about adding AM_PROC_CC_C_O - pander to it. @@ -6580,7 +6580,7 @@ 2007-08-12 rocky * configure.ac, lib/iso9660/iso9660_fs.c, test/.cvsignore, - test/Makefile.am, test/testisocd.c, test/testisocd2.c.in: + test/Makefile.am, test/testisocd.c, test/testisocd2.c.in: iso9660_fs.c: remove some (but not all) of the redundancy testisocd2.c.in: a test of working with an ISO 9660 image. @@ -6602,7 +6602,7 @@ 2007-08-11 flameeyes * lib/driver/osx.c: Workaround a missing callback, failures are - called immediately, sucesses are queued and might not be called + called immediately, successes are queued and might not be called properly. 2007-08-09 flameeyes @@ -6720,7 +6720,7 @@ 2007-03-09 rocky * src/cd-paranoia/doc/en/cd-paranoia.1.in: More potential cdparanoia - -> cd-paranoia changes. Note how this differes from cdparanoia (i.e. + -> cd-paranoia changes. Note how this differs from cdparanoia (i.e. not much). 2007-03-09 rocky @@ -6729,7 +6729,7 @@ 2007-03-07 rocky - * example/cdchange.c, lib/driver/gnu_linux.c: + * example/cdchange.c, lib/driver/gnu_linux.c: lib/driver/gnu_linux.c: bug #19221 (possibly): memory Leak opening an inaccessible device. cdchange.c: a stray character got added to the file @@ -6901,7 +6901,7 @@ * example/.cvsignore, example/Makefile.am, example/mmc3.c, include/cdio/mmc.h, lib/driver/Makefile.am, lib/driver/libcdio.sym, - lib/driver/mmc.c, lib/driver/mmc_private.h, lib/iso9660/Makefile.am: + lib/driver/mmc.c, lib/driver/mmc_private.h, lib/iso9660/Makefile.am: Add routine to get tray status (open/closed) and sample program. Seems broken at least on SuSE 10.1 if not other GNU/Linux's though. @@ -7017,7 +7017,7 @@ 2006-04-15 rocky - * example/C++/Makefile.am, example/C++/isofile.cpp: + * example/C++/Makefile.am, example/C++/isofile.cpp: iso3.cpp->isofile.cpp 2006-04-15 rocky @@ -7042,7 +7042,7 @@ * example/C++/Makefile.am, example/C++/OO/Makefile.am, example/Makefile.am, example/README, example/{iso3.c => isofile.c}, - example/{iso2.c => isofile2.c}, example/{iso1.c => isolist.c}: + example/{iso2.c => isofile2.c}, example/{iso1.c => isolist.c}: iso1.c->isolist.c iso2.c -> isofile2.c iso3.c -> isofile.c 2006-04-15 rocky @@ -7058,7 +7058,7 @@ 2006-04-14 rocky - * lib/driver/libcdio.sym, src/cdda-player.c, src/mmc-tool.c: + * lib/driver/libcdio.sym, src/cdda-player.c, src/mmc-tool.c: libcdio.sym: add mmc_close_tray cdda-player.c, mmc-tool.c: remove possibility of uninitialized return code variables @@ -7155,7 +7155,7 @@ 2006-04-05 rocky - * src/cdda-player.c: Figure out last line from screen paramaters. + * src/cdda-player.c: Figure out last line from screen parameters. (I'm embarrassed it this wasn't put in earlier.) Play *only* if we weren't previously paused or playing. @@ -7178,7 +7178,7 @@ * include/cdio/device.h, include/cdio/mmc.h, lib/driver/MSWindows/win32.c, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc.c, - src/mmc-tool.c: Clarify the difference betweeen speed as it is + src/mmc-tool.c: Clarify the difference between speed as it is defined in the MMC spec and drive unit speeds. Add a new mmc routine for the latter. @@ -7251,7 +7251,7 @@ 2006-03-26 rocky - * include/cdio/cd_types.h, lib/driver/device.c, test/testisocd.c: + * include/cdio/cd_types.h, lib/driver/device.c, test/testisocd.c: Bug in get_drive_types_with_cap: Had wrong boolean logic. 2006-03-26 rocky @@ -7296,7 +7296,7 @@ 2006-03-18 rocky * include/cdio/cdda.h, include/cdio/paranoia.h, - lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: + lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: documentation additions, mostly doxygen. More #defines become enumerations. @@ -7344,7 +7344,7 @@ 2006-03-18 rocky * NEWS, include/cdio/util.h, lib/cdda_interface/utils.c, - lib/driver/gnu_linux.c, lib/driver/util.c, lib/udf/udf_fs.c: + lib/driver/gnu_linux.c, lib/driver/util.c, lib/udf/udf_fs.c: Security: replace all uses of strcat and strcpy with strncat and strncpy @@ -7401,7 +7401,7 @@ 2006-03-17 rocky * lib/iso9660/iso9660.c, test/testiso9660.c: More time corrections - in the presense of timezones, daylight savings time, and + in the presence of timezones, daylight savings time, and HAVE_TM_GMTOFF 2006-03-17 rocky @@ -7417,7 +7417,7 @@ 2006-03-17 rocky - * NEWS, lib/iso9660/iso9660.c, test/testiso9660.c: + * NEWS, lib/iso9660/iso9660.c, test/testiso9660.c: iso9660_get_{l,d}time() anot accounting for the timezone properly. Some other small bugs removed. @@ -7500,7 +7500,7 @@ lib/cdio++/cdio.cpp, lib/cdio++/cdio_stub.cpp, lib/cdio++/iso9660.cpp, lib/cdio++/iso9660_stub.cpp: Move code from devices.hpp and iso9660.hpp headers into external files - cdio.cpp, - device.cpp, iso9660.cpp configure.ac, C++/OO/Makefile.am: Found some bugs libraries acces in + device.cpp, iso9660.cpp configure.ac, C++/OO/Makefile.am: Found some bugs libraries access in doing the above move. 2006-03-07 rocky @@ -7566,7 +7566,7 @@ * example/C++/device.cpp, include/cdio++/cdio.hpp, include/cdio++/device.hpp, include/cdio++/iso9660.hpp, include/cdio/iso9660.h, lib/cdio++/Makefile.am, - lib/cdio++/{stub.cpp => cdio_stub.cpp}, lib/cdio++/iso9660_stub.cpp: + lib/cdio++/{stub.cpp => cdio_stub.cpp}, lib/cdio++/iso9660_stub.cpp: lib/cdio++/Makeifle.am iso9660.hpp iso9660_stub.cpp: start C++ libiso9660 library iso9660.h: documentation changes. device.hpp: reduce number of methods stub.cpp->cdio_stub.cpp @@ -7606,7 +7606,7 @@ 2006-03-02 rocky * example/C++/iso1.cpp, example/iso1.c, example/iso3.c: Some small - changes inspired by correspoinding Perl programs. + changes inspired by corresponding Perl programs. 2006-03-01 rocky @@ -7691,7 +7691,7 @@ 2006-02-18 rocky - * lib/driver/bsdi.c, lib/driver/device.c, lib/driver/osx.c: + * lib/driver/bsdi.c, lib/driver/device.c, lib/driver/osx.c: scsi_mmc_direction_t -> cdio_mmc_direction_t 2006-02-16 rocky @@ -7718,8 +7718,8 @@ 2006-02-13 rocky - * example/.cvsignore, lib/udf/udf_time.c, src/.cvsignore: - udf_time.c: make sure offset is initialzed (Darwin doesn'thave + * example/.cvsignore, lib/udf/udf_time.c, src/.cvsignore: + udf_time.c: make sure offset is initialized (Darwin doesn'thave TIMEZONE var). .cvsignore: add .gdb_history 2006-02-13 rocky @@ -7778,7 +7778,7 @@ 2006-02-02 rocky * example/udf2.c, include/cdio++/cdio.hpp, include/cdio/device.h, - lib/driver/device.c, lib/driver/libcdio.sym: + lib/driver/device.c, lib/driver/libcdio.sym: cdio_driver_return_code_to_str -> cdio_driver_errmsg 2006-02-01 rocky @@ -7792,7 +7792,7 @@ 2006-01-26 rocky - * lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_private.h: + * lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_private.h: Commit some of the temporary UDF stuff. It will either be completed or disabled later. @@ -7903,12 +7903,12 @@ 2006-01-18 rocky - * include/cdio++/device.hpp: Add a default value for drive paramater + * include/cdio++/device.hpp: Add a default value for drive parameter of CloseTray(). 2006-01-18 rocky - * example/C++/OO/eject.cpp: Add close status message. Remove uneeded + * example/C++/OO/eject.cpp: Add close status message. Remove unneeded driver_id parameter. Fix a grammatical mistake. 2006-01-17 rocky @@ -8149,7 +8149,7 @@ 2005-11-07 pjcreath - * lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: + * lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: Cleaned up TRACE_PARANOIA and added some messages for the skip case. 2005-11-07 rocky @@ -8345,7 +8345,7 @@ 2005-10-28 rocky * lib/driver/MSWindows/win32.c: Use MMC routine for reading data - blocks. At leat on XP home it seems to work better than generic read + blocks. At least on XP home, it seems to work better than generic read which is a cooked read. 2005-10-27 rocky @@ -8396,7 +8396,7 @@ 2005-10-25 pjcreath - * configure.ac, example/Makefile.am, src/cd-paranoia/Makefile.am: + * configure.ac, example/Makefile.am, src/cd-paranoia/Makefile.am: Fixed Darwin builds broken by dependency tracking. 2005-10-25 rocky @@ -8426,7 +8426,7 @@ * example/udf1.c, lib/udf/udf_fs.c: Remove memory leak and invalid write references thanks to valgrind. Now lists all files correctly - - at least in the absense of directories under /. + - at least in the absence of directories under /. 2005-10-24 pjcreath @@ -8493,13 +8493,13 @@ 2005-10-23 rocky - * lib/cdda_interface/low_interface.h: Rmove references to external + * lib/cdda_interface/low_interface.h: Remove references to external (SCSI) routines that don't in fact exist. 2005-10-23 rocky * lib/cdda_interface/cddap_interface.c: Patch by Erik Lunchpail to - accomodate systems (e.g. MinGW) that don't have drand48 but have + accommodate systems (e.g. MinGW) that don't have drand48 but have rand. 2005-10-21 rocky @@ -8532,7 +8532,7 @@ 2005-10-21 rocky * include/cdio/mmc.h, lib/driver/gnu_linux.c, - lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h: + lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h: Try to regularize naming better. More mmc_ -> cdio_mmc_ Add more debug variables to be able to get at enum values in a debugger. @@ -8627,7 +8627,7 @@ * include/cdio/ecma_167.h: Shortten some field names, add udf_ prefixes to aid with namespace problem; turn logical volume - descriptor content use into something more useable. + descriptor content use into something more usable. 2005-10-17 rocky @@ -8641,7 +8641,7 @@ 2005-10-16 rocky * include/cdio/ecma_167.h: Datatypes closer to matching terms used - in ECMA 167 spec. Combine/remove duplicate tag identifer + in ECMA 167 spec. Combine/remove duplicate tag identifier definitions. 2005-10-16 rocky @@ -8841,7 +8841,7 @@ 2005-09-21 rocky * example/C++/paranoia.cpp, example/paranoia.c, - include/cdio/cdda.h, include/cdio/paranoia.h, test/testparanoia.c: + include/cdio/cdda.h, include/cdio/paranoia.h, test/testparanoia.c: Move lower-level cdrom_drive_t from paranoia.h into cdda.h This may cause some incompatibilty in applications that did #include without #include As of now it's okay to just #include or include @@ -8883,7 +8883,7 @@ 2005-09-18 rocky * src/cd-info.c, src/cd-read.c: The type of (option) opt needs to be - int not char and this is noticable on ppc where char is unsigned by + int not char and this is noticeable on ppc where char is unsigned by default. Furthermore, poptGetNextOpt() returns an int, not a char. Bug noticed and patch all thanks to Nicolas Boullis. 2005-09-18 rocky @@ -8920,7 +8920,7 @@ 2005-09-16 rocky - * configure.ac, example/C++/Makefile.am, example/Makefile.am: + * configure.ac, example/C++/Makefile.am, example/Makefile.am: configure.ac: make it explicit that --without-cd-paranoia also means without the library If --without-cd-paranoia don't try to build paranoia programs in example and example/C++. Thanks to Elio Blanca for reporting the problems. @@ -9033,7 +9033,7 @@ 2005-07-10 rocky - * README: Note existance and libcdio use in gmerlin and mplayerxp. + * README: Note existence and libcdio use in gmerlin and mplayerxp. 2005-07-09 rocky @@ -9089,7 +9089,7 @@ 2005-06-26 rocky - * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: + * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: cd-paranoia: Add option --mmc-timeout (-m) to set MMC timeout. 2005-06-26 rocky @@ -9249,14 +9249,14 @@ 2005-04-23 rocky * lib/driver/_cdio_generic.c, lib/driver/generic.h, - lib/driver/gnu_linux.c, lib/driver/osx.c, lib/driver/solaris.c: + lib/driver/gnu_linux.c, lib/driver/osx.c, lib/driver/solaris.c: Patch from Burkhard Plaum: 1. In the function is_cdrom_linux(...) in the file lib/driver/gnu_linux.c, the CDROMREADTOCHDR ioctl gets called, which fails when the drive is empty. The CDROM_GET_CAPABILITY ioctl always succeeds for CDrom drives and fails for hard disks etc. 2. For some reason, at least my (GNU/Linux 2.6.10) Kernel fails to open empty drives, when only O_RDONLY is used. Changing the open - flag to O_RDONLY|O_NONBLOCK, the call succeeds also for emtpy + flag to O_RDONLY|O_NONBLOCK, the call succeeds also for empty drives. By the way, the cdrom header file in the kernel says - explicitely, that O_RDONLY|O_NONBLOCK should used whenever a cdrom + explicitly, that O_RDONLY|O_NONBLOCK should used whenever a cdrom is touched. rocky: also made a change to eject to continue even if we can't get the drive status -- which we can't with an empty CD-ROM drive. @@ -9376,7 +9376,7 @@ 2005-03-31 rocky - * src/cdda-player.c: Impliment -l (list tracks). + * src/cdda-player.c: Implement -l (list tracks). 2005-03-29 rocky @@ -9535,7 +9535,7 @@ * lib/driver/_cdio_stream.c, lib/driver/read.c, src/cd-drive.c, src/cd-info.c, src/iso-info.c: src/* gl_default_log_handler defined - only once. lib/dirver/*.c: looks to me like a cosmetic change but + only once. lib/driver/*.c: looks to me like a cosmetic change but supposedly it helps on Fedora Core 4 test1 Bug # 12363: See: http://savannah.gnu.org/bugs/?func=detailitem&item_id=12363 @@ -9636,7 +9636,7 @@ 2005-03-13 rocky * lib/driver/cdio_private.h, lib/driver/osx.c: A hacky OSX close - drive routine. It doesn't handle the actual drive paramater because + drive routine. It doesn't handle the actual drive parameter because we don't really know how to pass that to druti. 2005-03-13 rocky @@ -9751,7 +9751,7 @@ 2005-03-07 rocky * include/cdio/device.h, lib/driver/cdio_private.h, - lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym: + lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym: Start of a working close_tray routine. Add another routines which returns driver id to help reduce driver scans. Reduce unneeded driver scanning my skipping DRIVER_UNKNOWN. @@ -9794,7 +9794,7 @@ 2005-03-06 rocky - * include/cdio/audio.h, lib/driver/audio.c, lib/driver/libcdio.sym: + * include/cdio/audio.h, lib/driver/audio.c, lib/driver/libcdio.sym: Add cdio_audio_get_msf_seconds 2005-03-06 rocky @@ -9824,7 +9824,7 @@ 2005-03-06 rocky - * lib/driver/solaris.c: Don't rely on mmc backward compatability. + * lib/driver/solaris.c: Don't rely on mmc backward compatibility. 2005-03-06 rocky @@ -9838,7 +9838,7 @@ * example/C++/iso1.cpp, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/mmc1.c, example/mmc2.c, include/cdio/ds.h, lib/driver/gnu_linux.c, lib/driver/mmc.c, lib/driver/mmc_private.h, - src/util.c: Don't rely on compatability with 0.72. Use new type + src/util.c: Don't rely on compatibility with 0.72. Use new type names. 2005-03-05 rocky @@ -9892,7 +9892,7 @@ 2005-03-05 rocky * include/cdio/device.h, lib/driver/cdio_private.h, - lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/solaris.c: + lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/solaris.c: get_last_session returns lsn_t not session number. Add get_track_last_session for Solaris. Correct it's play_msf. @@ -10040,7 +10040,7 @@ 2005-03-01 rocky - * lib/driver/_cdio_linux.c, lib/driver/audio.c, src/cd-info.c: + * lib/driver/_cdio_linux.c, lib/driver/audio.c, src/cd-info.c: Corrections to audio. First glimpse at working (on GNU/Linux) audio controls. @@ -10151,7 +10151,7 @@ 2005-02-25 rocky - * lib/driver/_cdio_generic.c, lib/driver/_cdio_osx.c: + * lib/driver/_cdio_generic.c, lib/driver/_cdio_osx.c: _cdio_generic.c: OSX does return CDIO_CDROM_CDI_TRACK. _cdio_osx.c: fixup read_data_blocks. May have to complicate more if we need to make a distinction between Form 1 and Form 2. Revise for current name/variable conventions. @@ -10162,7 +10162,7 @@ 2005-02-24 rocky - * lib/driver/cdtext.c: Guard against deferencing NULL pointer. + * lib/driver/cdtext.c: Guard against dereferencing NULL pointer. 2005-02-24 rocky @@ -10187,7 +10187,7 @@ 2005-02-22 rocky - * lib/iso9660/iso9660.c, test/isofs-m1.right, test/monvoisin.right: + * lib/iso9660/iso9660.c, test/isofs-m1.right, test/monvoisin.right: iso9660_get_dtime hack: we've seen it happen that everything except gmtoff is zero and the expected date is the beginning of the epoch. So we accept 6 numbers being zero. I'm also not sure if using the of @@ -10208,7 +10208,7 @@ * include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/rock.c, src/cd-info.c, src/util.c: Add routine for - extracing ISO 9660 long time format and probably correct the + extracting ISO 9660 long time format and probably correct the short-time format a little. Handle Rock-Ridge time and be able to display it. This pretty much completes the bulk of handling Rock-Ridge extensions. @@ -10327,7 +10327,7 @@ 2005-02-19 rocky - * src/cd-info.c, src/cd-read.c, src/iso-info.c, src/iso-read.c: + * src/cd-info.c, src/cd-read.c, src/iso-info.c, src/iso-read.c: cd-info.c: tolerate CDDB options even when we don't support CDDB. Better error reporting of bad options. 2005-02-19 rocky @@ -10372,7 +10372,7 @@ 2005-02-18 rocky - * lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/cd-info.c: + * lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/cd-info.c: iso9660_fs.c: reallocate filename when Rock-Ridge name is bigger. rock.c: variable name changes cd-info.c: don't translate file name when there are Rock-Ridge Extensions. @@ -10383,7 +10383,7 @@ 2005-02-17 rocky - * lib/driver/cd_types.c, lib/iso9660/iso9660_fs.c, src/cd-info.c: + * lib/driver/cd_types.c, lib/iso9660/iso9660_fs.c, src/cd-info.c: Remove more of the no longer needed distinction (that we sometimes got wrong) of Mode 1 vs Mode 2 data reading. @@ -10467,7 +10467,7 @@ * include/cdio/iso9660.h: Add type definitions for achar, dchar and ISO 9660 7.1.1 - ISO 7.3.3 types and use them. This frees up space - for better comments about he feild names of a PVD or SVD. + for better comments about he field names of a PVD or SVD. 2005-02-12 rocky @@ -10529,7 +10529,7 @@ 2005-02-10 rocky - * include/cdio/mmc.h, lib/driver/_cdio_sunos.c, lib/driver/mmc.c: + * include/cdio/mmc.h, lib/driver/_cdio_sunos.c, lib/driver/mmc.c: Use solaris ioctl for blocksize set/get. Prototype corrections. 2005-02-10 rocky @@ -10555,7 +10555,7 @@ * example/.cvsignore, example/Makefile.am, example/README, example/{iso4.c => isofuzzy.c}, include/cdio/mmc.h, - lib/driver/mmc.c, lib/driver/mmc_private.h, test/check_fuzzyiso.sh: + lib/driver/mmc.c, lib/driver/mmc_private.h, test/check_fuzzyiso.sh: Add mode_sense6() and mode_sense10() MMC commands. Use them to hopefully clean up code a little. Remove some unused MMC "private" commands. iso4 -> isofuzzy @@ -10599,7 +10599,7 @@ 2005-02-07 rocky - * lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_linux.c: + * lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_linux.c: Break out DVD detection. More verbose comments about the issues here. @@ -10636,7 +10636,7 @@ lib/driver/libcdio.sym, lib/driver/portable.h, lib/paranoia/overlap.c, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c: Various portability - fixes mosty for MSVC which doesn't have drand and doesn't allow + fixes mostly for MSVC which doesn't have drand and doesn't allow dynamic local arrays. v_fragment -> v_fragment_t libcdio.sym: more external symbols defined /lib/_cdio_linux.c: harmless type mismatch example/sample2.c -> example/device.c @@ -10712,7 +10712,7 @@ 2005-02-05 rocky * include/cdio/cdda.h, lib/cdda_interface/scan_devices.c: Another - "cooked" name bites the dust. Soem doxygen cleanup too. + "cooked" name bites the dust. Some doxygen cleanup too. 2005-02-05 rocky @@ -10733,7 +10733,7 @@ 2005-02-05 rocky - * include/cdio/xa.h, lib/iso9660/iso9660_fs.c, lib/iso9660/xa.c: + * include/cdio/xa.h, lib/iso9660/iso9660_fs.c, lib/iso9660/xa.c: xa.h: add enumeration for debugging rest: better understanding of when there might be XA and when there might not be. Don't give a warnings about missing XA attributes when the format isn't supposed @@ -10743,7 +10743,7 @@ * lib/cdda_interface/Makefile.am, lib/cdda_interface/{cooked_interface.c => cddap_interface.c}, - lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h: + lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h: cooked -> cddap. It has been observed that the use of "cooked" causes confusion and derision among the small-minded; and the code doesn't use cooked reading anyway. @@ -10757,7 +10757,7 @@ 2005-02-05 rocky - * Makefile.am, package/.cvsignore, package/libcdio-suse.spec.in: + * Makefile.am, package/.cvsignore, package/libcdio-suse.spec.in: Remove SuSE spec - it is not likely to be very general purpose. It is also not the real one which needs to be modified for each version and vcdimager/libcdio/libcddb collection and undergoes Language @@ -10765,7 +10765,7 @@ 2005-02-05 rocky - * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32_ioctl.c: + * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32_ioctl.c: scsi_mmc -> mmc 2005-02-05 rocky @@ -10779,7 +10779,7 @@ * include/cdio/cdda.h, include/cdio/iso9660.h, include/cdio/sector.h, lib/cdda_interface/common_interface.c, lib/driver/sector.c, lib/iso9660/iso9660.c: Make debugger-helping - enums extern'd and define onces elsewhere. + enums extern'd and define once elsewhere. 2005-02-05 rocky @@ -10792,7 +10792,7 @@ 2005-02-05 rocky - * lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: + * lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: Remove d->interface. 2005-02-05 rocky @@ -10815,7 +10815,7 @@ 2005-02-04 rocky - * lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: + * lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: const removal to match proper run_scsi_cmd prototype. Bug in reporting TOC lsn's. Thanks to Bobbin007. @@ -10831,7 +10831,7 @@ 2005-02-03 rocky - * configure.ac, lib/cdda_interface/scan_devices.c: Test for presense + * configure.ac, lib/cdda_interface/scan_devices.c: Test for presence of lstat (optionally used in scan_devices of cdda_interface). 2005-02-03 rocky @@ -10930,7 +10930,7 @@ 2005-01-30 rocky - * libcdio_cdda.pc.in, libcdio_paranoia.pc.in, libiso9660.pc.in: + * libcdio_cdda.pc.in, libcdio_paranoia.pc.in, libiso9660.pc.in: libcdio_*: names probably need to be something other that libcdio which is already in use. libsio9660: minor title change @@ -10984,7 +10984,7 @@ src/cd-paranoia/doc/en/Makefile.am, src/cd-paranoia/doc/{ => en}/cd-paranoia.1.in, src/cd-paranoia/doc/jp/.cvsignore, src/cd-paranoia/doc/jp/Makefile.am, - src/cd-paranoia/doc/{cd-paranoia.1.jp.in => jp/cd-paranoia.1.in}: + src/cd-paranoia/doc/{cd-paranoia.1.jp.in => jp/cd-paranoia.1.in}: Put Japanese man page in man/jp. 2005-01-28 rocky @@ -11020,7 +11020,7 @@ 2005-01-27 rocky - * Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am: + * Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am: Attempt to get library version numbers correct for release. 2005-01-27 rocky @@ -11080,7 +11080,7 @@ 2005-01-25 rocky - * Makefile.am, package/.cvsignore, package/libcdio-suse.spec.in: + * Makefile.am, package/.cvsignore, package/libcdio-suse.spec.in: SuSE spec file from Stanislav Brabec 2005-01-25 rocky @@ -11198,13 +11198,13 @@ 2005-01-23 rocky - * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: + * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: Nope. Didn't get it right this time either with the byteswapping. However we've at least reduced the customness. 2005-01-23 rocky - * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: + * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: Use common byte-swapping routines and remove cdparanoia-specific ones. (This time, for sure!) @@ -11215,20 +11215,20 @@ 2005-01-22 rocky * lib/driver/image.h, lib/driver/image/cdrdao.c, test/Makefile.am, - test/check_cue.sh.in, test/vcd_demo.toc, test/vcd_demo_toc.right: + test/check_cue.sh.in, test/vcd_demo.toc, test/vcd_demo_toc.right: Improve cdrdao to handle MSF-length. Remove vcd_demo_toc.right since the cd-info output is now the same as vcd_demo.right vcd_demo.toc adjusted accordingly. 2005-01-22 rocky - * src/cd-drive.c, src/cd-info.c, src/iso-info.c, src/iso-read.c: + * src/cd-drive.c, src/cd-info.c, src/iso-info.c, src/iso-read.c: Version information now includes build. 2005-01-22 rocky * include/cdio/version.h.in, src/cd-paranoia/version.h, test/check_paranoia.sh.in: check_paranoia.sh.in: Add a more - agressive paranoia test. *version.h*: Include build name in version listings. + aggressive paranoia test. *version.h*: Include build name in version listings. 2005-01-22 rocky @@ -11368,7 +11368,7 @@ lib/driver/_cdio_stdio.c, lib/driver/_cdio_stdio.h, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, - lib/driver/generic.h, lib/driver/image.h, lib/iso9660/iso9660_fs.c: + lib/driver/generic.h, lib/driver/image.h, lib/iso9660/iso9660_fs.c: Move a set_speed and set_blocksize (via MMC)from driver-specific places to generic. Add _t to yet another type. @@ -11388,11 +11388,11 @@ * lib/cdda_interface/scan_devices.c: Even though this may not be nstrictly the way the original cdda_interface does things, add a - spaces between the vendor, model, and revison number. + spaces between the vendor, model, and revision number. 2005-01-19 rocky - * src/cd-paranoia/cd-paranoia.c: Accomodate Windows that sometimes + * src/cd-paranoia/cd-paranoia.c: Accommodate Windows that sometimes gives an argc that seems one greater than what's not NULL in argv. And it is probably a good idea anyway to test for null strings before calling strdup() @@ -11431,7 +11431,7 @@ 2005-01-18 rocky - * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: + * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: --force-generic-device -g is an alias for --force-cdrom-device -d 2005-01-18 rocky @@ -11539,7 +11539,7 @@ 2005-01-16 rocky * include/cdio/cdda.h: Redo bit masks for test flags. Should - accomodate what is in (even if not working) in cdparanoia. + accommodate what is in (even if not working) in cdparanoia. 2005-01-16 rocky @@ -11623,7 +11623,7 @@ 2005-01-14 rocky - * lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: + * lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: The sense I'm getting is that while the bigendianp detection is clever, it isn't complete. It may be that we need to use this along in conjunctin with the endianness of the OS. That is instead of @@ -11652,7 +11652,7 @@ 2005-01-13 rocky - * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: + * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: Put back original cdparanoia byte-swapping routines until we smoke out what's going wrong on cygwin. @@ -11709,13 +11709,13 @@ 2005-01-12 rocky * src/cd-paranoia/Makefile.am: I really don't understand how - Makefile's. Put in an explict dependency between usage.h and + Makefile's. Put in an explicit dependency between usage.h and usage.txt since the generic one isn't sufficient. 2005-01-11 rocky * src/cd-paranoia/Makefile.am: Install program and manpage according - to name specificed in --with-cdparnoia-name + to name specified in --with-cdparnoia-name 2005-01-11 rocky @@ -11814,7 +11814,7 @@ 2005-01-09 rocky - * lib/cdda_interface/cooked_interface.c, lib/driver/_cdio_sunos.c: + * lib/cdda_interface/cooked_interface.c, lib/driver/_cdio_sunos.c: Fix a bad bug where we were requesting potentially a huge number of blocks (-1 unsigned). Fix both the driver to disallow such a nonsensical thing as well as just don't make the request. @@ -11843,7 +11843,7 @@ * configure.ac, include/cdio/cdda.h, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/drive_exceptions.h, - lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: + lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: Put back some of the GNU/Linux-ism for detecting drive endian-ness. The data-driven endian correction isn't working correctly. Ultimately though this code should move down into libcdio (and get removed from here.) @@ -11875,7 +11875,7 @@ 2005-01-06 rocky * include/cdio/cdda.h: Doxygen documentatoin on more routines. - Remove some things that aren't useable any more. + Remove some things that aren't usable any more. 2005-01-06 rocky @@ -12044,7 +12044,7 @@ 2005-01-01 rocky * lib/driver/_cdio_linux.c, lib/driver/image/nrg.c: NRG: get track - flags working. linux: small clanup in track flags. more to come. + flags working. linux: small cleanup in track flags. more to come. 2005-01-01 rocky @@ -12088,7 +12088,7 @@ lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/generic.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, - lib/driver/image_common.h, lib/driver/libcdio.sym, src/cd-info.c: + lib/driver/image_common.h, lib/driver/libcdio.sym, src/cd-info.c: Start to fill in cdio_get_preemphasis, cdio_get_copy_permit, and cdio_get_channels. Internals reworked a little for this. @@ -12133,7 +12133,7 @@ 2004-12-22 rocky - * test/.cvsignore: Add derived paranoia regession test. + * test/.cvsignore: Add derived paranoia regression test. 2004-12-22 rocky @@ -12262,8 +12262,8 @@ src/cd-paranoia/utils.h, src/cd-paranoia/version.h, src/util.c, test/Makefile.am: BIG REORGANIZATION. Reorganize directory structure for inclusion of cd-paranoia. Works for GNU/Linux. Other OS's may be broken. Regression test output - needs to be adjusted too. Move: lib/driver (split off of lib) lib/iso9660 (split off of lib) Add from paranoia: lib/cdda_interface lib/paranoia src/paranoia Also made some small changes to capability indentification to show - more reading capabilties and show that. cd-info now shows the total disc size. + needs to be adjusted too. Move: lib/driver (split off of lib) lib/iso9660 (split off of lib) Add from paranoia: lib/cdda_interface lib/paranoia src/paranoia Also made some small changes to capability identification to show + more reading capabilities and show that. cd-info now shows the total disc size. 2004-12-17 rocky @@ -12373,7 +12373,7 @@ 2004-11-21 rocky - * NEWS, configure.ac, include/cdio/iso9660.h, lib/iso9660.c: + * NEWS, configure.ac, include/cdio/iso9660.h, lib/iso9660.c: configure.ac: in 72cvs now. iso9660.{c,h}: "new" is a reserved word in C++. Don't use it as a parameter name @@ -12473,7 +12473,7 @@ 2004-11-15 rocky - * include/cdio/util.h, lib/Makefile.am, lib/libcdio.sym, lib/util.c: + * include/cdio/util.h, lib/Makefile.am, lib/libcdio.sym, lib/util.c: rename to_bcd8 and from_bcd8 to cdio_to_bcd8 and cdio_from_bcd8. (N. Boullis) lib/Makefile.am: avoid non-GNU ld options when --without-versioned-libs is in effect. @@ -12523,7 +12523,7 @@ 2004-11-12 rocky - * lib/Makefile.am: Guidence from Nicolas Boullis on how to library + * lib/Makefile.am: Guidance from Nicolas Boullis on how to library versioning works or should work. 2004-11-08 rocky @@ -12533,7 +12533,7 @@ 2004-11-07 rocky - * NEWS, lib/image/bincue.c, lib/image/cdrdao.c, lib/portable.h: + * NEWS, lib/image/bincue.c, lib/image/cdrdao.c, lib/portable.h: Hoist common "portable" definitions into portable.h NEWS - rearrange. @@ -12551,7 +12551,7 @@ 2004-11-07 rocky - * lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c: + * lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c: win32_ioctl.c: minor comment or function name changes. aspi32.c: use length definitions better. @@ -12709,7 +12709,7 @@ 2004-10-30 rocky - * configure.ac, lib/iso9660.c, lib/iso9660_fs.c, src/iso-info.c: + * configure.ac, lib/iso9660.c, lib/iso9660_fs.c, src/iso-info.c: configure.ac, iso9660.c: test for tzname variable. configure.ac, iso9660_fs.c: test for nls_langinfo() and #include iso-info.c: some OS's need 2 args for multi-arg defines. @@ -12744,7 +12744,7 @@ 2004-10-28 rocky - * include/cdio/Makefile.am: cdio.h accidently got removed. + * include/cdio/Makefile.am: cdio.h accidentally got removed. 2004-10-28 rocky @@ -12794,7 +12794,7 @@ * lib/FreeBSD/freebsd.c, lib/MSWindows/win32.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, src/cd-info.c: Various - valgrind-detected memory leaks and unitialized variable errors. + valgrind-detected memory leaks and uninitialized variable errors. 2004-10-26 rocky @@ -12821,7 +12821,7 @@ * example/iso2.c, include/cdio/cdio.h, include/cdio/iso9660.h, lib/_cdio_generic.c, lib/_cdio_stream.c, lib/cdio.c, lib/generic.h, - lib/image/bincue.c, lib/iso9660.c, lib/iso9660_fs.c, src/cd-info.c: + lib/image/bincue.c, lib/iso9660.c, lib/iso9660_fs.c, src/cd-info.c: First attempt to extent Joliet to CD reading portion. 2004-10-24 rocky @@ -12854,7 +12854,7 @@ * Makefile.am, configure.ac, doc/Makefile.am, doc/doxygen/{Doxyfile => Doxyfile.in}, src/iso-info.c: configure.ac: test for intl and iconv needed for Joliet support iso-info.c: add --no-joliet option - Doxyfile*, configure.ac: Automatically update some ofthe Doxyfile + Doxyfile*, configure.ac: Automatically update some of the Doxyfile information 2004-10-24 rocky @@ -12877,7 +12877,7 @@ 2004-10-23 rocky * NEWS, configure.ac, doc/glossary.texi, include/cdio/iso9660.h, - lib/iso9660.c, lib/iso9660_fs.c, src/iso-info.c, test/testbincue.c: + lib/iso9660.c, lib/iso9660_fs.c, src/iso-info.c, test/testbincue.c: First cut at Joliet support for ISO 9660 images. More work is needed to integrate this into CD reading. @@ -12984,9 +12984,9 @@ lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio_private.h, lib/cdtext.c, lib/cdtext_private.h, lib/image/bincue.c, lib/image/cdrdao.c, - lib/image/nrg.c, lib/scsi_mmc.c, lib/sector.c, lib/util.c: + lib/image/nrg.c, lib/scsi_mmc.c, lib/sector.c, lib/util.c: configure.ac: now in 0.71cvs *.c: lint-like changes. Tested on Sun's - SUNPRO cc compiler. Removed feild initialization lingo (even if it + SUNPRO cc compiler. Removed field initialization lingo (even if it is C99). 2004-09-02 rocky @@ -13032,7 +13032,7 @@ 2004-08-30 rocky - * lib/_cdio_osx.c, src/cd-info.c: _cdio_osx.c: wasnt' returning + * lib/_cdio_osx.c, src/cd-info.c: _cdio_osx.c: wasn't returning CDIO_INVALID_TRACK on TOC read error. cd-info.c: abort sooner if we can't read the TOC. @@ -13128,7 +13128,7 @@ 2004-08-27 rocky - * include/cdio/cdio.h, lib/cdio.c, src/cd-drive.c, src/cd-info.c: + * include/cdio/cdio.h, lib/cdio.c, src/cd-drive.c, src/cd-info.c: Add a couple of routines to pass back the driver used in getting a drive. Speeds up a little the task of opening the drive. Is now used in cd-drive and cd-info. @@ -13141,20 +13141,20 @@ 2004-08-27 rocky - * lib/_cdio_osx.c: Wrong access for setting drive capabilites to + * lib/_cdio_osx.c: Wrong access for setting drive capabilities to unknown. 2004-08-27 rocky * include/cdio/cdio.h, include/cdio/scsi_mmc.h, lib/cdio.c, - lib/cdio_private.h, lib/scsi_mmc.c, src/cd-drive.c, src/cd-info.c: + lib/cdio_private.h, lib/scsi_mmc.c, src/cd-drive.c, src/cd-info.c: Expose hwinfo call as a cdio command. It was SCSI-MMC. This may help on OSX. 2004-08-27 rocky * lib/_cdio_linux.c, lib/scsi_mmc.c: scsi_mmc.c: more aggressive - about getting drive capabilites. Try to get length first. Also try + about getting drive capabilities. Try to get length first. Also try CAPABILITIES_PAGEs as well as ALL_PAGEs. 2004-08-27 rocky @@ -13222,7 +13222,7 @@ 2004-08-16 rocky - * lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c: + * lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c: _cdio_osx.c: first attempt at issuing general SCSI-MMC passthrough command. others: small changes. @@ -13242,7 +13242,7 @@ 2004-08-13 rocky - * lib/_cdio_osx.c: Compilaton fixes. + * lib/_cdio_osx.c: Compilation fixes. 2004-08-12 rocky @@ -13261,7 +13261,7 @@ * example/sample10.c, lib/MSWindows/win32.c, lib/Makefile.am, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, - lib/_cdio_sunos.c, lib/cdio_private.h, lib/generic.h, src/util.c: + lib/_cdio_sunos.c, lib/cdio_private.h, lib/generic.h, src/util.c: lib/*.c: create and use get_cdtext_generic. lib/generic.h: prototypes for _cdio_generic.c (move out of _cdio_private.h) example/sample10.c, src/util.c: small print format improvement @@ -13271,7 +13271,7 @@ 2004-08-10 rocky - * lib/MSWindows/win32.c, lib/MSWindows/win32.h, src/util.c: + * lib/MSWindows/win32.c, lib/MSWindows/win32.h, src/util.c: Compilation fixes for Win32 and cd-text breakage. 2004-08-10 rocky @@ -13438,7 +13438,7 @@ 2004-08-06 rocky * src/cd-info.c, src/util.c: cd-info.c: should not try to print out - MCN for DVD's - they don't have any such thing. util.c: wasn't reading right/write parms when showing write + MCN for DVD's - they don't have any such thing. util.c: wasn't reading right/write params when showing write capabilities. now also show DVD+RW and DVD-RW capabilities. 2004-08-05 rocky @@ -13475,7 +13475,7 @@ 2004-08-03 imacintosh * lib/_cdio_sunos.c: Now uses DKIOCGMEDIAINFO to get discmode and - handles Soalris media + handles Solaris media 2004-08-01 rocky @@ -13492,7 +13492,7 @@ 2004-08-01 rocky - * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd_cam.c, lib/scsi_mmc.c: + * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd_cam.c, lib/scsi_mmc.c: scsi_mmc.c: doc change FreeBSD: use generic routines more often. Initialize TOC before getting drive capabilities (seems to be desired, not completely sure or sure why this would be so.) @@ -13570,7 +13570,7 @@ 2004-07-28 rocky - * example/sample8.c, include/cdio/cdio.h, lib/cdio.c, src/cd-info.c: + * example/sample8.c, include/cdio/cdio.h, lib/cdio.c, src/cd-info.c: Add discmode to string array. Simplifies some code a bit. 2004-07-28 rocky @@ -13674,7 +13674,7 @@ 2004-07-26 rocky - * lib/MSWindows/aspi32.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: + * lib/MSWindows/aspi32.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: get_dvd_physical common routine now works. 2004-07-26 rocky @@ -13686,9 +13686,9 @@ 2004-07-26 rocky - * lib/MSWindows/win32.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: + * lib/MSWindows/win32.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: Start to break out routines into a device-callable routine as well - as a publically callable routine. The device-callable routine will + as a publicly callable routine. The device-callable routine will be able to change the passthrough routine as M$ has two distinct routines for aspi and ioctl. @@ -13810,7 +13810,7 @@ 2004-07-25 rocky - * example/sample8.c, include/cdio/scsi_mmc.h, include/cdio/sector.h: + * example/sample8.c, include/cdio/scsi_mmc.h, include/cdio/sector.h: Changes to facilitate DVD detection. 2004-07-25 rocky @@ -14087,7 +14087,7 @@ 2004-07-16 rocky * include/cdio/cdtext.h, lib/cdtext.c, src/cd-info.c, - src/cd-read.c, test/cdda-mcn.right, test/cdda.right, test/cdda.toc: + src/cd-read.c, test/cdda-mcn.right, test/cdda.right, test/cdda.toc: Add cdtext display to cd-info and adjust regression tests accordingly. cd-read.c: don't try to print null strings. @@ -14212,13 +14212,13 @@ 2004-07-11 rocky - * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: + * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: Initialize cdtext to NULL and other add some initializations that should have been done. 2004-07-11 rocky - * lib/cdtext.c: Correct some string initalization bugs in + * lib/cdtext.c: Correct some string initialization bugs in cdtext_keywords. We switched from binary search to linear search for now. @@ -14302,7 +14302,7 @@ * lib/cdtext.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image/nrg.h, lib/image_common.h: mcn -> psz_mcn and other psz variables. bincue.c: a little closer to getting - cuetools parse_cuefile useable. + cuetools parse_cuefile usable. 2004-07-09 rocky @@ -14402,7 +14402,7 @@ 2004-06-27 rocky * lib/_cdio_sunos.c: Compilation fix. Remove magic number 100. Use - common mmc routine for drive capabilites. + common mmc routine for drive capabilities. 2004-06-27 rocky @@ -14633,12 +14633,12 @@ 2004-06-19 rocky - * include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-info.c: + * include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-info.c: iso9660_iso_... -> iso9660_ifs_... 2004-06-19 rocky - * include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-info.c: + * include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-info.c: iso9660*.{c,h}: Add PVD read for ISO 9660 images. iso-info now shows this info. 2004-06-18 rocky @@ -14771,7 +14771,7 @@ 2004-06-06 rocky - * include/cdio/cdio.h: Doc fixes and some paramater name renamings. + * include/cdio/cdio.h: Doc fixes and some parameter name renamings. 2004-06-06 rocky @@ -14965,7 +14965,7 @@ 2004-05-31 rocky - * lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c: + * lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c: Hopefully improve names. "user_data" comes from user. "env" an environment is really what this is. "obj" is just to vague. @@ -15064,7 +15064,7 @@ 2004-05-16 rocky * lib/FreeBSD/freebsd.c, lib/MSWindows/aspi32.c, - lib/MSWindows/win32.c, lib/image/cdrdao.c, src/cd-info.c: + lib/MSWindows/win32.c, lib/image/cdrdao.c, src/cd-info.c: MSWindows/*: get access mode working better. ASPI support is faulty though freebsd.c: it's "ioctl" not "IOCTL"; cdrdao: it's cdrdao, not "toc" cd-info: slightly better error message? @@ -15136,8 +15136,8 @@ test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/data7.toc, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, - test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: - Ouptut of LSN has one more place just to be sure. cd-info.c: use new msf_to_str routine. + test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: + Output of LSN has one more place just to be sure. cd-info.c: use new msf_to_str routine. 2004-05-09 rocky @@ -15255,7 +15255,7 @@ 2004-05-07 rocky - * test/check_cd_read.sh, test/check_iso.sh.in, test/check_opts.sh: + * test/check_cd_read.sh, test/check_iso.sh.in, test/check_opts.sh: Error reporting improved to make debugging easier. 2004-05-06 rocky @@ -15382,7 +15382,7 @@ 2004-04-30 rocky - * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/_cdio_sunos.c: + * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/_cdio_sunos.c: Compilation fixes after adjustments. 2004-04-30 rocky @@ -15397,7 +15397,7 @@ * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c, lib/Makefile.am: Attempt to add FreeBSD CAM access method. Hope I - havent' broken FreeBSD otherwise. + haven't broken FreeBSD otherwise. 2004-04-30 rocky @@ -15458,7 +15458,7 @@ 2004-04-25 rocky - * lib/image/bincue.c, lib/image/nrg.c, lib/image_common.h: + * lib/image/bincue.c, lib/image/nrg.c, lib/image_common.h: Regularize and I hope simplify names a bit more. image/*.c: (bogus) eject media now frees resources bincue.c: missing default_devices routine in function initialization table. @@ -15473,8 +15473,8 @@ 2004-04-25 rocky * lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, - lib/image_common.h, lib/scsi_mmc.h, src/cd-drive.c, src/util.c: - get_mcn paramater is const. solaris: failed attempt to get mcn and drive capabilities. Some + lib/image_common.h, lib/scsi_mmc.h, src/cd-drive.c, src/util.c: + get_mcn parameter is const. solaris: failed attempt to get mcn and drive capabilities. Some boilerplate routines used. scsi_mmc: more defines. src/cd-drive.c: bugfix when cdio is null src/util.c: small enhancement. @@ -15529,7 +15529,7 @@ 2004-04-24 rocky - * src/cd-info.c: Better formating of drive capabilities. + * src/cd-info.c: Better formatting of drive capabilities. 2004-04-24 rocky @@ -15546,7 +15546,7 @@ 2004-04-23 rocky * lib/Makefile.am, lib/image/bincue.c, lib/image/nrg.c, - lib/{image/common.c => image_common.h}, test/vcd_demo_vcdinfo.right: + lib/{image/common.c => image_common.h}, test/vcd_demo_vcdinfo.right: image/common.h -> image_common.h. I'd rather switch than fight. I still hate automake. @@ -15570,7 +15570,7 @@ * README.libcdio, configure.ac, example/sample2.c, include/cdio/cdio.h, include/cdio/types.h, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h: *.{c,h}: add cdio_get_drive_cap to - determine what kind of CDROM device we've got. README.libcdio: suggest stonger making a separate package for + determine what kind of CDROM device we've got. README.libcdio: suggest stronger making a separate package for cd-info configure.ac: we are in 0.69cvs now 2004-04-21 rocky @@ -15714,7 +15714,7 @@ 2004-03-13 rocky - * src/iso-info.c: Cater to implimentations that don't impliment + * src/iso-info.c: Cater to implementations that don't implement Single Unix strftime. Like mingw. 2004-03-11 rocky @@ -15757,7 +15757,7 @@ 2004-03-07 rocky * lib/MSWindows/win32.c: Bug in read_mode2 sectors fixed. With this, - vcd-info, vcdxrip, vlc and xine shoudl be able to read okay on + vcd-info, vcdxrip, vlc and xine should be able to read okay on win2k! 2004-03-07 rocky @@ -15848,7 +15848,7 @@ 2004-03-05 rocky - * doc/doxygen/.cvignore, doc/doxygen/html/.cvsignore: CVS lint. + * doc/doxygen/.cvsignore, doc/doxygen/html/.cvsignore: CVS lint. 2004-03-04 rocky @@ -15861,7 +15861,7 @@ 2004-03-04 rocky * lib/win32ioctl.c: mode2 reading works on win2k via ioctl (so - probaby on WINNT and xp as well. + probably on WINNT and xp as well. 2004-03-03 rocky @@ -15951,7 +15951,7 @@ 2004-02-28 rocky * lib/Makefile.am: libiso9660 has changed - the fs_stat_translate - routines added and that packed attribut on XA. Thus we've got to + routines added and that packed attribute on XA. Thus we've got to update "current" in libiso9660. 2004-02-28 rocky @@ -15983,7 +15983,7 @@ 2004-02-27 rocky - * README, configure.ac, doc/libcdio.texi, lib/Makefile.am: + * README, configure.ac, doc/libcdio.texi, lib/Makefile.am: configure.ac, Makefile.am: don't do library symbol version on BSDis variants libcdio.texi: minor example improvements. @@ -16149,7 +16149,7 @@ 2004-02-15 rocky - * libcdio.spec.in: Correctons from Manfred Tremmel who I am yet + * libcdio.spec.in: Corrections from Manfred Tremmel who I am yet again indebted. 2004-02-14 rocky @@ -16174,7 +16174,7 @@ 2004-02-14 rocky - * THANKS: Acknowlege what is only right. + * THANKS: Acknowledge what is only right. 2004-02-14 rocky @@ -16187,7 +16187,7 @@ 2004-02-14 rocky * doc/libcdio.texi: Go over. Add CD-image format, ISO 9660 characters and glossary from vcdimager - documentation. Numberous small corrections. + documentation. Numerous small corrections. 2004-02-13 rocky @@ -16209,7 +16209,7 @@ 2004-02-11 rocky - * lib/.cvsignore: Igore library version file. + * lib/.cvsignore: Ignore library version file. 2004-02-10 rocky @@ -16427,7 +16427,7 @@ 2003-12-24 uid67423 - * include/cdio/iso9660.h: Documention in comment bug. + * include/cdio/iso9660.h: Documentation in comment bug. 2003-12-03 rocky @@ -16443,7 +16443,7 @@ * doc/Makefile.am, include/cdio/cd_types.h, include/cdio/cdio.h, include/cdio/iso9660.h, include/cdio/logging.h, - include/cdio/sector.h, include/cdio/types.h, include/cdio/xa.h: + include/cdio/sector.h, include/cdio/types.h, include/cdio/xa.h: Related to doxygen documentation. 2003-11-17 rocky @@ -16492,7 +16492,7 @@ 2003-11-09 rocky - * doc/doxygen/.cvignore: The usual. + * doc/doxygen/.cvsignore: The usual. 2003-11-09 rocky @@ -16745,7 +16745,7 @@ 2003-10-03 rocky - * NEWS, include/cdio/cdio.h, lib/_cdio_bincue.c, lib/cdio.c: + * NEWS, include/cdio/cdio.h, lib/_cdio_bincue.c, lib/cdio.c: cdio.{c,h}: update initializations for get_devices. 2003-10-03 rocky @@ -16865,7 +16865,7 @@ 2003-09-28 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, test/cdda.cue, - test/cdda.right: Impliment MCN for bincue. + test/cdda.right: Implement MCN for bincue. 2003-09-27 rocky @@ -16918,7 +16918,7 @@ 2003-09-21 rocky - * src/cd-read.c, test/check_cd_read.sh, test/isofs-m1-read.right: + * src/cd-read.c, test/check_cd_read.sh, test/isofs-m1-read.right: Make cd-read more user-friendly and do more things: Add start/end/count options for cd-read, Input argument doesn't need a specifier (-i or --cue-file) now. block sizes for various formats have been set correctly now. 2003-09-21 rocky @@ -17076,7 +17076,7 @@ 2003-09-15 rocky - * configure.ac: Test for OSX presense of IOKit and CoreFoundation + * configure.ac: Test for OSX presence of IOKit and CoreFoundation and add to list of libraries. Change format of drivers reported. 2003-09-15 rocky @@ -17263,7 +17263,7 @@ 2003-09-01 rocky - * include/cdio/iso9660.h, include/cdio/xa.h, lib/iso9660_private.h: + * include/cdio/iso9660.h, include/cdio/xa.h, lib/iso9660_private.h: Merge in and tidy up with mkisofs's iso9660.h. If that is correct (and it probably is), there were erroneous field definitions. @@ -17285,7 +17285,7 @@ 2003-09-01 rocky * test/check_cue.sh.in, test/check_nrg.sh.in: Was setting options - all wrong and using wrong CDDB subtitution variable. As Bullwinkle + all wrong and using wrong CDDB substitution variable. As Bullwinkle says, "This time, for sure!" 2003-09-01 rocky @@ -17362,7 +17362,7 @@ test/check_cue.sh.in, test/check_nrg.sh.in, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Move over reading ISO-9660 - filesytems from vcdimager. Handling of XA attributes also moved + filesystems from vcdimager. Handling of XA attributes also moved over. 2003-08-31 rocky @@ -17379,13 +17379,13 @@ 2003-08-31 rocky - * include/cdio/iso9660.h, lib/cd_types.c, lib/iso9660_private.h: + * include/cdio/iso9660.h, lib/cd_types.c, lib/iso9660_private.h: cd_types: tighter use of ISO #defines. Make some of the private ones public to reduce "private" use in vcdimager. 2003-08-31 rocky - * include/cdio/iso9660.h, lib/iso9660.c, src/cd-info.c: + * include/cdio/iso9660.h, lib/iso9660.c, src/cd-info.c: iso_directory_record_t -> iso9660_dir_t 2003-08-31 rocky @@ -17414,7 +17414,7 @@ 2003-08-29 rocky - * test/check_cue.sh.in, test/check_nrg.sh.in, test/check_opts.sh: + * test/check_cue.sh.in, test/check_nrg.sh.in, test/check_opts.sh: Invalid substituiton variable. Allow cd-info tests to be skipped. 2003-08-29 rocky @@ -17444,7 +17444,7 @@ 2003-08-17 rocky - * test/.cvsignore, test/Makefile.am, test/check_sizeof.c: + * test/.cvsignore, test/Makefile.am, test/check_sizeof.c: Makefile.am: add check_sizeof and testischar 2003-08-17 rocky @@ -17507,7 +17507,7 @@ 2003-08-14 rocky - * src/Makefile.am, src/analyze.c, src/analyze.h, src/cd-info.c: + * src/Makefile.am, src/analyze.c, src/analyze.h, src/cd-info.c: First cut at separating disc analysis part from standalone source. More modularity is needed. @@ -17598,7 +17598,7 @@ 2003-07-28 rocky - * Makefile.am, configure.ac, doc/Makefile.am, doc/libcdio.texi: + * Makefile.am, configure.ac, doc/Makefile.am, doc/libcdio.texi: First feeble attempt at documentation. 2003-07-27 rocky @@ -17698,7 +17698,7 @@ test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, - test/vcd_demo.right, test/videocd.right: Remvoe headers. Run with + test/vcd_demo.right, test/videocd.right: Remove headers. Run with --no-header now. 2003-06-07 rocky @@ -17771,7 +17771,7 @@ 2003-05-27 rocky * configure.ac, include/cdio/cdio.h, include/cdio/types.h, - lib/Makefile.am, lib/_cdio_win32.c, lib/cdio.c, parse/.cvsignore: + lib/Makefile.am, lib/_cdio_win32.c, lib/cdio.c, parse/.cvsignore: Closer to having WIN32 CD-ROM support 2003-05-27 rocky @@ -17781,7 +17781,7 @@ 2003-05-26 rocky * include/cdio/sector.h: more pedantic types (which in fact match - the implimentation). + the implementation). 2003-05-25 rocky @@ -17881,9 +17881,9 @@ 2003-05-16 rocky * include/cdio/cdio.h, lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, - lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio.c, parse/Makefile: + lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio.c, parse/Makefile: Bug in eject: need to close internal file descriptor before - ejecting. eject interface now nulls cdio pointer after a sucessful + ejecting. eject interface now nulls cdio pointer after a successful eject. 2003-05-11 rocky @@ -17911,7 +17911,7 @@ 2003-04-28 rocky - * test/Makefile.am, test/{check_nrg.sh => check_nrg.sh.in}: + * test/Makefile.am, test/{check_nrg.sh => check_nrg.sh.in}: check_nrg.sh is now derived since we may or may not have Video CD info displayed. @@ -17936,7 +17936,7 @@ * ChangeLog, Makefile.am, src/Makefile.am, src/{cdinfo.c => cd-info.c}, test/check_common_fn, test/check_opts.sh: rename cdinfo - to cd-info to accomodate previously existing cdinfo programs. + to cd-info to accommodate previously existing cdinfo programs. Thanks to Manfred Tremmel for reporting the problem. @@ -18014,7 +18014,7 @@ => test}/check_opts7.right, {tests => test}/fsf.right, {tests => test}/isofs-m1.right, {tests => test}/monvoisin.right, {tests => test}/svcd_ogt_test_ntsc.right, {tests => test}/svcdgs.right, - {tests => test}/vcd_demo.right, tests/cdda.cue, tests/isofs-m1.cue: + {tests => test}/vcd_demo.right, tests/cdda.cue, tests/isofs-m1.cue: tests -> test All public includes are included via #include rather than #include "....h" (removed -I $top_srcdir/include/cdio) @@ -18070,7 +18070,7 @@ 2003-04-21 hvr - * Makefile.am, configure.ac, include/cdio/cdio.h.in, libcdio.pc.in: + * Makefile.am, configure.ac, include/cdio/cdio.h.in, libcdio.pc.in: added pkg-config(1) support 2003-04-20 rocky @@ -18095,7 +18095,7 @@ tests/check_opts1.right, tests/check_opts2.right, tests/check_opts3.right, tests/check_opts4.right, tests/check_opts5.right, tests/check_opts6.right, - tests/check_opts7.right, tests/fsf-tompox.right, tests/isofs-m1.cue: + tests/check_opts7.right, tests/fsf-tompox.right, tests/isofs-m1.cue: Reduce overall size yet again by replaing isofs-m1 for fsf-tompox. cdinfo: Add options for CDDB port and CDDB http enable fix bug if no CD in cdrom drive. @@ -18213,7 +18213,7 @@ 2003-04-14 rocky * src/cdinfo.c: libpopt options need to be integers. Change order of - include to accomodate libcddb. Make distcheck now works. + include to accommodate libcddb. Make distcheck now works. 2003-04-14 rocky @@ -18250,7 +18250,7 @@ 2003-04-11 rocky - * lib/sector.c, lib/sector.h: Tired of all those unused warings. + * lib/sector.c, lib/sector.h: Tired of all those unused warnings. Remove the static inline stuff. It's probably not worth the performance gains. (And if it is we can turn into a #define) @@ -18317,7 +18317,7 @@ 2003-04-07 rocky - * lib/types.h: Indention formatting that Emacs prefers. + * lib/types.h: Indentation formatting that Emacs prefers. 2003-04-07 rocky @@ -18356,7 +18356,7 @@ 2003-04-06 rocky - * lib/_cdio_stdio.c, lib/_cdio_stream.c, lib/_cdio_stream.h: + * lib/_cdio_stdio.c, lib/_cdio_stream.c, lib/_cdio_stream.h: Document some of the interfaces. 2003-04-06 rocky @@ -18402,7 +18402,7 @@ 2003-04-06 rocky - * lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c, lib/cdio.h: + * lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c, lib/cdio.h: Use new sector.h constants. More changes will no doubt follow. 2003-04-06 rocky @@ -18421,7 +18421,7 @@ 2003-04-04 rocky - * lib/cdio.c, lib/cdio.h: Documentation improvment: Note that + * lib/cdio.c, lib/cdio.h: Documentation improvement: Note that get_default_device returns NULL on error. 2003-04-03 rocky @@ -18440,7 +18440,7 @@ * lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c, lib/cdio.c, - lib/cdio.h, lib/cdio_private.h: More common routiens and structures + lib/cdio.h, lib/cdio_private.h: More common routines and structures moved to cdio_generic.c or cdio_private.h respectively. 2003-03-30 rocky @@ -18518,4 +18518,3 @@ 2003-03-24 rocky * Initial revision - libcdio-2.2.0/ChangeLog.spell-corrected000066400000000000000000022035131474051130400177650ustar00rootroot000000000000002024-12-25 R. Bernstein * : Merge pull request #6 from pbatard/warnings2 Fix some more warnings 2024-12-24 Pete Batard * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_generic.c, lib/driver/cdtext.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c: Add some more checks for potentially NULL buffers Some static analysers complain about parts of our code that don't check for the result of malloc/calloc. 2024-12-24 Pete Batard * .vs/libcdio.vcxproj, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c: Use non widestring API calls for MSVC where required When compiling for MSVC with Unicode enabled, the compiler tries to use widestring API calls unless otherwise specified. So make sure we enforce the use of non widestring (A suffixed) calls when we pass char* parameters. Also fix a warning related to the declaration of is_cdrom_aspi() and silence a warning about GetVersion() being deprecated. 2024-12-21 R. Bernstein * : Merge pull request #5 from pbatard/warnings Fix multiple warnings 2024-12-21 R. Bernstein * : Merge pull request #4 from pbatard/msvc Add Visual Studio 2022 support and MinGW GitHub Actions 2024-12-20 Pete Batard * .vs/README.txt, .vs/cd-info.vcxproj, .vs/cd-info.vcxproj.filters, {MSVC => .vs}/config.h, .vs/libcdio.vcxproj, .vs/libcdio.vcxproj.filters, .vs/set_version.ps1, .vs/unistd.h, MSVC/README, MSVC/cd-info.vcproj, MSVC/libcdio.sln, MSVC/libcdio.vcproj, Makefile.am, include/cdio/types.h, libcdio.sln: Add Visual Studio 2022 project files Move and update the MSVC project files to a .vs/ directory since it gets created by Visual Studio. Also remove the XBox specific configuration. 2024-12-20 Pete Batard * src/util.h: Use "..." and "__VA_ARGS__" for variadic macros "..." and "__VA_ARGS__" is pretty much standard and supported by compilers like MSVC whereas "args..." and "##args" isn't. 2024-12-20 Pete Batard * lib/iso9660/iso9660_fs.c: Only use the __attribute__ macro on GNU C compilers that support it This improves on commit 771dc256eaf5c94af3926b14febe08184ef283c4, as it breaks MSVC compilation otherwise 2024-12-21 Pete Batard * .github/workflows/mingw.yml: Add MinGW GitHub Actions workflow 2024-12-21 Pete Batard * .github/workflows/macos.yml, .github/workflows/ubuntu.yml: Clean up MacOS and Linux GitHub Actions scripts Be more descriptive about the jobs, and remove the verbose option so that any error/warning will pop out. Also remove set -x which is unneeded when there are only a couple of commands being invoked. Finally, make sure these apply to any branch, so that people who create one to submit a PR will get a GitHub Actions run to validate these changes in their repo. 2024-09-30 R. Bernstein * : Merge pull request #3 from libcdio/more-CI Try macos testing 2024-09-30 R. Bernstein * .github/workflows/macos.yml, .github/workflows/{test.yml => ubuntu.yml}: Try macos testing and tweak ubuntu setup 2024-09-27 R. Bernstein * : Merge pull request #2 from adrianreber/2024-09-27-actions Add simple GitHub Actions definition 2024-09-09 R. Bernstein * : Merge pull request #1 from libcdio/tweaks-for-github Convert a number of README's to markdown... 2024-09-01 John Ernberg * lib/driver/cdtext.c, test/cdtext-krosis.right, test/check_cdtext.sh: cdtext: Count empty fields as tracks The following CD-TEXT would fail when parsing due to an off-by-one in the songwriter data type because the album-level field is empty: 80 0 0 0 41 20 4d 65 6d 6f 69 72 20 6f 66 20 5f 23 80 0 1 c 46 72 65 65 20 57 69 6c 6c 0 47 6f 5b 8d 80 1 2 2 6e 65 20 42 75 74 20 4e 6f 74 20 46 b0 df 80 1 3 e 6f 72 67 6f 74 74 65 6e 0 49 6e 73 9 18 80 2 4 3 61 6e 69 74 79 20 41 20 4d 6f 6e 69 49 27 80 2 5 f 6b 65 72 20 4f 66 20 4d 65 0 54 6f 13 d2 80 3 6 2 20 50 65 72 73 69 73 74 20 6f 72 20 3b 87 80 3 7 e 41 64 68 65 72 65 0 41 6e 20 45 6c 63 87 80 4 8 5 65 67 79 20 66 6f 72 20 61 20 4d 61 bc e6 80 4 9 f 6e 20 41 6c 69 76 65 0 50 73 79 63 93 89 80 5 a 4 68 6f 74 69 63 6c 79 73 6d 0 41 6e d6 a 80 6 b 2 20 49 6e 74 72 61 6d 75 72 61 6c 20 aa b6 80 6 c e 4d 61 64 6e 65 73 73 0 51 75 65 73 b8 0 80 7 d 4 74 69 6f 6e 73 20 6f 66 20 61 20 48 60 11 80 7 e f 6f 6c 69 73 74 69 63 20 44 69 76 69 bb b8 80 7 f f 6e 65 0 57 69 74 68 20 56 69 72 74 60 f5 80 8 10 9 75 65 20 49 20 41 6d 20 46 72 65 65 21 6 80 8 11 f 0 42 61 74 74 6c 65 73 20 41 72 65 a5 b9 80 9 12 b 20 57 6f 6e 20 57 69 74 68 69 6e 0 b0 f3 80 a 13 0 41 20 4d 65 6d 69 6f 72 20 6f 66 20 52 2f 80 a 14 c 46 72 65 65 20 57 69 6c 6c 0 0 0 78 30 81 0 15 0 4b 72 6f 73 69 73 0 4b 72 6f 73 69 91 f1 81 1 16 5 73 0 9 0 9 0 9 0 9 0 9 0 80 2d 81 7 17 0 9 0 9 0 9 0 9 0 0 0 0 0 bd f4 82 0 18 0 0 4b 72 6f 73 69 73 0 9 0 9 0 47 9c ^^^ 82 4 19 0 9 0 9 0 9 0 9 0 9 0 9 0 1f 7f 82 a 1a 0 9 0 0 0 0 0 0 0 0 0 0 0 1e f8 83 0 1b 0 0 4b 72 6f 73 69 73 0 9 0 9 0 62 1b 83 4 1c 0 9 0 9 0 9 0 9 0 9 0 9 0 31 9f 83 a 1d 0 9 0 0 0 0 0 0 0 0 0 0 0 c6 da 84 0 1e 0 0 4b 72 6f 73 69 73 0 9 0 9 0 8c 40 84 4 1f 0 9 0 9 0 9 0 9 0 9 0 9 0 d4 a3 84 a 20 0 9 0 0 0 0 0 0 0 0 0 0 0 98 d2 8e 0 21 0 0 51 4d 37 32 38 31 39 30 35 32 30 2c cb 8e 1 22 b 34 0 51 4d 37 32 38 31 39 30 35 32 31 28 8e 2 23 a 30 35 0 51 4d 37 32 38 31 39 30 35 1a 5c 8e 3 24 9 32 30 36 0 51 4d 37 32 38 31 39 30 53 af 8e 4 25 8 35 32 30 37 0 51 4d 37 32 38 31 39 6c 0 8e 5 26 7 30 35 32 30 38 0 51 4d 37 32 38 31 c6 9b 8e 6 27 6 39 30 35 32 30 39 0 51 4d 37 32 38 39 e0 8e 7 28 5 31 39 30 35 32 31 30 0 51 4d 37 32 48 67 8e 8 29 4 38 31 39 30 35 32 31 31 0 51 4d 37 bf 19 8e 9 2a 3 32 38 31 39 30 35 32 31 32 0 51 4d 17 fa 8e a 2b 2 37 32 38 31 39 30 35 32 31 33 0 0 6f 43 8f 0 2c 0 0 1 a 0 15 3 3 3 3 0 0 0 5f 7b 8f 1 2d 0 0 0 0 0 0 0 b 3 2e 0 0 0 68 6c 8f 2 2e 0 0 0 0 0 9 0 0 0 0 0 0 0 e7 87 With the album-level field empty cur_track was never incremented, causing an off-by-one. Since the CD-TEXT additionally makes use of the Tab Indicator the entire CD-TEXT is thrown out as invalid due to a tab found in track 1 (that should be track 2). Fix this by always incrementing cur_track on a termination, even if the buffer contains nothing while still avoiding adding any blank fields to the parsed CD-TEXT structure. Include the above CD-TEXT in the test data. 2024-09-01 R. Bernstein * configure.ac: remove a gcc warning option... -Wmissing-declarations is obsolete? 2024-05-23 R. Bernstein * include/cdio/ecma_167.h, lib/driver/_cdio_generic.c, lib/driver/image_common.h, lib/driver/mmc/mmc_ll_cmds.c, lib/iso9660/iso9660_fs.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, test/driver/mmc_read.c, test/driver/mmc_write.c: Remove unneeded >0 check ... from last commit and misc lint: * Align style of last commit with current style * Remove declarations from block scope and move to function local variables * strip some trailing spaces * Use driver_return_code_t instead of int where it is a driver_return_code_t * rename i_flags to u_flags where u_flags is an unsigned int 2024-05-22 Mansour Gashasbi * lib/udf/udf_fs.c: Check the validity of i_extended_attr member in udf_get_lba() 2024-05-21 R. Bernstein * lib/udf/udf_fs.c: Merge mismatch... remove unneeded test, when type becomes unsigned 2024-05-21 R. Bernstein * THANKS: Add Mansour Gashasbi 2024-05-19 Mansour Gashasbi * lib/iso9660/iso9660_fs.c: Fix overflow in iso9660 dir read (32-bit) 2024-05-18 R. Bernstein * lib/udf/udf_fs.c: Correct type on unicode16_decode function 2024-05-17 R. Bernstein * lib/iso9660/iso9660_fs.c: Comment out patch incomplete code 2024-05-16 Mansour Gashasbi * lib/iso9660/iso9660_fs.c: Add bounds checking for directory buffer size and total size calculation 2024-05-16 Mansour Gashasbi * lib/udf/udf_fs.c: Add input validation to unicode16_decode function 2024-05-16 Mansour Gashasbi * lib/driver/_cdio_stdio.c: Limit the maximum read count to prevent overflow 2024-05-16 Mansour Gashasbi * lib/iso9660/rock.c: Allocate enough space for growth and additional buffer 2024-01-09 R. Bernstein * include/cdio/iso9660.h, lib/driver/libcdio.sym, lib/iso9660/iso9660_fs.c: libcdio.sym: Remove undefined symbols See https://lists.gnu.org/archive/html/libcdio-devel/2024-01/msg00000.htmland See https://bugs.gentoo.org/915826 With default options ld.lld-16 and newer fails to link due to undefined symbols listed in libddio.sym. Specifically: cdio_get_default_device_bsdi cdio_get_devices_bsdi cdio_have_bsdi cdio_open_am_bsdi cdio_open_bsdi cdio_set_drive_speed mmc_get_last_lsn mmc_isrc_track_read_subchannel The definitions for the 5 *_bsdi symbols were removed with commit 487136b3c6c80bbc772c56e6a388b12db55982f4. Neither the definition nor declaration appear in the git history for the symbols cdio_set_drive_speed and mmc_get_last_lsn. The definition for was removed with commit b427b174e664f632756bb1653fd2463592066fa3. 2023-04-09 R. Bernstein * .gitignore, Makefile.am: Add new files to distribution 2023-04-03 Thomas Schmitt * test/check_multiextent.sh: Remove blanks from the test names in check_multiextent 2023-04-03 Thomas Schmitt * test/README.multiextent, test/check_multiextent.sh, test/multiextent_emultocpad.right: Re-add the old multi-extent test ISO This image contains a second superblock and 300+ KiB of zeros, as is default with an ISO from a run of xorriso using its native commands set, i.e. not the mkisofs emulation. 2023-04-09 Thomas Schmitt * : commit f3097ebd1e035858b4f8678b379948700a69388c Author: R. Bernstein Date: Sun Apr 2 12:18:21 2023 -0400 2023-04-02 R. Bernstein * include/cdio/iso9660.h: Align iso9660.h definition name and implementation we use prefix p_ to indicate a pointer. 2023-03-31 Thomas Schmitt * : Merging branch joliet_multi_extent. 2023-03-27 Robert Kausch * doc/libcdio.texi, src/cd-info.c, src/cddb.c: Update freedb references to GnuDB. freedb was shut down in 2020. 2023-03-26 R. Bernstein * configure.ac: Bump version to dev 2023-03-26 R. Bernstein * configure.ac: Partial update of configure.ac.. to track autoconf and automake changes. autoupdate used. However some of the changes were not accepted. 2023-03-26 Thomas Schmitt * : Explicit initialization of tm_temp_tmp 2023-03-22 Pete Batard * lib/iso9660/rock.c: Add processing of Rock Ridge CE records Use the processed cont_extent to read the relevant continuation block once the current extensions have been processed. The code is designed to handle chained CE blocks if needed, and we also add code to detect ISOs that are abusing the specs to loop CEs. Also clean up the CHECK...() macros and fix some whitespace issues. 2023-03-22 Pete Batard * include/cdio/rock.h, lib/iso9660/rock.c: Clean up rock.h and fix the use of char arrays in iso_su_ce_s Using char arrays for extent, offset and size results in from_733() issues when processing CE data. Also harmonize to always use stdint types where possible. 2023-03-15 Robert Kausch * lib/driver/osx.c: Fix crash reading CD TOC on macOS Ventura Remove unnecessary additional byte added to the TOC buffer length and length of the range requested from CFDataGetBytes. As of macOS Ventura, CFDataGetBytes checks the requested length and asserts if more data than available is requested. 2022-10-30 R. Bernstein * lib/iso9660/rock.c: Correct NULL termination for Rock Ridge dir attrs Patch found by Sija Kijin and posted to libcdio-devel on Oct 20, 2022. See https://lists.gnu.org/archive/html/libcdio-devel/2022-10/msg00000.html 2022-08-24 R. Bernstein * test/driver/realpath.c: Correct realpath test failure See https://savannah.gnu.org/bugs/?62948 Patch courtesy of Martin Liška 2022-06-25 Thomas Schmitt * lib/iso9660/iso9660_fs.c: Bug fix: Recognition of multi-extent files was broken if Joliet is present 2022-02-02 Miguel Borges de Freitas * lib/driver/gnu_linux.c: Use getmntent/setmntent for reading mounts Since fields in the mtab and fstab files are separated by whitespace, octal escapes are used to represent the characters space (\040), tab (\011), newline (\012), and backslash (\\) in those files when they occur in one of the four strings in a mntent structure. The routines addmntent() and getmntent() will convert from string representation to escaped representation and back. When converting from escaped representation, the sequence \134 is also converted to a backslash. 2022-01-23 R. Bernstein * example/cdchange.c, lib/driver/gnu_linux.c: Bump copyright 2021-10-10 Lukas Prediger * example/cdchange.c, lib/driver/gnu_linux.c: Multiprocess robust cd change detection The new CDROM_TIMED_MEDIA_CHANGE ioctl introduced with Linux v5.16 allows media change detection to work robustly for multiple processes. This commit adapts libcdio to use this new ioctl request if compiled against kernel v5.16 or newer. It retains the old behavior for older kernels. 2021-11-01 R. Bernstein * src/cdda-player.c: Bump copyright 2021-11-01 Sergei Trofimovich * src/cdda-player.c: src/cdda-player.c: always use "%s"-style format for printf()-style functions `ncuses-6.3` added printf-style function attributes and now makes it easier to catch cases when user input is used in place of format string when built with CFLAGS=-Werror=format-security: cdda-player.c:1032:31: error: format not a string literal and no format arguments [-Werror=format-security] 1032 | mvprintw(i_line++, 0, line); | ^~~~ Let's wrap all the missing places with "%s" format. 2021-09-06 R. Bernstein * src/iso-read.c: Correct name of iso files in error message. 2021-03-01 R. Bernstein * : commit 95479463eee2c4f84586d8a35d0fe678e54d2d1f Merge: 197fcef4 73358383 Author: R. Bernstein Date: Sun Feb 28 16:35:30 2021 -0500 2021-02-28 R. Bernstein * : commit 73358383f15558f5646d1f19f3691cbd2a1ad660 Author: R. Bernstein Date: Sun Feb 28 16:34:41 2021 -0500 2020-07-02 Pete Batard * test/data/Makefile.am: Fix make distcheck 2020-05-29 Pete Batard * test/Makefile.am, test/check_deep_directory.sh, test/data/Makefile.am, test/data/deep_directory1_file, test/data/deep_directory2_file, test/deep_directory.right: Add Rock Ridge deep directory test The test is designed to test more than one level of deep directories. Also the ISO is designed so that the folder with deep directory children (/1/) appears before the target (/rr_moved/), so that any endless recursion during lookup of the CL target will be tested. In other words, this validates that the deep directory lookup doesn't only work if the CL target can be listed before the CL source. 2020-05-28 Pete Batard * include/cdio/rock.h, lib/driver/cdio_private.h, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c: Add Rock Ridge deep directory support In order to locate the target of a child link, we need to be able to call iso9660_[i]fs_find_lsn() from within get_rock_ridge_filename() which means that we need to add an additional image parameter for the handful of calls that are used during directory traversing. We also need to use a special version of the call, that works with DD disabled, since we need to process RE entries, i.e the directories that contain the CL target, as well as ignore CL elements altogether, so that we don't end up with an endless recursion. All of the above can be achieved by also carrying a 'DISABLE_RR_DD' flag in the image. However since we need to ensure that we handle both iso9660_t as well as CdIo_t as the image, we modify both structures so that they have a common header which we can reference. Note that the approach of turning Rock Ridge extensions altogether during LSN seek (through the use of the iso9660_t extension mask for instance) is not appropriate as we do want to be able to retrieve other Rock Ridge attributes, such as long filenames, for the child link target, hence the requirement to being able to disable deep directory alone. 2020-05-28 Pete Batard * include/cdio/rock.h, lib/iso9660/rock.c: Introduce u_su_fields Rock Ridge attributes Also fix and clean various Rock Ridge related issues. 2020-05-28 Pete Batard * lib/iso9660/rock.c: Remove parse_rock_ridge_stat/parse_rock_ridge_stat_internal These calls aren't being used anywhere -> remove them. 2020-05-29 Pete Batard * src/iso-read.c, test/testisorr.c: Fix tests where using iso9660_open() might prevent extension usage iso9660_open() is currently an alias to iso9660_open_ext(..., ISO_EXTENSION_NONE) which means that the image is requested to be opened without Joliet or Rock Ridge extensions. Switch to using iso9660_open_ext() for tests that do rely on extensions. 2020-05-29 Pete Batard * lib/driver/gnu_linux.c, test/driver/gnu_linux.c: Fix gnu-linux.c compilation warnings * There's no point in using strncpy when we allocate for the string size. * A NULL psz_source string was used instead of ppsz_drives[0]. 2020-05-24 Pete Batard * test/check_multiextent.sh: Add missing +x permission to check_multiextent.sh 2020-05-23 Pete Batard * test/Makefile.am, test/check_multiextent.sh, test/data/Makefile.am, test/data/multi_extent_file, test/multiextent.right: Add multi extent test 2020-05-18 Pete Batard * example/extract.c, example/isofile.c, example/isofile2.c, example/isolist.c, include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c, src/iso-info.c, src/iso-read.c, src/util.c, test/testisocd.c, test/testisocd2.c, test/testisocd_joliet.c: Add support for ISO9660 multi extent files This change expands the iso9660_stat_s struct to add support for processing multiple extents. The new structure is compatible with the current API, provided the DO_NOT_WANT_COMPATIBILITY macro is not defined. Examples and tests are also modified to use the updated API. Co-authored-by: Thomas Schmitt 2020-05-22 Pete Batard * configure.ac: Introduce --disable-compatibility as a configure option The option sets the DO_NOT_WANT_COMPATIBILITY macro in config.h which is used to disable APIs that are being retired. 2020-05-19 Pete Batard * lib/driver/cdio_private.h, lib/iso9660/iso9660.c, lib/udf/udf_fs.c: Fix gcc strncpy related warnings gcc 10 on MinGW generates a handful of: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=] Either use memcpy() to avoid that remove the unneeded MIN in places where it is superfluous. Also add guards for the GCC specific pragma in iso9660.c. 2020-05-18 Thomas Schmitt * include/cdio++/iso9660.hpp: Fix free while still in use in iso9660.hpp C++ method IFS::readdir() freed the iso9660_stat_t objects which it handed out to its caller. 2020-05-18 Thomas Schmitt * example/C++/OO/iso4.cpp, example/C++/OO/isolist.cpp: Fix two memory leaks in example/C++/OO/ example/C++/OO/isolist.cpp did not delete its Stat objects. example/C++/OO/iso4.cpp had a memory leak by forgotten destructor. 2020-05-18 Thomas Schmitt * example/C++/isofile.cpp, example/C++/isofile2.cpp, example/isofile.c, example/isofile2.c, include/cdio++/iso9660.hpp, lib/iso9660/iso9660_fs.c, src/iso-read.c: Fix use of iso9660_stat_free() where appropriate. 2020-05-20 Thomas Schmitt * lib/driver/MSWindows/win32.c: Fixed win32 implementation of .get_track_msf() for CD with first track number > 1 2020-05-20 Pete Batard * test/testischar.c: Use current API names in testischar.c If we are using iso9660_is_dchar() we might as well use iso9660_is_achar(). 2020-05-20 Pete Batard * : Remove leftover symlink attribute from cdda_4_5.bin 2020-05-20 Pete Batard * : Fix check_cue test failure on Windows platforms Can't use symbolic links on Windows, and cdda_4_5.bin was registered as a symbolic link to cdda.bin. For now, just duplicate the file. 2020-05-19 Pete Batard * .gitattributes: Fix check_opts.sh failure on MinGW It turns out that grep really doesn't like to see CRLF in regexps. 2020-05-19 Pete Batard * src/cd-info.c: Fix double reporting of sizes in cd-info.c If the sizes were smaller than 1 KB (e.g. 0), you would get something like: 0: 00:02:00 000000 leadout (0 bytes(0 KB raw, 0 bytes0 KB formatted) 2019-08-18 R. Bernstein * configure.ac, include/cdio/types.h: Remove homegrown boolean type; require 2019-05-07 R. Bernstein * : Merge remote-tracking branch 'origin/bug53929' 2019-05-04 Edd Barrett * configure.ac: Revert "Disable cdda_player on NetBSD" This reverts commit 123db461efef93b05401b7918afe4d05f78d8cb2. Fixes bug #56240. 2019-05-03 Thomas Schmitt * lib/driver/cdtext.c: Made CD-TEXT character set interpretation more tolerant towards bad input. Reaction on savannah bug 53929. 2019-04-19 Lars Wendler * configure.ac: configure.ac: Search for pkg-config with its PKG_PROG_PKG_CONFIG macro Otherwise the pkg-config command might not be found and thus some of the required packages (like ncurses) as well. Signed-off-by: Lars Wendler 2019-04-17 R. Bernstein * include/cdio/types.h: Fix C-preprocessor typo involving OSX packed() 2019-04-17 R. Bernstein * NEWS.md, configure.ac, doc/how-to-make-a-release.md, include/cdio/audio.h, include/cdio/cdtext.h, include/cdio/device.h, include/cdio/mmc.h, include/cdio/mmc_ll_cmds.h: Get ready for release 2.1.0.. and go over Doxygen docs. 2019-04-14 R. Bernstein * NEWS.md: Small spelling and markup changes to NEWS.md 2019-04-14 Edd Barrett * NEWS.md: Fix a couple of small typos. 2019-04-14 R. Bernstein * NEWS.md, THANKS, configure.ac, test/driver/mmc_read.c: Edd Barrett's suggestions * Read failure on mmc_read is now logged as test skipped. * Correct Edd's contributions. My mistake! 2019-04-13 R. Bernstein * lib/iso9660/iso9660.c, src/cd-read.c, src/cdda-player.c: lint-like fixes... iso9660.c - suppose gcc small-format warning cdda-player.c: free terminal on exit; don't init screen more than once cd-read.c: correct help 2019-04-13 R. Bernstein * include/cdio/types.h, lib/iso9660/iso9660_fs.c: gcc 8 wants strlen in strncpy ... rather than sizeof(src) 2019-04-13 R. Bernstein * : commit b72ac347f21b6d6d3416c0c687ebfe5f98c1d160 Author: R. Bernstein Date: Sat Apr 13 06:47:11 2019 -0400 2019-04-13 R. Bernstein * include/cdio/types.h: Handle clang pack(push)/pack(pop) 2019-04-13 R. Bernstein * lib/iso9660/rock.c: Remove one clang warning 2019-04-13 R. Bernstein * Makefile.am, example/.gitignore, example/Makefile.am, example/udffile.c, src/Makefile.am: Go over valgrind leak detection 2019-04-13 R. Bernstein * NEWS.md, configure.ac, example/C++/OO/cdtext.cpp, example/cdtext-raw.c, example/cdtext.c, example/read-disc-struct.c, lib/driver/Makefile.am: Get ready for 2.1.0RC1 + administrivia 2019-04-13 R. Bernstein * Makefile.am, NEWS => NEWS.md, THANKS, doc/.gitignore, doc/Makefile.am, doc/how-to-make-a-release.md, doc/how-to-make-a-release.txt: Go over and turn release process into Markdown. Go over release notes. Convert NEWS to Markdown. Acknowledge Edd Barrett help Some administrivia 2019-02-24 R. Bernstein * : commit af3debc3704ef5cd02c5f8a89792194073316c69 Author: Edd Barrett Date: Sun Feb 10 17:27:33 2019 +0000 2019-01-22 Thomas Schmitt * test/data/Makefile.am: Replaced 8 blanks by tab character in test/data/Makefile.am. Correction of previous commit. 2019-01-22 Thomas Schmitt * test/data/Makefile.am, test/data/cdda_4_5.bin: Added new file cdda_4_5.bin and re-enabled cdda_4_5.cue 2019-01-20 R. Bernstein * test/data/Makefile.am: cdda_4_5.bin is not in git, and there is no rule to make it 2019-01-14 Thomas Schmitt * test/check_fuzzyiso.sh: Added cdda_4_5.bin and cdtextfile.bin to the exemption list of test/check_fuzzyiso.sh 2019-01-14 Thomas Schmitt * test/Makefile.am, test/cdda_4_5.right, test/check_cue.sh.in, test/data/Makefile.am, test/data/cdda_4_5.cue: Added test about cdda_4_5.cue which checks for proper display of track start number > 1 2019-01-22 R. Bernstein * : commit 879e0bf8243624652eb7686bcf360aeb9f09ef9a Author: Thomas Schmitt Date: Tue Jan 22 14:07:44 2019 +0100 2019-01-22 Thomas Schmitt * test/data/Makefile.am, test/data/cdda_4_5.bin: Added new file cdda_4_5.bin and re-enabled cdda_4_5.cue 2019-01-20 R. Bernstein * : commit 2663976828f206f6f173ae3468531a215acce7fe Author: R. Bernstein Date: Sun Jan 20 17:14:42 2019 -0500 2019-01-14 Thomas Schmitt * test/check_fuzzyiso.sh: Added cdda_4_5.bin and cdtextfile.bin to the exemption list of test/check_fuzzyiso.sh 2019-01-14 Thomas Schmitt * src/cd-info.c, test/Makefile.am, test/cdda_4_5.right, test/check_cue.sh.in, test/data/Makefile.am, test/data/cdda_4_5.cue: Added test about cdda_4_5.cue which checks for proper display of track start number > 1 2018-12-30 R. Bernstein * configure.ac: Bump LIBCDIO_VERSION_NUM 2018-12-30 R. Bernstein * : commit 865140686d97a5c854f18895d74d45edf3c3248a Author: R. Bernstein Date: Sun Dec 30 15:04:19 2018 -0500 2018-12-30 Thomas Schmitt * lib/driver/image/bincue.c: Replaced the newly introduced calls of cdio_warn() by cdio_log() 2018-12-29 Thomas Schmitt * lib/driver/image/bincue.c: Fixed another wrong track number assumption in BIN/CUE driver 2018-12-29 Thomas Schmitt * lib/driver/image/bincue.c, lib/driver/image_common.c: Fixed wrong assumptions about track start number in BIN/CUE driver 2018-12-28 Thomas Schmitt * lib/driver/gnu_linux.c: Fixed in gnu_linux.c some wrong assumptions that the start track number is always 1 2018-12-01 Edd Barrett * lib/driver/netbsd.c, src/cd-info.c: NetBSD/OpenBSD: Do not assume the first track number is 1. Found by Thomas Schmitt: http://lists.gnu.org/archive/html/libcdio-devel/2018-10/msg00025.html 2018-09-10 Edd Barrett * src/cdda-player.c: cdda-player: Add missing `-d` to help message and fix an indent. 2018-09-01 Edd Barrett * src/cdda-player.c: cdda-player: Missing set of b_cd for stopping the CD non-interactive. 2018-09-01 Edd Barrett * src/cdda-player.c: cdda-player: Ensure that stdin is in the fd set for select_wait(). 2018-09-01 Edd Barrett * src/cdda-player.c: cdda-player: Unbreak -s. 2018-06-19 Edd Barrett * lib/driver/netbsd.c: NetBSD/OpenBSD: Merge in-tree driver with the local patch in OpenBSD ports. Some time ago Jasper Lievisse Adriaanse imported libcdio into OpenBSD ports including with a dedicated OpenBSD backend: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/audio/libcdio/files/openbsd.c?rev=1.4&content-type=text/x-cvsweb-markupThis change merges his work into the existing NetBSD backend (there were many missing functions in the NetBSD backend). Note that in doing so, we also switched from LBA addressing to MSF addressing. Fixes many problems with the NetBSD driver on OpenBSD. 2018-06-19 Edd Barrett * lib/driver/netbsd.c: NetBSD driver: Improve device enumeration and make it work on OpenBSD. 2018-09-10 Edd Barrett * lib/driver/netbsd.c: NetBSD: libcdio_error -> libcdio_warn. 2018-06-11 Edd Barrett * autogen.sh: OpenBSD: Make autogen.sh work on OpenBSD. 2018-12-02 R. Bernstein * src/cd-info.c: Slight correction to Edd's patch 2018-10-26 R. Bernstein * configure.ac: Disable cdda_player on NetBSD 2018-09-16 R. Bernstein * autogen.sh: Fix barf of autogen.sh on creating stamp-vti 2018-09-01 R. Bernstein * : commit cb487963c4ae1ae11cf092e1b822463c9290ea37 Author: R. Bernstein Date: Thu Aug 30 21:02:34 2018 -0400 2018-08-12 R. Bernstein * lib/driver/netbsd.c: linux->netbsd in some names in netbsd.c 2018-08-12 R. Bernstein * lib/driver/gnu_linux.c, lib/driver/netbsd.c: Netbsd alignment... - Add write and exclusive-write CD access modes - add netbsd mode1 reading like others 2018-07-03 R. Bernstein * : Merge remote-tracking branch 'origin/stef-cdda-lib-patch' 2018-06-28 R. Bernstein * configure.ac: cdda-player configure patch from Stef #54191 From Stef: I came up with a patch that I believe will work for everyone. It uses AC_SEARCH_LIBS, instead of AC_CHECK_LIB. So, if keypad() is defined in -lncurses or -lcurses, it does exactly what it does now. However, if -ltinfo is needed, it is added to CDDA_PLAYER_LIBS along with the curses library. 2018-06-28 R. Bernstein * : Merge remote-tracking branch 'origin/api-doc' 2018-06-25 Thomas Schmitt * example/cdtext-raw.c: Enabled recognition and skipping of MMC headers before raw CD-TEXT data 2018-06-24 Thomas Schmitt * lib/driver/image/bincue.c: Applied the proper destructor to CdioDataSource_t if parse_cuefile() sees an undersized CDTEXTFILE 2018-06-24 Thomas Schmitt * example/cdtext-raw.c, lib/driver/cdtext_private.h, lib/driver/image/bincue.c: Expanded maximum CD-TEXT payload size to 8 full text blocks of 256 * 18 bytes 2018-06-24 Thomas Schmitt * include/cdio/cdtext.h, include/cdio/disc.h, include/cdio/mmc.h, include/cdio/mmc_ll_cmds.h: Some clarifications about the API for raw CD-TEXT information 2018-06-17 R. Bernstein * include/cdio/disc.h: Small typo caught by Thomas... Remove read-disc-struct binary 2018-06-16 Thomas Schmitt * example/cdtext-raw.c: Added comment to explain why function language_code_tests() exists 2018-06-13 R. Bernstein * example/cdtext.c: Small change in comment wording. 2018-06-13 R. Bernstein * conf9AaqoM/subs.awk, conf9AaqoM/subs1.awk, test/driver/abs_path.dSYM/Contents/Info.plist: Remove addition of unintended files... thanks to Thomas for pointing out. 2018-06-13 R. Bernstein * : commit ce2a26f2fcfc860c99b0ec75f0873d09e1230b64 Author: R. Bernstein Date: Wed Jun 13 04:22:48 2018 -0400 2018-06-12 R. Bernstein * conf9AaqoM/subs.awk, conf9AaqoM/subs1.awk, config_extract.sh, example/read-disc-struct.c, example/read-disc-struct.sh, test/driver/abs_path.dSYM/Contents/Info.plist: fc94b050dcd361b6f18dbef3886384ee520a4d4b 2018-06-05 Pete Batard * lib/driver/image/bincue.c, lib/driver/image/nrg.c: Fix MinGW inlining failed warnings The latest MinGW32 reports the following during compilation: image/bincue.c: In function 'cdio_get_devices_bincue': image/bincue.c:992:20: warning: inlining failed in call to 'Win32Glob.constprop': call is unlikely and code size would grow [-Winline] static inline void Win32Glob(const char* pattern, const char* szCurPath, char ***drives, unsigned int *num_files) ^~~~~~~~~ image/nrg.c: In function 'cdio_get_devices_nrg': image/nrg.c:1128:20: warning: inlining failed in call to 'Win32Glob.constprop': call is unlikely and code size would grow [-Winline] static inline void Win32Glob(const char* pattern, const char* szCurPath, char ***drives, unsigned int *num_files) ^~~~~~~~~ 2018-05-30 Thomas Schmitt * lib/driver/cdtext.c: Removed an unreachable return statement from cdtext_lang2str() 2018-05-29 Thomas Schmitt * lib/driver/cdtext.c: Bug fix: cdtext_lang2str() yielded wrong texts, invalid memory addresses, or immediate memory fault with language codes above 0x2B. 2018-05-29 Thomas Schmitt * example/cdtext-raw.c: New tests for CDTEXT language code conversion 2018-05-28 Thomas Schmitt * include/cdio/cdtext.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/libcdio.sym: Renamed internal cdtext_is_language() to cdtext_lang2str() and promoted it to API 2018-05-27 Pete Batard * lib/iso9660/iso9660_fs.c: Switch to using the more relaxed from_733 in _iso9660_dir_to_statbuf * Done so that libcdio doesn't bail out when processing non-compliant ISOs such as openSUSE Leap 15.0 2018-05-27 Pete Batard * include/cdio/bytesex.h: Set from_723 and from_733 to return the little-endian value always * And silence the warning in case of little-endian and big-endian mismatch * Also introduce a from_723_with_err() that can be used to report mismatch if needed 2018-05-27 Thomas Schmitt * example/C++/OO/cdtext.cpp, example/cdtext-raw.c, example/cdtext.c, include/cdio++/cdtext.hpp, include/cdio/cdtext.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/libcdio.sym, src/cd-info.c: New API call cdtext_list_languages_v2() to be preferred over now deprecated cdtext_list_languages(). New API call cdtext_set_language_index(). 2018-05-18 R. Bernstein * .gitignore: Admnistrivia 2018-05-18 R. Bernstein * configure.ac: Remove some obsolete macros 2018-02-16 rocky * src/iso-read.c: Fix small I/O leak when we can't read ISO file See Savannah bug #53170. Thanks to David Binderman. 2017-12-31 R. Bernstein * NEWS, THANKS, configure.ac, doc/how-to-make-a-release.txt: Get ready for release 2.0.0 2017-12-29 R. Bernstein * configure.ac, example/mmc3.c, example/sample4.c, lib/driver/gnu_linux.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/cdda-player.c, test/driver/cdda.c, test/driver/mmc_read.c, test/testgetdevices.c, test/testiso9660.c, test/testisocd.c: Memory leaks and lint found from clang "scan_build" 2017-12-24 R. Bernstein * configure.ac: RC3 2017-12-23 R. Bernstein * configure.ac, lib/driver/_cdio_generic.c: Removed wrong line 2017-12-22 R. Bernstein * lib/driver/_cdio_generic.c: Fix double free courtesy of Chris Clayton 2017-12-21 R. Bernstein * NEWS: Update NEWS again 2017-12-21 R. Bernstein * : commit 48176cc51a183ff52fab338f6bca3033746e3a5f Merge: 872898b6 6dc697d2 Author: R. Bernstein Date: Thu Dec 21 23:26:02 2017 -0500 2017-12-21 R. Bernstein * : commit 6dc697d29a885d87ce37897ba977bd2421c0b32d Author: R. Bernstein Date: Thu Dec 21 23:16:17 2017 -0500 2017-12-21 R. Bernstein * NEWS: Wordsmith NEWS 2017-12-21 R. Bernstein * NEWS, configure.ac, lib/cdio++/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/udf/Makefile.am: rc1 candidate - update news, bump SO numbers 2017-12-21 R. Bernstein * lib/driver/device.c, lib/driver/netbsd.c, src/cd-info.c: Add NetBSD drive detection; correct drive detection in cd-info.c Patches from Onno van der Linden 2017-12-20 R. Bernstein * example/cdtext-raw.c: Windows tolerance in cdtest-raw program 2017-12-20 R. Bernstein * test/testgetdevices.c: Remove MingGW compile warning in a test 2017-12-20 R. Bernstein * src/Makefile.am, test/check_common_fn.in, test/driver/realpath.c: Correct realpath for memleaks and MinGW; fix src/Makefile clean target 2017-12-19 R. Bernstein * example/.gitignore, example/Makefile.am, src/Makefile.am: "make clean" administrivia Clean OSX schmutz and .libs 2017-12-19 R. Bernstein * NEWS: Note API breakage in 1.1.0 and 1.0.0 2017-12-10 R. Bernstein * doc/how-to-make-a-release.txt: Administrivia 2017-12-10 R. Bernstein * include/cdio/iso9660.h: Doxygen fixups 2017-12-10 R. Bernstein * NEWS, configure.ac, doc/how-to-make-a-release.txt: Get ready for release 1.1.0 2017-12-09 R. Bernstein * src/cd-drive.c, src/cd-info.c, src/cd-read.c, src/iso-info.c, src/iso-read.c, src/mmc-tool.c: DRY/Regularize src programs 2017-12-09 R. Bernstein * src/cd-drive.c: Small cd-drive.c tweak 2017-12-09 R. Bernstein * src/cd-drive.c, src/iso-info.c: More memory leak and invalid access removal 2017-12-09 R. Bernstein * lib/driver/osx.c: Fix some of the memory leaks on OSX... more to come 2017-12-09 R. Bernstein * lib/driver/MSWindows/win32.c: Reduce MSWindows leaks 2017-12-08 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/gnu_linux.c, lib/driver/netbsd.c: DRY code. More leak removal. 2017-12-08 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/image/cdrdao.c, test/testisocd_joliet.c: Reduce memory leaks 2017-12-07 R. Bernstein * lib/driver/_cdio_generic.c, lib/driver/aix.c, lib/driver/solaris.c, src/iso-info.c, src/mmc-tool.c: Another pass at removing memory leaks 2017-12-07 R. Bernstein * example/C++/Makefile.am, example/C++/OO/Makefile.am, example/C++/OO/iso4.cpp, lib/driver/gnu_linux.c, lib/iso9660/iso9660_fs.c, test/testisocd.c: Reduce memory leaks and invalid pointer accesses 2017-12-06 R. Bernstein * src/iso-info.c: iso-info: free memory on error 2017-12-06 R. Bernstein * lib/driver/_cdio_generic.c: Remove duplicate free... Now that cdio_destroy cleans up after itself better 2017-12-06 R. Bernstein * lib/iso9660/iso9660.c: Another #if -> #ifdef 2017-12-05 R. Bernstein * NEWS: Typo 2017-12-05 R. Bernstein * NEWS, configure.ac, doc/how-to-make-a-release.txt: Things in preparation for a release 2017-12-05 R. Bernstein * lib/iso9660/Makefile.am: Bump revision 2017-12-05 R. Bernstein * lib/iso9660/iso9660.c, lib/iso9660/libiso9660.sym: Small stuff.. Includes to patcheds from Ozkan Sezer 2017-12-05 R. Bernstein * include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c, src/cd-info.c, src/iso-info.c: Add Cdio9660DirList type, new() and free() 2017-12-05 R. Bernstein * : commit fef44a73d92998e34980daa0211959b5f3a2a1b8 Author: R. Bernstein Date: Tue Dec 5 17:00:33 2017 -0500 2017-12-02 R. Bernstein * example/C++/eject.cpp, example/eject.c, lib/driver/device.c: Remove memory leak in cdio_eject_media_drive 2017-12-01 R. Bernstein * example/C++/Makefile.am, example/C++/OO/isolist.cpp, example/C++/isolist.cpp, include/cdio++/iso9660.hpp: Start C++ cleanup 2017-12-01 R. Bernstein * example/extract.c, example/isofuzzy.c, example/isolist.c, include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, src/cd-info.c, src/iso-info.c: Add custom readdir statbuf list... and free routine 2017-12-01 R. Bernstein * lib/driver/gnu_linux.c, lib/driver/mmc/mmc_cmd_helper.h, test/driver/mmc_read.c, test/driver/mmc_write.c: Remove test leaks and uninitialized access 2017-11-30 R. Bernstein * configure.ac, example/Makefile.am, lib/iso9660/iso9660.c, test/Makefile.am, test/testisocd.c, test/testisocd_joliet.c: More valgrind warnings... configure.ac, iso9660.c: initialize tm_zone in tm if that exists example/Makefile.am: add make leak-check target testisocd{_joliet,}.c: remove memory leaks 2017-11-30 R. Bernstein * lib/iso9660/iso9660_fs.c: Remove invalid access in RR handling 2017-11-30 R. Bernstein * test/testudf.c: Plug memory leaks in testudf.c 2017-11-30 R. Bernstein * configure.ac, include/cdio++/iso9660.hpp, include/cdio/iso9660.h, lib/cdio++/iso9660.cpp, lib/iso9660/iso9660_fs.c, src/cd-info.c, test/Makefile.am, test/driver/Makefile.am, test/testisocd2.c: Lots of cleanups... isio9660.h, iso9660.c, iso9660.hpp remove mode2 from is9660_fs_stat_translate() and in C++ version go over doxygen comments. (More is needed) iso-info.c, cd-info.c: use alloca() instead of malloc() where possible test/Mamefile.am: correct remake comments for check-leaks testisocd2.c: make leak free iso9660_fs.c: fix memory leak in iso9660_ifs_find_lsn 2017-11-28 R. Bernstein * configure.ac, example/extract.c, example/isofuzzy.c, example/isolist.c, example/udf1.c, example/udffile.c, include/cdio++/iso9660.hpp, include/cdio/ds.h, include/cdio/types.h, lib/cdio++/iso9660.cpp, lib/driver/_cdio_stream.c, lib/driver/ds.c, lib/driver/image/nrg.c, lib/iso9660/iso9660_fs.c, src/cd-info.c, src/iso-info.c, test/testisocd2.c: WIP: deal with memory leaks from cdio_lists TODO: * create function for dirlist free; is: _cdio_list_free (dirlist, true, free); * create function for statbuf free; is: _cdio_list_free (entlist, true, (CdioDataFree_t) iso9660_stat_free); * Add targets to run valgrind to look for memory leaks * Fix remaining memory leaks 2017-11-25 R. Bernstein * lib/driver/MSWindows/aspi32.c, src/cdda-player.c: Restore -x mode change 2017-11-25 R. Bernstein * lib/driver/MSWindows/aspi32.c, src/cdda-player.c: Rename some shadowed variables 2017-11-25 R. Bernstein * example/cdchange.c, test/driver/mmc_read.c, test/driver/mmc_write.c: do not use sleep() for MS Windows. From Ozkan Sezer: _sleep() has long been deprecated and no longer prototyped in stdlib.h, despite the fact that msvcrt.dll still exports it. therefore, undefine HAVE_SLEEP when targeting windows, use Sleep win32 api function instead. 2017-11-25 R. Bernstein * lib/driver/cdio_private.h: fix 'strndup shadows a built-in function' warnings From Ozkan Sezer: if strndup() is not available, the build log is plagued with the following warnings: lib/driver/cdio_private.h:46:21: warning: declaration of 'strndup' shadows a built-in function So, rename the replacement inline strndup to libcdio_strdup, and define strndup as libcdio_strndup. 2017-11-25 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: fix mixed declarations and code in win32_ioctl.c from Ozkan Sezer 2017-11-25 R. Bernstein * : commit 4305bc1e093e4341aeddb857bd1e6203228000cb Author: R. Bernstein Date: Sat Nov 25 14:03:37 2017 -0500 2017-11-24 R. Bernstein * configure.ac, src/cdda-player.c: Bug introduced by unshadowing variables Patch from Bernard Cafarelli . See https://savannah.gnu.org/bugs/?52495 2017-11-23 R. Bernstein * configure.ac: Set LIBCDIO_VERSION in a more consistent way we'll use the convention x.y.zjunk => x*10000 + y*100 + z Savannah bug #52491 2017-11-21 R. Bernstein * configure.ac, doc/how-to-make-a-release.txt: Now in 1.0.1git land 2017-11-21 R. Bernstein * include/cdio/mmc_ll_cmds.h: FIx doxygen-noted problems 2017-11-21 R. Bernstein * NEWS: What's new in 1.0.0 (update) 2017-11-21 R. Bernstein * configure.ac: 1.0.0 release 2017-11-21 R. Bernstein * configure.ac, lib/driver/FreeBSD/freebsd.c, src/cdda-player.c, src/getopt.c: Remove more warnings/spurious code 2017-11-20 R. Bernstein * NEWS, src/iso-info.c, test/check_bad_iso.sh: Fixes for bad iso9660 detection ... from Thomas Schmitt 2017-11-20 R. Bernstein * lib/udf/udf_fs.c: Slight udf tweak 2017-11-20 R. Bernstein * include/cdio/ds.h, lib/iso9660/iso9660_fs.c: Another small memory leak plugged. 2017-11-20 R. Bernstein * include/cdio/ds.h, lib/driver/device.c, lib/iso9660/iso9660_fs.c, test/testisocd.c: Reduce memory leaks... remove deprecated things in dh.h Note: a reworking of ds.h is needed to handle data which has alloc memory. 2017-11-20 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: Move another C decl 2017-11-20 R. Bernstein * configure.ac, test/testisocd_joliet.c: Add CC -Wbad-function-cast when possible 2017-11-20 R. Bernstein * configure.ac, example/mmc1.c, lib/driver/abs_path.c, src/iso-info.c, test/driver/bincue.c, test/testgetdevices.c, test/testisocd2.c: Make sure C decls are not mixed after code 2017-11-19 R. Bernstein * include/cdio/util.h, lib/driver/image/bincue.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/iso9660/iso9660_fs.c, src/util.c, test/Makefile.am, test/driver/Makefile.am, test/testisocd2.c: Remove more memory leaks; remove more #ifdefs 2017-11-19 R. Bernstein * lib/driver/gnu_linux.c: Another #if -> #ifdef 2017-11-19 R. Bernstein * test/driver/realpath.c: Remove memory leaks in realpath test 2017-11-19 R. Bernstein * NEWS, lib/driver/image/nrg.c, test/driver/logger.c: Remove more memory leaks (via valgrind) 2017-11-19 R. Bernstein * lib/driver/cdtext.c: More complete CD-Text free 2017-11-19 R. Bernstein * README.libcdio, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c: MSWindows updates; Update README.libcdio; 2017-11-19 R. Bernstein * lib/driver/FreeBSD/freebsd.c: FreeBSD lint Tidy code now that we assume CAM always 2017-11-19 R. Bernstein * lib/driver/netbsd.c: Fix NetBSD return type in get_track_format 2017-11-18 R. Bernstein * include/cdio/types.h, lib/driver/netbsd.c, src/cdda-player.c: NetBSD fixes 2017-11-18 R. Bernstein * lib/driver/solaris.c: Bring solaris in line with recent changes 2017-11-18 R. Bernstein * NEWS, src/cd-info.c: bug introduced in unshadowing... found by clang. Update NEWS 2017-11-18 R. Bernstein * configure.ac, include/cdio/device.h, lib/driver/FreeBSD/freebsd.h, lib/driver/Makefile.am, lib/driver/bsdi.c, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/image/bincue.c, src/cd-info.c, src/util.c, test/testiso9660.c: Remove BSDI remnants. Remove -wundef warnings 2017-11-18 R. Bernstein * configure.ac, example/audio.c, example/mmc1.c, example/mmc2.c, lib/driver/image/bincue.c, src/cd-info.c, src/cdda-player.c, src/mmc-tool.c, src/util.c, test/Makefile.am: Don't shadowing variables ... add CC -wshadow 2017-11-18 R. Bernstein * lib/driver/gnu_linux.c: Fix small bug in GNU/Linux access-mode setting 2017-11-18 R. Bernstein * lib/driver/mmc/mmc.c, test/Makefile.am, test/check_bad_iso.sh: I said remove get_trace_isrc_mmc 2017-11-18 R. Bernstein * test/check_bad_iso.sh: Remove abs_srcdir 2017-11-17 R. Bernstein * lib/driver/Makefile.am: Bump libcdio_la_CURRENT... We have removed OS/2 and some deprecations 2017-11-16 R. Bernstein * NEWS: What's happened in the last year 2017-11-16 R. Bernstein * include/cdio/device.h, include/cdio/mmc.h, lib/driver/Makefile.am, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/os2.c: Remove deprecated stuff... - OS/2 driver - mmc_isrc_track_read_subchannel - CDIO_MIN_DRIVER, CDIO_MIN_DEVICE_DRIVER, CDIO_MAX_DRIVER, CDIO_MAX_DEVICE_DRIVER Apple Darwin OS X -> macOS 2017-11-16 R. Bernstein * README.libcdio, configure.ac, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c: Merge Thomas' changes and ... Try release 1.0.0rc1 Some grammar changes made in comments. 2017-11-16 R. Bernstein * : commit ddd984854b09c1a8203867534c087c0d83ff8622 Author: R. Bernstein Date: Mon Oct 9 12:35:54 2017 -0400 2017-09-26 R. Bernstein * lib/iso9660/iso9660_fs.c, src/iso-info.c, src/util.c, test/Makefile.am, test/check_bad_iso.sh, test/check_iso.sh.in, test/data/Makefile.am: handle bad iso 9660 better. Fixes bug #52091 src/iso-info.c: reflect errors in getting information back in exit code lib/iso9660_fs.c: bail when we there is bad stat info for a directory change interface to report failure src/util.h: bump copyright test/data/bad-dir.iso: bad ISO 9660 test/check_bad_iso.sh: test program test/check_iso.sh.in: expect nonzero RC on failures 2017-09-16 R. Bernstein * : commit 266aa360193dc66ec7650e8804cdcb354b657633 Author: R. Bernstein Date: Sat Sep 16 08:43:33 2017 -0400 2017-09-16 R. Bernstein * README.libcdio: Note --enable-maintainer-mode 2017-09-15 R. Bernstein * lib/driver/osx.c, test/check_cdtext.sh: (High) Sierra compatibility... osx.c: Use libcdio version of assert, not OSX's. check_cdtext.sh: return should only be used inside functions 2017-08-25 R. Bernstein * configure.ac, lib/driver/utf8.c: iconv is need to build libcdio... Add check in configure.ac (was just for joliet) and add check in code that needs it. 2017-08-22 R. Bernstein * lib/driver/netbsd.c: Add NetBSD patch-ad 2017-07-30 R. Bernstein * lib/iso9660/iso9660_fs.c: Fix type bug, and attempt to improve comments. 2017-07-30 Thomas Schmitt * lib/iso9660/iso9660_fs.c: Hopefully final fix for https://savannah.gnu.org/bugs/?45015 2017-07-29 R. Bernstein * lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c: Thomas Schmitt's fixes for Rock Ridge SUSP See the thread in http://lists.gnu.org/archive/html/libcdio-devel/2017-07/msg00000.html 2017-03-25 R. Bernstein * include/cdio/udf_time.h: change MinGW guard around rolling our own timespec 2017-03-14 R. Bernstein * autogen.sh: Force creating stamp-vti update in autogen.sh 2017-03-14 R. Bernstein * : commit 251bb7082c7073f4c2073673d29b59c1c12d765f Author: Pete Batard Date: Mon Mar 13 11:56:46 2017 +0100 2017-03-13 Pete Batard * lib/driver/_cdio_stdio.c, lib/driver/_cdio_stream.c, lib/driver/ds.c, lib/driver/utf8.c, lib/driver/util.c, lib/iso9660/iso9660_fs.c, lib/udf/udf_fs.c: add asserts to test memory allocations Also use the common breakdown for calloc() parameters, add a missing closing parenthesis in a log statement and NUL terminate a string after the srtncpy() call. 2017-02-05 R. Bernstein * : commit 8b90e80cd30b5dbb1b10054c8792b644e1dabdae Author: R. Bernstein Date: Sun Feb 5 07:28:49 2017 -0500 2016-11-29 enzo1982 * configure.ac: Enable CD drivers on current and future versions of FreeBSD and Darwin (OS X), so we do not have to add every new OS version explicitly. 2016-11-20 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c, lib/iso9660/iso9660_fs.c: Remove minor print cast warnings From Ozkan Sezer 2016-11-20 R. Bernstein * configure.ac: ross-compiling friendliness part 3 check /bin/bash.exe result only if not cross-compiling. From Ozkan Sezer 2016-11-20 R. Bernstein * lib/driver/Makefile.am, lib/iso9660/Makefile.am: Cross-compile friendliness part 2 Do not call 'nm' directly, use the NM variable instead. From Ozkan Sezer 2016-11-20 R. Bernstein * lib/driver/cdio_private.h: cross-compile friendliness - part 1 stdlib.h and string.h are needed for malloc, strlen and strncpy From Ozkan Sezer 2016-11-20 R. Bernstein * doc/libcdio.texi: Documentation fixes by Wieland Hoffmann See https://savannah.gnu.org/patch/index.php?8915 - Remove a duplicate example program entry - Move a period to the correct place 2016-10-22 R. Bernstein * : commit 8815de6f669c29a0639c9a567dd49f4d9ebe4801 Author: R. Bernstein Date: Sat Oct 22 20:43:43 2016 -0400 2016-10-22 R. Bernstein * Makefile.am, configure.ac, doc/Makefile.am, doc/how-to-make-a-release.txt, include/cdio/mmc.h, include/cdio/mmc_ll_cmds.h: Get ready for release 0.94 2016-10-16 R. Bernstein * NEWS: NEWS typos and updates 2016-10-16 enzo1982 * configure.ac: Use Darwin driver on macOS versions through Sierra. 2016-10-15 R. Bernstein * NEWS, configure.ac, doc/Makefile.am, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stream.c, lib/driver/cdio.c, lib/driver/ds.c, lib/driver/sector.c, lib/iso9660/iso9660.c: 0.94 release candidate 1 * gcc -Wend-labels -> -Wendif-labels * remove rcsid's and some trailing blanks in those files 2016-09-16 R. Bernstein * autogen.sh: Add code to get version.texi to get built 2016-08-12 R. Bernstein * .gitignore: More ignore 2016-08-12 R. Bernstein * include/cdio/types.h: g++ greater than 4.0 handles "pack" Fixes bug #48759 where example/C++/isolist.cpp built with g++ fails on gcc 5.0 and greater 2016-08-12 R. Bernstein * include/cdio/types.h: g++ > 4.0 handles pack Fixes bug #48759 hwere isoilst examples built with g++ >5 are failing 2016-07-11 R. Bernstein * Makefile.am, lib/driver/abs_path.c, lib/driver/cdio_private.h: conditional GIT2CL; host stndup replacement GIT2CL only if --maintainer-mode stndump in cdio_private.h for those systems that don't have it Changes suggested by Thomas Schmitt 2016-06-04 Leon Merten Lohse * doc/CD-TEXT-testfiles: Add documentation for Thomas Schmitts' CD-TEXT test files 2016-06-03 Leon Merten Lohse * test/Makefile.am, test/cdtext-libburnia.right, test/cdtext.right, test/check_cdtext.sh, test/data/Makefile.am, test/data/cdtext.cue: Add dedicated unit test for the CD-Text parser Adds a dedicated test script (bash) for the CD-Text parser, using one of the example tools (cdtext-raw) to call libcdio's CD-Text parser and display the fields. Tests are performed for two files, one generated by libburnia, the other one by a win95 reference tool. 2016-06-01 Leon Merten Lohse * : Merge remote-tracking branch 'origin/source-configured-via-compile-switches' into cdtext-testing 2016-06-01 Leon Merten Lohse * include/cdio/mmc.h, lib/driver/_cdio_generic.c, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_private.h: Expose mmc_read_cdtext as a publicly accessible function Removes some redundant error reporting in mmc_read_cdtext (was mmc_read_cdtext_private) and make the function public. Also fixes some incorrect lengths for isrc and mcn. 2016-06-01 Leon Merten Lohse * example/.gitignore: Add cdtext-raw to gitignore 2016-05-31 Leon Merten Lohse * lib/driver/mmc/mmc.c: Fix inconsistent maximal length in CD-Text extraction 2016-05-31 Leon Merten Lohse * configure.ac, test/.gitignore, test/Makefile.am, test/check_common_fn.in, test/check_cue.sh.in, test/driver/.gitignore, test/driver/Makefile.am, test/driver/{bincue.c.in => bincue.c}, test/driver/{cdrdao.c.in => cdrdao.c}, test/driver/{nrg.c.in => nrg.c}, test/driver/{track.c.in => track.c}, test/{testgetdevices.c.in => testgetdevices.c}, test/{testisocd2.c.in => testisocd2.c}, test/{testisocd_joliet.c.in => testisocd_joliet.c}, test/{testisorr.c.in => testisorr.c}, test/{testpregap.c.in => testpregap.c}, test/{testudf.c.in => testudf.c}: Make test sources independent of configure variables The binary tests need the location of the data files. This was previously achieved by generating the sources with configure. This commit passes it via -DDATA_DIR to the preprocessor so that the sources can be static. 2016-05-30 Leon Merten Lohse * lib/driver/mmc/mmc.c: Delete debug printf's 2016-05-30 Leon Merten Lohse * include/cdio/mmc_ll_cmds.h, lib/driver/_cdio_generic.c, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_ll_cmds.c, lib/driver/mmc/mmc_private.h: Untangle mmc code for isrc/mmc and cdtext This implements (not exclusively) changes proposed by Thomas Schmitt. Added new low level functions for READ SUB-CHANNEL and READ TOC/PMA/ATIP for CD-TEXT extraction. 2016-04-13 Leon Merten Lohse * example/Makefile.am, example/README, example/cdtext-raw.c: Add example demonstrating the raw cdtext parser This example demonstrates the new API functions. 2016-04-13 Leon Merten Lohse * include/cdio/cdtext.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/libcdio.sym: Add cdtext binary parser and track number to public api This introduces 3 new functions to initialize a cdtext struct from raw cdtext blob and to access the stored first and last track numbers. The latter is necessary to use the parsed raw cdtext blob without the corresponding table of contents. 2016-04-04 Leon Merten Lohse * lib/driver/cdtext.c: Avoid buffer overflow in CD-Text parser A malicious binary CD-Text blob could cause the buffer of the parser to overflow. Add a check for buffer length. 2016-04-04 Leon Merten Lohse * lib/driver/cdtext.c: Interpret TAB indicators in CD-Text parser ASCII TAB (0x9) is a special character in the binary CD-Text format that is used for consecutive copies of the same string. Correctly interpret this character. 2016-04-03 R. Bernstein * : Increase track # for short CD-Text fields Bug reported by James Olin Oden in https://bugzilla.redhat.com/show_bug.cgi?id=1321677 See also http://lists.gnu.org/archive/html/libcdio-devel/2016-03/msg00015.html 2016-04-03 R. Bernstein * : Increase track # for short CD-Text fields Bug reported by James Olin Oden in https://bugzilla.redhat.com/show_bug.cgi?id=1321677 See also http://lists.gnu.org/archive/html/libcdio-devel/2016-03/msg00015.htmlOn branch parsing-CD-Text-short-fields 2016-04-02 R. Bernstein * lib/driver/cdtext.c, test/cdtext.right: Increase track # for short CD-Text fields Bug reported by James Olin Oden in https://bugzilla.redhat.com/show_bug.cgi?id=1321677 See also http://lists.gnu.org/archive/html/libcdio-devel/2016-03/msg00015.html 2016-04-03 R. Bernstein * : commit 90b6276c21cc994e1ba10234bae640f478b21cbe Author: R. Bernstein Date: Sat Apr 2 21:41:38 2016 -0400 2016-04-02 R. Bernstein * lib/driver/cdtext.c, test/cdtext.right: fix incorrect parsing of CD-Text with short fields See http://lists.gnu.org/archive/html/libcdio-devel/2016-03/msg00015.html 2015-07-28 R. Bernstein * configure.ac, test/driver/logger.c: Fix warning from automake. From Adrian Reber During ./autogen.sh following message was printed out: lib/driver/Makefile.am:54: warning: source file 'FreeBSD/freebsd.c' is in a subdirectory, lib/driver/Makefile.am:54: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. Adding the 'subdir-objects' option to AM_INIT_AUTOMAKE removes this warning. 2015-07-28 R. Bernstein * .gitignore, configure.ac, doc/libcdio.texi, example/.gitignore, lib/driver/MSWindows/aspi32.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/sector.c, lib/driver/util.c, src/getopt.c, test/.gitignore, test/Makefile.am, test/copying-rr-mingw.right, test/driver/logger.c, test/driver/mmc_write.c, test/testgetdevices.c.in, test/testisocd2.c.in: Remove executable bit from files. From Adrian Reber https://bugzilla.redhat.com/show_bug.cgi?id=1247351 2015-06-15 enzo1982 * lib/driver/memory.c: Fixed cdio_free leaking instead of freeing the passed pointer. 2015-06-14 enzo1982 * lib/driver/osx.c: Fix disc eject for Cocoa apps and support ejecting CD-Extra discs on OS X. 2015-06-12 enzo1982 * lib/driver/gnu_linux.c: Make sure device is opend in read/write mode when trying to eject. 2015-05-26 R. Bernstein * lib/driver/logging.c: Document better the cdio_logv recursion situation 2015-05-26 R. Bernstein * lib/driver/logging.c: Recursion checking in cdio_logv() can't use cdio_assert_not_reached() which causes more recursion. To reduce the possibility concurrent log writes, we'll eliminate those that are ignored earlier. sr #108751: 2015-05-08 R. Bernstein * include/cdio/bytesex.h, lib/iso9660/iso9660_fs.c: Add an error reporting from_733_with_err bug #45014 2015-05-08 R. Bernstein * lib/iso9660/rock.c, src/util.c: Guard against malformed rockridge iso. See bug #45015 2015-05-08 R. Bernstein * configure.ac, lib/iso9660/iso9660_fs.c, test/driver/logger.c, test/driver/realpath.c: iso9660_fs.c: DRY free code a little logger.c: remove gcc warning configure.ac: start testing for mkstemp for possible use in the future. 2015-05-08 R. Bernstein * lib/iso9660/iso9660_fs.c, test/Makefile.am, test/check_iso.sh.in, test/data/Makefile.am, test/malformed2.right: bug #45013: malformed iso crashes iso-info 2015-05-08 R. Bernstein * lib/iso9660/iso9660_fs.c, test/Makefile.am, test/check_iso.sh.in, test/data/Makefile.am, test/data/malformed.iso, test/malformed.right: guard against 0-size calloc bug #45016 2015-02-23 R. Bernstein * configure.ac, example/logging.c, lib/driver/device.c, lib/driver/image/cdrdao.c, src/cd-drive.c, src/cdda-player.c: Scale back on CC warning opts used - for now. Address some warnings though. 2015-02-23 R. Bernstein * configure.ac: Fix configure gcc warning flags test/set 2015-01-19 R. Bernstein * doc/libcdio.texi: Typo: Logical Sector Number -> Logical Block Address. Correction from Matthew Gambrell - 2015-01-13 R. Bernstein * lib/udf/udf_fs.c: testudf segfaults/fails on big endian arches because few values are not converted from LE to native number. Savannah bug #43995. Patch from Dan Horak. 2014-10-20 R. Bernstein * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: Add get_last_session to the win32 driver. Also fixes cd-paranoia behavior. Savannah bug #43446. 2014-10-19 R. Bernstein * doc/how-to-make-a-release.txt, lib/driver/mmc/mmc_hl_cmds.c: mmc_set_drive_speed: GNU/Linux ioctl treats <= 0 as max speed, so we'll do that here as well. Savannah bug #43428 2014-09-29 R. Bernstein * configure.ac, doc/how-to-make-a-release.txt: In 0.94git now 2014-09-29 R. Bernstein * NEWS, configure.ac: Release 0.93 2014-09-26 R. Bernstein * lib/cdio++/Makefile.am: INCLUDES->AM_CPPFLAGS 2014-09-26 enzo1982 * configure.ac, lib/driver/sector.c: Two files still mentioned GPLv2. 2014-09-25 R. Bernstein * lib/driver/utf8.c: One more gcc warning removed 2014-09-24 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/device.c, lib/driver/image/bincue.c, lib/driver/mmc/mmc.c, src/cd-drive.c: Silence more gcc warnings 2014-09-24 R. Bernstein * NEWS, lib/driver/Makefile.am, lib/driver/mmc/mmc.c, lib/iso9660/Makefile.am, lib/udf/Makefile.am, src/cd-info.c, test/Makefile.am: lib/*/Makefile.am: bump version in preparation of release 0.93 test/Makefile.am: add proper dependency on test/example NEWS: not coverty work 2014-09-24 R. Bernstein * : commit cdc3cfa07cf1059b63c145a32aa62f2b1fdcb065 Author: R. Bernstein Date: Wed Sep 24 20:26:50 2014 -0400 2014-09-24 R. Bernstein * NEWS, src/Makefile.am: Perparation for 0.93 release. 2014-09-24 enzo1982 * doc/libcdio.texi: Update docs for change in cdio-paranoia. 2014-09-24 enzo1982 * example/isolsn.c, include/cdio++/iso9660.hpp, include/cdio/iso9660.h, include/cdio/xa.h, lib/cdio++/iso9660.cpp, lib/iso9660/iso9660_fs.c, lib/iso9660/libiso9660.sym, lib/iso9660/xa.c: Add iso9660_stat_free and iso9660_xa_free functions. 2014-09-24 enzo1982 * include/cdio++/cdtext.hpp, include/cdio++/disc.hpp, include/cdio++/mmc.hpp, include/cdio/Makefile.am, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/disc.h, include/cdio/memory.h, include/cdio/mmc.h, include/cdio/track.h, include/cdio/utf8.h, include/cdio/util.h, lib/driver/Makefile.am, lib/driver/_cdio_stdio.c, lib/driver/cdtext.c, lib/driver/disc.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/libcdio.sym, lib/driver/memory.c, lib/driver/mmc/mmc.c, lib/driver/track.c, lib/driver/utf8.c, lib/driver/util.c, src/cd-info.c, src/mmc-tool.c, test/driver/mmc_read.c, test/driver/mmc_write.c: Add cdio_free function for freeing memory allocated by libcdio. 2014-07-30 R. Bernstein * lib/driver/os2.c, src/getopt.h: Make high memory safe on OS/2 - from KO 2014-07-27 R. Bernstein * .gitignore, THANKS: More ignore. Update OS/2 email contact. 2014-06-22 R. Bernstein * example/audio.c, include/cdio++/cdio.hpp, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/mmc/mmc.c, src/cd-info.c, src/iso-read.c, src/mmc-tool.c: A couple more coverty-found problems, none serious 2014-06-22 R. Bernstein * lib/iso9660/iso9660_fs.c, src/iso-read.c: A couple more coverty-found memory leaks in minor code 2014-06-22 R. Bernstein * example/udf1.c, src/cd-info.c, src/iso-info.c: A couple more coverty-found memory leaks in minor code 2014-06-22 R. Bernstein * lib/iso9660/iso9660_fs.c, src/iso-read.c, src/util.c: Some minor coverty-found memory leaks 2014-06-21 R. Bernstein * lib/driver/mmc/mmc.c: Remove possible illegal access in mmc.c suggested by coverty 2014-06-21 R. Bernstein * lib/udf/udf_fs.c: Coverty-informed error fixed: cd-info: don't overrun _fullname. This time, for sure! 2014-06-20 R. Bernstein * src/cd-info.c: Coverty-informed error fixed: cd-info: don't overrun _fullname 2014-06-20 R. Bernstein * lib/iso9660/iso9660.c, lib/udf/udf_fs.c, src/iso-info.c: Coverty informed errors fixed: Make sure tokenline ends in '\0'; make sure we don't leak on multiple storage iso-info -i switches 2014-06-20 R. Bernstein * example/extract.c, lib/driver/image/bincue.c, src/iso-info.c: Reduce coverty-found errors 2014-06-20 R. Bernstein * lib/driver/image/cdrdao.c: Fix compilation error. Simplify by reducing scope of psz_dirname and psz_filename. 2014-06-18 R. Bernstein * doc/libcdio.texi, example/mmc2.c, include/cdio/mmc.h, lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/aix.c, lib/driver/bsdi.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_private.h, lib/driver/netbsd.c, lib/driver/os2.c, lib/driver/solaris.c, src/cd-info.c: Merge commit '2561384' into static-analysis. Remove Illegal address computation 2014-06-18 R. Bernstein * src/getopt_int.h: This file is now needed for getopt 2014-06-18 R. Bernstein * example/mmc2.c: Remove illegal address computation caught by coverty 2014-06-13 R. Bernstein * src/getopt.c, src/getopt.h, src/getopt1.c: Updated getopt to the version included with glibc 2.19. [robert kausch] 2014-06-13 R. Bernstein * lib/iso9660/iso9660_fs.c: Fixed ISO 9660 bugs reported by Frantisek Kluknavsky. 2014-06-14 enzo1982 * src/getopt.c, src/getopt.h, src/getopt1.c, src/getopt_int.h: Updated getopt to the version included with glibc 2.19. 2014-06-14 enzo1982 * lib/driver/abs_path.c, lib/driver/cdio_private.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, test/driver/abs_path.c: Avoid memory leaks with cdio_dirname and cdio_abspath. The functions were changed to always allocate memory to be freed by the caller. Before, callers were unable to know if the returned string was stack- or heap-allocated and thus unable to free heap-allocated strings. 2014-06-13 enzo1982 * lib/iso9660/iso9660_fs.c, lib/udf/udf_fs.c: Fixed bugs reported by Frantisek Kluknavsky. 2014-06-08 R. Bernstein * doc/libcdio.texi: Some doc typos. Add mention of mmc-tool. Note that paraonia is separate and is GPL2 2014-06-07 Robert Kausch * : commit 6550d3a654b4beb708d6ea296cf9110e75320100 Author: Robert Kausch Date: Sat Jun 7 13:28:06 2014 +0200 2014-06-07 Robert Kausch * lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/aix.c, lib/driver/bsdi.c, lib/driver/gnu_linux.c, lib/driver/netbsd.c, lib/driver/os2.c, lib/driver/solaris.c: Enable cdio_get_track_isrc in drivers. 2014-06-07 Robert Kausch * include/cdio/mmc.h, src/cd-info.c: Deprecate mmc_isrc_track_read_subchannel. 2014-06-07 Robert Kausch * include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_private.h: Add mmc_get_track_isrc function. 2014-06-06 Robert Kausch * configure.ac: configure.ac: recognize Darwin 13 and 14 (OS X 10.9 and 10.10) 2014-06-05 Robert Kausch * lib/driver/osx.c: lib/driver/osx.c: probe devices before querying media list The problem with IOServiceGetMatchingServices is that the result is cached by the system so if you insert or remove a disc between two calls, you won't get updated information. To get an up to date media list, we need to probe the storage devices using IOServiceRequestProbe before each call. 2014-06-05 R. Bernstein * THANKS: Add Robert Kausch 2014-06-04 R. Bernstein * configure.ac, lib/driver/netbsd.c: From Robert Kausch: configure recognizes OpenBSD (via the NetBSD driver) which Robert says he has tested 2014-06-04 R. Bernstein * configure.ac: From Robert Kausch: configure recognizes FreeBSD 10 which Robert says he has tested 2014-06-04 R. Bernstein * .gitignore, config_extract.rb, example/Makefile.am, lib/driver/MSWindows/win32.c, src/cd-read.c, test/Makefile.am: From Robert Kausch: Binary file I/O on MS Windows. More ignore, and remove schmutz files created in testing 2014-06-04 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: More great work from From Robert Kausch (https://savannah.gnu.org/patch/index.php?8302): - make buffer size unlimited again in buffered mode - do not set Spt.Cdb[4] to buffer size as position of allocation size field depends on CDB size and is not always at byte 4, rely on caller to set the field as in direct mode - fix memory leak in case of an error in buffered mode (p_sptwb was not freed) - use stack allocated structure in direct mode to prevent constant reallocation of memory (note that before the patch, memory was allocated to include the buffer as well, which was pointless as an already allocated buffer is passed in direct mode) - rename direct mode unsigned int parameters u_* to match buffered mode parameter names - fix top comment to use correct parameter names and include u_cdb Direct mode is functionally unchanged. 2014-03-13 R. Bernstein * lib/iso9660/rock.c: From Pete Batard: Fix unwanted 'Unsupported NM flag settings' messages 2014-03-08 R. Bernstein * configure.ac: Bump version to 0.93git 2014-03-08 R. Bernstein * lib/driver/Makefile.am: Bug #41811 linking libcdio.dylib on OSX - missing libraries from $DARWIN_PKG_LIB_HACK 2014-02-22 rocky * : commit c8eb88a0fdfe1dd0808c0a02025a3ffe7072d12c Author: Pete Batard Date: Sun Feb 23 02:28:55 2014 +0000 2014-02-23 Pete Batard * : Add new UDF test image 2014-02-21 R. Bernstein * lib/driver/utf8.c, lib/udf/udf_fs.c, test/check_fuzzyiso.sh, test/testudf.c.in: Unicode support to udf_fs and return UTF-8 strings where relevant. From Pete Batard 2014-02-01 R. Bernstein * lib/driver/osx.c, test/driver/osx.c: patch #8292: Do not list slice devices on OS X. Thanks to robert.kausch@freac.org 2014-02-01 R. Bernstein * lib/driver/sector.c: patch #8293: Fix minute truncation in cdio_lsn_to_msf thanks to Eric Hattow 2013-12-15 R. Bernstein * NEWS, configure.ac, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/udf/Makefile.am: Get ready for release 0.92 2013-12-14 R. Bernstein * configure.ac: Get ready for release 0.91 2013-12-14 R. Bernstein * NEWS, include/cdio/iso9660.h, lib/driver/FreeBSD/freebsd.c, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/udf/Makefile.am: Bump age in libudf, libiso966 and libcdio: only interfaces added. 2013-12-14 R. Bernstein * configure.ac: Respect --disable-cxx 2013-12-14 rocky * example/cdchange.c, lib/driver/cdtext.c, src/iso-read.c: Remove remaining compilation warnings. Thanks again to Thomas Schmitt. 2013-12-14 rocky * lib/driver/cdtext.c, test/driver/mmc_read.c: mmc_read.c: no need to special case FreeBSD. cdtext.c: Remove unnecessary > 0 tests on an unsigned int type. Thanks to Thomas Schmitt. 2013-12-12 R. Bernstein * lib/driver/_cdio_generic.c, test/driver/mmc_read.c: _cdio_generic.c: correct confusing debug message test/driver/mmc_read.c: skip until someone understand what to do here. 2013-12-12 R. Bernstein * lib/driver/FreeBSD/freebsd_ioctl.c: Remove compile warning. 2013-12-09 R. Bernstein * NEWS, lib/udf/udf_fs.c: Fix UDF library bug on BigEndian CPUs (POWER, SPARC, HP/UX) 2013-12-09 R. Bernstein * lib/udf/udf_fs.c: Towards getting this to be big-endian compatible. More work is needed though. 2013-12-08 R. Bernstein * test/check_iso_read.sh.in: check_iso_read.sh.in: Solaris doesn't do test -e, it does test -f. Allow VERBOSE=1 to have this give more output 2013-12-08 R. Bernstein * test/check_iso_read.sh.in: Silence ceck_iso_read.sh. Also don't assume tar has -z option. (Solaris for example doesn't) 2013-12-08 R. Bernstein * Makefile.am, make-check-filter.pl: Add a Perl version of make-check-filter.pl for those environments like MinGW that find it hard to get Ruby installed. Sigh 2013-12-08 R. Bernstein * configure.ac, example/Makefile.am: Make 0.91rc1 2013-12-08 R. Bernstein * test/data/Makefile.am, test/testudf.c.in: Move udf102.iso to the place data other test images are located. 2013-11-12 R. Bernstein * src/iso-info.c: Typo in iso-info usage help corrected by Leo Baschy 2013-10-30 R. Bernstein * test/testudf.c.in: From Pete Batard: Add UDF test for Logical Volume ID 2013-10-29 R. Bernstein * configure.ac, test/.gitignore, test/Makefile.am: From Pete Batard: Add UDF test for Logical Volume ID 2013-10-29 R. Bernstein * lib/iso9660/iso9660_fs.c: Don't need to free rr symlink which isn't allocated. 2013-10-27 R. Bernstein * example/Makefile.am, example/isorr.c, include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c, src/iso-info.c, test/testisorr.c.in: Put limit on amount of file traversion for rock-ridge requested. 2013-10-26 R. Bernstein * src/iso-info.c: Change report format for showing whether Rock Ridge Extensions are used in iso-info 2013-10-24 R. Bernstein * : commit ed9594d386fa85fde79cfeb5b9fff2dca2425428 Author: R. Bernstein Date: Thu Oct 24 06:04:46 2013 -0400 2013-10-21 R. Bernstein * visualC-config.rb: A stray test/ goit in filename suffixes; chmod +x /visualC-config.rb 2013-10-20 R. Bernstein * test/check_iso_read.sh.in: Revise for POSIX shell (remove bash extensions) so it works on systems that don't do /bin/bash, e.g. FreeBSD. 2013-10-20 R. Bernstein * visualC-config.rb: Remove debug puts 2013-10-20 R. Bernstein * visualC-config.rb: Add LIBCDIO_SOURCE_PATH and substitute in doc/doxygen/Doxyfile 2013-10-20 R. Bernstein * visualC-config.rb: Correct comment for visualC-config's perform_substitutions 2013-10-20 R. Bernstein * NEWS, include/cdio/version.h.in, visualC-config.rb: Start alternate method of config OS's that aren't POSIX 2013-10-20 R. Bernstein * test/Makefile.am: Add special "right" file for mingw32 for check_cue.sh 2013-10-20 R. Bernstein * .gitignore, example/.gitignore, test/.gitignore, test/copying-rr-mingw.right: More ignore 2013-10-20 R. Bernstein * configure.ac, test/check_iso.sh.in: Ignore with MINGW32 RR oddity 2013-10-20 R. Bernstein * test/Makefile.am, test/check_cue.sh.in, test/testdefault.c, test/testgetdevices.c.in, test/testisocd2.c.in: Remove test/testdefault.c which is now covered by getdevices.c ; Limp along check_cue.sh on cygwin 2013-10-20 R. Bernstein * test/driver/logger.c: For some reason comparing fn handle on MS/Windows does not work. We will see if that is true on other platforms too. 2013-10-19 rocky * test/driver/logger.c: Cast for debug output 2013-10-19 R. Bernstein * configure.ac: Have to put back in more of the C++ tests. Sigh 2013-10-19 rocky * configure.ac, test/driver/logger.c: Disable C++ more aggressively if disabling C++ desired. 2013-10-19 R. Bernstein * lib/driver/device.c, lib/driver/utf8.c: Remove 'p_driver_id' may be used uninitialized in cdio_close_try. Remove conflicting types in cdio_charset_to_utf8. Patches from Pete Batard. 2013-10-19 R. Bernstein * test/Makefile.am: Better test and linking for isofs-m1.{bin,cue}. Problem reported by Pete Batart. 2013-10-14 rocky * include/cdio/udf.h, lib/udf/udf_fs.c: From Pete Batard: * Add udf_get_logical_valume_id to retrieve a UDF Logical Volume Identifier string * Fix a possible NULL deref in udf_ff_traverse() * Fix comments that were referencing wrong variable names 2013-10-09 R. Bernstein * test/testisocd_joliet.c.in: Check that Joliet was configured for some tests. 2013-10-09 R. Bernstein * Makefile.am, configure.ac, lib/driver/_cdio_generic.c, lib/driver/cd_types.c, lib/driver/generic.h, lib/iso9660/iso9660.c, src/util.c, test/.gitignore, test/Makefile.am, test/testisocd2.c.in, test/testisocd_joliet.c.in: Add joliet test and joliet level tests 2013-10-08 R. Bernstein * : commit 4c8361f12c1cb7c2cc4f7246069a0f12b53e59a0 Author: R. Bernstein Date: Tue Oct 8 03:04:24 2013 -0400 2013-10-08 R. Bernstein * lib/driver/_cdio_generic.c, lib/driver/aix.c, lib/driver/cd_types.c, lib/driver/generic.h, lib/driver/track.c, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, src/iso-info.c, src/util.c: List joliet level on iso-info. i_joliet_level -> u_joliet_level. Not in p_iso whether we've read superblock or not. Strip blanks in effected files. 2013-09-26 R. Bernstein * test/check_iso_read.sh.in: As Leo Baschy suggests, we need /bin/bash (or ksh) since we use [[ in this program. 2013-09-21 R. Bernstein * doc/libcdio.texi, example/extract.c, example/logging.c, include/cdio/logging.h, lib/driver/libcdio.sym, lib/driver/logging.c, test/Makefile.am, test/driver/.gitignore, test/driver/Makefile.am, test/driver/logger.c: Rename and expose cdio_default_loghandler as the default log handler. test/driver/logger.c: Add logging unit test. doc/libcdio.texi: Correct documentation on CDIO_LOG_ASSERT and CDIO_LOG_ERROR. 2013-09-20 R. Bernstein * doc/libcdio.texi: Update copyright on doc 2013-09-20 R. Bernstein * doc/libcdio.texi, example/logging.c: Add information about setting the log level. 2013-09-20 R. Bernstein * example/isofile2.c, lib/driver/read.c: More debug logging in reading lsn sectors. 2013-09-20 R. Bernstein * example/logging.c: Add a custom log handler. 2013-09-20 R. Bernstein * example/Makefile.am, example/isofile2.c, example/logging.c, lib/driver/_cdio_generic.c, lib/driver/device.c: example/isofile2.c: correct location of ISO9660 file Makefile.am: use logging in list of tests logging.c: allow argument to be "debug", "info", "warn", etc. or a number _cdio_generic.c: remove stray blanks 2013-09-19 R. Bernstein * example/.gitignore, example/Makefile.am, example/logging.c, include/cdio/device.h, lib/driver/device.c, test/driver/mmc_read.c, test/driver/mmc_write.c: include/cdio/device.h: add cdio_get_driver_name_from_id lib/driver/device.c: more logging example/logging.c: example of how to increase verbosity of logging. mmc_read.c, mmc_write.c: don't show info logging by default. 2013-09-15 R. Bernstein * lib/iso9660/iso9660_fs.c, test/Makefile.am: 2nd try at but #39373. Add target check-iso-read-large and check-iso-read-large-terse to test. 2013-09-15 R. Bernstein * lib/iso9660/iso9660_fs.c: Remove old shmutz 2013-09-15 R. Bernstein * lib/iso9660/iso9660_fs.c: Update copyright date 2013-09-15 R. Bernstein * lib/iso9660/iso9660_fs.c: patch for bug #39373 from Leo Baschy 2013-09-01 R. Bernstein * .gitignore, configure.ac, test/.gitignore, test/Makefile.am, test/check_iso_read.sh.in: Adapt and add Leo Baschy's test of iso-read. 2013-09-01 R. Bernstein * .gitignore, configure.ac, test/Makefile.am, test/check_cue.sh.in, test/isofs-m1-test2.right, test/isofs-m1.right: We weren't enabling Rock-Ridge by default as intended. Thanks to Mike Frysinger for catching this. 2013-05-28 Eric Shattow * src/Makefile.am: Remove 'lt-' prefix using help2man --libtool 2013-05-28 Brendan O'Dea * src/cd-drive.help2man, src/cd-info.help2man, src/cd-read.help2man, src/iso-info.help2man, src/iso-read.help2man: Fix NAME paragraph in man pages. Closes #39095 2013-05-16 R. Bernstein * lib/driver/track.c: Squash another bug in cdio_get_track() 2013-05-15 R. Bernstein * lib/driver/image_common.c: Test whether TOC is init'd and init if not when asking for track number. 2013-05-15 R. Bernstein * test/driver/track.c.in, test/testpregap.c.in: Update comments in test programs for how to compile outside of "make". 2013-05-15 R. Bernstein * configure.ac, lib/driver/track.c, test/data/cdda.toc, test/driver/.gitignore, test/driver/Makefile.am, test/driver/track.c.in, test/testpregap.c.in: lib/driver/track.c: was returning last_track+1 for leadout LSN, Use CDIO_CROM_LEADOUT_TRACK instead. ltest/driver/track.c.in: start test of lib/driver/track.c. cdda.toc: CDRDAO CD-DA image. Trim blanks off of varousl files. 2013-04-11 R. Bernstein * lib/driver/track.c, test/Makefile.am: We broke things in to fix #38421 we broke the things. 2013-04-09 rocky * lib/driver/MSWindows/win32_ioctl.c: Fix up mmc_read for SCSI_PASS_THROUGH_DIRECT 2013-04-07 R. Bernstein * configure.ac, example/C++/Makefile.am, example/C++/OO/Makefile.am, example/Makefile.am, include/cdio/udf_time.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/udf/Makefile.am, src/Makefile.am, test/Makefile.am, test/driver/Makefile.am: Savannah #38678, mostly from LRN: mingw-w64 compatibility, fixes Windows ioctl code for PASSTHROUGH_DIRECT. Other changes: INCLUDES => AM_CPPFLAGS. test/Makefile.am: fix up test for whether to run ln -s or not. compatibility, the other fixes up old code that went stale. The third patch is already in HEAD. 2013-04-06 R. Bernstein * configure.ac: It is AC_CONFIG_HEADERS -- with an "S" 2013-04-06 R. Bernstein * configure.ac: Savannah bug #38663 . Thanks to LRN. 2013-03-31 R. Bernstein * include/cdio/track.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/gnu_linux.c, lib/driver/sector.c: One more attempt to give a guard against using more than 99 tracks. 2013-03-03 R. Bernstein * lib/driver/gnu_linux.c: Remove debug code 2013-03-03 R. Bernstein * lib/driver/gnu_linux.c, lib/driver/track.c: 2nd attempt at Savannah #38421 2013-02-26 R. Bernstein * lib/driver/gnu_linux.c: Correct calculation in listing number of bad tracks 2013-02-26 R. Bernstein * lib/driver/gnu_linux.c: Wrong calculation for number of tracks. Savannah #bug #38421 2013-02-06 R. Bernstein * : commit 9a14bd745c609880994fc5689b215e555fe93fc7 Author: R. Bernstein Date: Wed Feb 6 19:06:31 2013 -0500 2013-02-02 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: DDynamically allocate passthrough buffer based on info LRN in libcdio-devel Sun Jan 20, 2013 2012-11-23 R. Bernstein * : commit 6c0251d145e44b7cdfeb9767c615646fb8f51320 Author: Christophe Fergeau Date: Thu Nov 22 13:53:15 2012 +0100 2012-11-20 R. Bernstein * doc/libcdio.texi: Try to clarify LBA versus LSN in libcdio. 2012-11-04 R. Bernstein * lib/driver/Makefile.am: Bump library number 2012-10-27 R. Bernstein * doc/doxygen/Doxyfile.in, include/cdio/cdtext.h, include/cdio/mmc.h, include/cdio/mmc_cmds.h, include/cdio/mmc_hl_cmds.h, include/cdio/mmc_ll_cmds.h, include/cdio/utf8.h, lib/driver/mmc/mmc_ll_cmds.c: Doxygen update, fixes, tweaks for release. 2012-10-27 R. Bernstein * make-check-filter.rb: make-check-short.rb: ignore gmake as you would make or remake 2012-10-27 R. Bernstein * NEWS, configure.ac: Make configure SED environment aware, e.g. for OSX (Robert William Fuller). Get ready for release 0.90 2012-10-27 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: Try to mitigate some of the Windows driver brokenness 2012-10-24 R. Bernstein * THANKS: Christophe Fergeau added UDF reading to iso-info as well 2012-10-24 R. Bernstein * : commit 2cda07957f08f07304f63cc158f881735fb24003 Author: Leon Merten Lohse Date: Wed Oct 24 20:06:08 2012 +0200 2012-10-22 rocky * src/iso-info.c, src/iso-read.c: -U option-processing fixes. 2012-10-21 R. Bernstein * : commit 906462c731edee99910f4a67f7e75085a5e50ff4 Author: R. Bernstein Date: Sun Oct 21 22:42:50 2012 -0400 2012-10-21 R. Bernstein * NEWS: Update NEWS 2012-10-21 R. Bernstein * src/Makefile.am, src/iso-info.c, src/iso-read.c: Add allow iso-read and iso-info to handle UDF format via options --udf or -U. Modified patch #7865 2012-10-22 rocky * make-check-filter.rb: make-check-filter.rb: Ignore older "make: .. is up to date." message 2012-10-21 R. Bernstein * make-check-filter.rb: make-check-filter.rb: Correct remake separator string 2012-10-21 rocky * configure.ac, lib/driver/MSWindows/win32_ioctl.c: Convert win32_ioctl.c to use header-tested includes from configure 2012-10-21 R. Bernstein * configure.ac: Towards getting MinGW and cygwin ddk includes correct. 2012-10-21 rocky * lib/driver/MSWindows/win32_ioctl.c: Revise to make cygwin work again. Warning - more checking is needed. 2012-10-21 R. Bernstein * .gitignore, lib/driver/MSWindows/win32_ioctl.c: Small stuff: Indent win32_ioctl.c defines. ignore all ~'s 2012-10-19 R. Bernstein * NEWS, THANKS, src/iso-read.c: Add UDF support to iso-read 2012-10-19 R. Bernstein * src/Makefile.am, src/iso-read.c: Move ISO9660 specific code to a helper function; adding UDF support to iso-read. From Christophe Fergeau patch #7865 2012-10-18 Leon Merten Lohse * lib/driver/image/bincue.c: Fix bin/cue cdtext parsing using wrong track number. Thanks to Robert William Fuller 2012-10-18 Leon Merten Lohse * include/cdio/cdtext.h, lib/driver/cdtext.c, lib/driver/libcdio.sym, src/cd-info.c, test/cdtext.right: Add cdtext_get_genre Add GENRE_CODE output to cd-info and update test 2012-10-17 R. Bernstein * THANKS: Note Robert William Fuller's fixes to CD-Text for Nero. 2012-10-15 R. Bernstein * include/cdio/Makefile.am: More liberal space after #define suggested by Robert William Fuller 2012-10-10 R. Bernstein * lib/driver/gnu_linux.c: Reduce level of severity resolving realpath in GNU/Linux driver is_mounted(). Adrian Reber post to libcdio-devel 2012-10-02 R. Bernstein * NEWS, include/cdio/mmc.h, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, make-check-filter.rb, test/driver/mmc_read.c: Add mmc_cmd2str() 2012-10-02 R. Bernstein * NEWS, include/cdio/mmc.h: Add MMC5 commands. Thanks yet again to Thomash Schmitt for doing the heavy lifting. 2012-10-02 R. Bernstein * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/sector.c, lib/driver/util.c, src/getopt.c, test/driver/mmc_write.c: Remove some gcc warnings and change wording of a test warning message 2012-10-01 rocky * README.libcdio: Make note that gcc 4.0 or greater is needed on MinGW 2012-10-01 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c, lib/driver/gnu_linux.c: Show opcode in linux on a MMC error if loglevel is info or more detailed. 2012-10-01 rocky * lib/driver/MSWindows/win32_ioctl.c: Show MMC opcode on a bad MMC command 2012-09-30 R. Bernstein * include/cdio/mmc.h, make-check-filter.rb: mmc.h: Add additional MMC4/ATAPI command codes from http://wiki.osdev.org/ATAPI#Complete_Command_Set . make-check-filter.rb: remove C++ compile and loads 2012-09-27 rocky * configure.ac: This time, for sure? 2012-09-27 R. Bernstein * configure.ac, test/testisocd2.c.in, test/testpregap.c.in: Recalculate native_top_srcdir one more time 2012-09-27 rocky * configure.ac, test/testisocd2.c.in, test/testpregap.c.in: Add native_top_srcdir MinGW and DOS/Windows. 2012-09-26 rocky * configure.ac: Limit MINGW native path the srcdir and abs_top_srcdir 2012-09-26 rocky * configure.ac: A more specific use of bash's pwd builtin 2012-09-26 rocky * configure.ac: MINGW wants native paths in regression tests bug #37447 2012-09-26 rocky * example/mmc2a.c: More places where -- prefix output added on examples 2012-09-26 rocky * test/driver/mmc_write.c: Shorten output for mmc_write.exe 2012-09-26 R. Bernstein * Makefile.am, example/Makefile.am, example/README, example/cdchange.c, example/cdtext.c, example/device.c, example/drives.c, example/extract.c, example/isofuzzy.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/sample4.c, make-check-filter.rb, test/Makefile.am, test/check_common_fn.in, test/check_cue.sh.in, test/check_nrg.sh.in, test/check_sizeof.c, test/driver/Makefile.am, test/driver/realpath.c, test/testgetdevices.c.in, test/testischar.c, test/testisocd.c, test/testpregap.c.in: Add "make check-short" target to run tests without bloated output. 2012-09-26 rocky * include/cdio/types.h: Work on packed definition for MinGW 2012-09-25 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: Fix text in warning message 2012-09-25 rocky * lib/driver/MSWindows/win32_ioctl.c: Small change 2012-09-24 R. Bernstein * include/cdio/types.h, lib/iso9660/iso9660.c, lib/iso9660/iso9660_private.h: Make bool be 8-bit. Rather switch than find where in ISO9660 there was a discrepancy between stdbool and the type.h definition. 2012-09-23 R. Bernstein * lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, lib/udf/udf_private.h, src/cdda-player.c: Try again for more consistent use of booleans. WARNING libiso9660 is broke. Last known good commit is 6137ddb73763bcdc524f65dde2048bc639695dc4. 2012-09-23 rocky * lib/driver/MSWindows/win32_ioctl.c, lib/driver/device.c, lib/driver/disc.c, lib/driver/generic.h, lib/driver/image.h, lib/driver/image/nrg.c, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_ll_cmds.c, lib/driver/read.c, lib/driver/track.c: Make sure stdbool is used in driver when it is defined. I think this fixes bug #37394 2012-09-23 rocky * example/C++/.gitignore, lib/driver/MSWindows/win32_ioctl.c: Follow MS SCSI Passthrough more closely. Still some bugs... 2012-09-22 rocky * lib/driver/MSWindows/win32_ioctl.c: Provisional changes based on bug 37394 2012-09-19 R. Bernstein * configure.ac: Update where to report bugs 2012-09-18 rocky * lib/driver/MSWindows/win32_ioctl.c: Need to include stdbool.h so _Bool does not get defined as int on Windows win32_ioctl.c 2012-09-15 R. Bernstein * lib/driver/image/bincue.c, test/driver/mmc_read.c, test/driver/mmc_write.c: image/bincue.c: remove gcc warning. mmc_read.c, mmc_write.c: use usleep if that's available; fall back to "for" loop if sleep, usleep, and MSwindows Sleep isn't available. 2012-04-29 rocky * THANKS: Add Natalia Portillo to the hall of fame 2012-04-29 Natalia Portillo * lib/driver/osx.c: Changed Mac OS X SDK check so it detects correct path for 10.3 and 10.4, not only >=10.5. Tested it compiles and works on 10.3, 10.4, 10.5, 10.6 and 10.7. If Mac OS X SDK is 10.5, include bluray headers, if not manually define the BD media class for IOKit travelling. When searching for an optical drive, search also for BD media class, so if drive is a BD with a BD disc it will be found (BD with CD or DVD discs were found before). 2012-04-29 R. Bernstein * configure.ac, lib/driver/_cdio_generic.c: _cdio_generic.c: Initialize new scsi_tuple field. Removes SEGV in OSX and others. configure.ac: Try sed -r and -E rather than rely on OS type. 2012-04-28 R. Bernstein * lib/driver/aix.c, lib/driver/bsdi.c, lib/driver/netbsd.c, lib/driver/os2.c, lib/driver/osx.c, lib/driver/solaris.c, src/Makefile.am: osx.c: try to eliminate invalid free of an uninitialized structure. untabify various drivers and get this more in-sync with gnu_linux.c driver. 2012-04-28 R. Bernstein * : commit 07711418d09c1b709759021d1157eb9521990072 Author: R. Bernstein Date: Sat Apr 28 21:06:50 2012 -0400 2012-04-28 R. Bernstein * configure.ac, include/cdio/Makefile.am: OSX and BSD use -E for extended re's rather than GNU -r 2012-04-28 rocky * configure.ac, lib/driver/osx.c: Do not need DARWIN_10_OR_GREATER but can use __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ instead courtesy Natalia Portillo. Savannah Bug #36330 https://savannah.gnu.org/bugs/?36330 2012-04-26 R. Bernstein * THANKS, lib/driver/osx.c: Fix #30467 cdio_get_default_device() returns non-cdrom removable. From Nigel Pearson. 2012-04-23 R. Bernstein * configure.ac: Need to allow darwin10.8 etc. 2012-04-23 rocky * lib/driver/FreeBSD/freebsd.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/aix.c, lib/driver/netbsd.c, lib/driver/os2.c: Pete's changes require a more aggressive use of stdbool.h. 2012-04-22 R. Bernstein * configure.ac: configure architecture fixes from Nigel Pearson. 2012-04-22 R. Bernstein * NEWS: Make a stab at recording what's changed. 2012-04-21 R. Bernstein * configure.ac, lib/driver/osx.c: OSX fixes: test for stdbool.h, allow darwin10-12 and set DARWINT_10_OR_GREATER. Use generic CD-Text routines. 2012-04-17 rocky * lib/driver/cdtext_private.h: Use typedefs for enums. OSX 10.6's C compiler seems to create storage for enums. 2012-04-16 R. Bernstein * configure.ac, lib/driver/aix.c, lib/driver/bsdi.c, lib/driver/image/nrg.c, lib/driver/mmc/mmc.c, lib/driver/osx.c, lib/driver/solaris.c: Reduce use of cdtext_private.h. Let's see if autoconf 2.61 (circa 6 years ago) is okay. Some MacBooks seem to still use this. 2012-04-16 R. Bernstein * lib/driver/gnu_linux.c: ld: duplicate symbol _cdtext_format_enum in .libs/gnu_linux.o and .libs/cdtext.o for architecture x86_64 on OSX. I don't think it needs to be included in gnu_linux.c anyway. Comment #7, bug #30019 2012-04-16 rocky * include/cdio/cdtext.h: Add back in MIN_CDTEXT_FIELD. It's compatible too. 2012-04-15 R. Bernstein * lib/driver/disc.c, test/driver/.gitignore, test/driver/Makefile.am, test/driver/cdda.c, test/driver/gnu_linux.c: Add guard around get_mcn for null p_cdio. 2012-04-14 R. Bernstein * lib/driver/_cdio_generic.c: Update copyright 2012-04-14 R. Bernstein * lib/driver/_cdio_generic.c: Wasn't testing CD-Text error return properly. (Bug found via rbcdio/example/cdtext.rb) 2012-04-10 R. Bernstein * : commit 844578d2042aff813a397f711e422048d8e1176d Author: R. Bernstein Date: Tue Apr 10 03:29:32 2012 -0400 2012-03-27 Leon Merten Lohse * : commit 3940726aa77d102096117fb2f47aa2bb41c8abdc Author: Leon Merten Lohse Date: Tue Mar 27 17:45:09 2012 +0200 2012-03-26 R. Bernstein * README, README.libcdio: Update some README's to reflect the current situation. 2012-03-25 rocky * Makefile.am, configure.ac, example/Makefile.am, test/Makefile.am, test/driver/Makefile.am: test/Makefile.am: test example files, some of which are used in tests, is no longer optional other Makefile.am: remove some cruft. 2012-03-25 rocky * configure.ac, libcdtext.pc.in: Getting back to before cdtext library 2012-03-25 rocky * : commit 8a3f964baa48e95abf50a75490a013f785c7702a Author: rocky Date: Sun Mar 25 17:16:55 2012 -0400 2012-03-25 R. Bernstein * src/util.c, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/data/isofs-m1.cue: Add catalog number to ISO 9660 cue file. 2012-03-25 R. Bernstein * example/Makefile.am, lib/driver/gnu_linux.c, lib/driver/track.c: track.c, gnu_linux.c: Test for exceeding max track limit but allow specifying the leadout track in some cases. Makefile.am: need to build extract unconditionally since that is used in testing 2012-03-25 R. Bernstein * include/cdio/sector.h: Typo in C preprocessor symbol Comment #3 Savannah #35818 2012-03-25 R. Bernstein * test/driver/gnu_linux.c, test/driver/helper.c, test/driver/helper.h: Expand driver test framework a little and the tests we do. 2012-03-19 rocky * include/cdio/utf8.h: MinGW seems to need for FILE in utf8.h now 2012-03-18 R. Bernstein * include/cdio/Makefile.am, include/cdio/cdda.h, test/check_cue.sh.in: Small changes. 2012-03-18 R. Bernstein * include/cdio/dvd.h, include/cdio/sector.h: Replace a few collections of preprocessor #define's with enum's. Savannah bug #35746 https://savannah.gnu.org/bugs/?35746 . Patch from Markus Elfring. 2012-03-18 R. Bernstein * example/audio.c: Recent header work by Pete Batard eliminates the need to set __CDIO_H__ here. 2012-03-18 R. Bernstein * include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/device.hpp, include/cdio++/devices.hpp, include/cdio++/iso9660.hpp, include/cdio/audio.h, include/cdio/bytesex.h, include/cdio/bytesex_asm.h, include/cdio/cd_types.h, include/cdio/cdtext.h, include/cdio/device.h, include/cdio/disc.h, include/cdio/ds.h, include/cdio/dvd.h, include/cdio/ecma_167.h, include/cdio/iso9660.h, include/cdio/logging.h, include/cdio/mmc.h, include/cdio/mmc_cmds.h, include/cdio/mmc_hl_cmds.h, include/cdio/mmc_ll_cmds.h, include/cdio/mmc_util.h, include/cdio/posix.h, include/cdio/read.h, include/cdio/rock.h, include/cdio/sector.h, include/cdio/track.h, include/cdio/types.h, include/cdio/util.h, include/cdio/xa.h, lib/driver/_cdio_stdio.h, lib/driver/_cdio_stream.h, lib/driver/cdio_assert.h, lib/driver/cdio_private.h, lib/driver/cdtext_private.h, lib/driver/filemode.h, lib/driver/generic.h, lib/driver/image.h, lib/driver/image_common.h, lib/driver/mmc/mmc_cmd_helper.h, lib/driver/portable.h, lib/iso9660/iso9660_private.h, lib/udf/udf_fs.h, lib/udf/udf_private.h, src/getopt.h: More small header changes: * Remove leading underscores in header preprocessor names * Regularize names to include directory parts in the file name * Untabify files * Update copyright and remove unmaintained cvs $Id$ line The justification for removing leading underscores comes from a CERTS Secure Coding recommendation: https://www.securecoding.cert.org/confluence/display/cplusplus/DCL32-CPP.+Do+not+declare+or+define+a+reserved+identifierSee also Savannah bug #35745 https://savannah.gnu.org/bugs/?35745 2012-03-14 rocky * .gitignore, configure.ac, lib/Makefile.am, lib/cdtext/.gitignore, lib/cdtext/Makefile.am, lib/cdtext/cdtext.c, lib/cdtext/cdtext_private.h, lib/cdtext/libcdtext.sym, libcdtext.pc.in: Create CD-Text library - first round. (Second round will remove from lib/driver) 2012-03-25 R. Bernstein * src/util.c, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/data/isofs-m1.cue: Add catalog number to ISO 9660 cue file. 2012-03-25 R. Bernstein * example/Makefile.am, lib/driver/gnu_linux.c, lib/driver/track.c: track.c, gnu_linux.c: Test for exceeding max track limit but allow specifying the leadout track in some cases. Makefile.am: need to build extract unconditionally since that is used in testing 2012-03-25 R. Bernstein * include/cdio/sector.h: Typo in C preprocessor symbol Comment #3 Savannah #35818 2012-03-25 R. Bernstein * test/driver/gnu_linux.c, test/driver/helper.c, test/driver/helper.h: Expand driver test framework a little and the tests we do. 2012-03-22 Leon Merten Lohse * : commit 591c23ee48d44936535e0f5b13c2d8e025ac7dea Author: Leon Merten Lohse Date: Thu Mar 22 22:21:52 2012 +0100 2012-03-19 rocky * include/cdio/utf8.h: MinGW seems to need for FILE in utf8.h now 2012-03-18 R. Bernstein * include/cdio/Makefile.am, include/cdio/cdda.h, test/check_cue.sh.in: Small changes. 2012-03-18 R. Bernstein * include/cdio/dvd.h, include/cdio/sector.h: Replace a few collections of preprocessor #define's with enum's. Savannah bug #35746 https://savannah.gnu.org/bugs/?35746 . Patch from Markus Elfring. 2012-03-18 R. Bernstein * example/audio.c: Recent header work by Pete Batard eliminates the need to set __CDIO_H__ here. 2012-03-18 R. Bernstein * include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/device.hpp, include/cdio++/devices.hpp, include/cdio++/iso9660.hpp, include/cdio/audio.h, include/cdio/bytesex.h, include/cdio/bytesex_asm.h, include/cdio/cd_types.h, include/cdio/cdtext.h, include/cdio/device.h, include/cdio/disc.h, include/cdio/ds.h, include/cdio/dvd.h, include/cdio/ecma_167.h, include/cdio/iso9660.h, include/cdio/logging.h, include/cdio/mmc.h, include/cdio/mmc_cmds.h, include/cdio/mmc_hl_cmds.h, include/cdio/mmc_ll_cmds.h, include/cdio/mmc_util.h, include/cdio/posix.h, include/cdio/read.h, include/cdio/rock.h, include/cdio/sector.h, include/cdio/track.h, include/cdio/types.h, include/cdio/util.h, include/cdio/xa.h, lib/driver/_cdio_stdio.h, lib/driver/_cdio_stream.h, lib/driver/cdio_assert.h, lib/driver/cdio_private.h, lib/driver/cdtext_private.h, lib/driver/filemode.h, lib/driver/generic.h, lib/driver/image.h, lib/driver/image_common.h, lib/driver/mmc/mmc_cmd_helper.h, lib/driver/portable.h, lib/iso9660/iso9660_private.h, lib/udf/udf_fs.h, lib/udf/udf_private.h, src/getopt.h: More small header changes: * Remove leading underscores in header preprocessor names * Regularize names to include directory parts in the file name * Untabify files * Update copyright and remove unmaintained cvs $Id$ line The justification for removing leading underscores comes from a CERTS Secure Coding recommendation: https://www.securecoding.cert.org/confluence/display/cplusplus/DCL32-CPP.+Do+not+declare+or+define+a+reserved+identifierSee also Savannah bug #35745 https://savannah.gnu.org/bugs/?35745 2012-03-12 R. Bernstein * NEWS: Update NEWS for some small typos 2012-03-12 R. Bernstein * lib/iso9660/iso9660.c: Set timezone compatible with previous version. Patch from N. Boullis. 2012-03-11 Leon Merten Lohse * example/C++/OO/cdtext.cpp, example/cdtext.c, include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/disc.hpp, include/cdio/cdtext.h, lib/driver/cdtext.c, lib/driver/libcdio.sym, src/cd-info.c: [renamed] cdtext_languages_available to cdtext_list_languages [fixed] C++ CD-Text API [fixed] C++ CD-Text example 2012-03-07 Pete Batard * include/cdio/cdio_unconfig.h, test/cd-paranoia-log.right: More paranoia and unconfig removal 2012-03-10 R. Bernstein * example/cdtext.c: cdtext.c: Correct cdtext cue file name. 2012-03-10 R. Bernstein * : commit 0c7c1104fd7aafd7167bdc70e29140ed7091ff87 Author: R. Bernstein Date: Sat Mar 10 13:46:22 2012 -0500 2012-03-10 R. Bernstein * lib/driver/cdtext.c: Don't set crc field outside of the limit of the cdtext_pack_t structure. 2012-03-09 Leon Merten Lohse * lib/driver/cdtext.c, lib/driver/image/bincue.c: Redo some of rocky's beautifications. 2012-03-05 R. Bernstein * Makefile.am, configure.ac, libcdio_cdda.pc.in: Remove paranoia libcdio_cdda.pc.in 2012-03-05 R. Bernstein * example/cdtext.c, include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/disc.h, include/cdio/utf8.h, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_generic.c, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/utf8.c, src/cd-info.c, src/cdda-player.c, test/cdda.right, test/cdtext.right, test/check_cue.sh.in, test/driver/nrg.c.in: Multilanguage CD-Text from greenleon 2012-03-05 Pete Batard * test/driver/bincue.c.in: Fix an "unused but set warning" in bincue test 2012-03-05 Pete Batard * doc/.cvsignore, doc/doxygen/.cvsignore, example/C++/.cvsignore, example/C++/OO/.cvsignore, include/.cvsignore, include/cdio++/.cvsignore, include/cdio/.cvsignore, include/cdio/paranoia.h, lib/cdio++/.cvsignore, lib/driver/.cvsignore, lib/iso9660/.cvsignore, lib/udf/.cvsignore, m4/.cvsignore, package/.cvsignore, src/.cvsignore: Remove .cvsignore as well as cdio/paranoia.h 2012-03-05 Pete Batard * include/cdio/ecma_167.h, lib/udf/udf_fs.c: Apply MSVC compatibility workaround to ecma_167.h * An union of empty arrays is not size zero in MSVC * this causes issues with various sections of the UDF code that use sizeof and can prevent structures from being read properly * group empty array unions with at least one non zero-sized member 2012-03-05 Pete Batard * lib/driver/image/bincue.c, lib/driver/image/nrg.c: Add missing glob() equivalent for Windows platforms 2012-03-05 Pete Batard * example/cdchange.c, lib/driver/cdio.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/realpath.c, src/cdda-player.c, test/check_sizeof.c, test/driver/abs_path.c, test/driver/freebsd.c, test/driver/gnu_linux.c, test/driver/helper.c, test/driver/mmc_read.c, test/driver/mmc_write.c, test/driver/osx.c, test/driver/realpath.c, test/driver/solaris.c, test/driver/win32.c, test/test_lib_driver_util.c, test/testassert.c, test/testdefault.c, test/testgetdevices.c.in, test/testischar.c, test/testiso9660.c, test/testisocd2.c.in, test/testpregap.c.in: More source headers harmonization * fix missing #ifdefs * remove spaces and page feeds * follow same set of rules everywhere, with cdio includes coming after standard C includes. 2012-03-05 Pete Batard * lib/driver/FreeBSD/freebsd_cam.c, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/iso9660/iso9660_fs.c, src/cd-read.c, test/check_legal.regex: Fix various issues * bzero is obsolete * use HMODULE instead of long win win32 for 64 bit compatibility * iso9660_seek_read_framesize fails seeking to a position higher than 4 GB * cd-read produces a warning * legal-regex should allow for years > 2009 2012-03-05 Pete Batard * include/cdio/utf8.h, lib/driver/_cdio_stdio.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/utf8.c: Make fopen() and stat() support UTF-8 paths on Windows 2012-03-05 Pete Batard * example/extract.c, lib/driver/utf8.c, lib/iso9660/iso9660_fs.c: Joliet improvements * support discs with more than one secondary volume descriptors * add Joliet support for extract sample * add fallback to non-Joliet if non-Joliet may be longer 2012-03-05 Pete Batard * include/cdio/util.h, lib/driver/_cdio_stdio.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/util.c: Add _cdio_strdup_fixpath for absolute paths handling in MinGW * MinGW may provide absolute paths in the form /c/directory/... to native calls that require instead c:/directory 2012-03-05 Pete Batard * libcdio_paranoia.pc.in, test/check_paranoia.sh.in: Additional fixups for paranoia removal Should libcdio_cdda.pc.in be removed as well? 2012-03-05 Pete Batard * .gitignore, Makefile.am, example/.gitignore, example/C++/.cvsignore, example/C++/.gitignore, example/C++/paranoia.cpp, example/C++/paranoia2.cpp, example/Makefile.am, include/cdio/Makefile.am, lib/driver/Makefile.am, lib/driver/logging.c, test/.gitignore, test/Makefile.am, test/testparanoia.c: More paranoia removal * Also some silencing of makefile operations 2012-03-05 R. Bernstein * doc/cd-text-format.texi: Minor expository changes 2012-03-04 R. Bernstein * src/cd-paranoia/.gitignore, src/cd-paranoia/Makefile.am, src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/doc/.gitignore, src/cd-paranoia/doc/FAQ.txt, src/cd-paranoia/doc/Makefile.am, src/cd-paranoia/doc/en/.gitignore, src/cd-paranoia/doc/en/Makefile.am, src/cd-paranoia/doc/en/cd-paranoia.1.in, src/cd-paranoia/doc/ja/.gitignore, src/cd-paranoia/doc/ja/Makefile.am, src/cd-paranoia/doc/ja/cd-paranoia.1.in, src/cd-paranoia/doc/overlapdef.txt, src/cd-paranoia/getopt.c, src/cd-paranoia/getopt.h, src/cd-paranoia/getopt1.c, src/cd-paranoia/header.c, src/cd-paranoia/header.h, src/cd-paranoia/pod2c.pl, src/cd-paranoia/report.c, src/cd-paranoia/report.h, src/cd-paranoia/usage-copy.h, src/cd-paranoia/usage.txt.in, src/cd-paranoia/utils.h, src/cd-paranoia/version.h: Remove more paranoia code 2012-03-04 R. Bernstein * test/testgetdevices.c.in: test/testgetdevices.c.in Remove some warnings on MingGW 2012-03-04 R. Bernstein * test/Makefile.am: test/Makefile.am: Remove test/unconfig -- this time, for sure! 2012-03-04 rocky * test/Makefile.am, test/testunconfig.c: Remove testunconfig. We have removed unconfig.h 2012-03-04 R. Bernstein * src/util.h, test/driver/freebsd.c, test/driver/gnu_linux.c: More pbatard patches 2012-03-04 R. Bernstein * src/util.c: More pbatard patches 2012-03-04 R. Bernstein * MSVC/README, lib/driver/MSWindows/win32_ioctl.c, lib/driver/realpath.c, lib/driver/sector.c, lib/driver/util.c, lib/iso9660/Makefile.am, lib/iso9660/rock.c, lib/iso9660/xa.c, lib/udf/filemode.c, lib/udf/udf_private.h, src/getopt.h, src/iso-info.c, src/iso-read.c, src/mmc-tool.c: More patches from the pbatard branch. 2012-03-04 R. Bernstein * configure.ac, lib/driver/ds.c, lib/driver/mmc/mmc_ll_cmds.c: Some more pbatard patches 2012-03-04 R. Bernstein * example/extract.c, include/cdio/Makefile.am: Makefile.am: add CDIO_ to all #defines in cdio_config.h extract.c: give filename on extract errors and convert encoding to unix. 2012-03-04 rocky * lib/driver/MSWindows/win32.c, lib/driver/solaris.c: Remove some driver compilation warnings 2012-03-04 R. Bernstein * lib/driver/os2.c: merge another warning fix from the pbatard-branch 2012-03-04 rocky * : I hate conflicted merges 2012-03-04 R. Bernstein * test/check_udf.sh: check_udf.sh is derived and thus should not be in git 2012-03-04 R. Bernstein * configure.ac, test/.gitignore, test/check_udf.sh, test/check_udf.sh.in, test/data/Makefile.am: test/check_udf.sh works when building outside source tree. With this "make distcheck" should work again 2012-03-04 R. Bernstein * test/Makefile.am, test/check_cd_read.sh, test/check_common_fn.in, test/check_udf.sh: test/*: Add first UDF test - test sequential file extraction. example/extract.c: give non-zero return code if we can't find UDF image test/* 2012-03-04 rocky * test/check_common_fn.in: This time, for sure! 2012-03-03 R. Bernstein * INSTALL: Revert inadvertanet INSTALL update 2012-03-04 rocky * INSTALL, test/check_common_fn.in: Tolerancefor Solaris /bin/sh and grep 2012-03-03 R. Bernstein * test/Makefile.am: Add test/cdtext.right to distribution. 2012-03-03 R. Bernstein * test/data/Makefile.am: Add test/data/cdtext.cue to distribution. 2012-03-03 R. Bernstein * test/testgetdevices.c.in: Skip testgetdevices on MinGW for now 2012-03-03 R. Bernstein * test/driver/mmc_write.c: Had messed up on pbatard mmc_write.c sleep patch for MinGW 2012-03-03 R. Bernstein * src/cd-info.c: More pbatard patches 2012-03-03 R. Bernstein * lib/driver/MSWindows/win32.c, lib/udf/udf.c, lib/udf/udf_time.c: More pbatard patches 2012-03-03 R. Bernstein * lib/driver/portable.h: Forgot to add back in portable.h 2012-03-03 R. Bernstein * example/isofile.c, example/isofile2.c, example/isofuzzy.c, lib/driver/Makefile.am, lib/driver/filemode.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/logging.c, lib/driver/sector.c, src/iso-read.c, test/testisocd.c, test/testisocd2.c.in: More patches from pbatard to reduce warnings, etc. 2012-03-03 R. Bernstein * lib/driver/MSWindows/win32.c: Reduce compilation warnings via changes in pbatard branch 2012-03-03 R. Bernstein * lib/driver/MSWindows/aspi32.c, lib/driver/cdtext.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/mmc/mmc.c: Reduce compilation warnings via changes in pbatard branch 2012-03-03 R. Bernstein * test/driver/bincue.c.in, test/driver/cdrdao.c.in, test/driver/mmc_write.c: Remove a couple of warnings, some of which were removed in the pbatard branch. 2012-03-03 R. Bernstein * test/check_legal.regex: check_legal.regex: wrong regexp. This time, for sure! 2012-03-03 R. Bernstein * test/check_common_fn.in, test/check_legal.regex: check_legal.regex: allow matching cd-info.exe. check_common_fn.in: don't erase file cd-info_legal.dump if there is an error. 2012-03-03 R. Bernstein * THANKS: More things Pete has done 2012-03-03 R. Bernstein * test/driver/nrg.c.in: Reinstate nrg test for MinGW. 2012-03-03 R. Bernstein * example/isofile.c, example/isofile2.c, example/isofuzzy.c, include/cdio/udf.h, include/cdio/udf_time.h, include/cdio/util.h, lib/driver/Makefile.am, lib/driver/_cdio_generic.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/abs_path.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/logging.c, src/iso-read.c, test/testisocd.c, test/testisocd2.c.in: Pete Batard's patches offset types especially for MinGW and MS Visual C. 2012-03-03 R. Bernstein * lib/driver/{portable.h => filemode.h}: Pete Batard's patches offset types especially for MinGW and MS Visual C. 2012-03-03 R. Bernstein * include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c: pbatard empty array changes for iso9660.h. I think the last of the header patches. 2012-03-03 R. Bernstein * include/cdio/ecma_167.h, lib/udf/udf_file.c, lib/udf/udf_fs.c: pbatard flexible array for ecma_167.h header 2012-03-03 R. Bernstein * test/check_common_fn.in: test/check_common.sh.in: Avoid $(...) for sh of Solaris 10 2012-03-03 R. Bernstein * example/Makefile.am: A foolish consistency with respect to the ordering of making example programs 2012-03-03 R. Bernstein * include/cdio/bytesex.h, include/cdio/bytesex_asm.h, include/cdio/cdio.h, include/cdio/read.h, include/cdio/rock.h, include/cdio/types.h, lib/driver/utf8.c, lib/udf/udf_fs.c: Reduce differences in pbatard branch for headers. (Still need to add empty array/union differences). 2012-03-03 R. Bernstein * THANKS, configure.ac, example/.gitignore, example/Makefile.am, example/README, example/extract.c, example/udffile.c: Reduce differences between master and pbatard branch. 2012-03-03 R. Bernstein * example/C++/OO/cdtext.cpp, example/cdtext.c, include/cdio++/disc.hpp: Revise OO CD-Text CPP for different interface. Update copyright and untabify some files. 2012-03-03 R. Bernstein * example/C++/OO/cdtext.cpp, example/C++/OO/device.cpp, example/C++/OO/drives.cpp, example/C++/OO/eject.cpp, example/C++/OO/iso4.cpp, example/C++/OO/isofile.cpp, example/C++/OO/isofile2.cpp, example/C++/OO/isolist.cpp, example/C++/OO/mmc1.cpp, example/C++/OO/mmc2.cpp, example/C++/OO/tracks.cpp, example/C++/device.cpp, example/C++/eject.cpp, example/C++/isofile.cpp, example/C++/isofile2.cpp, example/C++/isolist.cpp, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/C++/paranoia.cpp, example/C++/paranoia2.cpp: Harmonize source headers: C++ examples [PATCH 3/5] from pbatard. 2012-03-03 R. Bernstein * test/driver/nrg.c.in: Change headers as per pbatard branch to make MinGW work out. 2012-03-02 R. Bernstein * example/audio.c, example/cdchange.c, example/cdio-eject.c, example/cdtext.c, example/device.c, example/discid.c, example/drives.c, example/eject.c, example/isofile.c, example/isofile2.c, example/isofuzzy.c, example/isolist.c, example/isolsn.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/sample3.c, example/sample4.c, example/tracks.c, example/udf1.c, example/udf2.c, example/udffile.c: Harmonize source headers: C examples (Patch 4/5) 2012-03-02 R. Bernstein * lib/iso9660/iso9660_fs.c, test/check_common_fn.in: check_common_fn.in: show command name when we hit an error 2012-03-02 R. Bernstein * lib/iso9660/iso9660_fs.c: Properly address 'len' MinGW shadow variable warnings in ISO9660. From pbatard branch. 2012-02-26 R. Bernstein * test/check_common_fn.in: A slightly better locale-missing fix 2012-02-26 rocky * test/check_common_fn.in: MinGW doesn't have a locale command 2012-02-26 rocky * test/driver/nrg.c.in: Skip test/driver/nrg until we work out off_t issues 2012-02-25 R. Bernstein * include/cdio/udf_time.h, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/cdio_assert.h, lib/iso9660/rock.c: Silence 'cont_###' set but not used warnings on MinGW From pbatard branch. Update copyright date on recently changed files. 2012-02-25 R. Bernstein * test/check_common_fn.in: Fix "setlocale: LC_TIME: cannot change locale (en_US" warning during tests. Both 'en_US' and 'en_US.utf8' might be defined on some platforms From pbatard branch. 2012-02-25 R. Bernstein * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c: Fix missing logging header for aspi32.c/win32.c From pbatard branch 2012-02-25 R. Bernstein * include/cdio/udf_time.h: Fix 'struct timespec declared inside parameter list' MinGW warning. From pbatard branch. 2012-02-25 R. Bernstein * lib/driver/cdio_assert.h: Use native Windows assert for MinGW. This also avoids false positive warnings with Clang static analyzer, as the default libcdio assert does return. From pbatard branch. 2012-02-24 R. Bernstein * example/cdchange.c, test/driver/mmc_read.c, test/driver/mmc_write.c, test/driver/realpath.c: Fix some of the tests for MinGW and fix the use of Sleep/usleep for MinGW & MSVC platforms * Sleep takes ms, not s * Use sleep/Sleep rather than usleep in the cdchange sample, as usleep is not available on recent MinGW platforms From pbatard branch. 2012-02-24 R. Bernstein * .gitattributes, configure.ac: * use "Define to" as this is the comment default from autotools * use quotes and x prefix for string tests * add detection for MinGW required LFS calls and remove unneeded AC_FUNC_FSEEKO * set LFS support for MinGW * disable cdda_player for MinGW * enable Joliet support without iconv on MinGW * also fix an issue with CRLF in config.rpath Above from Pete Batard. 2012-02-24 R. Bernstein * include/cdio/device.h, include/cdio/types.h: types.h: gcc before 4.5 has a no-argument form of deprecated. device.h: use LIBCIO_DEPRECATED macro rather than assume gcc. 2012-02-24 R. Bernstein * lib/driver/osx.c: lib/driver/osx.c: duplicate transport error enum - cdio/cdda.h removed 2012-02-23 R. Bernstein * include/cdio/Makefile.am, test/Makefile.am: Make "distcheck" works again. include/cdio/Makefile.am: was missing inclusion of cdtext.h test/Makefile.am: remove paranoia test. 2012-02-19 rocky * Makefile.am, configure.ac, example/C++/.gitignore, example/C++/Makefile.am, example/C++/OO/.gitignore, example/Makefile.am, example/paranoia.c, example/paranoia2.c, include/cdio/Makefile.am, lib/Makefile.am, lib/cdda_interface/.cvsignore, lib/cdda_interface/.gitignore, lib/cdda_interface/Makefile.am, lib/cdda_interface/cddap_interface.c, lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/drive_exceptions.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/interface.c, lib/cdda_interface/libcdio_cdda.sym, lib/cdda_interface/low_interface.h, lib/cdda_interface/scan_devices.c, lib/cdda_interface/scsi_interface.c, lib/cdda_interface/smallft.c, lib/cdda_interface/smallft.h, lib/cdda_interface/test_interface.c, lib/cdda_interface/toc.c, lib/cdda_interface/utils.c, lib/cdda_interface/utils.h, lib/iso9660/.gitignore, lib/paranoia/.cvsignore, lib/paranoia/.gitignore, lib/paranoia/Makefile.am, lib/paranoia/gap.c, lib/paranoia/gap.h, lib/paranoia/isort.c, lib/paranoia/isort.h, lib/paranoia/libcdio_paranoia.sym, lib/paranoia/overlap.c, lib/paranoia/overlap.h, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c, src/Makefile.am, test/Makefile.am, test/driver/realpath.c: paranoia code removed. Is now in separate tree under GPL v2+. realpath.c: patch from Debian and N. Boullis 2012-02-19 rocky * test/driver/realpath.c: Debian POSIXness fix from N. Boullis 2012-02-19 rocky * NEWS, include/cdio/device.h: Deprecate some defines - patch from Nicolas Boullis. 2012-02-19 rocky * src/Makefile.am, src/cd-info.c: manual page corrections. 2012-02-12 R. Bernstein * test/check_cue.sh.in: $abs_top_path now seems to really refer to the absolute top path. Adjust data/check locations accordingly. 2012-02-12 R. Bernstein * test/check_cue.sh.in: $abs_top_path now seems to really refer to the absolute top path. Adjust data/check locations accordingly. 2012-02-08 R. Bernstein * doc/cd-text-format.texi: Incorporate Leon'suggestions 2012-02-08 R. Bernstein * doc/cd-text-format.texi: Other Pack Types -> Miscellaneous Pack Types 2012-02-08 R. Bernstein * doc/cd-text-format.texi: One more time 2012-02-08 R. Bernstein * doc/cd-text-format.texi: One small little change 2012-02-08 R. Bernstein * doc/cd-text-format.texi: Work a little on the grammar in the beginning of section "Pack Contents" 2012-02-08 R. Bernstein * doc/cd-text-format.texi: Revision based on latest comments from Thomas 2012-02-07 R. Bernstein * doc/cd-text-format.texi: Refine sectioning yet again, add pack numbers to appropriate sections. Other small changes. 2012-02-06 R. Bernstein * doc/cd-text-format.texi: Make two top-level sections to separate lower-level decode/encode from higher-level CD-TEXT entry. Go over references -- another pass is needed. Corrections from Thomas. CD Text -> CD-TEXT since that's how docs list it. 2012-02-06 R. Bernstein * doc/.gitignore, doc/Makefile.am, doc/{cd-text.texi => cd-text-format.texi}: Add an introduction. Make less machine-centric and more Human-centric. Regularize terminology more, e.g. CD Text, Pack Types. 2012-02-05 R. Bernstein * doc/cd-text.texi: Correct makeinfo sectioning. Use unnumbered for references 2012-02-05 R. Bernstein * doc/cd-text.texi: More small cd-text.texi changes 2012-02-05 R. Bernstein * doc/cd-text.texi: Clarifications and typos suggested by Thomas Schmitt. 2012-02-05 R. Bernstein * doc/cd-text.texi, doc/libcdio.texi: libcdio.texi: Encorporate Thomas' suggestions cd-text.texi: Encorporate Thomas' suggestions, revise sectioning; Start using floats in tables, and small corrections. 2012-02-04 R. Bernstein * doc/cd-text.texi: More little changes 2012-02-04 R. Bernstein * doc/cd-text.texi: More formatting changes 2012-02-04 R. Bernstein * doc/cd-text.texi: Ooops name spelling correction 2012-02-04 R. Bernstein * doc/Makefile.am, doc/libcdio.texi: Add rules to make cd-text.{html,pdf,ps}. Update CD-Text info as per discussion in libcdio-devel. 2012-02-04 R. Bernstein * doc/cd-text.texi: Misc small formatting changes and corrections. Work on references. 2012-02-04 R. Bernstein * doc/cd-text.texi: Add Thomas Schmitt's cdtext.txt converted to texinfo 2012-02-04 R. Bernstein * doc/libcdio.texi: Split one paragraph into 3 as suggested by Thomas Schmitt 2012-01-28 R. Bernstein * test/driver/realpath.c: realpath.c(main): Remove duplicate if condition. 2012-01-28 R. Bernstein * test/check_cue.sh.in: Wasn't showing full command name when check_cue.sh failed. 2012-01-28 R. Bernstein * lib/driver/mmc/mmc_hl_cmds.c, lib/driver/solaris.c, test/check_cue.sh.in: mmc_hl_cmds.c: remove gcc warning solaris.c: remove unused fn warning when not on solaris check_cue.sh.in: fix so we can build outside of source tree. With this, "make distcheck" works again. 2012-01-26 R. Bernstein * lib/driver/image/bincue.c, test/check_cue.sh.in: CDTEXTFILE directifile should be relative to CUE file. 2012-01-25 R. Bernstein * lib/driver/image/cdrdao.c, test/data/vcd2.toc: Find/fix another place in TOC reader where we need to use relative paths. Here in a branch of code for the DATAFILE statement. 2012-01-25 R. Bernstein * .gitignore, COPYING, configure.ac: Administrivia: Don't recreate INSTALL when doing autoreconf. COPYING is now in .git too. 2012-01-17 R. Bernstein * configure.ac, example/sample3.c, example/sample4.c: Enable automake enable silent rules which makes it easier to spot warnings. If Automake v1.10 or earlier is used, AM_SILENT_RESULES is be ignored. Patch also from Pete Batard. 2012-01-17 R. Bernstein * example/sample3.c, example/sample4.c: Remove a couple of "possibly unused variable" warnings. Patch from Pete Batard. 2012-01-17 R. Bernstein * .gitattributes: Make sure shell, automake, and autoconf files end in Unixish LF, the default autocrlf. Patch again from Pete Batard. 2012-01-17 R. Bernstein * : Add cdda.bin which is used in tests 2012-01-16 rocky * configure.ac, lib/driver/abs_path.c: Add replacement for strndup(). MinGW doesn't have it. From Pete Batard again. 2012-01-16 rocky * configure.ac: Remove -mwindows for MinGw and cygwin since it prevents stdout/stderr from reaching the console. From Pete Batard, see libcdio-devel Jan 16, 2012. 2012-01-16 rocky * lib/iso9660/iso9660_fs.c, lib/udf/udf_fs.c: Plug memory leak in iso9660_ifs_readdir() and udf_open(). Patches from Pete Batard. See libcdio_devel from Jan 16, 2012. 2011-12-25 rocky * test/cdtext.right, test/data/cdtext.cue: Double length of cdtext cue/bin example. Thomas reports on libcdio-devel that the helps some LG drives and wodim. 2011-12-16 rocky * lib/cdda_interface/libcdio_cdda.sym: Add fft_foward to externs. Used in linking libcdio_cdda 2011-12-15 R. Bernstein * configure.ac: Allow FreeBSD9. John Wehle says it works 2011-12-11 R. Bernstein * lib/driver/abs_path.c, lib/driver/cdio_private.h, lib/driver/image.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image_common.h: Issue #33636 make path names toc/cue files be relative to the toc/cue when no absolute path is specified in toc/cue FILENAME statements. 2011-12-11 R. Bernstein * lib/driver/abs_path.c, lib/driver/libcdio.sym, test/driver/.gitignore, test/driver/Makefile.am, test/driver/abs_path.c: Add cdio_dirname which I think should complete what we need. Also add test of abs_path and dirname 2011-12-11 R. Bernstein * lib/driver/abs_path.c: Start abs_path and basename to be used in cue files. 2011-12-10 R. Bernstein * lib/driver/.gitignore, lib/driver/Makefile.am, lib/driver/abs_path.c, lib/driver/libcdio.sym: Start abs_path and basename to be used in cue files. 2011-12-05 R. Bernstein * include/cdio/Makefile.am, src/util.h, test/check_common_fn.in: Incorporate patch #7628 for building outside of source tree. Check for locale en-US. 2011-12-04 R. Bernstein * include/cdio/cdtext.h, lib/driver/_cdio_generic.c, lib/driver/cdtext.c, lib/driver/image/bincue.c, lib/driver/image/nrg.c, lib/driver/mmc/mmc.c, test/cdtext.right, test/check_cue.sh.in: Patch from Leon Merten Lohse: Correct the length of the CD-TEXT block. 2011-11-30 rocky * INSTALL: Reinstate INSTALL - I need a better way to keep INSTALL from getting destroyed 2011-11-30 rocky * INSTALL, configure.ac, src/cdda-player.c: cygwin has ncurses.h in 2011-11-28 R. Bernstein * test/data/cdtext.cue: This cue is burnable via the command: cdrecord -text cuefile=cdtext.cue 2011-11-27 R. Bernstein * lib/driver/mmc/mmc_ll_cmds.c, test/driver/mmc_read.c: Look for a NULL destination buffer in mmc_read_cd and return DRIVER_OP_BAD_POINTER in this particular situation. 2011-11-27 R. Bernstein * doc/glossary.texi: Better CD Text information via Rob Fuller. 2011-11-27 R. Bernstein * doc/glossary.texi: Add a couple of URLs for CD Text information. 2011-11-27 R. Bernstein * lib/driver/image/cdrdao.c, test/data/cdda.cue, test/data/vcd2.toc: Move a little bit forward in implementing SILENCE in cdrdao. cdrdao tests now work while being a little more strict. 2011-11-25 R. Bernstein * lib/driver/image/cdrdao.c, test/data/Makefile.am: Add Leon Merten Lohse's cdtext test images. cdrdao.c reduce severity of not finding source - may change my mind later about this... 2011-11-25 rocky * configure.ac: If we don't have ncurses.h don't try to look for libncurses 2011-11-25 rocky * lib/driver/image/cdrdao.c: Check that we can find data source and give error when we can't 2011-11-24 R. Bernstein * configure.ac: up release to 0.84git 2011-11-24 R. Bernstein * THANKS, example/cdtext.c, include/cdio++/cdtext.hpp, include/cdio++/device.hpp, include/cdio++/disc.hpp, include/cdio++/track.hpp, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/disc.h, include/cdio/track.h, lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_generic.c, lib/driver/aix.c, lib/driver/bsdi.c, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/disc.c, lib/driver/generic.h, lib/driver/gnu_linux.c, lib/driver/image.h, lib/driver/image/.gitignore, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_private.h, lib/driver/netbsd.c, lib/driver/os2.c, lib/driver/osx.c, lib/driver/solaris.c, src/cd-info.c, src/cdda-player.c, test/cdtext.right, test/check_cue.sh.in, test/check_fuzzyiso.sh, test/data/cdtext.cue, test/driver/nrg.c.in: 1) cdtext objects are no longer associated with a track but with the disc. 2) - cdio_get_cdtext no longer takes track as an argument - cdtext_get, cdtext_get_const, cdtext_set require track argument 3) Language, Genre, Genre Code and Encoding Fields are now properly parsed and stored in the cdtext object 4) Added public function cdio_get_cdtext_raw to extract the binary CD-Text 5) Added CDTEXTFILE keyword logic in cue sheet parser. Parses binary/raw CD-Text files 6) Added cdtext_genre2str to convert genre code 7) altered the example programs, test drivers, cdda-player and cd-info to work with these changes 8) Added test case 9) A few smaller changes A disc either holds CD-Text for all the tracks or does not hold any. Therefore a CD-Text object for the whole disc seems more natural to me. It also enables us to store global fields, like genre, encoding, language. Patch was tested on GNU/Linux 32 bit running Gentoo. 2011-11-16 R. Bernstein * configure.ac, include/cdio/device.h, lib/driver/image/cdrdao.c, test/data/Makefile.am, test/data/data5.toc, test/data/data6.toc, test/data/data7.toc, test/data/t10.toc, test/driver/cdrdao.c.in: Don't error out on handling "NO PRE_EMPHASIS" in cdrdao TOC. Savannah bug #34826: 2011-11-05 R. Bernstein * example/.gitignore, example/Makefile.am, example/README, example/discid.c, lib/.gitignore: discid (http://discid.sourceforge.net/) using libcdio. 2011-10-27 R. Bernstein * Makefile.am: Change -perm -777 to -perm -755 so gnu.ftp.org will accept upload. 2011-10-26 R. Bernstein * doc/how-to-make-a-release.txt: Administrivia. 2011-10-26 R. Bernstein * include/cdio/mmc.h, include/cdio/mmc_hl_cmds.h, include/cdio/mmc_ll_cmds.h: Reduce doxygen warnings regarding documenting some parameters. 2011-10-26 R. Bernstein * configure.ac: Get ready for 0.83 release 2011-10-21 rocky * INSTALL: INSTALL got clobbered 2011-10-21 R. Bernstein * INSTALL, configure.ac, lib/cdda_interface/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am, lib/udf/Makefile.am: Makefile.am: Increase shared library "current" numbers, zeroing "revision" and "age ". configure.ac: require autoconf at least 2.67 2011-10-21 rocky * test/Makefile.am: Forgot to add check_legal.regex 2011-10-21 rocky * README.develop: Add version numbers for autoconf and automake. 2011-10-21 rocky * : commit 3dfffd589cad5ed04a3c72ead29f0407db424d76 Author: R. Bernstein Date: Fri Oct 21 06:05:17 2011 -0400 2011-10-20 R. Bernstein * README: Note there is limited support for writing via MMC as noted by Thomash Schmitt. 2011-10-20 R. Bernstein * include/cdio/Makefile.am, src/cd-paranoia/Makefile.am: src/cd-paranoia.h and include/cdio/cdio_config.h are derived files, so don't include them in the distribution. 2011-10-20 R. Bernstein * include/cdio/Makefile.am, include/cdio/cdio_unconfig.h, test/.gitignore, test/Makefile.am, test/testunconfig.c: Add an include to remove any C Preprocessor symbol libcdio's config.h creates. Programs using libcdio can do this: // for cdio: // for your program 2011-10-20 R. Bernstein * example/cdchange.c, example/isolist.c, example/isolsn.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/paranoia.c, example/udffile.c, include/cdio/Makefile.am, lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/drive_exceptions.c, lib/cdda_interface/toc.c, lib/cdda_interface/utils.c, lib/cdio++/devices.cpp, lib/cdio++/iso9660.cpp, lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stream.c, lib/driver/aix.c, lib/driver/audio.c, lib/driver/bsdi.c, lib/driver/cd_types.c, lib/driver/cdio.c, lib/driver/cdio_assert.h, lib/driver/cdtext.c, lib/driver/device.c, lib/driver/disc.c, lib/driver/ds.c, lib/driver/gnu_linux.c, lib/driver/image.h, lib/driver/image/bincue.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/logging.c, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_hl_cmds.c, lib/driver/mmc/mmc_ll_cmds.c, lib/driver/mmc/mmc_util.c, lib/driver/netbsd.c, lib/driver/os2.c, lib/driver/osx.c, lib/driver/portable.h, lib/driver/read.c, lib/driver/realpath.c, lib/driver/sector.c, lib/driver/solaris.c, lib/driver/track.c, lib/driver/utf8.c, lib/driver/util.c, lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, lib/iso9660/xa.c, lib/paranoia/gap.c, lib/paranoia/isort.c, lib/paranoia/overlap.c, lib/paranoia/p_block.c, lib/paranoia/paranoia.c, lib/udf/filemode.c, lib/udf/udf_fs.c, lib/udf/udf_private.h, lib/udf/udf_time.c, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/report.c, src/cdda-player.c, src/cddb.c, src/mmc-tool.c, src/util.h, test/check_sizeof.c, test/driver/bincue.c.in, test/driver/cdrdao.c.in, test/driver/freebsd.c, test/driver/gnu_linux.c, test/driver/helper.c, test/driver/mmc_read.c, test/driver/mmc_write.c, test/driver/nrg.c.in, test/driver/osx.c, test/driver/realpath.c, test/driver/solaris.c, test/driver/win32.c, test/test_lib_driver_util.c, test/testassert.c, test/testdefault.c, test/testgetdevices.c.in, test/testischar.c, test/testiso9660.c, test/testisocd.c, test/testparanoia.c, test/testpregap.c.in: Make sure config.h or the copy of that gets included only once to reduce duplicate include warnings. 2011-10-20 R. Bernstein * configure.ac, include/cdio/Makefile.am, lib/driver/cdtext.c, lib/driver/utf8.c, src/cd-info.c: Correct test for enable_cdda to accept either curses.h *or* ncurses.h Add in more places that use bzero. Checks suggested by Blake Jones. Add preprocessor symbol CDIO_CONFIG_H to 2011-10-20 rocky * THANKS: Add Dagobert Michelson to the growing list. 2011-10-20 R. Bernstein * example/README: Note that some adjustments might be needed to compile example programs 2011-10-20 R. Bernstein * Makefile.am, doc/Makefile.am, src/cd-paranoia/Makefile.am: Add remake --task documentation 2011-10-19 R. Bernstein * src/util.h: Add to pick up definition of bzero. 2011-10-19 R. Bernstein * README.develop, example/sample3.c, include/cdio++/iso9660.hpp, src/cd-drive.c, src/cd-paranoia/Makefile.am, test/check_legal.regex: Remove CVS $Id$ line which is no longer automatically updated. ios9660.hpp under FS because of Solaris macro conflict as suggested by Thomas Schmitt. cd-drive.c: add some casts to remove gcc warnings src/cd-paranoia/Makefile.am: remove a GNU make idiom. README.develop: note needing GNU make or remake 2011-10-19 R. Bernstein * example/mmc3.c, example/sample3.c, example/sample4.c: Remove some warnings 2011-10-19 R. Bernstein * lib/driver/gnu_linux.c: sprintf -> snprintf 2011-10-20 rocky * lib/driver/solaris.c: solaris.c: sprintf->snprintf as implicitly suggested by Thomas Schmitt 2011-10-20 rocky * lib/iso9660/rock.c, test/check_common_fn.in: rock.c: small C-Preprocessor bug noticed on Solaris 10 sparc. check_common_fn.in: avoid == for older /bin/sh as Solaris has 2011-10-18 R. Bernstein * : commit 47e4844390cb801a3dcd8e38cad4cc7e559962d4 Author: R. Bernstein Date: Tue Oct 18 20:00:56 2011 -0400 2011-10-18 rocky * NEWS: Update NEWS for pending 0.83 release. 2011-10-04 R. Bernstein * src/util.c, test/cdda-mcn.right, test/cdda-read.right, test/cdda.right, test/check_common_fn.in, test/check_opts.sh, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/copying-rr.right, test/copying.right, test/fsf.right, test/isofs-m1-no-rr.right, test/isofs-m1-read.right, test/isofs-m1.right, test/joliet-nojoliet.right, test/joliet.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/vcd_demo_vcdinfo.right, test/vcd_demo_vcdinfo_toc.right, test/videocd.right: --no-header omits warranty. Patch from Martin von Gagem. Savannah #29307. 2011-09-12 R. Bernstein * src/cd-info.c: Give CDDB info if *any* tracks are found to be audio tracks. 2011-08-25 rocky * lib/driver/MSWindows/win32_ioctl.c: Fix a couple of sizeof syntax errors in converting sprintf to snprintf. See bug #34125. 2011-07-08 rocky * configure.ac, include/cdio/Makefile.am: Use "make" to create include/cdio/cdio_config.h rather than do it in the configure script. 2011-07-08 rocky * include/cdio/paranoia.h, lib/paranoia/paranoia.c: Reduce range of seek in paranoia_seek to be int32_t. CDDA's definitely live within this range. off_t is influenced by _FILE_OFFSET_BITS and can cause problems on a 32-bit system where _FILE_OFFSET_BITS is set to 64. See Bastiaan Timmer's posting to libcdio-help on July 7, 2011. 2011-07-07 rocky * configure.ac: Copy all of config.h in order to get _FILE_OFFSET_BITS. 2011-05-31 R. Bernstein * lib/iso9660/iso9660_fs.c, src/iso-info.c: Two more Coverty static analysis issues addressed by Honza Horak. 2011-05-30 rocky * example/audio.c, example/mmc2a.c, example/paranoia.c, lib/cdda_interface/cddap_interface.c, lib/cdda_interface/common_interface.c, lib/cdda_interface/scan_devices.c, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/mmc/mmc.c, lib/driver/read.c, lib/iso9660/iso9660_fs.c, lib/paranoia/paranoia.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, src/cd-info.c, src/cd-paranoia/cd-paranoia.c, src/cd-read.c, src/iso-info.c: patch from Honza Horak using Coverity's static analysis tool. 2011-05-27 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c, lib/driver/solaris.c, src/cdda-player.c: Change a number of sprintf's to snprintf. 2011-05-20 R. Bernstein * README.libcdio, configure.ac: configure.ac: remove no AC_LANG_SOURCE call detected. (From Christopher Yeleighton) 2011-05-19 R. Bernstein * INSTALL: Typo 2011-05-19 R. Bernstein * .gitignore, INSTALL: More specific install instructions 2011-05-19 R. Bernstein * INSTALL.git: INSTALL.git information is in README.develop 2011-05-19 R. Bernstein * README.develop, README.libcdio: Update development install instructions and libcdio-specific "configure" options. 2011-05-19 R. Bernstein * test/cdda.right: Adjust test output - track now has width for two digits. 2011-05-19 R. Bernstein * INSTALL.git, Makefile.am, README, doc/Makefile.am, doc/doxygen/html/.cvsignore, example/audio.c, include/cdio++/enum.hpp, include/cdio++/read.hpp, include/cdio/rock.h, include/cdio/scsi_mmc.h, lib/driver/portable.h, lib/driver/sector.c, lib/iso9660/xa.c, package/libcdio.spec.in, parse/toc.y, src/Makefile.am, src/cd-drive.help2man, src/cd-info.help2man, src/cd-paranoia/doc/en/cd-paranoia.1.in, src/cd-paranoia/header.c, src/cd-read.help2man, src/cdda-player.c, src/cdinfo-linux.c, src/iso-info.help2man, src/iso-read.help2man, src/util.c, src/util.h: Add git install instructions. Simplify and customize INSTALL. Add dependency to cause version.texi to get created. Update my email address. 2011-05-18 rocky * THANKS, include/cdio/audio.h, include/cdio/types.h, include/cdio/udf_file.h, lib/driver/mmc/mmc.c, src/cd-info.c: Add ISRC track info to cd-info output. Code from Scot C. Bontrager. 2011-05-18 R. Bernstein * src/cdda-player.c: Correct wording in cdda-player comments. For Christopher Yeleighton, among others. 2011-05-18 R. Bernstein * src/cdda-player.c: Don't wrap-around volume adjustment for cdda-player. The rationale is that folks might not look at the volume indicator or know what the max or min values are. See issue #33333 by Christopher Yeleighton. 2011-05-17 rocky * lib/driver/libcdio.sym: Make sure mmc_isrc_track_read_subchannel is a global symbol 2011-05-17 rocky * THANKS, include/cdio/mmc.h, lib/driver/mmc/mmc.c: Add mmc routine to get the ISRC information on a CD that is in the q subchannel but not showing up in the CDTEXT. Contributed by Scot C. Bontrager. 2011-04-23 R. Bernstein * example/cdtext.c, lib/driver/cdtext.c, lib/driver/cdtext_private.h: From Leon Merten Lohse https://savannah.gnu.org/patch/?7532: * discid field extraction * genre field extraction (experimental) * blocksize field extraction * read charcode from blocksize field * some unneeded comments removed * unneeded local variables removed * typos 2011-03-28 R. Bernstein * : commit 66a3e4689efe80897648ca0e4b0faf36845a1fed Author: R. Bernstein Date: Mon Mar 28 12:30:36 2011 -0400 2011-03-28 R. Bernstein * lib/driver/cdtext.c: CD-text patches from Leon Merten Lohse to handle double-byte strings. See https://savannah.gnu.org/patch/?7516 2011-02-24 rocky * src/cd-read.c: Correct erroneous error message. Thanks to Bas Timmer via libcdio-help. 2010-11-30 R. Bernstein * lib/iso9660/rock.c, src/util.c: Guard against not having S_ISLNK and S_ISSOCK. 2010-11-10 R. Bernstein * lib/cdda_interface/scan_devices.c: Memory leak reported in paranoia-dev. Fix from billy.donahue. 2010-10-26 R. Bernstein * Makefile.am, lib/udf/udf_file.c: Makefile.am: Variable was misspelled 2010-10-22 R. Bernstein * : commit 122aecc0a93cd3613379059d8983af5acf390ad8 Author: R. Bernstein Date: Fri Oct 22 23:39:19 2010 -0400 2010-08-27 rocky * : commit e3226cdd2bf02d6934f928a70898facbbbc98009 Author: rocky Date: Fri Aug 27 17:09:14 2010 -0400 2010-05-30 R. Bernstein * example/cdchange.c, example/isofile.c, example/isofile2.c, example/isofuzzy.c, example/paranoia.c, example/udffile.c: config.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. Part 2 of patch from Thomas Schmitt 2010-05-30 R. Bernstein * : commit 789a90472a461ec9f4ec19d1f3417aa9c81e5b10 Author: R. Bernstein Date: Sun May 30 01:24:59 2010 -0400 2010-05-11 R. Bernstein * include/cdio/dvd.h: uint8_t -> unsigned int. http://en.wikipedia.org/wiki/C_syntax#Bit_fields via Thomas Schmitt 2010-05-11 R. Bernstein * src/cdda-player.c: Silence another GCC warning. Thanks to Thomas Schmitt for this. 2010-05-11 R. Bernstein * include/cdio/mmc.h: Typo found by Thomas Schmitt. 2010-05-07 rocky * lib/driver/FreeBSD/freebsd_cam.c: From Thomas Schmitt: in order to preserve the current behavior over the CAM changes. 2010-03-23 R. Bernstein * lib/iso9660/iso9660.c: Compile error when Rock Ridge support is disabled. Savannah bug #29308. 2010-03-23 R. Bernstein * configure.ac: Savannah Patch #7129 from Mike Frysinger: specifies user-visible e-mail address in AC_INIT - uses AC_HELP_STRING() for enable/with options - uses AC_MSG_* instead of `echo` for user notices - removes redundant test checks for enable/with options - fixes 3rd arg handling with AC_ARG_ENABLE and --enable-rock and --enable-cddb and --enable-vcd-info - properly quotes enable/with variables in case someone passes a value with spaces as the enable/with value 2010-03-23 R. Bernstein * lib/driver/disc.c: Track discmode_t (include/disc.h) enumeration changes 2010-02-22 R. Bernstein * include/cdio/Makefile.am, include/cdio/device.h, include/cdio/mmc.h, include/cdio/mmc_util.h, lib/driver/Makefile.am, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_util.c, test/driver/.gitignore: mmc_util.{c,h} Break simpler non-dependent mmc helper or utility routines from mmc.{c,h} 2010-02-11 R. Bernstein * configure.ac, example/cdchange.c: Start to remove sleep in favor of usleep. Bug #28543. 2010-02-11 R. Bernstein * lib/driver/mmc/mmc_hl_cmds.c: Small change 2010-02-11 R. Bernstein * include/cdio/mmc.h, include/cdio/mmc_hl_cmds.h, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_hl_cmds.c, test/driver/mmc_read.c: Move another routine from mmc.c into mmc_hl_cmds.c 2010-02-11 R. Bernstein * test/driver/mmc_read.c: Fix Minor test bug 2010-02-11 R. Bernstein * test/driver/mmc_read.c, test/driver/mmc_write.c: Go over for coding and code style. 2010-02-10 R. Bernstein * test/driver/mmc_write.c: Small changes 2010-02-10 R. Bernstein * include/cdio/mmc_ll_cmds.h, lib/driver/mmc/mmc_ll_cmds.c, test/driver/Makefile.am, test/driver/mmc_read.c, test/driver/{mmc.c => mmc_write.c}: Split off MMC tests which don't involve exclusive access from those that do. 2010-02-09 R. Bernstein * example/mmc1.c, include/cdio/Makefile.am, include/cdio/mmc.h, include/cdio/mmc_cmds.h, include/cdio/mmc_hl_cmds.h, include/cdio/mmc_ll_cmds.h, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_hl_cmds.c, lib/driver/mmc/mmc_ll_cmds.c, test/driver/mmc.c: Add mmc_read_disc_information. Change get_disctype to use it and thus it moves from mmc.c into mmc_hl_cmds.c. Status is now the return type, not erasable. Split mmc_cmds.h into mmc_ll_cmds.h and mmc_hl_cmds.h. test/driver/mmc.c for invalid page check we get the right sense key, asc, and ascq. 2010-02-09 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: Clear sense request valid flag. 2010-02-09 R. Bernstein * test/driver/mmc.c: Test sense key, sense code and additional sense code on invalid page. 2010-02-09 R. Bernstein * include/cdio/mmc.h: Add CDIO_MMC_GPCMD_READ_TRACK_INFORMATION 2010-02-09 R. Bernstein * lib/driver/libcdio.sym, test/driver/mmc.c: sort libcdio.sym. Remove duplicated tests. 2010-02-09 R. Bernstein * lib/driver/libcdio.sym, test/driver/Makefile.am: Missing some more externals and a file which needs to go into the distribution tarball. 2010-02-09 R. Bernstein * configure.ac, lib/driver/libcdio.sym: Drop version number on automake. Add missing externals to libcdio.sym 2010-02-08 R. Bernstein * include/cdio/mmc.h: Comment spelling typos 2010-02-08 R. Bernstein * example/mmc1.c, test/driver/mmc.c: Use mmc_get_disctype in mmc example. 2010-02-08 R. Bernstein * include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_hl_cmds.c, test/driver/mmc.c: Remove duplicate cdio_mmc_disctype_t. 2010-02-08 R. Bernstein * lib/driver/mmc/mmc_cmd_helper.h, lib/driver/mmc/mmc_hl_cmds.c, lib/driver/mmc/mmc_ll_cmds.c, test/driver/mmc.c: Fix all of the bugs I introduced "improving" the code of others. mmc_ll_cmds.c: mmc_mode_select and mmc_get_configuration now work. mmc_hl_cmds.c: bug introduced by turning a var into a pointer to that variable. 2010-02-08 R. Bernstein * doc/glossary.texi, test/driver/mmc.c: glossary.texi: disctype additions/corrections mmc.c: start test of get_disctype, stylisting convention changes. Warning: mmc_get_configuration and mmc_get_mode_select are broken. 2010-02-07 R. Bernstein * doc/glossary.texi: See above. 2010-02-07 R. Bernstein * doc/glossary.texi: Add DVD-R DL, HD DVD-R and HD DVD-RAM. 2010-02-07 R. Bernstein * include/cdio++/mmc.hpp, include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_hl_cmds.c, lib/driver/mmc/mmc_ll_cmds.c, src/mmc-tool.c, test/driver/mmc.c: Add SCSI-MMC GET CONFIGURATION. Add Frank Endres' disc type determination via MMC. Be more careful to suffix with CDIO_MMC which I hope will reduce possible name conflicts. 2010-02-07 R. Bernstein * include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/gnu_linux.c, lib/driver/mmc/mmc.c, lib/driver/mmc/mmc_hl_cmds.c, lib/driver/mmc/mmc_ll_cmds.c: Start populating mmc/mmc_hl_cmds.c. Create mmc directory in preparation for making it a library. mmc.h: CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL -> CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL mmc.c: Move mm_eject_media and mmc_set_drive_speed to mmc/mmc_hl_cmds.c mmc_ll_cmds.c: add mmc_prevent_allow_medium_removal, move mmc_mode_sense to mmc/mmc_hl_cmds.c 2010-02-07 R. Bernstein * include/cdio++/mmc.hpp, include/cdio/mmc_cmds.h, lib/driver/Makefile.am, lib/driver/cdio_private.h, lib/driver/mmc/.gitignore, lib/driver/mmc/Makefile, lib/driver/{ => mmc}/mmc.c, lib/driver/mmc/mmc_cmd_helper.h, lib/driver/mmc/mmc_hl_cmds.c, lib/driver/{mmc_cmds.c => mmc/mmc_ll_cmds.c}, lib/driver/{ => mmc}/mmc_private.h, src/mmc-tool.c, test/driver/mmc.c: Move more towards making MMC a library. Start to reorganize more to break out 1-1 SCSI-MMC commands (in mmc_ll_cmds.c) from higher-level commands which use the lower-level ones. 2010-02-07 R. Bernstein * include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/mmc_cmds.c, test/driver/mmc.c: Add mcc_test_unit_ready and mmc_mode_select (buggy). Allow for timeouts on mmc commands - more work needed here too. 2010-02-06 R. Bernstein * include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/mmc.c, lib/driver/mmc_cmds.c: Small cleanups 2010-02-06 R. Bernstein * include/cdio++/mmc.hpp, include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/mmc.c, lib/driver/mmc_cmds.c, src/mmc-tool.c, test/driver/mmc.c: lib/driver/mmc.c - DRY code. Warning - might have introduced breakage here *mmc*: mmc_start_stop_media -> mmc_start_stop_unit, CDIO_MMC_GPCMD_START_STOP -> CDIO_MMC_GPCMD_START_STOP_UNIT cdio++/mmc.hpp: Regularize Doxygen comment format. 2010-02-06 R. Bernstein * example/mmc2a.c, include/cdio++/cdio.hpp, include/cdio/Makefile.am, include/cdio/mmc.h, include/cdio/mmc_cmds.h, lib/driver/Makefile.am, lib/driver/device.c, lib/driver/mmc.c, lib/driver/mmc_cmds.c, src/mmc-tool.c, test/driver/mmc.c: Start to split off specific mmc commands from the lower-level internals. 2010-02-06 R. Bernstein * include/cdio/disc.h, include/cdio/dvd.h, lib/driver/_cdio_generic.c: Add CDIO_DISC_MODEs to correspond to updated DVD Book types. 2010-02-06 R. Bernstein * include/cdio/dvd.h: See above 2010-02-06 R. Bernstein * NEWS, include/cdio/dvd.h, lib/driver/disc.c: dvd.h: Update DVD book types disc.c: Add CDIO_DISC_MODE_DVD_OTHER Thanks to Frank Endes and Thomas Schmitt for observing the problem and suggesting the fixes. 2010-02-06 R. Bernstein * lib/driver/disc.c: Had erroneously omitted CDIO_DISC_MODE_DVD_OTHER. Omission pointed out by Frank Endres. 2010-02-05 R. Bernstein * doc/glossary.texi, include/cdio/mmc.h, lib/driver/mmc.c, test/driver/mmc.c: glossary.texi, mmc.h: note acronyms SPC-3, MMC-5, SBC-2. glossary.texi: start using texinfo cross references test/driver/mmc.c: use provided routine for start/stop unit. Warning: might have broken things here. 2010-02-05 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/mmc.c: Revise with info from dpANS SCSI Primary Commands-3 (SPC-3). Use sense data structure in mmc_last_cmd_sense. 2010-02-05 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c: Add SCSI sense key values. 2010-02-04 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/mmc.c: mmc.h: Big endian bytes is not the same as big_endian bitfield mmc.c: more pervasive use of cdio's mmc definitions. 2010-02-03 R. Bernstein * include/cdio/device.h, include/cdio/mmc.h, lib/driver/MSWindows/win32_ioctl.c, test/driver/mmc.c: mmc.h: TEST_UNIT_READY MMC command opcode device.h: Add DRIVER_OP_MMC_SENSE to driver_return_code_t. win32_ioctl.c: work around MS bug where buffer sizes are 0 or 1. Set return code status if sense data passed back. Translate bad parameter MS Windows error into a driver_return_code_t error. test/driver/mmc.c: Reinstate old logic now that the MS Windows driver has been made to work more like other drivers and copes with some of the MS Windows causing failure here. 2010-02-03 R. Bernstein * lib/driver/gnu_linux.c: Fix in changing data types. 2010-02-03 R. Bernstein * include/cdio/mmc.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/gnu_linux.c: Add more doxygen comments as to sense request information means and add a typedef for mmc_sense_request. Use this in win32_ioctl.c. 2010-02-03 R. Bernstein * include/cdio/mmc.h, include/cdio/types.h, lib/driver/gnu_linux.c: Add type definition for SCSI sense data. 2010-02-02 R. Bernstein * test/driver/mmc.c: Comment out some MMC tests which are failing on GNU/Linux where we are *not* getting sense data back but we are getting failures from ioctl(.. CDROM_SEND_PACKET) 2010-02-02 R. Bernstein * : commit 60b237a16126b6e538a5fbea863f64ef5dfe92d6 Author: R. Bernstein Date: Tue Feb 2 22:15:55 2010 -0500 2010-02-01 R. Bernstein * lib/driver/osx.c: Handle SCSI_MMC_DATA_NONE and copy sense data. Not working since SCSI Pass is still broken. Presumably after that's solved there will be less catch-up work. 2010-01-31 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c: Format windows error messages better. 2010-01-31 R. Bernstein * : commit 5f10331adb59fbc25e4817e74624781642a5c0bd Author: R. Bernstein Date: Sun Jan 31 21:31:08 2010 -0500 2010-01-31 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/mmc.c: Allow a status parameter in mmc_get_disc_eraseable to be NULL. Suggested by Frank Endres on libcdio-devel mailing list. 2010-01-30 R. Bernstein * example/mmc1.c: Update date 2010-01-30 R. Bernstein * example/mmc1.c, test/driver/mmc.c: Linguistic purity. 2010-01-30 R. Bernstein * example/mmc1.c: Show off drive_erasable() in MMC example. 2010-01-29 R. Bernstein * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c, test/driver/gnu_linux.c, test/driver/win32.c: Add cdio_get_arg("scsi-tuple") for Win32 ioctl. 2010-01-29 R. Bernstein * NEWS, include/cdio/mmc.h, lib/driver/mmc.c: Update MMC Feature Profile list 2010-01-29 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/mmc.c: Add a driver return code parameter to mmc_get_get_disc_erasable. 2010-01-28 R. Bernstein * NEWS, THANKS, include/cdio/mmc.h, lib/driver/mmc.c, lib/driver/mmc_private.h, test/driver/mmc.c: Add mmc_get_disc_erasable courtesy of Frank Endres. 2010-01-28 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c: Fill out parameter descriptions to remove doxygen warnings. 2010-01-28 R. Bernstein * include/cdio/mmc.h, lib/driver/mmc.c, test/driver/bincue.c.in: Regularis some of the mmc Doxygen comments. 2010-01-27 R. Bernstein * src/cd-paranoia/getopt.h: Assume nowadays Standard C is Standard C 2010-01-24 R. Bernstein * test/driver/.gitignore, test/driver/Makefile.am, test/driver/bincue.c.in, test/driver/cdrdao.c.in, test/driver/gnu_linux.c, test/driver/helper.c, test/driver/helper.h, test/driver/nrg.c.in: Start to DRY driver unit tests. 2010-01-23 R. Bernstein * test/driver/bincue.c.in, test/driver/cdrdao.c.in: Reduce verbosity of test programs. For additional verbosity pass a param to the test program. 2010-01-23 R. Bernstein * configure.ac, doc/.gitignore, test/Makefile.am, test/driver/.gitignore, test/driver/Makefile.am, test/{testtoc.c => driver/cdrdao.c.in}: testtoc -> driver/cdrdao.c.in 2010-01-23 R. Bernstein * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, src/cd-paranoia/.gitignore, test/driver/.gitignore: Better diagnostic messages for MS Window driver. 2010-01-22 R. Bernstein * doc/glossary.texi, doc/libcdio.texi: libcdio.texi: More sectioning with respect to the libraries glossary.texi: Add Thomas Schmitt's DVD Blu-Ray and media information. 2010-01-22 R. Bernstein * doc/libcdio.texi: Input and Control -> Input, Output, and Control thanks to Thomas Schmitt 2010-01-22 R. Bernstein * doc/libcdio.texi, test/driver/.gitignore: Revise section regarding "SCSI, SCSI commands, and MMC commands" 2010-01-21 R. Bernstein * doc/glossary.texi: Thomas Schmitt's corrections and additions. 2010-01-21 R. Bernstein * doc/libcdio.texi: Document corrections courtesy of Thomas Schmitt. 2010-01-21 R. Bernstein * test/driver/.gitignore, test/driver/bincue.c: Document corrections courtesy of Thomas Schmitt. 2010-01-21 R. Bernstein * configure.ac: Allow automake 1.10 2010-01-21 R. Bernstein * test/.gitignore, test/cdda.bin, test/isofs-m1.bin: Remove derived files. 2010-01-21 R. Bernstein * test/Makefile.am, test/cdda.bin, test/driver/bincue.c, test/driver/mmc.c, test/isofs-m1.bin: cygwin fixes. 2010-01-21 R. Bernstein * configure.ac, example/paranoia.c, lib/cdda_interface/utils.c, src/cd-read.c, test/Makefile.am, test/driver/Makefile.am, test/driver/bincue.c, test/driver/bincue.c.in, test/{testnrg.c.in => driver/nrg.c.in}: Remove more warnings. test/testnrg.c.in -> test/driver/nrg.c.in 2010-01-20 R. Bernstein * test/driver/bincue.c, test/driver/bincue.c.in, test/driver/gnu_linux.c: Fold more tests into bi/ncue driver. 2010-01-20 R. Bernstein * test/Makefile.am, test/data/isofs-m1.cue, test/driver/.gitignore, test/driver/Makefile.am, test/driver/bincue.c: Make "make dist" package everything again. 2010-01-20 R. Bernstein * configure.ac, doc/.gitignore, doc/doxygen/.gitignore, test/Makefile.am, test/check_cd_read.sh, test/check_cue.sh.in, test/check_fuzzyiso.sh, test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh, test/check_paranoia.sh.in, test/data/.gitignore, test/data/Makefile.am, test/{ => data}/bad-cat1.cue, test/{ => data}/bad-cat1.toc, test/{ => data}/bad-cat2.cue, test/{ => data}/bad-cat2.toc, test/{ => data}/bad-cat3.cue, test/{ => data}/bad-cat3.toc, test/{ => data}/bad-file.toc, test/{ => data}/bad-mode1.cue, test/{ => data}/bad-mode1.toc, test/{ => data}/bad-msf-1.cue, test/{ => data}/bad-msf-1.toc, test/{ => data}/bad-msf-2.cue, test/{ => data}/bad-msf-2.toc, test/{ => data}/bad-msf-3.cue, test/{ => data}/bad-msf-3.toc, test/{ => data}/cdda.cue, test/{ => data}/cdda.toc, test/{ => data}/cdtext.toc, test/{ => data}/data1.toc, test/{ => data}/data2.toc, test/{ => data}/data5.toc, test/{ => data}/data6.toc, test/{ => data}/data7.toc, test/{ => data}/isofs-m1.toc, test/{ => data}/p1.cue, test/{ => data}/t1.toc, test/{ => data}/t2.toc, test/{ => data}/t3.toc, test/{ => data}/t4.toc, test/{ => data}/t5.toc, test/{ => data}/t6.toc, test/{ => data}/t7.toc, test/{ => data}/t8.toc, test/{ => data}/t9.toc, test/{ => data}/vcd2.toc, test/{ => data}/vcd_demo.toc, test/driver/.gitignore, test/driver/Makefile.am, test/{testbincue.c.in => driver/bincue.c.in}, test/isofs-m1.cue, test/testgetdevices.c.in, test/testisocd2.c.in, test/testnrg.c.in, test/testpregap.c.in, test/testtoc.c: Reorganize test data for future growth. 2010-01-18 R. Bernstein * doc/libcdio.texi, example/cdchange.c, lib/driver/aix.c, lib/driver/gnu_linux.c: More information around access modes for specific drivers. 2010-01-18 R. Bernstein * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, test/driver/win32.c: Extend win32 test to check get_arg("mmc-supported?"). Turn ASPI load failure into an info message 2010-01-18 R. Bernstein * lib/driver/MSWindows/win32.c, test/driver/realpath.c: Bug fixes in test/driver programs 2010-01-17 R. Bernstein * doc/libcdio.texi: Start a section on access modes and cdio_get_args. 2010-01-17 R. Bernstein * example/cdchange.c, example/paranoia.c, lib/driver/aix.c, lib/driver/image_common.c, lib/driver/netbsd.c, test/driver/gnu_linux.c: driver/*.c: Add response for get_arg("mmc-supported?") example/*.c: remove compiler warnings. 2010-01-17 R. Bernstein * : commit 67c86230519db22b3731e789e0e86381e8d29ff6 Author: R. Bernstein Date: Sun Jan 17 04:49:47 2010 -0500 2010-01-17 R. Bernstein * test/driver/realpath.c: Test was erroneously failing when temp directory had a symbolic link in it (as it does on OSX). 2010-01-16 R. Bernstein * lib/cdda_interface/scan_devices.c: realpath -> cdio_realpath which pretends to be more portable. 2010-01-16 R. Bernstein * lib/driver/gnu_linux.c: Add way to determine if MMC commands are available: get_arg("mmc-supported?") 2010-01-16 R. Bernstein * NEWS, lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/gnu_linux.c, test/driver/mmc.c: FreeBSD read/write and most-recent scsi sense access courtesy of Thomas Schmitt. 2010-01-16 R. Bernstein * configure.ac, include/cdio/util.h, lib/driver/Makefile.am, lib/driver/_cdio_generic.c, lib/driver/gnu_linux.c, lib/driver/{follow_symlink.c => realpath.c}, lib/iso9660/iso9660_fs.c, test/driver/Makefile.am, test/driver/{follow_symlink.c => realpath.c}: cdio_follow_symlink -> cdio_realpath which is really POSIX realpath. (Suggestion via Thomas Schmitt.) gnu_linux.c: report errors when they occur. 2010-01-15 R. Bernstein * test/driver/follow_symlink.c: Add doxyen comment for follow_symlink. Add another follow_symlink test. 2010-01-14 R. Bernstein * test/driver/follow_symlink.c: CLean up better by remove temporary symbolic link file. 2010-01-14 R. Bernstein * test/driver/.gitignore, test/driver/Makefile.am, test/driver/follow_symlink.c: include/cdio/util.h: document cdio_follow_symlink. lib/is9660/iso966O_fs.c: Remove a gcc warning test/driver/follow_symlink.c First test of cdio_follow_symlink. Doc 2010-01-13 R. Bernstein * lib/driver/.gitignore, lib/driver/Makefile.am, lib/driver/follow_symlink.c, lib/driver/util.c: Add Thomas Schmitt's bug fixes and standalone code. 2010-01-07 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h: Start to add read-write access mode for FreeBSD. Not working yet. 2010-01-06 R. Bernstein * lib/driver/FreeBSD/freebsd.c, test/driver/freebsd.c: Correct cdio_get_devices for FreeBSD. 2010-01-06 R. Bernstein * test/driver/freebsd.c: First functional (if minimal) FreeBSD test program. 2010-01-06 R. Bernstein * lib/driver/FreeBSD/freebsd_cam.c, test/.gitignore, test/driver/.gitignore, test/driver/Makefile.am, test/driver/freebsd.c: Start FreeBSD driver test. Not currently working though. freebsd.cam: check for error in ioctl. 2010-01-03 R. Bernstein * configure.ac: Let's try FreeBSD driver on FreeBSD 8.x 2010-01-01 R. Bernstein * lib/driver/MSWindows/win32_ioctl.c, lib/driver/gnu_linux.c: Start to request sense data in DeviceIOControl of MS Windows. gnu_linux.c: small changes. 2009-12-31 R. Bernstein * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h: Closer to having RW access working 2009-12-31 R. Bernstein * test/driver/mmc.c: mmc.c: use OS driver open, not the specific GNU/Linux one 2009-12-31 WIndows XP * lib/driver/MSWindows/win32.c, lib/driver/gnu_linux.c: Last change to gnu_linux.c broke things on non GNU/Linux 2009-12-31 R. Bernstein * NEWS: Update NEWS with scsi-tuple* 2009-12-31 R. Bernstein * lib/driver/_cdio_generic.c, lib/driver/generic.h, lib/driver/gnu_linux.c, test/driver/gnu_linux.c: Add ability to retrieve SCSI tuple for a name and/or fake one up. This helps programs that want to be cd-record compatible. In particular to parameters were added to cdio_get_arg, "scsi-tuple", and "scsi-tuple-linux". Code from Thomas Schmitt. 2009-12-31 R. Bernstein * lib/driver/mmc.c, test/driver/Makefile.am, test/driver/mmc.c: lib/driver/mmc.c: remove bug in dereferencing NULL pointer. (Found in testing ;-) test/driver/mmc.c: MMC command testing code from Thomas Schmitt. 2009-12-26 R. Bernstein * test/driver/Makefile.am, test/driver/osx.c: Start OSX driver test 2009-12-26 R. Bernstein * example/mmc3.c: Don't eject a CDROM drive door in testing. 2009-12-26 WIndows XP * test/driver/Makefile.am, test/driver/win32.c: Start unit test for lib/driver/MSWindows/win32.c 2009-12-26 rocky * example/cdtext.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/paranoia.c, example/paranoia2.c, example/sample4.c, test/testiso9660.c: example/* change failures so the record as skipped tests when running 'make check'. 2009-12-26 R. Bernstein * configure.ac, include/cdio/version.h.in, test/Makefile.am, test/driver/.gitignore, test/driver/Makefile.am, test/{testlinux.c => driver/gnu_linux.c}, test/{testsolaris.c => driver/solaris.c}: Move driver tests into a separate directory. 2009-12-26 WIndows XP * test/testlinux.c, test/testsolaris.c: Small changes 2009-12-26 rocky * : commit e7911dcb697d34373ca9ef670f27555551db7cbc Author: rocky Date: Sat Dec 26 13:25:35 2009 +0100 2009-12-25 R. Bernstein * : commit 5aec1e053615018b84f7779953232853073bb44b Author: R. Bernstein Date: Fri Dec 25 19:45:09 2009 -0500 2009-12-25 WIndows XP * lib/driver/MSWindows/aspi32.c, lib/driver/gnu_linux.c: First attempt to add sense retrieval in Windows driver. Clean up return code in run_mmc_cmd_aspi. 2009-12-25 R. Bernstein * configure.ac: Show whether we are building C++ programs in configure output. 2009-12-25 R. Bernstein * include/cdio/version.h.in, lib/driver/libcdio.sym, lib/driver/util.c, test/.gitignore, test/Makefile.am, test/test_lib_driver_util.c: Add run-time variables for libcdio version number/string. 2009-12-25 R. Bernstein * NEWS, THANKS, lib/driver/gnu_linux.c, lib/driver/solaris.c: Recording and retrieval of SCSI sense reply for GNU/Linux. 2009-12-25 R. Bernstein * NEWS, THANKS, include/cdio/mmc.h, lib/driver/generic.h, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/iso9660/iso9660.c: Add interface for retrieval of last SCSI sense command. 2009-12-24 R. Bernstein * lib/driver/gnu_linux.c: Keep indentions the same as the others. 2009-12-24 R. Bernstein * configure.ac: cddb configure patch #6904 for gentoo bug #272788. 2009-12-24 R. Bernstein * lib/driver/gnu_linux.c, lib/driver/solaris.c: On ioctl's, a negative number is considered an unspecified error while a positive number is not. Replace tabs in lines with blanks. 2009-12-23 R. Bernstein * lib/driver/gnu_linux.c, test/testiso9660.c: gnu_linux.c: run_mmc_cmd_linux: be sure to set return return code. testiso9660.c: broke things working when on hacking on Solaris 2009-12-24 rocky * lib/driver/solaris.c, lib/iso9660/iso9660.c, test/.gitignore, test/Makefile.am, test/testsolaris.c: Start Solaris driver test. Driver MMC sets cdio return codes better. 2009-12-24 rocky * lib/iso9660/iso9660.c, test/testiso9660.c: Real test of testiso9660 on Solaris which does not have HAVE_GMTOFF 2009-12-23 R. Bernstein * test/testiso9660.c: Add small test for iso9660_set_dtime_with_timezone and iso9660_get_dtime which is especially useful on systems that don't have the gmtoff. 2009-12-23 R. Bernstein * include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/libiso9660.sym: Start set/get time routines that tolerate no timezone structure in struct tm. Solaris is like that. (I think cygwin too.) 2009-12-20 R. Bernstein * lib/driver/gnu_linux.c: NONBLOCK inadvertently removed. 2009-12-20 R. Bernstein * lib/driver/gnu_linux.c: Writing opens drive exclusive, not nonblock. 2009-12-20 R. Bernstein * .gitignore, lib/driver/gnu_linux.c, test/.gitignore, test/Makefile.am, test/testlinux.c: Add MMC_RDWR access mode - open drive R/W only with this access. Start GNU/Linux test driver. 2009-12-20 Rocky Bernstein (VCDImager Developer) * : commit 5908486078359d4ca93c178b5efc5a2654f12c1c Author: Rocky Bernstein (VCDImager Developer) Date: Sun Dec 20 05:55:53 2009 +0100 2009-12-19 R. Bernstein * : commit 4e8eff137e4912f13f6740c3abf52e44430bcff8 Author: R. Bernstein Date: Sat Dec 19 18:17:18 2009 -0500 2009-11-26 R. Bernstein * example/Makefile.am: Remove one more example program from distcheck 2009-11-26 R. Bernstein * example/Makefile.am: Remove some example program from make check to make "make distcheck" work easier. I would Rather remove programs than coddle automake. 2009-11-26 R. Bernstein * example/C++/Makefile.am, example/C++/OO/Makefile.am, example/C++/OO/cdtext.cpp, example/C++/OO/device.cpp, example/C++/OO/drives.cpp, example/C++/OO/eject.cpp, example/C++/OO/iso4.cpp, example/C++/OO/isofile.cpp, example/C++/OO/isofile2.cpp, example/C++/OO/isolist.cpp, example/C++/OO/mmc1.cpp, example/C++/OO/mmc2.cpp, example/C++/OO/tracks.cpp, example/C++/device.cpp, example/C++/eject.cpp, example/C++/isofile.cpp, example/C++/isofile2.cpp, example/C++/isolist.cpp, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/C++/paranoia.cpp, example/C++/paranoia2.cpp, example/Makefile.am, example/audio.c, example/cdchange.c, example/cdio-eject.c, example/cdtext.c, example/device.c, example/drives.c, example/eject.c, example/isofile.c, example/isofile2.c, example/isofuzzy.c, example/paranoia.c, example/paranoia2.c, example/sample3.c, example/sample4.c, example/tracks.c, example/udf1.c, example/udf2.c, example/udffile.c, include/cdio/cdio.h: Possibly make compiling example programs easier from the outside - don't assume HAVE_CONFIG_H is defined but pick up values from the runtime version of that file. We also now run example programs as tests if they are built. 2009-10-29 R. Bernstein * configure.ac: Change tests for S_ISLNK and S_ISSOCK macros from AC_COMPILE_IFELSE to AC_LINK_IFELSE. On Mingw 4.4.0 these macros succeed when they should fail. Patch by carlo.bramix to libcdio-devel 2009-10-27 R. Bernstein * lib/driver/image/bincue.c: Revert one cppcheck style change since gcc complains about it. 2009-10-27 R. Bernstein * example/paranoia.c, lib/cdda_interface/common_interface.c, lib/cdda_interface/smallft.c, lib/cdda_interface/test_interface.c, lib/driver/gnu_linux.c, lib/driver/image/bincue.c, lib/driver/image/nrg.c, test/testparanoia.c: Remove some cppcheck style warnings 2009-10-27 R. Bernstein * lib/cdda_interface/scsi_interface.c, lib/driver/device.c: A couple more memory leaks from cppcheck 2009-10-27 R. Bernstein * configure.ac, doc/doxygen/.gitignore, doc/how-to-make-a-release.txt, example/C++/OO/cdtext.cpp, lib/driver/FreeBSD/freebsd.c, lib/driver/device.c, lib/driver/netbsd.c, lib/iso9660/iso9660_fs.c, src/cd-info.c, src/iso-info.c, test/.gitignore: In 0.83git now. Fix minor leaks in libcdio 0.82 detected by cppcheck via Eric Sesterhenn. 2009-10-27 R. Bernstein * configure.ac, doc/how-to-make-a-release.txt, include/cdio/iso9660.h: Make doxygen clean. Get ready for 0.82 release. 2009-10-22 R. Bernstein * THANKS: Thanks Geoff Bailey. 2009-10-22 R. Bernstein * config.rpath, lib/driver/FreeBSD/freebsd.c: Perhaps adding a real config.rpath will help some of the iconv problems. Remove a compiler warning when not compiling in FreeBSD. 2009-10-22 R. Bernstein * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h: Remove duplicated code caused by mixup with existing get-media-changed code. 2009-10-21 R. Bernstein * example/.gitignore, src/.gitignore, test/.gitignore: Ignore windows executables and stack dumps. 2009-10-21 R. Bernstein * NEWS, lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/Makefile.am: NEWS: update what's up lib/driver/Makefile.am: increment library number lib/driver/FreeBSD/*: FreeBSD get_media_changed fixes for ioctl. 2009-07-12 Nicolas Boullis * include/cdio/device.h: Update the documentation in include/cdio/device.h as well. 2009-07-12 Nicolas Boullis * doc/libcdio.texi, example/C++/OO/device.cpp, example/C++/device.cpp, example/device.c, src/cd-drive.c, src/util.c: Remove all remaining uses of CDIO_MIN_DRIVER, CDIO_MAX_DRIVER, CDIO_MIN_DEVICE_DRIVER or CDIO_MAX_DEVICE_DRIVER. 2009-07-12 Nicolas Boullis * lib/driver/libcdio.sym: Export the cdio_drivers and cdio_device_drivers arrays. 2009-07-12 Nicolas Boullis * lib/driver/cdio_private.h, lib/driver/device.c: Remove all other uses of CDIO_MIN_DRIVER, CDIO_MAX_DRIVER, CDIO_MIN_DEVICE_DRIVER or CDIO_MAX_DEVICE_DRIVER within the libcdio library. 2009-07-12 Nicolas Boullis * lib/driver/device.c: Change scan_for_driver to use cdio_drivers and cdio_device_drivers. 2009-07-12 Nicolas Boullis * include/cdio/device.h, lib/driver/device.c: Add new cdio_drivers and cdio_device_drivers arrays. 2009-07-11 R. Bernstein * src/cd-paranoia/cd-paranoia.c: Removed cd-paranoia.c by accident. 2009-07-03 R. Bernstein * src/Makefile.am: MOSTLYCLEANFILES subsumes MAINTAINERCLEANFILES. As Nicolas Boulis points out, want only the latter. 2009-07-02 R. Bernstein * : commit 2522c26ec8082be46ee4012cfac76467bb0fb350 Author: R. Bernstein Date: Thu Jul 2 20:26:39 2009 -0400 2009-06-15 R. Bernstein * : commit 7f8f0f806af7800652d352e6428be7d3fdd1a176 Author: R. Bernstein Date: Mon Jun 15 09:31:54 2009 -0400 2009-05-16 R. Bernstein * : commit cc08ce617f81eecb1112ec9b50b01f272da613d9 Author: rocky Date: Sat May 16 23:01:39 2009 -0400 2009-05-14 R. Bernstein * lib/driver/cdtext.c: Guard against dereferencing a null cdtext pointer. 2009-04-23 rocky * lib/driver/FreeBSD/freebsd_cam.c: Patch from John Wehle: A side effect of opening the cdrom device on FreeBSD is it locks the drive. This makes cdio_get_media_changed less useful and prevents you from being able to switch disks when using things such as the audacious media player. This patch simply unlocks the drive right after it's opened prior to opening the cam passthrough device. 2009-04-20 rocky * example/C++/README, example/README: Revise for new paranoia descriptions. 2009-04-20 rocky * example/C++/Makefile.am, example/C++/README, example/C++/paranoia.cpp, example/Makefile.am, example/README, example/paranoia.c: paranoia.cpp: write WAV file of up to the first 300 sectors of the first track */Makefile.am remove any created WAV files. README: update paranoia descriptions parananoia.c: track-01.wav -> track01s.wav 2009-04-20 rocky * example/C++/.gitignore, example/C++/OO/.gitignore, example/C++/OO/eject.cpp, example/C++/OO/isofile.cpp, example/C++/isofile.cpp, example/C++/isofile2.cpp, example/paranoia.c: paranoia.c: slight code touch-up. *.cpp remove lint warnings, e.g. int -> unsigned int 2009-04-19 rocky * example/.gitignore: Administrivia 2009-04-19 rocky * doc/libcdio.texi, example/README, example/paranoia.c: Extend paranoia program to write a file with a WAV header 2009-04-19 rocky * .gitignore, example/C++/.gitignore, example/C++/OO/.gitignore: Administrivia 2009-04-05 rocky * README.develop, README.libcdio: Revise installation instructions and add what you need to do if you want to develop libcdio 2009-02-20 R. Bernstein * doc/libcdio.texi: Display copying in texinfo. Patch thanks to Jesse Weinstein. 2009-02-08 R. Bernstein * THANKS, configure.ac, include/cdio/device.h, lib/cdda_interface/common_interface.h, lib/driver/Makefile.am, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/generic.h, lib/driver/os2.c, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/report.c, src/cdda-player.c, src/util.c: Add OS/2 driver courtesy of KO Myung-Hun. Security: Add "%s" to cdparanoia's fprintfs 2008-12-30 R. Bernstein * lib/driver/gnu_linux.c: Endless loop when no CD-rom drives. Patch thanks to Adrian Reber 2008-12-28 R. Bernstein * src/Makefile.am: Fix manpage generation on platforms with non-empty EXEEXT, and fix the VPATH build as well. 2008-12-28 R. Bernstein * configure.ac, include/cdio/paranoia.h, include/cdio/sector.h, lib/cdio++/Makefile.am, lib/iso9660/Makefile.am, libcdio.pc.in, libiso9660++.pc.in, libiso9660.pc.in: Use LTLIBICONV instead of LIBICONV. Bug #25201 from Yaakov Selkowitz 2008-12-28 R. Bernstein * Makefile.am: The installation of libcdio++.pc and libiso9660++.pc should be dependent on ENABLE_CXX_BINDINGS, not ENABLE_CPP. Bug #25202 from Yaakov Selkowitz 2008-12-28 R. Bernstein * lib/driver/device.c: Fix Solaris and Win32 conditionals bug #25201 from Yaakov Selkowitz 2008-12-13 R. Bernstein * doc/libcdio.texi: Some small typos. 2008-12-07 R. Bernstein * .gitignore, INSTALL: INSTALL isn't really ours - yet 2008-12-07 R. Bernstein * test/testgetdevices.c: Remove trailing spaces on some lines 2008-12-07 R. Bernstein * test/testgetdevices.c: More verbose about driver installed 2008-12-07 R. Bernstein * INSTALL, test/testgetdevices.c: Correct name for OSX in uname 2008-12-07 R. Bernstein * test/testgetdevices.c: Add more tests for drivers in more OS's. 2008-12-07 R. Bernstein * configure.ac, include/cdio/.gitignore, test/testgetdevices.c: Add check against GNU/Linux driver. More info in include/cdio/config. 2008-12-06 R. Bernstein * example/.gitignore, lib/driver/.gitignore, test/.gitignore: Resolve conflicted files. 2008-12-06 R. Bernstein * : I hate conflicted merges 2008-12-06 R. Bernstein * example/.gitignore, lib/driver/.gitignore, lib/driver/device.c, test/.gitignore, test/Makefile.am, test/testdefault.c, test/testgetdevices.c: Wasn't checking the range of the device id in cdio_have_driver. Add regression test for checking this too. More git administrivia. 2008-12-06 R. Bernstein * .cvsignore, .gitignore, Makefile.am, NEWS, configure.ac, cvs2cl_header, cvs2cl_usermap, doc/.gitignore, doc/doxygen/.gitignore, example/.cvsignore, example/.gitignore, example/C++/.gitignore, example/C++/OO/.gitignore, include/.gitignore, include/cdio++/.gitignore, include/cdio/.gitignore, lib/.cvsignore, lib/.gitignore, lib/cdda_interface/.gitignore, lib/cdio++/.gitignore, lib/driver/.gitignore, lib/iso9660/.gitignore, lib/paranoia/.gitignore, lib/udf/.gitignore, parse/.cvsignore, parse/.gitignore, src/.gitignore, src/cd-paranoia/.cvsignore, src/cd-paranoia/.gitignore, src/cd-paranoia/doc/.cvsignore, src/cd-paranoia/doc/.gitignore, src/cd-paranoia/doc/en/.cvsignore, src/cd-paranoia/doc/en/.gitignore, src/cd-paranoia/doc/ja/.cvsignore, src/cd-paranoia/doc/ja/.gitignore, test/.cvsignore, test/.gitignore: Makefile.am: Redo target for ChangeLog to use git2cl. NEWS: Note NetBSD driver added. Reset: git administrivia. 2008-11-29 R. Bernstein * : More conversion weirdnesses 2008-11-29 R. Bernstein * .gitignore: Administrivia 2008-11-29 R. Bernstein * : . 2008-11-29 R. Bernstein * .gitignore, INSTALL, MSVC/README, MSVC/cd-info.vcproj, MSVC/config.h, MSVC/libcdio.sln, MSVC/libcdio.vcproj, Makefile.am, README, README.libcdio, THANKS, TODO, autogen.sh, configure.ac, cvs2cl_header, cvs2cl_usermap, doc/.gitignore, doc/Makefile.am, doc/doxygen/.gitignore, doc/doxygen/Doxyfile.in, doc/doxygen/run_doxygen, doc/fdl.texi, doc/glossary.texi, doc/libcdio.texi, example/.gitignore, example/C++/.cvsignore, example/C++/.gitignore, example/C++/Makefile.am, example/C++/OO/.cvsignore, example/C++/OO/.gitignore, example/C++/OO/Makefile.am, example/C++/OO/cdtext.cpp, example/C++/OO/device.cpp, example/C++/OO/drives.cpp, example/C++/OO/eject.cpp, example/C++/OO/iso4.cpp, example/C++/OO/isofile.cpp, example/C++/OO/isofile2.cpp, example/C++/OO/isolist.cpp, example/C++/OO/mmc1.cpp, example/C++/OO/mmc2.cpp, example/C++/OO/tracks.cpp, example/C++/README, example/C++/device.cpp, example/C++/eject.cpp, example/C++/isofile.cpp, example/C++/isofile2.cpp, example/C++/isolist.cpp, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/C++/paranoia.cpp, example/C++/paranoia2.cpp, example/Makefile.am, example/README, example/audio.c, example/cdchange.c, example/cdio-eject.c, example/cdtext.c, example/device.c, example/drives.c, example/eject.c, example/isofile.c, example/isofile2.c, example/isofuzzy.c, example/isolist.c, example/isolsn.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/paranoia.c, example/paranoia2.c, example/sample3.c, example/sample4.c, example/tracks.c, example/udf1.c, example/udf2.c, example/udffile.c, include/.gitignore, include/Makefile.am, include/cdio++/.cvsignore, include/cdio++/.gitignore, include/cdio++/Makefile.am, include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/device.hpp, include/cdio++/devices.hpp, include/cdio++/disc.hpp, include/cdio++/enum.hpp, include/cdio++/iso9660.hpp, include/cdio++/mmc.hpp, include/cdio++/read.hpp, include/cdio++/track.hpp, include/cdio/.cvsignore, include/cdio/.gitignore, include/cdio/Makefile.am, include/cdio/audio.h, include/cdio/bytesex.h, include/cdio/bytesex_asm.h, include/cdio/cd_types.h, include/cdio/cdda.h, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/device.h, include/cdio/disc.h, include/cdio/ds.h, include/cdio/dvd.h, include/cdio/ecma_167.h, include/cdio/iso9660.h, include/cdio/logging.h, include/cdio/mmc.h, include/cdio/paranoia.h, include/cdio/posix.h, include/cdio/read.h, include/cdio/rock.h, include/cdio/scsi_mmc.h, include/cdio/sector.h, include/cdio/track.h, include/cdio/types.h, include/cdio/udf.h, include/cdio/udf_file.h, include/cdio/udf_time.h, include/cdio/utf8.h, include/cdio/util.h, include/cdio/version.h.in, include/cdio/xa.h, lib/.gitignore, lib/Makefile.am, lib/cdda_interface/.cvsignore, lib/cdda_interface/.gitignore, lib/cdda_interface/Makefile.am, lib/cdda_interface/cddap_interface.c, lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/drive_exceptions.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/interface.c, lib/cdda_interface/libcdio_cdda.sym, lib/cdda_interface/low_interface.h, lib/cdda_interface/scan_devices.c, lib/cdda_interface/scsi_interface.c, lib/cdda_interface/smallft.c, lib/cdda_interface/smallft.h, lib/cdda_interface/test_interface.c, lib/cdda_interface/toc.c, lib/cdda_interface/utils.c, lib/cdda_interface/utils.h, lib/cdio++/.gitignore, lib/cdio++/Makefile.am, lib/cdio++/cdio.cpp, lib/cdio++/devices.cpp, lib/cdio++/iso9660.cpp, lib/driver/.gitignore, lib/driver/FreeBSD/Makefile, lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/MSWindows/Makefile, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/Makefile.am, lib/driver/_cdio_generic.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stdio.h, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/aix.c, lib/driver/audio.c, lib/driver/bsdi.c, lib/driver/cd_types.c, lib/driver/cdio.c, lib/driver/cdio_assert.h, lib/driver/cdio_private.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/device.c, lib/driver/disc.c, lib/driver/ds.c, lib/driver/generic.h, lib/driver/gnu_linux.c, lib/driver/image.h, lib/driver/image/Makefile, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image/nrg.h, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/logging.c, lib/driver/mmc.c, lib/driver/mmc_private.h, lib/driver/netbsd.c, lib/driver/osx.c, lib/driver/portable.h, lib/driver/read.c, lib/driver/sector.c, lib/driver/solaris.c, lib/driver/track.c, lib/driver/utf8.c, lib/driver/util.c, lib/iso9660/.cvsignore, lib/iso9660/.gitignore, lib/iso9660/Makefile.am, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, lib/iso9660/libiso9660.sym, lib/iso9660/rock.c, lib/iso9660/xa.c, lib/paranoia/.cvsignore, lib/paranoia/.gitignore, lib/paranoia/Makefile.am, lib/paranoia/gap.c, lib/paranoia/gap.h, lib/paranoia/isort.c, lib/paranoia/isort.h, lib/paranoia/libcdio_paranoia.sym, lib/paranoia/overlap.c, lib/paranoia/overlap.h, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c, lib/udf/.cvsignore, lib/udf/.gitignore, lib/udf/Makefile.am, lib/udf/filemode.c, lib/udf/libudf.sym, lib/udf/udf.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_fs.h, lib/udf/udf_private.h, lib/udf/udf_time.c, libcdio++.pc.in, libcdio.pc.in, libcdio_cdda.pc.in, libcdio_paranoia.pc.in, libiso9660++.pc.in, libiso9660.pc.in, libudf.pc.in, m4/codeset.m4, m4/iconv.m4, m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4, m4/pkg.m4, misc/libcdio.ebuild, package/.gitignore, package/libcdio.spec.in, parse/Makefile, parse/cue.L, parse/cue.y, parse/test/runall, parse/test/t1.cue, parse/test/t2.cue, parse/test/t3.cue, parse/toc.L, parse/toc.y, parse/toclexer.c, parse/toclexer.h, src/.gitignore, src/Makefile.am, src/cd-drive.c, src/cd-drive.help2man, src/cd-info.c, src/cd-info.help2man, src/cd-paranoia/.cvsignore, src/cd-paranoia/.gitignore, src/cd-paranoia/Makefile.am, src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/doc/.cvsignore, src/cd-paranoia/doc/.gitignore, src/cd-paranoia/doc/FAQ.txt, src/cd-paranoia/doc/Makefile.am, src/cd-paranoia/doc/en/.cvsignore, src/cd-paranoia/doc/en/.gitignore, src/cd-paranoia/doc/en/Makefile.am, src/cd-paranoia/doc/en/cd-paranoia.1.in, src/cd-paranoia/doc/ja/.cvsignore, src/cd-paranoia/doc/ja/.gitignore, src/cd-paranoia/doc/ja/Makefile.am, src/cd-paranoia/doc/ja/cd-paranoia.1.in, src/cd-paranoia/doc/overlapdef.txt, src/cd-paranoia/getopt.c, src/cd-paranoia/getopt.h, src/cd-paranoia/getopt1.c, src/cd-paranoia/header.c, src/cd-paranoia/header.h, src/cd-paranoia/pod2c.pl, src/cd-paranoia/report.c, src/cd-paranoia/report.h, src/cd-paranoia/usage-copy.h, src/cd-paranoia/usage.txt.in, src/cd-paranoia/utils.h, src/cd-paranoia/version.h, src/cd-read.c, src/cd-read.help2man, src/cdda-player.c, src/cddb.c, src/cddb.h, src/cdinfo-linux.c, src/getopt.c, src/getopt.h, src/getopt1.c, src/iso-info.c, src/iso-info.help2man, src/iso-read.c, src/iso-read.help2man, src/mmc-tool.c, src/util.c, src/util.h, test/.gitignore, test/Makefile.am, test/bad-cat1.cue, test/bad-cat1.toc, test/bad-cat2.cue, test/bad-cat2.toc, test/bad-cat3.cue, test/bad-cat3.toc, test/bad-file.toc, test/bad-mode1.cue, test/bad-mode1.toc, test/bad-msf-1.cue, test/bad-msf-1.toc, test/bad-msf-2.cue, test/bad-msf-2.toc, test/bad-msf-3.cue, test/bad-msf-3.toc, test/cd-paranoia-log.right, test/cdda-mcn.right, test/cdda-read.right, test/cdda.right, test/cdtext.toc, test/check_cd_read.sh, test/check_common_fn.in, test/check_cue.sh.in, test/check_fuzzyiso.sh, test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/check_paranoia.sh.in, test/check_sizeof.c, test/copying-rr.gpl, test/copying-rr.right, test/copying.gpl, test/copying.right, test/data1.toc, test/data2.toc, test/data5.toc, test/data6.toc, test/data7.toc, test/fsf.right, test/isofs-m1-no-rr.right, test/isofs-m1-read.right, test/isofs-m1.cue, test/isofs-m1.right, test/isofs-m1.toc, test/joliet-nojoliet.right, test/joliet.right, test/monvoisin.right, test/p1.cue, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/t1.toc, test/t2.toc, test/t3.toc, test/t4.toc, test/t5.toc, test/t6.toc, test/t7.toc, test/t8.toc, test/t9.toc, test/testassert.c, test/testbincue.c.in, test/testdefault.c, test/testischar.c, test/testiso9660.c, test/testisocd.c, test/testisocd2.c.in, test/testnrg.c.in, test/testparanoia.c, test/testpregap.c.in, test/testtoc.c, test/vcd2.toc, test/vcd_demo.cue, test/vcd_demo.right, test/vcd_demo.toc, test/vcd_demo_vcdinfo.right, test/vcd_demo_vcdinfo_toc.right, test/videocd.right: First commit after CVS conversion. Should be just administrative changes. 2008-11-28 R. Bernstein * .gitignore, AUTHORS, MANIFEST.in, Makefile, NEWS, README.txt, cdio.py, data/isofs-m1.cue, example/README, example/audio.py, example/cd-read.py, example/cdchange.py, example/device.py, example/drives.py, example/eject.py, example/iso1.py, example/iso2.py, example/iso3.py, example/tracks.py, iso9660.py, pycdio.py, pyiso9660.py, setup.cfg, setup.py, swig/.gitignore, swig/audio.swg, swig/compat.swg, swig/device.swg, swig/device_const.swg, swig/disc.swg, swig/pycdio.i, swig/pyiso9660.i, swig/read.swg, swig/track.swg, swig/types.swg, test/.gitignore, test/cdda.toc, test/test-cdio.py, test/test-iso.py, test/test-isocopy.py: Initial commit after git-cvsimport (import from CVS). 2008-11-28 R. Bernstein * Makefile, example/audio.py, example/cd-read.py, example/cdchange.py, example/device.py, example/drives.py, example/eject.py, example/iso1.py, example/iso2.py, example/iso3.py, example/tracks.py: Remove import path hard-coding. Will have to deal with in a Pythonic way and some package somewhere. 2008-11-28 R. Bernstein * .gitignore, setup.py: Tighter module creation code, and a module name typo from cut and paste. 2008-11-28 R. Bernstein * .gitignore, AUTHORS, Makefile, NEWS, setup.cfg, setup.py, swig/.gitignore, test/.gitignore: Get link arguments from pkg-config. Add more files. 2008-11-28 R. Bernstein * setup.py, swig/.gitignore, test/test-cdio.py, test/test-iso.py, test/test-isocopy.py: Include libcdio libraries as appropriate when making pycdio libraries. 2008-11-27 R. Bernstein * .gitignore, setup.py, swig/{pycdio.swg => pycdio.i}, swig/{pyiso9660.swg => pyiso9660.i}, test/test-cdio.py, test/test-iso.py, test/test-isocopy.py: swig compilation and invoking unixcompiler now works. Closer to having setup.py bdist working. Still need to figure out how add libcdio libraries and how to get the test import working. 2008-11-27 rocky * configure.ac: Patch by Mike Frysinger to facilitate cross-compilation. sr #106338 2008-11-25 rocky * configure.ac: Erroneous initialization. See sr #106271 2008-11-25 rocky * configure.ac: Treat uclinux like GNU/Linux. sr #106336 from Mike Frysinger. 2008-11-25 rocky * INSTALL, configure.ac: Remove bit-ordering test in configure.ac since we don't seem to use this at compile time and it fouls up cross compilation. cd-paranoia has tests at run-time. libcdio inherited this from vcdimager which needs it in writing images. It is possible that when libcdio does writing this may come back. Until then, simplify. 2008-11-23 R. Bernstein * .gitignore, example/README: Add more of the files we need 2008-11-23 R. Bernstein * .gitignore, MANIFEST.in, README.txt, cdio.py, data/isofs-m1.cue, example/audio.py, example/cd-read.py, example/cdchange.py, example/device.py, example/drives.py, example/eject.py, example/iso1.py, example/iso2.py, example/iso3.py, example/tracks.py, iso9660.py, pycdio.py, pyiso9660.py, setup.py, swig/audio.swg, swig/compat.swg, swig/device.swg, swig/device_const.swg, swig/disc.swg, swig/pycdio.swg, swig/pyiso9660.swg, swig/read.swg, swig/track.swg, swig/types.swg, test/cdda.cue, test/cdda.toc, test/test-cdio.py, test/test-iso.py, test/test-isocopy.py: First semblance of distutils setuptools. Not complete yet though. 2008-10-29 rocky * configure.ac: Typo in comment 2008-10-29 rocky * configure.ac, lib/cdio++/Makefile.am: Bug fix to allow linker flags --as-needed and --no-undefined. Thanks to Gtz Waschk 2008-10-25 rocky * .cvsignore: One more. 2008-10-25 rocky * Makefile.am: Create a tar.bz2 dist as well as tar.gz. 2008-10-20 rocky * lib/cdda_interface/Makefile.am, lib/cdio++/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am: Increment library numbers 2008-10-20 rocky * NEWS: What's up 2008-10-17 rocky * lib/driver/osx.c: patch #6548: fix osx handling. See that for more information 2008-10-17 rocky * test/check_common_fn.in, test/check_iso.sh.in, test/check_paranoia.sh.in: Allow for more cygwin tests to pass 2008-09-29 flameeyes * configure.ac: Don't use echo -n, use subshells instead. echo -n is not working on all shells, in particular it does not seem to work on Sun /bin/sh shell; instead use subshells to have the same output everywhere. 2008-09-22 rocky * doc/libcdio.texi: Typo 2008-09-09 rocky * src/cd-info.c: Nuke cddb disc ID if --no-cddb option is given. 2008-09-09 rocky * test/cdda-mcn.right, test/cdda.right: Output changed when --no-cddb option added. 2008-09-08 rocky * INSTALL, src/cd-info.c: Allow compiling cd-info without cddb. Patch thanks to Fabrice Ménard. 2008-08-31 rocky * lib/driver/Makefile.am: Remove stray @ character in Makefile.am. Thanks yet again to Steve Schultz for finding/fixing. 2008-08-31 flameeyes * example/C++/Makefile.am, example/C++/OO/Makefile.am, example/Makefile.am, lib/driver/Makefile.am, src/Makefile.am, src/cd-paranoia/Makefile.am, test/Makefile.am: Use the LTLIBICONV variable rather than LIBICONV. With this change, instead of using the fully qualified path to the shared object (or the one that the configure think is the fully qualified path), the path where the library is found will be added to the search path and just a generic -liconv will be used. The old variable would be fooled up when /usr/lib/libiconv.so is an LD script that redirects to /lib/libiconv.so, causing failures with some linkers. Also, replace @LIBICONV@ for libcdio itself also with $(LTLIBICONV) or it will fail to link against on uClibc. 2008-08-30 rocky * lib/driver/osx.c: Free memory when recovering from errors. 2008-07-27 rocky * INSTALL, autogen.sh: Pass additional autogen.sh options to configure. 2008-07-27 pjcreath * autogen.sh, config.rpath: Replaced old, messy autogen.sh with a call to autoreconf. (empty config.rpath added for automake 1.10 compatibility) 2008-07-16 rocky * include/cdio/iso9660.h: Another small tweak - make sure macro is undefine'd first. 2008-07-15 rocky * config.rpath, include/cdio/iso9660.h: Undefine ISODCL and note where this comes from. 2008-07-15 rocky * include/cdio/iso9660.h: Remove cdrtools GPL "v2 only" pollution. iso9660.h is from Eric Youngdale's 1993 GPL v2 or later header from mkisofs 2008-06-25 rocky * THANKS, configure.ac, example/cdchange.c, lib/cdda_interface/Makefile.am, lib/cdda_interface/scsi_interface.c, lib/cdio++/Makefile.am, lib/iso9660/Makefile.am, lib/iso9660/iso9660.c, lib/paranoia/Makefile.am, lib/udf/Makefile.am, src/cddb.c, src/cddb.h: Fixes for Mingw+MSYS and DLL support from Carlo Bramini * configure.ac: Added AC_LIBTOOL_WIN32_DLL for enabling the creation of shared libraries. * configure.ac: Added -I$(top_srcdir)/include to LIBCDIO_CFLAGS, it allows to build outside the source tree. * configure.ac: Added LT_NO_UNDEFINED for adding '-no-undefined' switch to libtool when building win32 shared libraries. * configure.ac: Check for Windows.h presence if under Mingw (included for using Sleep() function). * configure.ac: Check for more missing functions: setenv(), unsetenv(), sleep(), gmtime_r(), localtime_r(). * example/cdchange.c: If sleep() function does not exist, it tries to emulate it with a similar code (require inclusion of Windows.h) * src/cddb.c: * lib/cdda_interface/scsi_interface.c: Compilation fails because u_int32_t is undefined. It has been changed to uint32_t to be compliant to all other parts of the libraries. * lib/cdda_interface/Makefile.am: * lib/iso9660/Makefile.am: * lib/cdio++/Makefile.am: * lib/paranoia/Makefile.am: * lib/udf/Makefile.am: * lib/driver/Makefile.am: added LT_NO_UNDEFINED to libtool flags. * lib/iso9660/iso9660.c: Added replacements for setenv(), unsetenv(), gmtime_r\ (), localtime_r(). 2008-06-25 rocky * lib/driver/Makefile.am, lib/driver/gnu_linux.c: Was accessing outside of check2list causing wild looping. Turn all sprintf's to snprintf's and check the return. Turn check1list and check2list looping into a fixed constant number of iterations rather than rely on a sentinel. 2008-06-19 flameeyes * example/audio.c, src/cd-drive.c, src/cd-info.c, src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/pod2c.pl, src/cd-read.c, src/cdda-player.c, src/iso-info.c, src/iso-read.c, src/mmc-tool.c, test/testparanoia.c: Mark variables and constant as static in source tools, examples and tests. Also replace some char pointers with char arrays. 2008-06-19 flameeyes * configure.ac: Fix AC_ARG_WITH and AC_ARG_ENABLE call to use the un-translated option name (that is, using dash rather than underscore). 2008-06-16 flameeyes * lib/driver/cdtext.c: Make cdtext_keywords a static array of arrays. 2008-06-16 flameeyes * .cvsignore: Ignore a few more scripts created by autoreconf -i. 2008-06-16 flameeyes * m4/.cvsignore: Ignore the m4 macro files created by libtool 2.2. 2008-06-16 flameeyes * Makefile.am, configure.ac: Put all macros in the m4 directory, this avoids cluttering the main directory with libtool 2.2 (that split the macros in multiple files). 2008-06-16 flameeyes * lib/cdda_interface/scan_devices.c: Replace character pointers with character arrays, mark constants as static as they are not used outside this translation unit (and some not at all). 2008-06-16 flameeyes * lib/driver/cd_types.c: Replace character pointers in signature_t with properly-sized character arrays. The size of sigs has increased a bit but now the sigs array can stay entirely in .rodata section, with no runtime relocations. Having 128 bytes sized elements also allows for direct random access on the array without multiplications. 2008-06-14 rocky * configure.ac, test/.cvsignore: --disable-example-progs help text wording change Ignore test/testpregap.c since that's now derived testpregap.c.in 2008-06-14 flameeyes * lib/cdda_interface/drive_exceptions.c: Check in the missing file. 2008-06-14 flameeyes * test/Makefile.am: Make testdefault an extra program, so that it's only built explicitly and not during make all. 2008-06-13 flameeyes * lib/driver/gnu_linux.c: Make checklists fit entirely in .rodata sections, by marking them constant and using an array of characters rather than a pointer to character. 2008-06-13 flameeyes * lib/cdda_interface/Makefile.am, lib/cdda_interface/cddap_interface.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/scsi_interface.c, lib/cdda_interface/test_interface.c: Make drive exceptions non-static objects that are shared between multiple units. Also replace the three Dummy functions with dummy_exception (also common). Bump the revision. This reduces the memory footprint of libcdda_interface of about 200 bytes. 2008-06-13 flameeyes * include/cdio++/iso9660.hpp: Cleanup includes, don't include twice, and include rather than . 2008-06-13 flameeyes * Makefile.am: Remove trailing backslash. 2008-06-13 flameeyes * Makefile.am: Only install libcdio++ and libiso9660++ pkg-config files if C++ bindings are being built and installed. 2008-06-10 pjcreath * config.rpath, m4/libtool.m4: Fix for automake 1.10 and removal of unnecessary m4. 2008-06-10 pjcreath * lib/driver/image/nrg.h, test/testpregap.c.in: Fixed pregap regression failure on non-Intel architectures, removed warnings 2008-06-09 rocky * autogen.sh, m4/.cvsignore, m4/codeset.m4, m4/iconv.m4, m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4, m4/libtool.m4, m4/pkg.m4: Copies of distribution m4 macros included to avoid extra installation on OSX. Patch from Peter Creath. 2008-06-03 rocky * NEWS, lib/iso9660/iso9660.c, test/testiso9660.c: More time setting/getting patches - the last of the patches from N. Boullis. Make testiso9660 more stringent now that bugs have been removed. 2008-05-31 rocky * configure.ac, lib/iso9660/iso9660.c: Replace last vestige of non-reentrant gmtime with timegm. Problem determination and fix again from Nicolas Boullis. 2008-05-31 rocky * lib/iso9660/iso9660.c: iso9660_get_ltime: the TZ environment variable was set using a local buffer that disappears when the function terminates. This might lead to segmentation faults. Reset to the old TZ value (if any) or unset the variable if it was previously not set. Problem noted and fixed by Nicolas Boullis. 2008-05-29 rocky * doc/libcdio.texi, lib/iso9660/iso9660.c: iso9660.c: On some architectures (like my powerpc), char is unsigned. So when libcdio tries to adjust "converted ISO9660 timezones" in iso9660_set_ltime on such architectures, it would replace legitimate negative values with 52. Cast &_pv_date[16] to "iso712_t *" and then dereference. Patch from Nicolas Boullis: doc: small spelling typos. 2008-05-28 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c, test/testiso9660.c: iso9660.h: parameter name change to match implementation. iso9660.c: use reentrant version of localtime and gettime (most of the time) Patch from Nicolas Boullis. testiso9660.c: Change a memcmp for a test_compare which gives more detailed information on failure. 2008-05-11 rocky * lib/driver/FreeBSD/freebsd.h: Fix prototype mismatch. Savannah Bug #23228 2008-05-09 edsdead * lib/driver/mmc.c: don't shift read_sector_type into reserved field of read cd cdb (resulting in every call being treated as CDIO_MMC_READ_TYPE_ANY) 2008-05-09 edsdead * lib/driver/mmc.c: fix incorrect behavior and potential buffer overrun in mmc_read_cd when i_blocks exceeds MAX_CD_READ_BLOCKS 2008-05-09 edsdead * include/cdio/mmc.h: fix up return type of mmc_run_cmd and mmc_run_cmd_len 2008-05-05 rocky * configure.ac, test/Makefile.am, test/{testpregap.c => testpregap.c.in}: Changes to testpregap.c to allow to build outside of the source tree. 2008-04-26 rocky * src/Makefile.am: restore tab which got lost in cut-and-past. -- A pox on "make". Thanks to Steve Schultz again for keeping us (more) honest. 2008-04-24 rocky * NEWS, THANKS, configure.ac, lib/driver/gnu_linux.c, lib/iso9660/xa.c, lib/udf/udf.c, lib/udf/udf_time.c, src/Makefile.am: Patch from Peter Hartley to allow Cross-compiling to mingw32: - MinGW doesn't have struct timespec, so udf_time.c doesn't compile (changes lib/udf/udf_time.c, configure.ac, config.h.in) - The configure test for bitfield ordering uses AC_TRY_RUN and thus doesn't work when cross-compiling; use sneakiness to try and determine it at compile time, falling back to the existing runtime check if the sneakiness doesn't work (changes configure.ac; tested on x86_64-linux-gnu and i586-mingw32 which are bf_lsbf=1, plus sparc64-linux-gnu which is bf_lsbf=0) - The configure test for "extern long timezone" needlessly uses AC_TRY_RUN when in fact AC_LINK_IFELSE is all we need to know, and that latter works when cross-compiling (changes configure.ac) - MinGW sys/stat.h doesn't have the *GRP or *OTH macros, nor S_IFLNK or S_IFSOCK, nor S_ISUID etc (changes lib/udf/udf.c and lib/iso9660/xa.c) - MinGW doesn't have , so even the header-inclusion bit of the Linux driver doesn't compile unless it's moved inside the "ifdef HAVE_LINUX_CDROM" (changes lib/driver/gnu_linux.c) - Because the man pages cd-info.1 etc depend on the binaries themselves (for help2man reasons), the configure options --without-cd-info etc don't actually stop them being compiled. Fixed by only depending on man pages for programs that are actually built, which also stops the installation of man pages of programs which aren't themselves installed (changes src/Makefile.am) 2008-04-22 karl * lib/driver/_cdio_generic.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stdio.h, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/aix.c, lib/driver/audio.c, lib/driver/bsdi.c, lib/driver/cd_types.c, lib/driver/cdio.c, lib/driver/cdio_assert.h, lib/driver/cdio_private.h, lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/device.c, lib/driver/disc.c, lib/driver/ds.c, lib/driver/generic.h, lib/driver/gnu_linux.c, lib/driver/image.h, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/logging.c, lib/driver/mmc.c, lib/driver/mmc_private.h, lib/driver/netbsd.c, lib/driver/osx.c, lib/driver/portable.h, lib/driver/read.c, lib/driver/solaris.c, lib/driver/track.c, lib/driver/utf8.c, lib/driver/util.c: gplv3+ 2008-04-21 karl * lib/driver/FreeBSD/Makefile, lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/MSWindows/Makefile, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/image/Makefile, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image/nrg.h: gplv3+ 2008-04-20 karl * lib/cdio++/cdio.cpp, lib/cdio++/devices.cpp, lib/cdio++/iso9660.cpp: gplv3+ 2008-04-18 karl * lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, lib/iso9660/rock.c, lib/iso9660/xa.c, lib/udf/filemode.c, lib/udf/udf.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_fs.h, lib/udf/udf_private.h, lib/udf/udf_time.c: gplv3+ 2008-04-17 karl * doc/Makefile.am, lib/cdda_interface/scsi_interface.c, lib/paranoia/gap.c, lib/paranoia/gap.h, lib/paranoia/isort.c, lib/paranoia/isort.h, lib/paranoia/overlap.c, lib/paranoia/overlap.h, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c, src/cd-paranoia/doc/Makefile.am, src/cd-paranoia/doc/en/Makefile.am, src/cd-paranoia/doc/ja/Makefile.am: gplv3+ 2008-04-16 karl * lib/cdda_interface/cddap_interface.c, lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h, lib/cdda_interface/scan_devices.c, lib/cdda_interface/smallft.c, lib/cdda_interface/smallft.h, lib/cdda_interface/test_interface.c, lib/cdda_interface/toc.c, lib/cdda_interface/utils.c, lib/cdda_interface/utils.h: gplv3+ 2008-04-15 rocky * Makefile.am: Install libcdio_paranoia.pc and libcdio_cdda.pc when cdparnaoia is enabled. Thanks to Geotz Waschk for catching this. 2008-04-14 karl * src/cd-drive.c, src/cd-info.c, src/cd-paranoia/pod2c.pl, src/cd-read.c, src/cdda-player.c, src/cddb.c, src/cddb.h, src/cdinfo-linux.c, src/iso-info.c, src/iso-read.c, src/mmc-tool.c, src/util.c, src/util.h: gplv3+ 2008-04-11 karl * src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/header.c, src/cd-paranoia/header.h, src/cd-paranoia/report.c, src/cd-paranoia/report.h, src/cd-paranoia/usage-copy.h, src/cd-paranoia/utils.h, src/cd-paranoia/version.h: gplv3+ 2008-03-28 rocky * lib/driver/gnu_linux.c, lib/driver/netbsd.c: netbsd.c: add more ops. Doc functions, bring more in line with other drivers. 2008-03-28 rocky * include/cdio/device.h, lib/driver/cdio_private.h, lib/driver/netbsd.c, test/Makefile.am: cdio_have_xxx is now private. Add p1.bin to distribution. 2008-03-27 rocky * configure.ac, include/cdio/device.h, lib/driver/Makefile.am, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/libcdio.sym, lib/driver/netbsd.c, test/Makefile.am: Start NetBSD driver 2008-03-27 edsdead * NEWS: add ISRC updates to NEWS 2008-03-25 karl * include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/device.hpp, include/cdio++/devices.hpp, include/cdio++/disc.hpp, include/cdio++/enum.hpp, include/cdio++/iso9660.hpp, include/cdio++/mmc.hpp, include/cdio++/read.hpp, include/cdio++/track.hpp, include/cdio/audio.h, include/cdio/bytesex.h, include/cdio/bytesex_asm.h, include/cdio/cd_types.h, include/cdio/cdda.h, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/device.h, include/cdio/disc.h, include/cdio/ds.h, include/cdio/dvd.h, include/cdio/ecma_167.h, include/cdio/iso9660.h, include/cdio/logging.h, include/cdio/mmc.h, include/cdio/paranoia.h, include/cdio/posix.h, include/cdio/read.h, include/cdio/rock.h, include/cdio/scsi_mmc.h, include/cdio/sector.h, include/cdio/track.h, include/cdio/types.h, include/cdio/udf.h, include/cdio/udf_file.h, include/cdio/udf_time.h, include/cdio/utf8.h, include/cdio/util.h, include/cdio/xa.h: gplv3 2008-03-24 karl * example/C++/OO/cdtext.cpp, example/C++/OO/device.cpp, example/C++/OO/drives.cpp, example/C++/OO/eject.cpp, example/C++/OO/iso4.cpp, example/C++/OO/isofile.cpp, example/C++/OO/isofile2.cpp, example/C++/OO/isolist.cpp, example/C++/OO/mmc1.cpp, example/C++/OO/mmc2.cpp, example/C++/OO/tracks.cpp, example/C++/device.cpp, example/C++/eject.cpp, example/C++/isofile.cpp, example/C++/isofile2.cpp, example/C++/isolist.cpp, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/C++/paranoia.cpp, example/C++/paranoia2.cpp, example/audio.c, example/cdchange.c, example/cdio-eject.c, example/cdtext.c, example/device.c, example/drives.c, example/eject.c, example/isofile.c, example/isofile2.c, example/isofuzzy.c, example/isolist.c, example/isolsn.c, example/mmc1.c, example/mmc2.c, example/mmc2a.c, example/mmc3.c, example/paranoia.c, example/paranoia2.c, example/sample3.c, example/sample4.c, example/tracks.c, example/udf1.c, example/udf2.c, example/udffile.c: gplv3 2008-03-23 karl * parse/Makefile, parse/cue.L, parse/cue.y, parse/toc.L, parse/toc.y, parse/toclexer.c, parse/toclexer.h: gplv3 2008-03-22 rocky * README.libcdio: NetBSD *can* be included in libcdio. Thanks to Karl Berry for pointing out. 2008-03-22 rocky * configure.ac, test/.cvsignore, test/Makefile.am, test/testnrg.c.in: Start a nrg image reading test. 2008-03-22 karl * test/check_cd_read.sh, test/check_common_fn.in, test/check_sizeof.c, test/testassert.c, test/testbincue.c.in, test/testdefault.c, test/testischar.c, test/testiso9660.c, test/testisocd.c, test/testisocd2.c.in, test/testparanoia.c, test/testpregap.c, test/testtoc.c: gplv3 2008-03-21 rocky * NEWS: More Housekeeping 2008-03-21 rocky * test/.cvsignore: Bookkeeping 2008-03-21 rocky * doc/Makefile.am: We no longer use gpl.texi. 2008-03-21 rocky * NEWS, cvs2cl_usermap, lib/driver/cdio_private.h, lib/driver/image/nrg.c: cdio_private.h: Remove type mismatch warning on get_track_pregap_lba when compiling image drivers. nrg.c: initialize previously uninitialzied field. Bug found by Robert William Fuller. cvs2cl_usermap: add esdead and karl NEWS: try to track what's been happening. 2008-03-21 edsdead * lib/driver/image/nrg.c: support cd-text 2008-03-20 karl * INSTALL, Makefile.am, doc/gpl.texi, example/C++/Makefile.am, example/C++/OO/Makefile.am, example/Makefile.am, include/Makefile.am, include/cdio++/Makefile.am, include/cdio/Makefile.am, lib/Makefile.am, lib/cdda_interface/Makefile.am, lib/cdio++/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am, lib/udf/Makefile.am, src/Makefile.am, src/cd-paranoia/Makefile.am, test/Makefile.am: update Makefiles to GPLv3+ 2008-03-20 rocky * doc/libcdio.texi: Change some ALL CAPS emphasis to @emph emphasis 2008-03-20 edsdead * lib/driver/image/nrg.c: minor correction to prior commit 2008-03-20 edsdead * lib/driver/image/nrg.c: handle DAO in nrg_read_audio_sectors 2008-03-20 edsdead * test/check_fuzzyiso.sh: expect failure on p1.bin and p1.nrg b/c they are not iso9660 images 2008-03-20 edsdead * include/cdio/track.h, lib/driver/cdio_private.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image/nrg.h, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/track.c: get isrc from nrg files AND new API char * cdio_get_track_isrc(CdIo_t *,track_t); 2008-03-20 edsdead * test/check_paranoia.sh.in: don't need # of blocks without offset 2008-03-19 edsdead * lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, test/cdda-read.right, test/check_paranoia.sh.in: remove 272 byte offset that emulated 68 sample read offset in author's drive 2008-03-19 edsdead * doc/libcdio.texi: added authorship to section on track pre-gaps and cd-da 2008-03-18 edsdead * test/p1.cue, test/testpregap.c: tests for pregap api 2008-03-18 edsdead * test/Makefile.am: add testpregap 2008-03-18 karl * NEWS, doc/fdl.texi, doc/libcdio.texi: switch manual to GFDL1.2+ and no invariant sections; systematize front matter; etc. 2008-03-16 rocky * THANKS, configure.ac, doc/libcdio.texi, include/cdio/track.h, lib/driver/Makefile.am, lib/driver/cdio_private.h, lib/driver/image.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image/nrg.h, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/track.c: get_track_pregap_lba, get_track_pregap_lsn. Section on "CD-DA pregap" in libcdio manual. All changes from Robert William Fuller. 2008-03-15 rocky * doc/doxygen/Doxyfile.in: Update for doxygen 1.5.3 2008-03-15 rocky * configure.ac: Assume darwin9 is like darwin8. 2008-03-15 rocky * example/Makefile.am, src/cd-paranoia/Makefile.am, test/Makefile.am: More libiconv escallation. Sigh. 2008-03-15 rocky * test/Makefile.am: libiconv needed in test programs probably as part of the subversive iconv escallation that's been going on. 2008-03-15 rocky * NEWS: Revise before release. 2008-03-15 rocky * Makefile.am, src/Makefile.am: Install pkgconfig files libudf.pc, libcdio++.pc and libiso9660++.pc. Distribute manual pages for standalone utilities. Suggestions thanks to Nicolas Boullis. 2008-03-09 rocky * autogen.sh: Try to undo the damage gettextize does on configure.ac and Makefile.am 2008-03-09 rocky * autogen.sh: fix syntax error 2008-03-09 rocky * Makefile.am, autogen.sh, configure.ac: . 2008-03-09 rocky * Makefile.am: gettext stuff pulled in by gettextize 2008-03-08 rocky * src/cd-paranoia/version.h, test/cd-paranoia-log.right, test/check_paranoia.sh.in: test/check_paranoia.sh.in: need to ignore variance in status. 2008-03-08 rocky * include/cdio/Makefile.am, test/check_paranoia.sh.in: Things needed to make "make distcheck" work. Makefile.am: forgot paranoia.h header. check_paranoia.sh.in: need to compare with "right" file $srcdir not "." 2008-03-08 rocky * autogen.sh: Looks like we need to run gettextize first now 2008-03-06 rocky * test/Makefile.am, test/cd-paranoia-log.right, test/check_paranoia.sh.in: Add a test of new -l option on cd-paranoia. 2008-03-06 rocky * NEWS, src/cd-read.c, src/util.c, src/util.h, test/check_cd_read.sh: cd-read add --mode='any' which is basically a mmc_read_cd with CDIO_MMC_READ_TYPE_ANY. 2008-03-04 rocky * lib/driver/mmc.c: Comment typo 2008-03-03 rocky * src/cd-paranoia/cd-paranoia.c: Remove what looks like a spurious --output-info (-i) option. 2008-02-29 rocky * NEWS, THANKS, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/doc/en/cd-paranoia.1.in, src/cd-paranoia/usage-copy.h, src/cd-paranoia/usage.txt.in, test/check_paranoia.sh.in: Add option to cd-paranoia to log summary output to a file. Patch from and thanks to Daniel Schwarz. 2008-02-08 rocky * lib/driver/utf8.c, lib/iso9660/iso9660_fs.c: Add checks for memory allocation failures. Patch from Mandriva folks by Gustavo De Nardin via Vincent Danen. Originally for libcdio 0.78.2 See also https://savannah.gnu.org/patch/?6413 2008-01-19 rocky * src/cd-paranoia/cd-paranoia.c: Cast to integer because function it seems really might not be paranoia_mode_t but seems augmented by to additional values below 0. Ugh. 2008-01-18 rocky * AUTHORS: email address change. 2008-01-09 rocky * example/udf1.c: Was accessing out of array bounds. Caught by Stanislav Brabec. 2008-01-09 rocky * include/cdio++/iso9660.hpp, src/cd-info.c, src/iso-info.c, src/mmc-tool.c: cd-info.c iso-info.c More error-tolerant patch from Stanislav Brabec at SuSE. iso9660.hpp: patch to compile libcdio with gcc 4.3 from Cristian Rodriguez via Stanislav Brabec. Add return statement in function returning non-void. mmc-tool.c: remove out-of-bound array access. 2008-01-05 rocky * NEWS, include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c: Note that iso9660_dir_to_name can return NULL if memory allocation fails. 2008-01-05 rocky * lib/iso9660/iso9660_fs.c: Another case of potentially accessing outside of array bounds. Bug caught by Nico Golde. 2008-01-03 rocky * src/cd-info.c, src/iso-info.c: Improper +1 on alloc. 2008-01-01 flameeyes * configure.ac, example/C++/Makefile.am, example/Makefile.am: Add a configure option to disable examples building (useful for distributions, as adding them to noinst will still build them during make all wasting build time. 2007-12-30 rocky * lib/driver/FreeBSD/freebsd.c: get_media_changed is static and shouldn't be compiled unless we are on FreeBSD. 2007-12-30 rocky * src/cd-info.c, src/iso-info.c: Remove possible buffer overrun when long joliet names are used. Savannah Bug #21910. 2007-12-28 rocky * NEWS, configure.ac, test/check_cd_read.sh, test/check_cue.sh.in, test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh: Build outside of source fixes for TEST. We're in 0.80 land now. 2007-12-28 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h: Add get_media_changed method on FreeBSD for drives accessed via CAM (SCSI or ATAPICAM). Patch thanks to Andriy Gapon. 2007-12-15 rocky * configure.ac, doc/how-to-make-a-release.txt, lib/driver/FreeBSD/freebsd.h: Apply kfreebsd patch from Debian. 2007-12-10 rocky * doc/libcdio.texi: Another reference to IEC 60908. Update copyright and email 2007-12-10 rocky * doc/glossary.texi: Add mention of IEC 60908 2007-12-10 rocky * doc/glossary.texi, doc/libcdio.texi: Add wiki reference to the Philips Red Book. 2007-11-21 rocky * include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c: Run a Multimedia command (MMC) specifying the CDB length. The motivation here is, for example, to use in is an undocumented debug command for LG drives (namely E7), whose length is being miscalculated by mmc_get_cmd_len(); it doesn't follow the usual code number to length conventions. Patch supplied by SukkoPera. 2007-11-19 flameeyes * include/cdio++/iso9660.hpp: Add missing include (for GCC 4.3). Patch by Ryan Hill (dirtyepic at gentoo). Patch #6271 at Savannah. 2007-11-17 flameeyes * src/cd-paranoia/Makefile.am: Don't try to use a generic rule for building usage.h or it will fail make distcheck when builddir != srcdir 2007-11-16 flameeyes * lib/iso9660/iso9660.c: Fix logic. 2007-11-16 flameeyes * test/testiso9660.c: Fix name of function. 2007-11-16 flameeyes * lib/iso9660/iso9660.c: Fix typo. 2007-11-16 flameeyes * test/Makefile.am: Don't compile the test programs during make all, make check will take care of that. 2007-11-16 flameeyes * Makefile.am: Fix make dist when run on $builddir != $srcdir. 2007-11-16 flameeyes * test/check_cd_read.sh, test/check_cue.sh.in, test/check_iso.sh.in, test/check_nrg.sh.in, test/check_opts.sh: check_common_fn is in the current dir (build dir), not in $srcdir. 2007-11-16 flameeyes * include/cdio/Makefile.am: Don't install the cdparanoia headers when cd-paranoia is not built nor installed. 2007-11-16 flameeyes * Makefile.am: Do not install the libcdio_paranoia.pc and libcdio_cdda.pc files if cd-paranoia is not built. If we do, the pkg-config based checks will report the presence of libraries that are not present in the system. 2007-11-16 flameeyes * lib/iso9660/iso9660.c: Do not assume that sizeof(int) == sizeof(long), the assumption is wrong on 64-bit arches. Reduce the size of strtol range when filling a struct tm variable. 2007-11-16 flameeyes * lib/driver/utf8.c: Include config.h before checking for HAVE_JOLIET or it will never build the function. 2007-11-16 flameeyes * configure.ac: Unbreak --enable/--disable joliet support. Use AS_HELP_STRING to pretty-print the help message. 2007-11-09 rocky * src/cd-paranoia/pod2c.pl: Apparently cygwin's perl sometimes puts in \r's for linefeeds. Patch from Gary Parks. 2007-10-27 rocky * INSTALL, NEWS, configure.ac: Final 0.79 release 2007-10-21 rocky * src/util.c: Update copyright. 2007-10-17 rocky * src/cd-paranoia/doc/jp/.cvsignore, src/cd-paranoia/doc/jp/Makefile.am, src/cd-paranoia/doc/jp/cd-paranoia.1.in: jp -> ja 2007-10-16 rocky * configure.ac, lib/cdda_interface/cddap_interface.c: libcdio cdparanoia doing the wrong thing on a single-sector read. Savannah patch #5999. 2007-10-15 rocky * NEWS, configure.ac, lib/cdda_interface/Makefile.am, lib/cdio++/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am, lib/udf/Makefile.am, src/Makefile.am, src/cd-paranoia/Makefile.am: Remove := in Makefiles for portability. autoconf 1.10 complains about adding AM_PROC_CC_C_O - pander to it. 2007-10-13 rocky * NEWS, lib/cdda_interface/Makefile.am, lib/cdio++/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am: Go over shared library revision numbers and NEWS in advance of a Oct 27 0.79 release. 2007-09-28 rocky * lib/paranoia/p_block.c: Ooops - typedef typo 2007-09-28 rocky * include/cdio/paranoia.h, lib/cdda_interface/common_interface.c, lib/paranoia/p_block.c: paranoia.h, p_block.c: Add paranoia_set_range and correct #define in paranoia.h common_interface.c: try to give credit where it is due. 2007-09-28 rocky * THANKS: Add Patrick Guimond 2007-09-28 rocky * lib/cdda_interface/common_interface.c: Not just lead-out gap, but lead-out + pregap 2007-09-28 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/toc.c, test/testiso9660.c: Support for multisession CD Extra Discs courtesy of Patrick Guimond. testiso9660.c: remove ltime comparison check. :-( 2007-09-26 rocky * lib/iso9660/iso9660_fs.c: iso9660_open_ext_private(): close image filecupon error. Leds to an open file descriptor making it impossible of e.g. unmounting a CDROM containing the file. Savannah bug #21147. 2007-09-05 rocky * lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, test/check_common_fn.in: iso9660.c: off-by-one bug which was causing dates to come out wrong. Thanks to Nicolas Boullis for finding and fixing. iso9660_fs.c: remove bugs merging code from the last round of changes/enhancements check_common_fn.in: show full iso_read command when it fails. 2007-08-12 rocky * example/.cvsignore: Yet another program, yet another ignore 2007-08-12 rocky * configure.ac, lib/iso9660/iso9660_fs.c, test/.cvsignore, test/Makefile.am, test/testisocd.c, test/testisocd2.c.in: iso9660_fs.c: remove some (but not all) of the redundancy testisocd2.c.in: a test of working with an ISO 9660 image. 2007-08-12 rocky * example/Makefile.am, example/README, example/isolist.c, example/isolsn.c, lib/iso9660/iso9660_fs.c: iso9660_fs.c: remove some bugs in freeing here. isolsn.c: Add a sample program for showing the path for given LSN. 2007-08-11 rocky * include/cdio/iso9660.h, lib/iso9660/Makefile.am, lib/iso9660/iso9660_fs.c, lib/iso9660/libiso9660.sym, test/testisocd.c: Add iso9660_fs_find_lsn_with_path and iso9660_ifs_find_lsn_with_path to report the full filename path of lsn. 2007-08-11 flameeyes * lib/driver/osx.c: Workaround a missing callback, failures are called immediately, successes are queued and might not be called properly. 2007-08-09 flameeyes * example/.cvsignore: Ignore udffile too. 2007-08-09 flameeyes * configure.ac, lib/driver/osx.c: Borrow the eject code for OSX from xine-lib-1.2-macos branch, as contributed by Matt Messier. This allows to eject disks on Mac OS X without having to call an external utility. Incidentally this fixes libcdio eject function on Mac OS X 10.4 and later, as hditool was moved from /usr/sbin to /usr/bin. 2007-08-09 flameeyes * example/cdio-eject.c: Include config.h, or the build will fail on at least Mac OS X. 2007-08-09 flameeyes * autogen.sh: Let autogen.sh work on OSX: test for glibtool presence (GNU libtool versus Apple libtool). 2007-08-09 flameeyes * autogen.sh: Accept automake 1.10 as a version greater than1.6. 2007-08-04 rocky * lib/driver/_cdio_generic.c: Small changes 2007-08-04 rocky * lib/iso9660/iso9660.c: Add note about funny strtol test and correct test. Thanks to Nicolas Boullis for finding this. 2007-07-19 rocky * test/testiso9660.c: Check for error status of iso9660_get_dtime and iso9660_get_ltime 2007-06-18 rocky * NEWS: Note last two bugs reported by Eric Shattow. 2007-06-18 rocky * src/cd-paranoia/cd-paranoia.c: Don't expect TOC reading to report audio mode if we are trying to rip prior to the very first track. And don't give an error here either. 2007-06-16 rocky * src/cd-info.c, src/cddb.c, src/cddb.h: CDDB disc id is an unsigned 32-bit integer, not long which could be 64-bits. 2007-05-27 rocky * NEWS: Bugs, bugs, bugs! 2007-05-27 rocky * lib/cdda_interface/scan_devices.c: Remove possible access of uninitialized cdio_hwinfo structure. 2007-05-27 rocky * lib/driver/_cdio_generic.c: Update copyright and email address. 2007-05-27 rocky * lib/driver/_cdio_generic.c: Fix bug in trying to free cd-text when it hasn't been initialized. 2007-05-16 rocky * configure.ac, src/cd-paranoia/doc/Makefile.am, src/cd-paranoia/doc/ja/.cvsignore, src/cd-paranoia/doc/ja/Makefile.am, src/cd-paranoia/doc/ja/cd-paranoia.1.in: Rename Japan locale to ja. Bug #19880. 2007-04-15 rocky * example/cdchange.c: cdchange doesn't use off_t, ssize or any fancy types so it shouldn't #include SYS_TYPES. Furthermore if cdio needs it, it should #include it on its own. 2007-04-15 rocky * example/cdchange.c: Take gcc's suggestion regarding adding parenthesis 2007-04-15 rocky * configure.ac: Was chopping off HAVE_SYS_TYPES declaration. 2007-04-15 rocky * example/cdio-eject.c, include/cdio/read.h: read.h: include sys/types.h since some OS's need it. cdio-eject.c: no real changes. Add copyright. 2007-03-16 rocky * include/cdio/audio.h, include/cdio/read.h: audio.h: doxygenation Address, Copyright change. 2007-03-10 rocky * lib/cdio++/devices.cpp, lib/cdio++/iso9660.cpp: Patches from sms to deal with off_t not getting defined. 2007-03-09 rocky * src/cd-paranoia/doc/en/cd-paranoia.1.in: More potential cdparanoia -> cd-paranoia changes. Note how this differs from cdparanoia (i.e. not much). 2007-03-09 rocky * src/cd-drive.c: Use "getopt.h" , not 2007-03-07 rocky * example/cdchange.c, lib/driver/gnu_linux.c: lib/driver/gnu_linux.c: bug #19221 (possibly): memory Leak opening an inaccessible device. cdchange.c: a stray character got added to the file 2007-03-05 rocky * configure.ac, example/cdchange.c, lib/driver/image/cdrdao.c, lib/iso9660/iso9660.c, src/cd-paranoia/cd-paranoia.c: Better strtol fix based on SMS's remark. 2007-03-05 rocky * example/cdchange.c, lib/driver/image/cdrdao.c, lib/iso9660/iso9660.c, src/cd-paranoia/cd-paranoia.c: Set errno=0 before calling strtol(). bug #18131 2007-02-25 rocky * include/cdio/read.h, lib/driver/read.c: Update cdio_read documentation. 2006-12-20 rocky * lib/iso9660/iso9660_fs.c: Symlinks were sharing stat_buf so freeing one made the pointer to the other invalid. Allocate a separate entry for each symlink. Bug report and patch provided by Antti Perl. Savannah bug #18563 2006-12-14 rocky * lib/driver/utf8.c: Patch by Gergely Szsz to respect --disable-joliet. (Things may change when UDF is more in use though.) Bug report #18522 2006-12-14 rocky * configure.ac: Typo in configure.ac reported by Gergely Szsz, bug report #18522. 2006-12-04 rocky * src/iso-read.c: Had one too many field in structure. 2006-11-30 rocky * configure.ac: Disable libvcdinfo - 2nd try. 2006-11-30 rocky * configure.ac: Disable vcdinfo in cd-info by default. It causes too much of a hassle for too many people. 2006-11-28 gmerlin * lib/driver/util.c: * Fixed potential security issues 2006-11-27 gmerlin * configure.ac, include/cdio/util.h, lib/driver/_cdio_generic.c, lib/driver/gnu_linux.c, lib/driver/util.c: * Better drive detection for Linux * cdio_add_device_list() now adds devices with symlinks only once 2006-11-16 rocky * test/Makefile.am, test/check_iso.sh.in, test/copying-rr.gpl: Add --ignore to iso-read and add a iso-read copying-rr extraction test. 2006-11-16 rocky * NEWS, configure.ac: We really are in 0.79cvs now. 2006-11-16 rocky * src/iso-read.c: Add --ignore (-k). Thanks to Justin F. Hallett for suggesting and testing 2006-11-13 rocky * rbcdio/AUTHORS, rbcdio/Makefile.am, rbcdio/NEWS, rbcdio/README, rbcdio/autogen.sh, rbcdio/configure.ac, rbcdio/example/device.rb, rbcdio/example/eject.rb, rbcdio/example/tracks.rb, rbcdio/lib/cdio.rb, rbcdio/lib/extconf.rb, rbcdio/rubycdio.m4, rbcdio/swig/Makefile, rbcdio/swig/audio.swg, rbcdio/swig/compat.swg, rbcdio/swig/device.swg, rbcdio/swig/device_const.swg, rbcdio/swig/disc.swg, rbcdio/swig/rubycdio.swg, rbcdio/swig/track.swg, rbcdio/swig/types.swg: Remove files checked into the wrong place 2006-11-13 rocky * rbcdio/AUTHORS, rbcdio/Makefile.am, rbcdio/NEWS, rbcdio/README, rbcdio/autogen.sh, rbcdio/configure.ac, rbcdio/example/device.rb, rbcdio/example/eject.rb, rbcdio/example/tracks.rb, rbcdio/lib/cdio.rb, rbcdio/lib/extconf.rb, rbcdio/rubycdio.m4, rbcdio/swig/Makefile, rbcdio/swig/audio.swg, rbcdio/swig/compat.swg, rbcdio/swig/device.swg, rbcdio/swig/device_const.swg, rbcdio/swig/disc.swg, rbcdio/swig/rubycdio.swg, rbcdio/swig/track.swg, rbcdio/swig/types.swg: Initial revision 2006-11-01 rocky * NEWS: Get ready for release. Note preprocessor symbol LIBCDIO_VERSION number has to be an integer. (Bug caused by naming version 0.78.1) 2006-10-30 rocky * configure.ac: A stray quote got inserted into the "cut". This time, for sure! 2006-10-30 rocky * configure.ac: Get reeady for 0.78.2 release? 2006-10-30 flameeyes * configure.ac: Use cut rather than sed for removing the micro version. 2006-10-29 rocky * configure.ac: This time, for sure! (See previous.) 2006-10-29 rocky * configure.ac: Remove .1 in LIBCDIO_VERSION_NUM 2006-10-28 rocky * NEWS: What's changed. 2006-10-28 rocky * configure.ac, doc/how-to-make-a-release.txt, lib/driver/Makefile.am: Prepare a release that doesn't have the .so problem. 2006-10-27 rocky * example/.cvsignore: Add cdio-eject 2006-10-27 rocky * configure.ac: Make iconv more necessary. 2006-10-27 rocky * include/cdio/cdda.h, include/cdio/iso9660.h, include/cdio/mmc.h, include/cdio/paranoia.h: Remove doxygen warnings. 2006-10-27 rocky * configure.ac: Get ready for release. 2006-10-27 rocky * NEWS: Revies NEWS version/date for release. 2006-10-21 rocky * NEWS, example/README, lib/driver/gnu_linux.c: gnu_linux.c: Fix bug reported by Burkhard in eject_media_linux() where we were closing an open tray. NEWS/README: note current changes 2006-10-21 gmerlin * example/Makefile.am, example/cdio-eject.c, lib/driver/gnu_linux.c: * Umount before ejecting * Ultra simple eject command 2006-10-11 rocky * example/.cvsignore, example/Makefile.am, example/mmc3.c, include/cdio/mmc.h, lib/driver/Makefile.am, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h, lib/iso9660/Makefile.am: Add routine to get tray status (open/closed) and sample program. Seems broken at least on SuSE 10.1 if not other GNU/Linux's though. 2006-09-26 flameeyes * lib/iso9660/iso9660_fs.c: Check for the pointers before dereference them. Found by Coverity Scan on xine-lib. 2006-09-26 flameeyes * lib/driver/MSWindows/win32.c: Check for the validity of the pointer before using strlen on it. Found by Coverity Scan on xine-lib. 2006-09-26 flameeyes * lib/iso9660/iso9660.c: Fix a possible off-by-one in strip_trail() identified by Coverity Scan on xine sources. 2006-08-20 rocky * lib/driver/Makefile.am, libcdio.pc.in: Patches from Steve Schultz to handle libiconv inclusion on BSDI (and possibly other BSD's) 2006-08-02 rocky * lib/driver/gnu_linux.c: Yet another guess at what happened to the CDROMREADTOCENTRY ioctl call. I haven't been able to find anything that documents in any detail how to use this ioctl let alone the weird behavior where CDROMREADTOC header beforehand turns and "invalid parameter" into a valid one. It's not the way other 'nix's work. 2006-07-30 rocky * test/testiso9660.c: Take out some checks until daylight savings time thing is resolved. 2006-07-30 rocky * NEWS, example/tracks.c, lib/driver/gnu_linux.c: gnu_linux: get_disc_last_lsn: cdte_format seems to want to be CDROM_MSF example/tracks.c: add a call to cdio_get_disc_last_lsn() NEWS - note UDF limitation. correct spelling typo. 2006-06-12 gmerlin * NEWS: * Updated NEWS 2006-06-03 gmerlin * include/cdio/utf8.h, lib/driver/utf8.c: * UTF-8 support 2006-06-03 rocky * lib/udf/udf_file.c: C lint. 2006-06-03 rocky * test/Makefile.am, test/check_iso.sh.in, test/copying.gpl: Add our own version of copying.gpl rather than rely on FSF's to be unchanging. 2006-06-02 gmerlin * include/cdio/Makefile.am, include/cdio/iso9660.h, include/cdio/types.h, lib/driver/Makefile.am, lib/driver/libcdio.sym, lib/iso9660/iso9660_fs.c: * UTF-8 support patch 2006-05-06 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c: Add missing field in SVD structure. Document correspondencies with ECMA 119 better. 2006-05-03 rocky * include/cdio/cdda.h: Note what nsectors does. 2006-04-28 rocky * lib/udf/udf_fs.c: gcc 2.9 fix remove ;; - thanks to sms 2006-04-17 rocky * doc/2006-summer-of-code.txt: Remove API overhaul. 2006-04-17 rocky * example/udffile.c, test/Makefile.am: Add UDF 1.02 image and use that in the default file-extraction test. 2006-04-17 rocky * example/Makefile.am, example/udffile.c: udf2.c becomes the more general udffile.c 2006-04-17 rocky * include/cdio/ecma_167.h, lib/udf/udf.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_fs.h, lib/udf/udf_private.h: UDF file reading works for strategy 4. What a pain in the ass. 2006-04-16 rocky * doc/libcdio.texi, example/Makefile.am, include/cdio/ecma_167.h, include/cdio/udf.h, lib/udf/udf.c, lib/udf/udf_file.c, lib/udf/udf_private.h: Remove some bugs in udf_file.c Others remain. 2006-04-15 rocky * example/C++/Makefile.am, example/C++/OO/Makefile.am, example/C++/README, example/Makefile.am, example/README: . 2006-04-15 rocky * example/C++/Makefile.am, example/C++/isofile.cpp: iso3.cpp->isofile.cpp 2006-04-15 rocky * example/C++/isolist.cpp: iso1.cpp->isolist.cpp 2006-04-15 rocky * example/C++/OO/{iso3.cpp => isofile.cpp}, example/C++/OO/{iso2.cpp => isofile2.cpp}, example/C++/OO/{iso1.cpp => isolist.cpp}, example/C++/iso1.cpp, example/C++/iso2.cpp, example/C++/{iso3.cpp => isofile2.cpp}: iso1->isolist iso2->isofile2 iso3->isofile 2006-04-15 rocky * example/.cvsignore, example/C++/.cvsignore, example/C++/OO/.cvsignore, example/C++/README: iso1->isolist iso2->isofile2 iso3->isofile 2006-04-15 rocky * example/C++/Makefile.am, example/C++/OO/Makefile.am, example/Makefile.am, example/README, example/{iso3.c => isofile.c}, example/{iso2.c => isofile2.c}, example/{iso1.c => isolist.c}: iso1.c->isolist.c iso2.c -> isofile2.c iso3.c -> isofile.c 2006-04-15 rocky * doc/2006-summer-of-code.txt: Proposed 2006 Summer of Code tasks 2006-04-15 rocky * include/cdio/udf_file.h, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/libcdio.sym, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_private.h: stream: add getpos routine udf: save last read position. 2006-04-14 rocky * lib/driver/libcdio.sym, src/cdda-player.c, src/mmc-tool.c: libcdio.sym: add mmc_close_tray cdda-player.c, mmc-tool.c: remove possibility of uninitialized return code variables 2006-04-14 rocky * include/cdio/udf_file.h: Fix prototype mismatch. Thanks yet again to the every vigilant Steve Schultz. 2006-04-12 rocky * src/mmc-tool.c: doc fix 2006-04-12 rocky * src/mmc-tool.c: Add access to GPCMD_INQUIRY 2006-04-12 rocky * doc/libcdio.texi, example/README: Note newer example programs like udf1.c udf2.c libcdio.texi also has some other small typo corrections. 2006-04-12 rocky * NEWS, configure.ac, example/mmc2a.c: configure.ac: in 0.78cvs now mmc2a.c: small changes from and synch with mmc-tool. 2006-04-12 rocky * example/mmc2a.c, include/cdio/cd_types.h, include/cdio/device.h, include/cdio/ecma_167.h, include/cdio/mmc.h, include/cdio/udf_file.h, lib/driver/mmc.c, src/mmc-tool.c: mmc: add mmc_close_tray(). mmc-tool: add option for close tray and to get mode-sense 2A data. 2006-04-12 rocky * src/mmc-tool.c: Allow multiple sequence of operations. 2006-04-11 rocky * example/udf2.c, lib/udf/udf_fs.c: udf_fs.c: was freeing freed memory when searching for a file that doesn't exist. udf2.c: print error when looking for a non-existent file. 2006-04-11 rocky * include/cdio/udf_file.h, lib/udf/Makefile.am, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_fs.h, lib/udf/udf_private.h: Make udf_read_block more like 2 read. Implementation is closer to the description (although it needs more work.) udf_fs.h: break out udf_check_tag() *.h: /*! -> /** - is more like Javadoc. 2006-04-11 rocky * lib/udf/udf_file.c: Handle error condition better. 2006-04-11 rocky * example/udf2.c: Print out entire file. (File must fit in memory though.) 2006-04-11 rocky * include/cdio/ecma_167.h, lib/udf/udf.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_private.h: UDF fixes. 2006-04-07 rocky * src/cdda-player.c, src/mmc-tool.c: Wrapping fixes 2006-04-07 rocky * src/cdda-player.c: If a driver doesn't have cdio_get_audio_volume, increase/decrease volume arbitrarily start off with 50 (midway in range) and we've arranged that cdda-player will do it's own bookkeeping to figure out what the current volume level is. 2006-04-05 rocky * src/cdda-player.c: Add ability to interactively set volume levels. Keys +/- 2006-04-05 rocky * src/cdda-player.c: Tidy up a little. 2006-04-05 rocky * lib/driver/.cvsignore: . 2006-04-05 rocky * src/.cvsignore: [no log message] 2006-04-05 rocky * src/cdda-player.c: Figure out last line from screen parameters. (I'm embarrassed it this wasn't put in earlier.) Play *only* if we weren't previously paused or playing. 2006-04-05 rocky * src/cdda-player.c: Start off playing all tracks. Set status to show playing all tracks. 2006-04-05 rocky * lib/driver/mmc.c, lib/driver/mmc_private.h: Make so we can call from driver. Some comment changes too. 2006-04-04 rocky * src/mmc-tool.c: typo 2006-04-04 rocky * include/cdio/device.h, include/cdio/mmc.h, lib/driver/MSWindows/win32.c, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc.c, src/mmc-tool.c: Clarify the difference between speed as it is defined in the MMC spec and drive unit speeds. Add a new mmc routine for the latter. 2006-04-04 rocky * src/mmc-tool.c: mmc-tool: tool do issue libcdio mmc commands. 2006-04-04 rocky * src/Makefile.am: Add get/set blocksize and MCN commands. 2006-04-03 rocky * example/mmc2a.c: typos 2006-04-03 rocky * example/.cvsignore: .cvsignore 2006-04-03 rocky * lib/driver/gnu_linux.c, lib/driver/mmc.c: gnu_linux: Use internal routine to set the speed. mmc.c: add more debug_ variables for new enums and extern vars in mmc.h set speed is in the write direction not read 2006-04-03 rocky * include/cdio/mmc.h: More #defines become enums. Add CDIO_MMC_GETPOS_LEN16. Is like CDIO_MMC_GETPOS_LEN16 with extra position parameter. 2006-04-03 rocky * example/Makefile.am, example/README, example/mmc2a.c: Add example program to show MODE_SENSE page 2A: CD/DVD Capabilities and Mechanical Status Page. 2006-03-30 flameeyes * configure.ac, include/Makefile.am, lib/Makefile.am: Add a --disable-cxx configure parameter so that the C++ bindings can be skipped. 2006-03-28 rocky * README: README 2006-03-28 rocky * README, package/libcdio.spec.in: README 2006-03-28 rocky * lib/driver/MSWindows/win32.c: For read_data_sectors, try first MMC commands and then cooked I/O. 2006-03-28 rocky * example/C++/OO/drives.cpp, example/drives.c, include/cdio/cd_types.h, include/cdio/device.h, lib/driver/cd_types.c, lib/driver/device.c, test/testisocd.c: Yet another attempt to get "get_drives_with_cap" working in a rational fashion. 2006-03-27 rocky * example/C++/OO/drives.cpp, example/drives.c, include/cdio/device.h, lib/driver/device.c: One more time, go over logic of get_drives_with_cap. 2006-03-26 rocky * include/cdio/cd_types.h, lib/driver/device.c, test/testisocd.c: Bug in get_drive_types_with_cap: Had wrong boolean logic. 2006-03-26 rocky * test/.cvsignore: . 2006-03-26 rocky * test/testisocd.c: Add ISO 9660 CD reading test. 2006-03-26 rocky * include/cdio/iso9660.h: A more stringent ISO 9660 CD reading test. 2006-03-26 rocky * test/Makefile.am: Add test of reading an ISO 9660 CD. 2006-03-26 rocky * lib/driver/_cdio_generic.c: Untabify 2006-03-26 rocky * lib/driver/_cdio_generic.c, lib/driver/osx.c: Add/correct comments. osx.c: remove tabs. 2006-03-25 rocky * configure.ac: We'll accept FreeBSD 7. 2006-03-25 rocky * include/cdio/iso9660.h: Document iso9660_iso_seek_read better. Well, the old doc at least had me confused. 2006-03-25 rocky * lib/cdda_interface/scan_devices.c: Store passed in messagedest in initializing drive object. 2006-03-18 rocky * include/cdio/cdda.h, include/cdio/paranoia.h, lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: documentation additions, mostly doxygen. More #defines become enumerations. 2006-03-18 rocky * NEWS: Forgot to update release date. 2006-03-18 rocky * test/testiso9660.c: sourceforge openpower is now giving problems in changing timezone. Will it ever end? 2006-03-18 rocky * Makefile.am, test/testiso9660.c: Makefile.am: failed bad attempt to get Sun 9's make work. But this is probably more correct anyway. testiso9660.c: I give up on getting localtime working. 2006-03-18 rocky * NEWS, configure.ac, doc/how-to-make-a-release.txt, include/cdio/iso9660.h, lib/iso9660/iso9660.c: iso9660.h: remove doxygen formatting warning. configure.ac, NEWS: get ready for 0.77 release 2006-03-18 rocky * lib/driver/FreeBSD/freebsd.h: typo 2006-03-18 rocky * example/cdtext.c, example/iso2.c, example/paranoia.c, example/paranoia2.c, src/cd-paranoia/cd-paranoia.c: More strcat, sprintf, and strcpy replacements. 2006-03-18 rocky * README, README.libcdio: Update instructions 2006-03-18 rocky * test/testiso9660.c: The latest wrinkle in the maze of twisty timezones all different. 2006-03-18 rocky * NEWS, include/cdio/util.h, lib/cdda_interface/utils.c, lib/driver/gnu_linux.c, lib/driver/util.c, lib/udf/udf_fs.c: Security: replace all uses of strcat and strcpy with strncat and strncpy 2006-03-17 rocky * src/cd-read.c, test/cdda-read.right, test/check_cd_read.sh: Add --just-hex option to cd-read. Not all OS's agree on what's printable. 2006-03-17 rocky * lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c: Replace strcat and strcpy with strncat, strncpy. 2006-03-17 rocky * configure.ac, src/Makefile.am, src/cd-info.c, src/cd-paranoia/Makefile.am, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/getopt.c, src/cd-paranoia/getopt.h, src/cd-paranoia/getopt1.c, src/cd-read.c, src/cdda-player.c, src/getopt.c, src/getopt.h, src/getopt1.c, src/iso-info.c, src/iso-read.c: Put back in getopt.h, getopt.c, getopt1.c. Solaris doesn't always have it and it's really too much of a hassle to do all that configuration code to figure out where it is and what has to be done to get it to work. 2006-03-17 rocky * lib/driver/aix.c, lib/driver/solaris.c: mmc_direction_t -> cdio_mmc_direction_t 2006-03-17 rocky * src/cd-drive.c: It's now mmc.h, not scsi_mmc.h 2006-03-17 rocky * test/testiso9660.c: Address one more glitch - NULL tm_zone's 2006-03-17 rocky * test/testiso9660.c: Even more dancing around the different tm mktime variations on different OS's. I think we have GNU/Linux, cygwin, and BSDI now. 2006-03-17 rocky * NEWS: NEWS 2006-03-17 rocky * test/testiso9660.c: Need more sophisticated way to compare times. 2006-03-17 rocky * lib/iso9660/iso9660.c, test/testiso9660.c: More time corrections in the presence of timezones, daylight savings time, and HAVE_TM_GMTOFF 2006-03-17 rocky * lib/iso9660/iso9660.c: use tzset to try to get GMT read. 2006-03-17 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: mmc_direction_t -> cdio_mmc_direction_t 2006-03-17 rocky * NEWS, lib/iso9660/iso9660.c, test/testiso9660.c: iso9660_get_{l,d}time() anot accounting for the timezone properly. Some other small bugs removed. 2006-03-14 rocky * cvs2cl_usermap: Remove email addresses -- spammers are winning 2006-03-14 rocky * cvs2cl_usermap: Add flameeyes 2006-03-14 rocky * NEWS, lib/cdda_interface/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am: Update library version numbers for possible release. FSF address change. 2006-03-14 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c, src/cdda-player.c: iso9660.h: note b_mode2 parameter is not used any more cdda-player.c FSF address change. 2006-03-13 rocky * lib/paranoia/paranoia.c: comment change - 0x2->FLAGS_UNREAD 2006-03-11 rocky * include/cdio++/cdio.hpp: Try p_cdio as protected. 2006-03-07 rocky * include/cdio/disc.h: Put back cdio_stat_size tolerance. 2006-03-07 rocky * .cvsignore, example/C++/OO/.cvsignore: . 2006-03-07 rocky * include/cdio++/iso9660.hpp, lib/cdio++/iso9660.cpp: Go back to inlining various functions because older STL's can't handle not having the bodies. (I think this is what's going on, but I'm not completely sure. Deals with failure on older BSDI and gcc 2.95 server) 2006-03-07 rocky * lib/cdio++/devices.cpp: Code for Cdio::Devices Class 2006-03-07 rocky * .cvsignore: .cvsignore 2006-03-07 rocky * example/C++/OO/Makefile.am, example/C++/OO/iso1.cpp, example/C++/OO/iso4.cpp, include/cdio++/iso9660.hpp, lib/cdio++/iso9660.cpp: Change list of files from a list to a vector. read_pvd() for ISO9660::FS works. iso4.cpp: show ISO 9660 info for CD-images (like iso1 for ISO images). 2006-03-07 rocky * test/.cvsignore: [no log message] 2006-03-07 rocky * lib/cdda_interface/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/paranoia/Makefile.am: Don't do library versioning if there no object files to look at. This removes spurious "nm: no a.out" messages when --disable-shared is in effect. 2006-03-07 rocky * configure.ac, example/C++/OO/Makefile.am, include/cdio++/cdio.hpp, include/cdio++/devices.hpp, include/cdio++/iso9660.hpp, lib/cdio++/Makefile.am, lib/cdio++/cdio.cpp, lib/cdio++/cdio_stub.cpp, lib/cdio++/iso9660.cpp, lib/cdio++/iso9660_stub.cpp: Move code from devices.hpp and iso9660.hpp headers into external files - cdio.cpp, device.cpp, iso9660.cpp configure.ac, C++/OO/Makefile.am: Found some bugs libraries access in doing the above move. 2006-03-07 rocky * configure.ac, test/Makefile.am, test/{testbincue.c => testbincue.c.in}: testbincue.c.in: set @srcdir@. Make gcc 2.95 compatible. 2006-03-07 rocky * include/cdio/iso9660.h, lib/iso9660/libiso9660.sym, test/testbincue.c: Have to have iso9660_find_fs_lsn linker symbol around. (At least for now.) 2006-03-06 rocky * Makefile.am, configure.ac, include/cdio++/Makefile.am, libcdio++.pc.in, libiso9660++.pc.in: Distribute pkg-config files. Add iso9600.hpp to distribution. 2006-03-06 rocky * NEWS, example/C++/OO/Makefile.am: Cosmetic changes. 2006-03-06 rocky * example/C++/OO/Makefile.am, example/C++/OO/iso2.cpp, include/cdio++/cdio.hpp, include/cdio++/iso9660.hpp, include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c, lib/iso9660/libiso9660.sym: Add ISO9660::FS - the cdio portion of ISO9660 reading. iso9600.h: another function rename to be more consistent. 2006-03-06 rocky * doc/libcdio.texi, example/C++/OO/iso1.cpp, include/cdio++/iso9660.hpp, include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/libiso9660.sym, test/testischar.c, test/testiso9660.c: iso9660.hpp, iso1.cpp get list iterators working. rest: add _ to isachar and isadchar 2006-03-06 rocky * example/C++/OO/Makefile.am, example/C++/OO/iso1.cpp, example/C++/OO/iso3.cpp, example/C++/iso1.cpp, include/cdio++/iso9660.hpp, lib/cdio++/Makefile.am: Start OO iso1.cpp. iso3.cpp: valgrind lint. iso1.cpp: tidy more. 2006-03-06 rocky * configure.ac, example/C++/OO/.cvsignore, example/C++/OO/Makefile.am, example/C++/OO/iso3.cpp, include/cdio++/iso9660.hpp, lib/cdio++/Makefile.am: Get first libiso9660++ OO program (iso3) working. 2006-03-05 rocky * include/cdio++/iso9660.hpp, include/cdio/iso9660.h: Add more C++ ISO 9660 methods and some classes (for C structs). 2006-03-05 rocky * example/C++/device.cpp, include/cdio++/cdio.hpp, include/cdio++/device.hpp, include/cdio++/iso9660.hpp, include/cdio/iso9660.h, lib/cdio++/Makefile.am, lib/cdio++/{stub.cpp => cdio_stub.cpp}, lib/cdio++/iso9660_stub.cpp: lib/cdio++/Makeifle.am iso9660.hpp iso9660_stub.cpp: start C++ libiso9660 library iso9660.h: documentation changes. device.hpp: reduce number of methods stub.cpp->cdio_stub.cpp 2006-03-03 flameeyes * example/.cvsignore: Add cdchange to ignored files. 2006-03-03 flameeyes * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c: scsi_mmc_cdb_t -> mmc_cdb_t; scsi_mmc_direction_t -> cdio_mmc_direction_t; make FreeBSD driver build again. 2006-03-02 flameeyes * lib/driver/FreeBSD/freebsd.c: Add missing include in freebsd driver (fix implicit declaration of htonl). 2006-03-02 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c: Mostly doc changes. However there was a field-name misspelling in iso9660.h 2006-03-02 rocky * example/C++/README, example/C++/iso1.cpp, example/README, example/iso1.c: iso1.c{,pp} Show PVD info as well. README: revise for the programs we've got. 2006-03-02 rocky * example/C++/iso2.cpp, example/C++/iso3.cpp, example/iso2.c, example/iso3.c: Simplify code. Add usage. 2006-03-02 rocky * example/C++/iso1.cpp, example/iso1.c, example/iso3.c: Some small changes inspired by corresponding Perl programs. 2006-03-01 rocky * lib/iso9660/iso9660.c: Date changed 2006-03-01 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c: Document iso9660_name_translate{,_ext} more accurately. 2006-03-01 rocky * example/iso1.c: Remove duplicate free 2006-03-01 rocky * include/cdio/iso9660.h: Improve some comments. 2006-03-01 rocky * example/C++/iso1.cpp, example/iso1.c: iso1.c, iso1.cpp: add p_ prefix to some pointers iso1.cpp: add iso1.c improvements: allow for an optional ISO name. 2006-02-27 flameeyes * lib/driver/_cdio_stdio.c, lib/driver/cd_types.c, lib/driver/device.c: Use complete struct initialization to avoid spurious pointers. 2006-02-27 flameeyes * example/audio.c: Fix keywords ordering. 2006-02-27 flameeyes * lib/driver/image/cdrdao.c: Don't put two strcmp() calls in bodyless if costructs when building the release version. Use -DTODO in CFLAGS to get the warning again. 2006-02-27 flameeyes * lib/driver/image/nrg.c: Don't check for an unsigned value to be >= 0. 2006-02-27 flameeyes * include/cdio/Makefile.am: Remove cdio_include.h at distclean rather than in clean, as it's done for config.h. Doesn't require to re-run ./configure at make clean. 2006-02-27 flameeyes * lib/driver/portable.h: Use preprocessor's #error instead of adding invalid code, makes the error more verbose and waste less time (as it stops during preprocessing instead of compiling). 2006-02-25 rocky * test/testiso9660.c: Small comment changes 2006-02-25 rocky * test/testiso9660.c: Revise test to be more informative 2006-02-25 rocky * test/testiso9660.c: Revise test to be more informative 2006-02-18 rocky * lib/driver/osx.c: Was accessing outside of legal range. Addresses bug #15787 Thanks to demo-n. 2006-02-18 rocky * .cvsignore: .cvsignore 2006-02-18 rocky * lib/driver/osx.c: Comment change. 2006-02-18 rocky * lib/driver/bsdi.c, lib/driver/device.c, lib/driver/osx.c: scsi_mmc_direction_t -> cdio_mmc_direction_t 2006-02-16 rocky * NEWS, doc/libcdio.texi: NEWS: Note strncpy problem libcdio.texi: Update copyright date. 2006-02-16 rocky * include/cdio/Makefile.am, include/cdio/cdda.h, include/cdio/disc.h, include/cdio/mmc.h, include/cdio/util.h: Remove some deprecated things. 2006-02-13 rocky * lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/mmc.c: image/* Wrong sizeof. mmc: remove some deprecated things. 2006-02-13 rocky * include/cdio/cd_types.h, lib/driver/cd_types.c: Replace yet another set of #defines with an enum. 2006-02-13 rocky * example/.cvsignore, lib/udf/udf_time.c, src/.cvsignore: udf_time.c: make sure offset is initialized (Darwin doesn'thave TIMEZONE var). .cvsignore: add .gdb_history 2006-02-13 rocky * NEWS: What's up. 2006-02-13 rocky * lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c: Use strncopy rather than strcpy in get_hwinfo. Make sure all strings have null byte at the end. 2006-02-12 rocky * lib/driver/image/nrg.c: Put in a much more stringent NRG image test. This means that for now we won't require the .NRG extension. 2006-02-12 rocky * test/testbincue.c: Add at least an attempt to call get_default_devices(). 2006-02-12 rocky * lib/driver/image/nrg.c: Fix bugs on accessing outside of string. Patch thanks to Diego 'Flameeyes' Petten. And he cleaned up and shortened the code too! 2006-02-12 rocky * configure.ac: Allow DragonFly which so far is exactly like FreeBSD. Guidance suggested and provided by Diego 'Flameeyes' Petten. 2006-02-10 rocky * include/cdio/cd_types.h: Change another set of #defines to an enum. 2006-02-10 rocky * lib/driver/cd_types.c, lib/driver/image/bincue.c: bincue.c: was using NRG default devices! cd_types.c: declare variable so we pick up debug info. 2006-02-09 rocky * example/C++/OO/drives.cpp, example/drives.c: Clean up code a little. 2006-02-02 rocky * src/cdda-player.c: Fix another bug in cdda-player? I think b_cd was there only for interactive use. 2006-02-02 rocky * example/udf2.c, include/cdio++/cdio.hpp, include/cdio/device.h, lib/driver/device.c, lib/driver/libcdio.sym: cdio_driver_return_code_to_str -> cdio_driver_errmsg 2006-02-01 rocky * NEWS: Go over. 2006-02-01 rocky * lib/driver/device.c, test/testparanoia.c: Fix bug in is_device when driver_id = DRIVER_UNKNOWN or DRIVER_DEVICE 2006-01-26 rocky * lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_private.h: Commit some of the temporary UDF stuff. It will either be completed or disabled later. 2006-01-25 rocky * src/cdda-player.c: Install a CDDB log handler. 2006-01-25 rocky * example/README: Add cdchange. 2006-01-25 rocky * example/C++/OO/device.cpp, example/C++/OO/drives.cpp, example/C++/OO/eject.cpp, include/cdio++/cdio.hpp, include/cdio++/device.hpp, include/cdio++/devices.hpp: Move the device routines which don't refer to an object private info (e.g. closign a tray) out of the Device class. 2006-01-25 rocky * include/cdio++/cdio.hpp, include/cdio++/devices.hpp: devices.hpp: Add default values on some parameters. cdio.hpp: Remove bogus class. 2006-01-25 rocky * example/C++/OO/.cvsignore, example/C++/OO/Makefile.am, example/C++/OO/drives.cpp: Add routine to show drives attached. Not really OO, but it is a little nicer than the corresponding C program. 2006-01-24 rocky * example/Makefile.am, example/README: Add cdchange program. 2006-01-24 rocky * example/cdchange.c: Allow parameter to specify seconds to wait. 2006-01-24 rocky * example/cdchange.c: Example to show media changed routine. 2006-01-23 rocky * doc/.cvsignore, doc/doxygen/html/.cvsignore: more lint. 2006-01-23 rocky * lib/driver/cdio_private.h, lib/driver/generic.h: Now check to see if we have config.h *AND* it hasn't been included before. 2006-01-23 rocky * include/cdio/read.h, include/cdio/types.h: LIBCDIO_CONFIG_H -> EXTERNAL_LIBCDIO_CONFIG_H so we don't get conflicting includes with the local config.h. 2006-01-23 rocky * include/cdio/read.h: Some small corrections to comments. 2006-01-23 rocky * lib/driver/cdio_private.h, lib/udf/udf_private.h: config.h now seems to get included. 2006-01-23 rocky * include/cdio/track.h: Move some more #defines into an enumeration. 2006-01-23 rocky * configure.ac: Probably this is the right way (or a better way?) to ensure derived scripts in test are made executable. 2006-01-22 rocky * example/tracks.c: We were assuming first_track is 1. It isn't always. 2006-01-21 rocky * NEWS, configure.ac, include/cdio/device.h, include/cdio/read.h, include/cdio/types.h: read.h needs Add it into cdio_config.h and include only once. Fixed based on observation and suggestion of Steve Schultz. 2006-01-21 rocky * lib/cdda_interface/test_interface.c: Note that this is not used and probably hasn't been in a while. 2006-01-21 rocky * test/testbincue.c: Add test of set blocksize and set speed. 2006-01-21 rocky * lib/driver/image/bincue.c: Had uninitialized set_speed and set_blocksize opts caused core dumps if called. 2006-01-18 rocky * include/cdio++/mmc.hpp, include/cdio++/read.hpp: Use exception handling. Set some default parameters like number of blocks=1. 2006-01-18 rocky * include/cdio++/device.hpp: Add a default value for drive parameter of CloseTray(). 2006-01-18 rocky * example/C++/OO/eject.cpp: Add close status message. Remove unneeded driver_id parameter. Fix a grammatical mistake. 2006-01-17 rocky * include/cdio/disc.h: Some typos. 2006-01-17 rocky * example/C++/OO/eject.cpp, include/cdio++/cdio.hpp, include/cdio++/device.hpp: Went the subclassed exception route (at the expense of lots of extra code and possibly extra maintenance). It will match the Python interface and it's I guess what Stroustrup recommends. 2006-01-15 rocky * example/C++/OO/eject.cpp, include/cdio++/cdio.hpp, include/cdio++/device.hpp: Convert routines in device.hpp into raising an exception rather than giving a return code. Sort of a test. More may follow. 2006-01-15 rocky * include/cdio/device.h, lib/driver/device.c, lib/driver/libcdio.sym: Add cdio_driver_return_code_to_str() to give a string interpretation of a driver return code. 2006-01-14 rocky * example/C++/eject.cpp, example/eject.c: Forgot to change (C) on that last change. 2006-01-14 rocky * example/C++/eject.cpp, example/eject.c: Add tests of opening/closing without specifying a drive. 2006-01-14 rocky * NEWS: What's up. 2006-01-14 rocky * lib/driver/device.c: Document behavior of cdio_open* and media_eject when no device given. 2006-01-14 rocky * include/cdio/device.h: Document behavior of eject and cdio_open* when no device is given. 2006-01-14 rocky * lib/iso9660/xa.c: Fix compiler error introduced by last enum change. 2006-01-14 rocky * lib/driver/device.c, lib/driver/image/nrg.c, lib/driver/image/nrg.h: More enumerations. *.c: add "debugger" enumeration variables. 2006-01-14 rocky * include/cdio/cdda.h, include/cdio/device.h, include/cdio/ecma_167.h, include/cdio/iso9660.h, include/cdio/read.h, include/cdio/rock.h, include/cdio/sector.h, include/cdio/track.h, include/cdio/udf.h, include/cdio/xa.h: Doxygen lint to change #define to \#define in comments. Add more enumerations. 2006-01-14 rocky * doc/doxygen/Doxyfile.in: Use ABBREVIATE_BRIEF setting used in another of my projects. 2006-01-14 rocky * lib/driver/image/nrg.h: Remove GCC 4 warning about ignored "packed". 2006-01-08 rocky * Makefile.am, largefile.m4: Go back to using standard autoconf-suppled AC_SYS_LARGEFILE 2006-01-06 rocky * doc/libcdio.texi: Smutz seems to get into file at the beginning. 2006-01-05 rocky * doc/how-to-make-a-release.txt: More explicit about directory location. 2006-01-05 rocky * lib/cdio++/stub.cpp: In C++ read.h needs . Don't know if this should be fixed here (where we could concievably check for HAVE_SYS_TYPES_H or in read.h (where it would be inde via cdio_config.h, but for now we'll do it this way. 2006-01-05 rocky * lib/paranoia/p_block.c: Using inline seems to cause a linking problem. Don't know exactly under what conditions or why, but "inline" isn't all that vital. 2006-01-05 rocky * configure.ac, largefile.m4: Add largefile support. For example ISO images over 2G. Problem and suggestion of where to look for a solution from Colossus. 2006-01-05 rocky * test/copying.right: Looks like FSF has changed their address. 2005-12-22 rocky * doc/libcdio.texi: Small typo iso-info->iso-read 2005-12-22 rocky * doc/glossary.texi: texi2html seems to have problems with @table @acronym so use @table @dfn. 2005-12-17 rocky * src/cd-paranoia/Makefile.am: We no longer use variable $(getopt_sources) 2005-11-29 rocky * include/cdio/device.h: #define mistake -- caught by SWIG, believe it or not. 2005-11-29 rocky * include/cdio++/Makefile.am: Forgot to include mmc.hpp 2005-11-14 rocky * example/C++/OO/mmc2.cpp: Add corresponding mmc2 OO C++ program. 2005-11-14 rocky * example/C++/OO/Makefile.am, example/C++/OO/cdtext.cpp, example/C++/OO/mmc1.cpp, example/C++/mmc1.cpp, example/mmc1.c, example/mmc2.c, include/cdio++/cdio.hpp, include/cdio++/mmc.hpp: Add C++ wrapper routines for MMC commands inside CdioDevice class. Some comments/code in sample programs gone over and new onse added for libcdio++. 2005-11-12 rocky * example/Makefile.am: Typo causing compilation failure on OSX. Thanks to Steve Schultz. 2005-11-11 rocky * src/cd-read.c: Use new read_sector routine. 2005-11-11 rocky * example/C++/OO/cdtext.cpp, example/C++/OO/device.cpp, example/C++/OO/eject.cpp, example/cdtext.c, example/device.c, example/eject.c, include/cdio++/Makefile.am, include/cdio++/cdio.hpp, include/cdio++/enum.hpp, include/cdio/cdtext.h, include/cdio/device.h: include/cdio++ Add pre- and post- increment/decrement operators for libcdio enums that it makes sense to iterate over. example/C++/OO/*: use these example/*: match up C and C++ programs better. 2005-11-10 rocky * example/.cvsignore, include/cdio++/.cvsignore, lib/udf/.cvsignore, test/.cvsignore: [no log message] 2005-11-10 rocky * example/C++/iso2.cpp, example/C++/iso3.cpp: Remove a couple of signed/unsigned comparisons. 2005-11-10 rocky * example/C++/OO/Makefile.am: automake Makefile for new C++ OO programs. 2005-11-10 rocky * configure.ac, example/C++/Makefile.am, example/C++/OO/.cvsignore, example/C++/OO/cdtext.cpp, example/C++/OO/device.cpp, example/C++/OO/eject.cpp, example/C++/OO/tracks.cpp, include/Makefile.am, include/cdio++/Makefile.am, include/cdio++/cdio.hpp, include/cdio++/cdtext.hpp, include/cdio++/device.hpp, include/cdio++/devices.hpp, include/cdio++/disc.hpp, include/cdio++/read.hpp, include/cdio++/track.hpp, lib/Makefile.am, lib/cdio++/.cvsignore, lib/cdio++/Makefile.am, lib/cdio++/stub.cpp: First cut at a C++ wrapper for libcdio libcdio++. What's not done are audio and MMC commands. No doubt it may be a little rough and I expect further changes. 2005-11-10 rocky * example/Makefile.am: Note more LIBCDIO dependencies for more programs. Pity automake doesn't handle this more automatically. 2005-11-10 rocky * example/Makefile.am: Add eject example program and the LIBCDIO_DEPS dependencies. 2005-11-10 rocky * example/tracks.c: Add C Preprocessor HAVE_SYS_TYPES_H test. 2005-11-10 rocky * example/iso1.c: Small comment change. 2005-11-10 rocky * include/cdio/cdtext.h, include/cdio/read.h, lib/driver/libcdio.sym, lib/driver/read.c: add read_sector{s} cdtext.h: Small typo. 2005-11-08 pjcreath * lib/paranoia/gap.c, lib/paranoia/paranoia.c: Documented silence matching 2005-11-07 pjcreath * lib/paranoia/gap.c, lib/paranoia/overlap.c, lib/paranoia/paranoia.c: Commented stage 2 extensively. 2005-11-07 pjcreath * lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: Cleaned up TRACE_PARANOIA and added some messages for the skip case. 2005-11-07 rocky * example/.cvsignore, example/C++/.cvsignore: Add eject 2005-11-07 rocky * lib/driver/libcdio.sym: Add cdio_eject_media_drive. 2005-11-07 rocky * example/C++/Makefile.am, example/C++/eject.cpp: C eject works as C++ too. Makefile.am: Add some of the dependency tracking. 2005-11-07 rocky * example/README: Update to list various programs. I'm having trouble keeping track of all them. 2005-11-07 rocky * example/README: Add eject.c. 2005-11-07 rocky * example/C++/iso2.cpp, example/eject.c, example/iso1.c, example/iso2.c, example/iso3.c, example/isofuzzy.c, include/cdio/cdio.h, include/cdio/device.h, lib/driver/device.c: Add interface to eject CD-ROM by device name. eject.c: new routine to test/show this. example/*.c iso2.cpp: Note in comment allowance of an optional argument. 2005-11-07 rocky * lib/driver/gnu_linux.c: Was giving a failure status on eject when it succeeded. The failure was because ioctl(fd, BLKRRPART) didn't succeed. Turn this into a cdio_info warning instead. 2005-11-06 rocky * include/cdio/device.h: Small typos. 2005-11-06 rocky * include/cdio/rock.h, lib/iso9660/rock.c: More separation between posix_mode_t and mode_t. 2005-11-06 rocky * include/cdio/udf.h: posix_mode_t -> mode_t 2005-11-06 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c: Return type of iso9660_get_posix_mode should be mode_t (the OS-specific version), not posix_mode_t (cdio's internally consistent version. 2005-11-06 rocky * include/cdio/udf_file.h: I think mode_t (not posix_mode_t) is correct here. The goal is to use in normal OS file operations. 2005-11-06 rocky * lib/udf/filemode.c: Need #include 2005-11-06 rocky * include/cdio/Makefile.am, include/cdio/ecma_167.h, include/cdio/iso9660.h, include/cdio/posix.h, include/cdio/rock.h, include/cdio/types.h, include/cdio/udf.h, include/cdio/udf_file.h, include/cdio/xa.h, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, lib/iso9660/libiso9660.sym, lib/iso9660/rock.c, lib/iso9660/xa.c: Break out POSIX-like definitions to posix.h Add ISO9660 routines to convert to mode_t Record whether XA or not in iso9660_stat_t. And other definition shifting around. 2005-11-04 rocky * src/cd-paranoia/Makefile.am: Patch from Steve Schultz @LIBGETOPT_LIB@ may have -l in it. 2005-11-04 rocky * example/udf2.c: Don't have udf_read_block yet... 2005-11-04 rocky * example/udf2.c: New test program for reading files. (Doesn't work yet.) 2005-11-02 rocky * include/cdio/udf_file.h, lib/udf/udf_file.c: A couple of corrections on udf_get_file_length(). 2005-11-02 rocky * example/udf1.c, include/cdio/udf_file.h, lib/udf/libudf.sym, lib/udf/udf_file.c, lib/udf/udf_fs.c: Add routine to get file length. Fix bug in retrieving dirent for root. Reduce overhead in udf_get_link_count() 2005-11-01 rocky * example/Makefile.am, example/udf1.c, include/cdio/udf.h, lib/udf/udf_file.c, lib/udf/udf_fs.c: udf_find_file -> udf_fopen and made closer to fopen(). It also simplifies things a little bit. Start testing. 2005-11-01 rocky * example/udf1.c, include/cdio/udf_file.h, lib/udf/udf_fs.c: Remove extraneous parameter on udf_opendir(). 2005-11-01 rocky * example/udf1.c, include/cdio/udf.h, include/cdio/udf_file.h, include/cdio/udf_time.h, lib/udf/libudf.sym, lib/udf/udf.c, lib/udf/udf_file.c, lib/udf/udf_fs.c, lib/udf/udf_private.h, lib/udf/udf_time.c: Rename some functions to be more like POSIX file reading, i.e. add udf_opendir() and udf_readdir(). udf_file_entry_t -> udf_dirent_t. 2005-10-30 rocky * src/iso-info.c: Remove small valgrind memory leak. 2005-10-30 rocky * example/udf1.c: Fix small valgrind leak. 2005-10-30 rocky * example/udf1.c, src/iso-info.c: udf1.c: Do better about dealing with recursive directories. iso-info.c: small variable name change 2005-10-30 rocky * example/iso2.c: Minor misspelling in comment. 2005-10-30 rocky * example/C++/iso2.cpp: Minor typographical misspellings in comment 2005-10-30 rocky * include/cdio/udf_time.h, lib/udf/udf_time.c: udf_times_to_stamp -> udf_timespec_to_stamp 2005-10-30 rocky * include/cdio/udf_file.h: Break off udf_file routines from udf.h 2005-10-30 rocky * example/udf1.c, include/cdio/Makefile.am, include/cdio/udf.h, lib/udf/Makefile.am, lib/udf/filemode.c, lib/udf/libudf.sym, lib/udf/udf.c, lib/udf/udf_file.c: Break of file routines into udf_file.{c,h} udf1: Add link count 2005-10-30 rocky * lib/udf/udf_time.c: Replace some numbers with enum "constants". 2005-10-30 rocky * example/udf1.c, include/cdio/ecma_167.h, include/cdio/udf.h, lib/udf/Makefile.am, lib/udf/filemode.c, lib/udf/libudf.sym, lib/udf/udf.c: Fill out file modes better and clean up interface more by trying to funnel into POSIX file mode_t. FIXME: something needs to be done to merge ISO9660 interfaces and UDF and probably the right thing is to make it look like POSIX. Would be nice if there were a library e.g. from GNU fileutils I could use to help. 2005-10-29 rocky * example/udf1.c, lib/udf/udf.c: Fill out posix attributes a little. Add directory listing to output. 2005-10-29 rocky * include/cdio/udf.h, lib/udf/libudf.sym, lib/udf/udf.c: Add more access functions. 2005-10-29 rocky * include/cdio/ecma_167.h: OS/X's linker does not permit common symbols in shared libs. 2005-10-28 rocky * lib/driver/MSWindows/win32.c: Use MMC routine for reading data blocks. At least on XP home, it seems to work better than generic read which is a cooked read. 2005-10-27 rocky * parse/toc.L: Lex/Flex cdrdao TOC scanner 2005-10-27 rocky * include/cdio/ecma_167.h, include/cdio/udf.h, include/cdio/udf_time.h, lib/udf/libudf.sym, lib/udf/udf.c, lib/udf/udf_fs.c, lib/udf/udf_time.c: More documentation of ecma 167. Some fields changed names. More #defines removed/replaced by enum type and variables. 2005-10-27 rocky * configure.ac: Need to move long timezone test lower for Cygwin 2005-10-27 rocky * configure.ac, lib/udf/udf_time.c: Attempt to deal with OS's (like BSDI) that don't have an extern long timezone. 2005-10-27 rocky * configure.ac, lib/udf/udf_private.h, lib/udf/udf_time.c: Changes to make work on Cygwin. However probably need a more general test for timezone being extern long. 2005-10-27 rocky * example/udf1.c, include/cdio/udf.h, lib/udf/libudf.sym, lib/udf/udf.c, lib/udf/udf_fs.c: File entry update fixed on udf_get_next(). More access functions added to return a UDF file entry and to interpret a permission string. 2005-10-26 rocky * include/cdio/track.h: Typo. 2005-10-26 rocky * example/udf1.c, include/cdio/Makefile.am, include/cdio/udf.h, include/cdio/udf_time.h, lib/udf/Makefile.am, lib/udf/libudf.sym, lib/udf/udf_fs.c, lib/udf/udf_private.h, lib/udf/udf_time.c: Add some UDF time routines and time-conversion routines. Note: udf_get_next() needs to advance file entry info 2005-10-25 pjcreath * configure.ac, example/Makefile.am, src/cd-paranoia/Makefile.am: Fixed Darwin builds broken by dependency tracking. 2005-10-25 rocky * example/udf1.c: libiso9660 -> libudf 2005-10-25 rocky * example/udf1.c, include/cdio/udf.h, lib/udf/udf_fs.c: Add routine to get volumeset id 2005-10-25 rocky * README.libcdio: Much needed revision. 2005-10-25 rocky * README: We *are* now adding UDF support. 2005-10-25 rocky * example/udf1.c, include/cdio/ecma_167.h, include/cdio/udf.h, lib/udf/libudf.sym, lib/udf/udf_fs.c: Add silly volume identifier. More #defines removed in favor of enums. 2005-10-25 rocky * example/udf1.c, lib/udf/udf_fs.c: Remove memory leak and invalid write references thanks to valgrind. Now lists all files correctly - at least in the absence of directories under /. 2005-10-24 pjcreath * lib/paranoia/p_block.c, lib/paranoia/paranoia.c, src/cd-paranoia/cd-paranoia.c: Added TRACE_PARANOIA, which differs from cdparanoia's NOISY compile-time flag in that it's designed to help someone understand how cdparanoia works, rather than troubleshoot. Setting TRACE_PARANOIA to 1 traces stage 1, 2 trace stage 2, and 3 traces both (and is extremely verbose). Additionally, committed a tentative bugfix to paranoia itself, which was causing the libcdio test case to break. If it introduces unexpected behavior, it should be backed out. So far it seems to fix all test cases. 2005-10-24 rocky * example/udf1.c, include/cdio/udf.h, lib/udf/Makefile.am, lib/udf/libudf.sym, lib/udf/udf.c, lib/udf/udf_fs.c, lib/udf/udf_private.h: UDF file is now opaque. Access routines then added. Note: there are valgrind and free() errors that need going over. 2005-10-24 rocky * lib/udf/libudf.sym: List more of the external routines (udf_get_next, udf_get_sub) 2005-10-24 rocky * lib/udf/.cvsignore: Ignore the usual. 2005-10-24 rocky * .cvsignore: Now have a libudf.pc 2005-10-24 rocky * lib/udf/Makefile.am: Makefile.am for libudf 2005-10-24 rocky * configure.ac, example/.cvsignore, example/Makefile.am, example/udf1.c, include/cdio/ecma_167.h, include/cdio/udf.h, lib/Makefile.am, lib/udf/udf_fs.c: First inkling of code for UDF support. 2005-10-24 rocky * src/cd-paranoia/cd-paranoia.c: MinGW tolerance. Patches based on those by Eric Lunchpail 2005-10-24 rocky * src/cd-info.c: Follow 0.76 (and below) behaviour: we don't require a device to explicitly be given. 2005-10-23 rocky * configure.ac: Add tests for gettimeofday(), {sete,get}{u,g}id() More of the UDF library code mechanism put in. 2005-10-23 rocky * lib/paranoia/paranoia.c: Remove a #define we don't need. 2005-10-23 rocky * lib/cdda_interface/low_interface.h: Remove references to external (SCSI) routines that don't in fact exist. 2005-10-23 rocky * lib/cdda_interface/cddap_interface.c: Patch by Erik Lunchpail to accommodate systems (e.g. MinGW) that don't have drand48 but have rand. 2005-10-21 rocky * lib/udf/libudf.sym: Start list of external symbols for Nicholas. 2005-10-21 rocky * include/cdio/ecma_167.h, include/cdio/udf.h: udf.h: Mostly add a couple more routines and more fields in udf_file_t ecma_167.h: more udf_ prefixes, add extern debugger symbols. 2005-10-21 rocky * lib/udf/udf_fs.c: Start some UDF routines. Very preliminary. 2005-10-21 rocky * include/cdio/iso9660.h: Minor comment change. 2005-10-21 rocky * include/cdio/iso9660.h: Remove some #defines covered by enums. 2005-10-21 rocky * include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c: Turn one more set of #define into an enum 2005-10-21 rocky * include/cdio/mmc.h, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h: Try to regularize naming better. More mmc_ -> cdio_mmc_ Add more debug variables to be able to get at enum values in a debugger. 2005-10-20 rocky * autogen.sh: Add --include-deps based on a suggestion by Burkhard Plaum. 2005-10-19 rocky * include/cdio/udf.h: Redo UDF_BLOCKSIZE so we can use symbol in debugging. 2005-10-19 rocky * include/cdio/ecma_167.h, include/cdio/udf.h: More changes based on use. 2005-10-19 rocky * include/cdio/ecma_167.h: Add udf_fileid_desc_t: were getting closer to being able to deal with files now. Add remaining udf_ prefixes extent_ad_{s,t} and lb_addr_{s,t} 2005-10-19 rocky * include/cdio/udf.h: Add udf_close(). udf_seek_read() renamed to udf_read_sectors(). First (lame) attempt to define UDF file entry structure. 2005-10-18 rocky * include/cdio/ecma_167.h: Typo. 2005-10-18 rocky * include/cdio/ecma_167.h: Add udf_ to another type (udf_icbtag) 2005-10-18 rocky * include/cdio/ecma_167.h: More changes based on use. 2005-10-18 rocky * src/cd-paranoia/Makefile.am: Not sure if this commit is correct and/or why it should be needed (if it is correct). We note a dependencies between cd-paranoia and its libraries. Section 7.4 "Program and Library Variables" of the automake 1.9.5 manual says: If `_DEPENDENCIES' is not supplied, it is computed by Automake. The automatically-assigned value is the contents of `_LDADD' or `_LIBADD', with most configure substitutions, `-l', `-L', `-dlopen' and `-dlpreopen' options removed. The configure substitutions that are left in are only `$(LIBOBJS)' and `$(ALLOCA)'; these are left because it is known that they will not cause an invalid value for `_DEPENDENCIES' to be generated. 2005-10-17 rocky * lib/iso9660/libiso9660.sym: Allow folks to refer to and use ISO_STANDARD_ID 2005-10-17 pjcreath * lib/paranoia/isort.h: Added comments to the sort_info_t macros, including the scary pointer arithmetic that makes ipos() tick. 2005-10-17 pjcreath * lib/paranoia/paranoia.c: Extensively commented cdparanoia's stage 1 matching. No code changes apart from added white space for improved readability. Comments containing "???" suggest areas for further study and documentation. 2005-10-17 pjcreath * test/check_paranoia.sh.in: Changed the underrun+jitter test to use small jitter, since medium jitter is now broken. The test should be returned to its former rigor (if not better) once we squash the medium jitter bug. 2005-10-17 rocky * include/cdio/ecma_167.h: Add a couple more udf_ prefixes to some types. 2005-10-17 rocky * include/cdio/ecma_167.h: Add constants for some string #defines. 2005-10-17 rocky * libudf.pc.in: Standard dance for pkg-config and libudf. 2005-10-17 rocky * NEWS: What's shaken. 2005-10-17 rocky * include/cdio/ecma_167.h: Shortten some field names, add udf_ prefixes to aid with namespace problem; turn logical volume descriptor content use into something more usable. 2005-10-17 rocky * src/cdda-player.c: artist field was clobbering author field in list. Uninitialized title/artist data cause core dumps. 2005-10-16 rocky * src/Makefile.am: One more libgetopt for BSD from Steve Schultz. 2005-10-16 rocky * include/cdio/ecma_167.h: Datatypes closer to matching terms used in ECMA 167 spec. Combine/remove duplicate tag identifier definitions. 2005-10-16 rocky * configure.ac, src/Makefile.am, src/cd-paranoia/Makefile.am: BSDI needs to test for libgnugetopt. Patch from Steven Schultz 2005-10-15 rocky * lib/paranoia/isort.c, lib/paranoia/isort.h: Analysis and comments courtesy of Peter J. Creath, again. (I believe this will be the last commit I'll make on his behalf.) 2005-10-14 rocky * include/cdio/paranoia.h, lib/paranoia/paranoia.c: Minor formatting changes. 2005-10-14 rocky * lib/paranoia/paranoia.c: Many informative comments courtesy of Peter J. Creath. External accessible routines renamed to their libcdio name. 2005-10-14 rocky * include/cdio/paranoia.h: Revise as per analysis of Peter J. Creath. 2005-10-13 rocky * include/cdio/ecma_167.h, include/cdio/udf.h: ecma_167.h: doxygen description changes a little. udf.h: First external function added. 2005-10-13 rocky * include/cdio/Makefile.am, include/cdio/ecma_167.h: ecma_167.h: shorten some tags based on use Makefile.am: add udf.h - Oops that file will be added in the next commit. 2005-10-13 rocky * include/cdio/ecma_167.h: Already 1st slight improvement: move #include after test if we've been included before. 2005-10-13 rocky * include/cdio/ecma_167.h: The top-level interface header for libudf: the UDF library; applications include this. First file checked in towards UDF support! (Admittedly not very exciting.) 2005-10-12 rocky * include/cdio/cdda.h, include/cdio/iso9660.h: Fix some typos. 2005-10-12 rocky * lib/iso9660/iso9660_fs.c: pathname ->psz_name 2005-10-08 rocky * lib/paranoia/isort.c, lib/paranoia/isort.h, lib/paranoia/paranoia.c, libpopt.m4: libpopt no longer use sort_link -> sort_link_t. 2005-10-07 rocky * src/cd-paranoia/cd-paranoia.c: Let compiler figure out size of dispcache. 2005-10-07 rocky * lib/driver/read.c: All multiple-block reading routines now return success when asked to read 0 blocks and the lsn's are valid. Idea suggested by Peter J. Creath. 2005-10-07 rocky * lib/driver/read.c: Two patches from Peter J. Creath Fix bug in handling arithmetic with unsigned numbers Return success if reading 0 audio blocks. 2005-10-06 rocky * src/cd-read.help2man: Fill in manual page more. 2005-10-06 rocky * src/Makefile.am, src/cd-drive.help2man, src/cd-info.help2man, src/iso-info.help2man, src/iso-read.help2man: Add AUTHOR field to help2man's 2005-10-06 rocky * src/cd-read.c, src/iso-read.c: More stdout->stderr and exit(EXIT_INFO) on help. 2005-10-06 rocky * src/Makefile.am, src/cd-drive.c, src/cd-drive.help2man, src/cd-info.c, src/cd-info.help2man, src/iso-info.c, src/iso-info.help2man, src/util.c, src/util.h: Improve manual pages. * help output needs to be to stdout not stderr for help2man (*.c,*.h) * Add EXIT_INFO return code. (*.c,*.h) * Start filling out man pages, e.g. add SEE ALSO. *.help2man * Remove non-existent reference to Info pages Makefile.am 2005-10-06 rocky * example/C++/Makefile.am: Was building paranoia programs when --without-cd-paranoia was given. 2005-10-05 rocky * NEWS: What's just gone on. 2005-10-05 rocky * MSVC/cd-info.vcproj, Makefile.am, THANKS, configure.ac, lib/driver/osx.c, src/Makefile.am, src/cd-drive.c, src/cd-info.c, src/cd-paranoia/Makefile.am, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/getopt.c, src/cd-paranoia/getopt.h, src/cd-paranoia/getopt1.c, src/cd-read.c, src/iso-info.c, src/iso-read.c, src/util.h: Remove libpopt. cd-drive, cd-info: some source option bug fixes osx.c: bug in duplicate free in add-device Patches and bug fixes courtesy Peter J. Creath 2005-10-05 rocky * lib/paranoia/paranoia.c: Just a little more clear about the enum/#define thing. 2005-10-05 rocky * lib/paranoia/paranoia.c: Use #defines (and enums for debugging) for paranoia read flags. Patch from Peter J. Creath. 2005-10-04 rocky * include/cdio/rock.h, lib/iso9660/rock.c: Some provision for handling Rock-Ridge device numbers. 2005-10-04 rocky * lib/cdda_interface/interface.c, lib/paranoia/paranoia.c: Remove the comments about the bug that was just addressed. Thanks again to Peter J. Creath 2005-10-03 rocky * lib/cdda_interface/cddap_interface.c, lib/paranoia/paranoia.c: Bug fix in overallocated analyzed and fixed courtesy of Peter J. Creath 2005-09-30 rocky * configure.ac: Add doxygen file identification to cdio/cdio_config.h. 2005-09-30 rocky * configure.ac: Add darwin8* to list - thanks to Peter J. Creath; Oh, and we are iIn version 0.77cvs now 2005-09-30 rocky * lib/driver/osx.c: Remove double free of str_bsd_path. Thanks to Peter J. Creath for finding/fixing. 2005-09-24 rocky * doc/how-to-make-a-release.txt: Wrong directory - ouch. 2005-09-23 rocky * NEWS, configure.ac: Final preparation for 0.76 release. 2005-09-22 rocky * NEWS: Release date. 2005-09-22 rocky * libcdio_cdda.pc.in: Reinstate -lm in libcdio_cdda.pc 2005-09-22 rocky * libiso9660.pc.in: Needs libcdio library. 2005-09-22 rocky * libcdio_cdda.pc.in, libcdio_paranoia.pc.in: libcdio_paranoia and libcdio_cdda need to include libcdio 2005-09-22 rocky * libcdio_cdda.pc.in: Remove potential -lm as it should be linked in to the library now. 2005-09-21 nboullis * lib/cdda_interface/Makefile.am: Link libcdio_cdda with libm as needed for cos and sin. 2005-09-21 rocky * example/C++/paranoia.cpp, example/paranoia.c, include/cdio/cdda.h, include/cdio/paranoia.h, test/testparanoia.c: Move lower-level cdrom_drive_t from paranoia.h into cdda.h This may cause some incompatibilty in applications that did #include without #include As of now it's okay to just #include or include both, but #includ'ing only will be a problem. 2005-09-21 rocky * NEWS, configure.ac, libcdio_cdda.pc.in: Add -lm in libcdio_cdda where it's needed. 2005-09-20 nboullis * lib/paranoia/Makefile.am: Fix the version of symbols in the libcdio_paranoia library. 2005-09-20 rocky * lib/cdda_interface/Makefile.am: Wrong name. 2005-09-20 rocky * lib/paranoia/Makefile.am: Wrong name. 2005-09-20 rocky * NEWS, example/.cvsignore, example/C++/.cvsignore, lib/cdda_interface/Makefile.am, lib/cdda_interface/libcdio_cdda.sym, lib/iso9660/Makefile.am, lib/iso9660/iso9660.c, lib/paranoia/Makefile.am, lib/paranoia/libcdio_paranoia.sym, lib/paranoia/p_block.c, lib/paranoia/p_block.h: Add --with-versioned-libs for libcdio_paranioa and libcdio_cdda Remove use of "new" even in private C parts. Changes and patch from Nicholas Boullis. 2005-09-18 rocky * NEWS: [no log message] 2005-09-18 rocky * src/cd-info.c, src/cd-read.c: The type of (option) opt needs to be int not char and this is noticeable on ppc where char is unsigned by default. Furthermore, poptGetNextOpt() returns an int, not a char. Bug noticed and patch all thanks to Nicolas Boullis. 2005-09-18 rocky * configure.ac: Change needed for building cdda-player: -lcdrom needs to come after -ldvd Problem determination and patch all from Steve Schultz. Thanks! 2005-09-17 rocky * NEWS, include/cdio/types.h, lib/cdda_interface/Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am: include only if not C++. 2005-09-17 rocky * configure.ac: disable cdda_player if lib curses test fails. Previous position of test was faulty. 2005-09-17 rocky * NEWS: Allow building cd-paranoia if Perl is not installed. 2005-09-17 rocky * configure.ac: Change of heart. Stay with CVS until right up until release. 2005-09-17 rocky * configure.ac, src/cd-paranoia/Makefile.am, src/cd-paranoia/usage-copy.h: Allow building cd-paranoia even if Perl isn't installed. (Sad in this day and age one still can't assume Perl.) 2005-09-16 rocky * configure.ac, example/C++/Makefile.am, example/Makefile.am: configure.ac: make it explicit that --without-cd-paranoia also means without the library If --without-cd-paranoia don't try to build paranoia programs in example and example/C++. Thanks to Elio Blanca for reporting the problems. 2005-09-15 rocky * NEWS: [no log message] 2005-09-15 rocky * configure.ac, example/Makefile.am, include/cdio/rock.h, lib/iso9660/Makefile.am, lib/iso9660/iso9660_fs.c, src/cd-info.c, src/cdda-player.c, src/cddb.c, src/util.c, test/check_cue.sh.in, test/check_iso.sh.in: Add option to disable Rock-Ridge support --disable-rock Add IS_ISSOCK() or S_ISLNK() macros for Rock-Ridge when environment doesn't have it, e.g. MSYS 1.0.10 with MinGW 3.4.2. Go over --enable settings. --disable-cpp-progs now works. Require libcddb 1.0.1 or better 2005-09-09 rocky * NEWS: What's new in 0.76 2005-09-09 rocky * THANKS: Add Diego 'Flameeyes' Petten 2005-08-28 rocky * lib/driver/MSWindows/aspi32.c: Remove warning: "use of cast expressions as lvalues is deprecated" Reports have it that gcc 4 doesn't tolerate this. 2005-08-27 rocky * example/paranoia.c, example/paranoia2.c: cosmetic: remove extraneous space at end of file. 2005-08-27 rocky * example/C++/Makefile.am, example/C++/paranoia.cpp, example/C++/paranoia2.cpp: Add C++ versions of paranoia.c and paranioa2.c 2005-08-27 rocky * lib/cdda_interface/scan_devices.c: Get device name if none supplied in cdio_cddap_indentify. Check for more error conditions and update doc to reflect that the error return is NULL. 2005-08-27 rocky * include/cdio/cdda.h, include/cdio/rock.h, include/cdio/xa.h: Make C++ compatible. 2005-07-23 rocky * lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c: Some small type and variable name changes. 2005-07-23 rocky * lib/driver/gnu_linux.c: Ooops -- syntax error. 2005-07-23 rocky * lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/gnu_linux.c: Doc changes. 2005-07-23 rocky * lib/driver/FreeBSD/freebsd_ioctl.c: Patch from Diego 'Flameeyes' Petten to eject_media_freebsd_ioctl(): Allegedly this works better than the CAM mode eject; CAM gets the error "Device not ready" when trying to eject an empty CD-ROM drive. We make use of an already open file descriptor to the CD-ROM instead of opening a new one (else we have two file descriptor open, so when it launch the ioctl() to eject the device it results busy because of the other fd). Also corrects the documentation comment about the return value. 2005-07-15 rocky * configure.ac: Open season for changes. Now in 0.76cvs land 2005-07-15 rocky * example/C++/.cvsignore: [no log message] 2005-07-15 rocky * example/C++/Makefile.am, example/C++/device.cpp: "Port" device.c into C++. 2005-07-11 rocky * NEWS: Add release date for 0.75 2005-07-11 rocky * configure.ac: Get ready for 0.75 release. 2005-07-11 rocky * TODO: Reorder and revise 2005-07-11 rocky * doc/libcdio.texi: Note libcdio_paranoia and libcdio_cdda. 2005-07-10 rocky * README: Small typos. 2005-07-10 rocky * README: Note existence and libcdio use in gmerlin and mplayerxp. 2005-07-09 rocky * NEWS: Add libcddb and cd-paranoia changes. 2005-07-09 rocky * src/cdda-player.c, src/cddb.c: Changes for libcddb 1.1.0 API change. Thanks to Chris Clayton for the patch. 2005-07-09 rocky * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: Now check that integer arguments are integers and are within range. Fixes to --mmc-timeout (-m) option. Put optstring in alphabetic order. 2005-07-07 rocky * example/tracks.c: Correct uninitialized variable caught by gcc 4 2005-07-07 rocky * lib/driver/Makefile.am: Conservative setting for library. 2005-07-07 rocky * lib/driver/gnu_linux.c: Remove gcc 4 warning 2005-07-07 rocky * NEWS: remove gcc 4.0 warnings 2005-07-07 rocky * lib/driver/image/nrg.c: Correct test caught by gcc 4.0 2005-07-07 rocky * lib/paranoia/paranoia.c: Remove gcc 4 warnings 2005-07-03 rocky * src/cd-info.c: Make compilation without CDDB work. 2005-07-02 rocky * NEWS: Note mmc and cd-paranoia timeout changes 2005-06-28 rocky * src/cd-info.c: CDDB errors should not terminate cd-info. 2005-06-26 rocky * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: cd-paranoia: Add option --mmc-timeout (-m) to set MMC timeout. 2005-06-26 rocky * NEWS, include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c: Allow the MMC timeout to be adjusted by the application. 2005-06-25 rocky * lib/driver/Makefile.am: Patch to make --disable-shared and --enable-static work with --with-versioned-libs 2005-06-25 rocky * NEWS: update 2005-06-11 rocky * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: Attempt getting audio port volume levels. 2005-06-08 rocky * src/cd-info.c, test/testdefault.c: Remove more valgrind-caught erroneous free()'s. 2005-06-08 rocky * lib/driver/image/cdrdao.c, lib/driver/image/nrg.c: Remove a couple more valgrind-caught memory leaks 2005-06-08 rocky * lib/driver/image/nrg.c: Remove valgrind-caught invalid memory reference. 2005-06-07 rocky * lib/driver/gnu_linux.c: Remove a valgrind-caught memory leak. 2005-06-07 rocky * lib/iso9660/iso9660_fs.c: A couple of flawfinder errors. Use sizeof instead of strlen. Fold strncat into preceding snprintf. 2005-05-16 rocky * configure.ac: Now in 0.75cvs land. 2005-05-16 rocky * lib/driver/_cdio_generic.c: Bug in getting CD-Text make sure TOC is read before trying to get CD-Text info. Problem reported by Christian Moser. 2005-05-13 rocky * example/audio.c: Remove warning that this may be uninitialized. 2005-05-13 rocky * NEWS: It's Friday the 13th! 2005-05-13 rocky * configure.ac: Get ready for 0.74 Release. 2005-05-09 rocky * lib/driver/FreeBSD/freebsd.c: Heiner reports that FreeBSD's passopen() and xptopen() don't allow nonblocking access so O_NONBLOCK might do harm. But it's just a guess pending what others discover/report. 2005-05-09 rocky * lib/driver/bsdi.c: Add O_NONBLOCK on sms's recommendation 2005-05-08 rocky * lib/driver/FreeBSD/freebsd_cam.c: Hopefully a better error message on a transport failed. 2005-05-08 rocky * lib/driver/FreeBSD/freebsd.c: cdio_generic_init interface parameter added. Noticed by Heiner. 2005-05-08 rocky * THANKS: Add Burkhard Plaum 2005-05-08 rocky * NEWS: What's up with 0.74 Add dates of releases and CVS ID line. 2005-05-07 rocky * lib/driver/FreeBSD/freebsd.c: Was converting in the wrong direction. 2005-04-30 rocky * src/cd-drive.c: One more small change. 2005-04-30 rocky * src/cd-drive.c: Try again. 2005-04-30 rocky * src/cd-drive.c: Show MMC level for single drive queries too. 2005-04-30 rocky * example/Makefile.am, include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c, src/cd-drive.c: Add routine to report MMC capabilities of a drive. Add that to the cd-drive program. 2005-04-30 rocky * include/cdio/cdda.h, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: Simplify endian determination - thanks to suggestions of Steve Schultz Remove recently added field is_scsi which isn't in cdparanoia 2005-04-30 rocky * example/Makefile.am, test/Makefile.am: Comment typo. 2005-04-28 rocky * configure.ac: We really should be in 0.74cvs by now. 2005-04-28 rocky * include/cdio/cdda.h, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: An ATAPI drive (_NEC , DVD_RW ND-3520A, 1.04, SCSI CD-ROM) was getting set as big endian although it appeared not to, possibly because of SCSI emulation. We now test for SCSIness in addition to ATAPIness as both can occur. Added field in cdrom_device structure for SCSIness and that's tested before unconditionally setting drive bigendian-ness. 2005-04-27 rocky * doc/glossary.texi, include/cdio/util.h: glossary.texi: CDTEXT -> CD Text util.h: allow getting larger sector count sizes. CD's new 900MB could exceed 16-bits. 2005-04-25 rocky * include/cdio/cdtext.h, lib/driver/cdtext.c, lib/driver/libcdio.sym: From Burkhard Plaum: 1. Fix a crash, which happened when cdtext_get() was called for an emtp= y (i.e. NULL) field. 2. Add another function cdtext_get_const(), which returns a const point= er and avoids too much strcpying (apps may want only to TEST if a field is present or have their own string management routines). 2005-04-23 rocky * lib/driver/_cdio_generic.c, lib/driver/generic.h, lib/driver/gnu_linux.c, lib/driver/osx.c, lib/driver/solaris.c: Patch from Burkhard Plaum: 1. In the function is_cdrom_linux(...) in the file lib/driver/gnu_linux.c, the CDROMREADTOCHDR ioctl gets called, which fails when the drive is empty. The CDROM_GET_CAPABILITY ioctl always succeeds for CDrom drives and fails for hard disks etc. 2. For some reason, at least my (GNU/Linux 2.6.10) Kernel fails to open empty drives, when only O_RDONLY is used. Changing the open flag to O_RDONLY|O_NONBLOCK, the call succeeds also for empty drives. By the way, the cdrom header file in the kernel says explicitly, that O_RDONLY|O_NONBLOCK should used whenever a cdrom is touched. rocky: also made a change to eject to continue even if we can't get the drive status -- which we can't with an empty CD-ROM drive. 2005-04-22 rocky * configure.ac: Another autoconf bug. I hate autoconf. 2005-04-22 rocky * configure.ac: Testing wrong variable in showing whether paranoia is set to be built. 2005-04-22 rocky * configure.ac: Order of ncurses/curses headers should match order of ncurses/curses library? 2005-04-22 rocky * configure.ac, src/cdda-player.c: Add test to see if curses has keypad(). May break on Solaris - we'll see. Fix from discussion with Steve Schultz 2005-04-21 rocky * src/cd-paranoia/cd-paranoia.c: Ooops. Remove duplicate free 2005-04-18 rocky * doc/libcdio.texi: Remove free() that is no longer needed. Also correct/add C++ names of example programs. 2005-04-17 rocky * src/cdda-player.c: Wasn't allowing last track to get played. 2005-04-16 rocky * src/.cvsignore: Add cdda-player binary 2005-04-15 rocky * NEWS: Get ready for 0.73 release. 2005-04-15 rocky * lib/iso9660/iso9660_fs.c: Fix bug if we don't have Joliet around. 2005-04-14 rocky * lib/driver/FreeBSD/freebsd.c: Remove unused variable. 2005-04-14 rocky * lib/driver/FreeBSD/freebsd.c: gcc 2.95 compatibility - decls before statements. 2005-04-14 rocky * configure.ac: Get ready for 0.73 release. 2005-04-11 rocky * test/Makefile.am: Seems to force executable shell better. 2005-04-11 rocky * test/check_cue.sh.in, test/check_fuzzyiso.sh, test/check_nrg.sh.in, test/check_paranoia.sh.in: Changes to make Solaris /bin/sh regression test work. 2005-04-11 rocky * example/audio.c, example/drives.c, example/paranoia.c, example/paranoia2.c, src/cd-drive.c, src/cdda-player.c: Misc memory issues 2005-04-11 rocky * NEWS, lib/driver/device.c, test/testparanoia.c: testparanoia.c: free() moved inside library where it belongs. others: trivial changes. 2005-04-11 rocky * src/cd-info.c: Small output format change. 2005-04-11 rocky * src/cd-info.c: Free libcddb regexp memory. 2005-04-11 rocky * lib/driver/device.c: trivial format change. 2005-04-11 rocky * lib/driver/device.c: More memory management stuff. 2005-04-10 rocky * src/cdda-player.c: Another valgrind-caught leak. 2005-04-10 rocky * lib/driver/device.c: Correct FreeBSD table initialization. Chalk another up for valgrind. Fix memory leak in cdio_free_device_list(). 2005-04-09 rocky * lib/driver/image/cdrdao.c: Small valgrind-caught memory leak. 2005-04-05 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/device.c: FreeBSD audio control patches from Heiner. 2005-03-31 rocky * src/cdda-player.c: Implement -l (list tracks). 2005-03-29 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/gnu_linux.c: freebsd.c: forgot initialization. correct one of the doxygen comments. 2005-03-29 rocky * lib/driver/Makefile.am, lib/iso9660/Makefile.am: Set libraries for revision before release. Interfaces in libcdio and iso9660 have been added so bump, current (and set revision and age 0). 2005-03-23 rocky * src/cdda-player.c: Don't know why cd_close was in play_track(). 2005-03-23 rocky * src/cdda-player.c: Remove compiler warning about uninitialized variable. 2005-03-23 rocky * lib/driver/bsdi.c, lib/driver/cdio_private.h: Remove internal "close_tray" function as this is external only. Now that close_tray is done right the prototype can be like the others. 2005-03-23 rocky * lib/driver/cdtext.c, lib/driver/cdtext_private.h, lib/driver/mmc.c: loop over cdtext using length reported back by MMC TOC command. Test sequence number only for valid blocks. cdtext_private.h: add enumeration to facilitate debugging cdtext.c: On Windows CD-Text was off by 4. Hack for this. 2005-03-22 rocky * src/cdda-player.c: Make expression more explicit. Warning on gcc 2.95 looks like a miscompile. 2005-03-22 rocky * src/cdda-player.c: Fix up return code status in close tray. 2005-03-22 rocky * lib/driver/bsdi.c: Pass back return code on command. 2005-03-22 rocky * lib/driver/bsdi.c, lib/driver/device.c: Fix up BSDI code for closing tray. All the hard work really due to Steve Schultz. 2005-03-22 rocky * src/cdda-player.c: Ability to toggle list display mode. 2005-03-21 rocky * include/cdio/types.h: Note BCDness of msf_t 2005-03-21 rocky * doc/glossary.texi, doc/libcdio.texi: Add info on: cdda-player, Rock Ridge Extensions. Note our MSF structure peculiarity. Remove remark that we don't support audio controls - we now do. Other miscellaneous revisions too. 2005-03-21 rocky * include/cdio/audio.h, include/cdio/device.h, include/cdio/mmc.h, include/cdio/read.h: Doxygen lint corrections. 2005-03-21 rocky * src/cdda-player.c: Some small changes to update list when track changes. Probably a lot more could be done in terms of having multiple disc views. 2005-03-21 rocky * lib/driver/MSWindows/win32_ioctl.c: Not sure why we set the loglevel to debug before a DVD STRUCT PHYSICAL. Remove it. 2005-03-21 rocky * lib/driver/bsdi.c: Keep up to date with recent changes in audio subchannel msf. 2005-03-21 rocky * lib/driver/FreeBSD/freebsd.c: Typo in field name. Thanks again to Steve Schultz. 2005-03-19 rocky * src/cdda-player.c: Small change to make currently playing track stand out more. 2005-03-19 rocky * src/cdda-player.c: Make sure reading non-interactive subchannel doesn't interfere with playing. 2005-03-19 rocky * lib/driver/solaris.c: Revise subchannel so solaris subchannel is libcdio msf. 2005-03-19 rocky * example/audio.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/bsdi.c, lib/driver/gnu_linux.c, lib/driver/mmc.c, src/cdda-player.c: Revise so audio subchannel msf is msf_t (BCD encoded). 2005-03-19 rocky * configure.ac: Horrible hack until I can figure out how to generate cdio/cdio_config.h correctly. 2005-03-19 rocky * lib/driver/bsdi.c, lib/driver/device.c: Remove gcc 2.95 warnings on BSDI 2005-03-19 rocky * configure.ac, example/audio.c, include/cdio/.cvsignore, include/cdio/Makefile.am, include/cdio/audio.h, include/cdio/types.h, lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/bsdi.c, lib/driver/mmc.c, src/cd-info.c, src/cdda-player.c: Revise audio subchannel structure to remove lba uniion since we don't support returning LBA's inside the structure. include/types.h: use cdio_config.h if none was supplied. 2005-03-18 rocky * lib/driver/bsdi.c: audio absolute relative frame on BSDI addressed. 2005-03-18 rocky * lib/driver/bsdi.c, lib/driver/cdio_private.h: BSDI eject works, more audio stuff working. 2005-03-18 rocky * src/cdda-player.c: Initialize volume_level to squelch compiler warning 2005-03-18 rocky * NEWS: [no log message] 2005-03-18 rocky * lib/driver/_cdio_stream.c, lib/driver/read.c, src/cd-drive.c, src/cd-info.c, src/iso-info.c: src/* gl_default_log_handler defined only once. lib/driver/*.c: looks to me like a cosmetic change but supposedly it helps on Fedora Core 4 test1 Bug # 12363: See: http://savannah.gnu.org/bugs/?func=detailitem&item_id=12363 2005-03-18 rocky * include/cdio/types.h: Apparently some are depending on sizeof(bool) to be 1 byte. I don't see this in libcdio, but I suppose it's a possibility. In gcc3 enums are 4 bytes. This patch from Tim Potter forces sizeof(bool) to be 1 byte. 2005-03-17 rocky * lib/driver/MSWindows/win32_ioctl.c: Reduce verbosity on disc mode detection 2005-03-17 rocky * lib/driver/FreeBSD/freebsd.c: missing declaration 2005-03-17 rocky * src/util.c: Don't really detect Burn-proof yet. 2005-03-17 rocky * lib/driver/device.c: remove non-const warning. 2005-03-17 rocky * lib/driver/bsdi.c, src/cdda-player.c: BSDI: add audio controls. cdda-player.c: gcc > 3.0 change. 2005-03-17 rocky * src/cdda-player.c: C-Preprocessor syntax errors when using ncurses.h 2005-03-17 rocky * configure.ac, src/cdda-player.c: Check for ncurses.h header (in addition to curses.h). Had a problem (on Solaris) where both libcurses and libncurses were around but the curses.h header (from libcurses) was installed. 2005-03-16 rocky * example/audio.c, src/cdda-player.c: Add setting volume and showing the subchannel when in non-interactive mode. 2005-03-15 rocky * src/cdda-player.c: Add status on play_tracks 2005-03-15 rocky * example/audio.c, src/cdda-player.c: *.c: return status of operations. Exit code is set on operation failure. cdda-player.c: debug and verbose change libcdio loglevel verbosity. 2005-03-15 rocky * lib/driver/gnu_linux.c: Remove duplicate open on CD. Some warnings turned into info messages. Remove unnecessary \n's. 2005-03-15 rocky * example/README: Add audio.c 2005-03-15 rocky * example/audio.c: Sample program to show audio controls. 2005-03-15 rocky * example/Makefile.am, src/cd-info.c, src/cdda-player.c: example: add sample audio program. cd-info.c cdda-player.c: read_subchannel sets format MSF. So caller no longer has to. 2005-03-15 rocky * lib/driver/gnu_linux.c, lib/driver/solaris.c: read_subchannel sets format MSF. So caller no longer has to. 2005-03-15 rocky * lib/driver/MSWindows/win32_ioctl.c: Get read_subchannel working - was thrown off by Microsoft's lousy poor documentation of IOCTL_READ_Q_SUBCHANNEL 2005-03-14 rocky * src/cdda-player.c: Show volume in display status output. 2005-03-14 rocky * include/cdio/audio.h, include/cdio/device.h, lib/driver/audio.c, lib/driver/device.c: Allow returned parameters to be NULL. 2005-03-13 rocky * lib/driver/cdio_private.h, lib/driver/osx.c: A hacky OSX close drive routine. It doesn't handle the actual drive parameter because we don't really know how to pass that to druti. 2005-03-13 rocky * src/cdda-player.c: Remove warnings from mvprintw (as seen on OSX). 2005-03-13 rocky * src/cdda-player.c: Use CD-Text for disc info too. 2005-03-12 rocky * src/cdda-player.c: Show CD-Text info. 2005-03-12 rocky * src/cdda-player.c: Off by one on track duration. 2005-03-12 rocky * src/cdda-player.c: Curses improvements. Can now show key/help and list of tracks. 2005-03-12 rocky * src/cd-info.c, src/cdda-player.c, src/cddb.c, src/cddb.h: Put move libcddb init routine out of cdda-player.c and cd-info.c and into cddb.{c,h} 2005-03-11 rocky * src/cd-info.c, src/cdda-player.c, src/cddb.h: Towards making a common init_cddb routine. 2005-03-11 rocky * lib/driver/FreeBSD/freebsd.c: Forgot close of file descriptor. 2005-03-11 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/cdio_private.h: Possible filling out of FreeBSD audio control routines. 2005-03-10 rocky * configure.ac, src/Makefile.am: Check for libncurses as well as libcurses and add whatever is found to cdda-player libraries. 2005-03-09 rocky * lib/driver/libcdio.sym: Correct export name. 2005-03-09 rocky * lib/driver/MSWindows/win32.c: Compilation fix for non MS OS's. 2005-03-09 rocky * example/mmc1.c, example/mmc2.c: mmc1.c: use DEVICE_DRIVER rather than DEVICE_UNKNOWN. mmc2.c: show use of "mmc_have_interface" 2005-03-09 rocky * include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c: Add MMC START STOP interface. 2005-03-09 rocky * configure.ac: Add --without-cdda-player. Dependency on curses now works. 2005-03-09 rocky * lib/driver/MSWindows/win32.c: Use mci command for close for now. 2005-03-09 rocky * lib/driver/MSWindows/win32.c, lib/driver/device.c, src/cdda-player.c: win32.c: get eject working. device.c: an additional test for a NULL pointer to be on the safe side. cdda-player: better handling of eject. 2005-03-08 rocky * lib/driver/MSWindows/win32_ioctl.c: Test for invalid file handle on close_tray. 2005-03-08 rocky * lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/solaris.c: Possibly Solaris close tray fixes. 2005-03-08 rocky * lib/driver/MSWindows/win32.c: Need to make close_tray_win32 external even when not on Windows. 2005-03-08 rocky * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/cdio_private.h, lib/driver/device.c, src/cdda-player.c: lib/driver/device.c: bug in close routine looping. lib/*: Modify close routine for Win32 ioctl. src/cdda-player: add option for close cd tray and minor things 2005-03-07 rocky * configure.ac, src/Makefile.am, src/cdda-player.c: Add Gerd Knorr's cdda-player as an example program using the libcdio Audio controls. 2005-03-07 rocky * include/cdio/device.h, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym: Start of a working close_tray routine. Add another routines which returns driver id to help reduce driver scans. Reduce unneeded driver scanning my skipping DRIVER_UNKNOWN. 2005-03-07 rocky * lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: windows audio control improvements: add stop and do a little better about getting subchannel info (still needs work). Attempt close tray routine which is still broken across the board pending reworking. 2005-03-06 rocky * lib/driver/solaris.c: Initial op.funcs. NULL. Try using close tray via CDROMSTART. 2005-03-06 rocky * lib/driver/gnu_linux.c, lib/driver/solaris.c: solaris: add audio stop gnu_linux.c: correct comment. 2005-03-06 rocky * test/vcd_demo_vcdinfo.right: Revised ISO9660 and multi-session output. 2005-03-06 rocky * lib/driver/audio.c: fix prototype mismatch. 2005-03-06 rocky * include/cdio/device.h, lib/driver/device.c: Was destroying device list when getting capabilities. This should be an in parameter only. 2005-03-06 rocky * src/cddb.c: Use cdio_audio_get_msf_seconds 2005-03-06 rocky * include/cdio/audio.h, lib/driver/audio.c, lib/driver/libcdio.sym: Add cdio_audio_get_msf_seconds 2005-03-06 rocky * src/Makefile.am: Split out cddb stuff for inclusion in a cdda player. 2005-03-06 rocky * include/cdio/audio.h, include/cdio/device.h, include/cdio/sector.h, lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/audio.c, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, lib/driver/solaris.c, src/cd-info.c, src/cddb.c, src/cddb.h: More audio control corrections. 2005-03-06 rocky * lib/driver/libcdio.sym: Forgot to add mmc_audio_state2str to list of exported symbols. 2005-03-06 rocky * include/cdio/mmc.h, lib/driver/mmc.c, src/cd-info.c: Add routine to turn audio status into a string. 2005-03-06 rocky * lib/driver/solaris.c: Don't rely on mmc backward compatibility. 2005-03-06 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: Don't rely on MMC backward compatibility. 2005-03-06 rocky * example/C++/iso1.cpp, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/mmc1.c, example/mmc2.c, include/cdio/ds.h, lib/driver/gnu_linux.c, lib/driver/mmc.c, lib/driver/mmc_private.h, src/util.c: Don't rely on compatibility with 0.72. Use new type names. 2005-03-05 rocky * test/Makefile.am, test/check_iso.sh.in, test/copying-rr.right: Add Rock-Ridge regression test. 2005-03-05 rocky * lib/driver/FreeBSD/freebsd.c: FreeBSD audio control fixes. 2005-03-05 rocky * lib/driver/bsdi.c: BSDI audio control fixes. 2005-03-05 rocky * lib/driver/MSWindows/win32_ioctl.c: Correct getting audio subchannel info. 2005-03-05 rocky * lib/driver/MSWindows/win32.c, src/cd-info.c: win32.c: closer to getting audio controls working. cd-info.c: was not testing MULTI_SESSION capability correctly. 2005-03-05 rocky * test/Makefile.am: Add test Rock-Ridge ISO-9660 image 2005-03-05 rocky * src/cd-info.c: Correct type mismatch: unsigned int -> lsn_t 2005-03-05 rocky * : Rock-Ridge test ISO 9660. 2005-03-05 rocky * src/cd-info.c, test/cdda-mcn.right, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1-no-rr.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Change multi-session output - cd-info reports LSN's, not session number. 2005-03-05 rocky * include/cdio/device.h, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/solaris.c: get_last_session returns lsn_t not session number. Add get_track_last_session for Solaris. Correct it's play_msf. 2005-03-05 rocky * include/cdio/device.h, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/gnu_linux.c, lib/driver/libcdio.sym, src/cd-info.c, test/cdda-mcn.right, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1-no-rr.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Add API routine to get last session number. 2005-03-05 rocky * include/cdio/audio.h, lib/driver/Makefile.am, lib/driver/{_cdio_aix.c => aix.c}, lib/driver/audio.c, lib/driver/{_cdio_bsdi.c => bsdi.c}, lib/driver/cdio_private.h, lib/driver/{_cdio_linux.c => gnu_linux.c}, lib/driver/{_cdio_osx.c => osx.c}, lib/driver/{_cdio_sunos.c => solaris.c}: Revise play_audio_msf for start/end as it should be. _cdio_*driver*.c -> *driver*.c 2005-03-05 rocky * include/cdio/audio.h, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_linux.c, lib/driver/audio.c, lib/driver/cdio_private.h: 1st attempt to fill in some audio controls for Windows ioctl. 2005-03-03 rocky * lib/driver/FreeBSD/freebsd.c: Towards audio controls working on FreeBSD. 2005-03-03 rocky * lib/iso9660/iso9660_fs.c: Fix syntax error if Joliet. 2005-03-03 rocky * NEWS: Update. 2005-03-03 rocky * configure.ac: Now use cdrom.h for BSDI libcdio library. 2005-03-03 rocky * test/testiso9660.c: Better failure output messages. 2005-03-03 rocky * lib/driver/_cdio_bsdi.c: Add some of the audio routines to BSDI driver. 2005-03-03 rocky * lib/iso9660/iso9660.c: Respect localtime parameter in iso9660_get_dtime 2005-03-03 rocky * lib/driver/_cdio_sunos.c: sunos -> solaris. lsn -> i_lsn 2005-03-03 rocky * test/check_fuzzyiso.sh: Change to make "make distcheck" (build outside of src directory) work. 2005-03-02 rocky * test/check_paranoia.sh.in: Change to make build out of srcdir work. 2005-03-02 rocky * configure.ac, src/cd-paranoia/Makefile.am, test/check_cue.sh.in, test/check_fuzzyiso.sh, test/check_nrg.sh.in, test/check_paranoia.sh.in: Enable building out of srcdir. Patches outside of test/* from Mike Castle 2005-03-02 rocky * include/cdio/audio.h, include/cdio/mmc.h, lib/driver/_cdio_linux.c, lib/driver/mmc.c, src/cd-info.c: audio.h: redo audio volume levels a little. mmc.{c,h}: attempt to get audio ports/selections via MMC. cd-info.c: show volume output levels in a cleaner fashion. 2005-03-02 rocky * src/util.c: Slightly more detailed capability reporting: VCD is MODE2 FORM 1/2; PhotoCD is ability to read multisessions. 2005-03-01 rocky * src/cd-info.c, test/cdda-mcn.right, test/cdda.right: Deal with unimplemented audio status (such as on image drivers) 2005-03-01 rocky * src/cd-info.c: Slight output change. 2005-03-01 rocky * lib/driver/_cdio_linux.c: Put back use of read_audio_subchannel_linux() 2005-03-01 rocky * include/cdio/audio.h, include/cdio/mmc.h, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_osx.c, lib/driver/_cdio_sunos.c, lib/driver/mmc.c, src/cd-info.c, src/cdinfo-linux.c: mmc.c: fix up read_audio_subchannel_mmc audio.h: more direct field names mmc.h: add mmc_subchannel_t; scsi_mmc -> mmc cdio-linux.c: remove deprecated from_bcd8 2005-03-01 rocky * include/cdio/device.h, include/cdio/mmc.h, include/cdio/types.h, lib/driver/MSWindows/win32.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h, src/util.c: Report ability to read MCN. Add MMC routine to read audio subchannel. 2005-03-01 rocky * lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c: _cdio_sunos.c: add audio routines. _cdio_linux.c: small formatting changes. 2005-03-01 rocky * src/cd-info.c: Don't do CD analysis if we are currently playing a CD. 2005-03-01 rocky * lib/driver/libcdio.sym: Add new audio routines. 2005-03-01 rocky * lib/driver/_cdio_linux.c, lib/driver/audio.c, src/cd-info.c: Corrections to audio. First glimpse at working (on GNU/Linux) audio controls. 2005-03-01 rocky * lib/driver/MSWindows/win32.c: read_data_sectors via (cooked) generic read. 2005-03-01 rocky * lib/driver/_cdio_sunos.c: Fix up read_data_sectors by using generic cooked routine. 2005-03-01 rocky * lib/driver/audio.c: Audio (via line output) related routines. 2005-03-01 rocky * include/cdio/Makefile.am, include/cdio/audio.h, include/cdio/mmc.h, include/cdio/types.h, lib/driver/Makefile.am, lib/driver/_cdio_linux.c, lib/driver/cdio_private.h: Add audio lineout controls (play, pause, volume control) 2005-03-01 rocky * lib/driver/_cdio_generic.c, lib/driver/generic.h: Add read_data_blocks via cooked mode. Seems to work better than read_cd. 2005-02-28 rocky * lib/driver/_cdio_linux.c: Failed attempt to make read_data_sectors work. 2005-02-28 rocky * TODO: One down one added. Not sure overall we're making progress. 2005-02-28 rocky * lib/iso9660/iso9660_fs.c: Report error when read_data_block fails. 2005-02-28 rocky * lib/driver/mmc.c: Don't try to read too many blocks on MMC readcd. 2005-02-28 rocky * include/cdio/util.h: Tighter declarations of variables. 2005-02-28 rocky * include/cdio/device.h, lib/driver/_cdio_linux.c: More device error return codes. More detailed errors when CDROM_SEND_PACKET fails. 2005-02-27 rocky * lib/driver/MSWindows/win32.c, lib/iso9660/iso9660.c, src/iso-info.c: 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. 2005-02-26 rocky * src/util.c, test/copying.right, test/isofs-m1-no-rr.right, test/isofs-m1.right, test/joliet-nojoliet.right, test/joliet.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Show seconds in ISO9660 listing. 2005-02-26 rocky * lib/iso9660/rock.c: Copy last changes to parse_rock_ridge_stat_internal(). 2005-02-26 rocky * lib/iso9660/rock.c: Fix bugs in getting full symbolic link name (when multiple directories). Remove unnecessary malloc in realloc_symlink(). 2005-02-26 rocky * src/util.c, test/isofs-m1.right, test/joliet-nojoliet.right, test/joliet.right: Show modification time, not create time as seems to be the common case for ls. 2005-02-26 rocky * test/isofs-m1-no-rr.right, test/isofs-m1.right, test/monvoisin.right: Time's on iso9660 have changed. 2005-02-26 rocky * lib/iso9660/iso9660.c: Change to iso9660_get_dtime to make dates on Rock-Ridge CD's match what the OS reports when mounting. A bit was done by trial and error although it doesn't seem *inconsistent* with standards definitions. 2005-02-25 rocky * lib/driver/_cdio_sunos.c: Bug in setting blocksize - wasn't using passed parameter. 2005-02-25 rocky * include/cdio/track.h: Remove duplicate #define's 2005-02-25 rocky * lib/driver/_cdio_generic.c, lib/driver/_cdio_osx.c: _cdio_generic.c: OSX does return CDIO_CDROM_CDI_TRACK. _cdio_osx.c: fixup read_data_blocks. May have to complicate more if we need to make a distinction between Form 1 and Form 2. Revise for current name/variable conventions. 2005-02-25 rocky * lib/iso9660/iso9660_fs.c: Erroneous parameter passed. 2005-02-24 rocky * lib/driver/cdtext.c: Guard against dereferencing NULL pointer. 2005-02-24 rocky * lib/driver/_cdio_osx.c: Use TR_ values from cdio/cdda.h. 2005-02-24 rocky * lib/driver/_cdio_osx.c: Add read_data_blocks; revise according to current conventions. 2005-02-23 rocky * lib/iso9660/iso9660.c: Don't assume all OS's have tm_gmtoff 2005-02-22 rocky * NEWS, README, include/cdio/iso9660.h, include/cdio/rock.h, lib/iso9660/iso9660.c, lib/iso9660/libiso9660.sym, lib/iso9660/rock.c: NEWS: all that's gone on so far in 0.73cvs README: Note paranoia and samba vfs module *.{h,c}: more debugger symbols. Use _s convention more. 2005-02-22 rocky * lib/iso9660/iso9660.c, test/isofs-m1.right, test/monvoisin.right: iso9660_get_dtime hack: we've seen it happen that everything except gmtoff is zero and the expected date is the beginning of the epoch. So we accept 6 numbers being zero. I'm also not sure if using the of the Epoch is also the right thing to do either. 2005-02-22 rocky * lib/iso9660/libiso9660.sym: Missing new symbol. Thanks again to Steve Schultz 2005-02-22 rocky * include/cdio/iso9660.h, include/cdio/rock.h, lib/iso9660/iso9660.c: More time corrections as hopefully move towards Nirvana. 2005-02-22 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/rock.c, src/cd-info.c, src/util.c: Add routine for extracting ISO 9660 long time format and probably correct the short-time format a little. Handle Rock-Ridge time and be able to display it. This pretty much completes the bulk of handling Rock-Ridge extensions. 2005-02-21 rocky * include/cdio/iso9660.h, include/cdio/rock.h, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/cd-info.c, src/iso-info.c, src/util.c, src/util.h: Process Rock-Ridge time fields. Not tested or shown yet. Break out Rock Ridge fields of our ISO9660 stat. 2005-02-21 rocky * include/cdio/iso9660.h, include/cdio/rock.h, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/cd-info.c, src/iso-info.c, src/util.c: Process symbolic links. Remove some memory leaks. 2005-02-20 rocky * example/C++/.cvsignore: [no log message] 2005-02-20 rocky * lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c: Fix some memory leaks caught by valgrind. Also replace a relloc - not sure why valgrind was having problems with that. 2005-02-20 rocky * include/cdio/rock.h, lib/iso9660/rock.c, src/cd-info.c, src/iso-info.c, src/util.c, test/Makefile.am, test/check_cue.sh.in, test/isofs-m1-no-rr.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Correct Rock-Ridge directory/link listing. {cd,iso}-info --no-rock-ridge works (and with rock-ridge too) test/*.right: output is now what I guess it's should be 2005-02-20 rocky * test/joliet-nojoliet.right, test/joliet.right: Add LSNs more places. 2005-02-20 rocky * test/copying.right: Add LSN's 2005-02-20 rocky * src/util.c, test/isofs-m1.right: Put in LSN's and sizes more often. 2005-02-20 rocky * src/util.c: "printf (" -> "report (stdout," 2005-02-20 rocky * include/cdio/iso9660.h, include/cdio/rock.h, include/cdio/xa.h, lib/iso9660/iso9660_fs.c, lib/iso9660/libiso9660.sym, lib/iso9660/rock.c, lib/iso9660/xa.c, src/Makefile.am, src/cd-info.c, src/iso-info.c, src/util.c, src/util.h, test/copying.right, test/isofs-m1.right, test/joliet-nojoliet.right, test/joliet.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: all: Add iso9660_get_rock_attr_str to get an ls-like mode string for rock ridge. {cd,iso}-info.c util.{c,h}: put common printing routine in util.c rock.h: add enum for NM flags iso9660.h: move mode_t typedef so it can be used in rock.h xa.{c,h}: small typos. test/*: in most cases better output. On VCD's however there there is a slight regression on displaying the filename someitmes. Will be addressed later. 2005-02-20 rocky * lib/iso9660/iso9660_fs.c, test/check_iso.sh.in, test/joliet-nojoliet.right: [no log message] 2005-02-20 rocky * example/C++/iso2.cpp, example/iso2.c: Another small change/generalization: don't limit driver to a BIN/CUE image. 2005-02-20 rocky * example/C++/iso2.cpp, example/iso2.c: Revise these for current state-of-the-art use and show off libiso9660 library with more compitency. We now allow one to specify the CUE file as well as file to extract. 2005-02-20 rocky * example/README: Revise now that we have a separate C++ directory. 2005-02-19 rocky * test/check_iso.sh.in: Add --no-header as all regression tests probably should do (so we don't get copyright info.) 2005-02-19 rocky * include/cdio/iso9660.h: Add debugging enumeration for ISO EXTENSION masks. 2005-02-19 rocky * configure.ac: Add C++ Makefile. 2005-02-19 rocky * include/cdio/mmc.h: Allow C++ programs to issue mmc commands. 2005-02-19 rocky * example/Makefile.am: Ooops. MMC4 wasn't supposed to get in there. 2005-02-19 rocky * src/cd-info.c, src/cd-read.c, src/iso-info.c, src/iso-read.c: cd-info.c: tolerate CDDB options even when we don't support CDDB. Better error reporting of bad options. 2005-02-19 rocky * example/C++/.cvsignore, example/C++/Makefile.am, example/C++/README, example/{iso1cpp.cpp => C++/iso1.cpp}, example/{iso2cpp.cpp => C++/iso2.cpp}, example/{iso3cpp.cpp => C++/iso3.cpp}, example/C++/mmc1.cpp, example/C++/mmc2.cpp, example/Makefile.am, example/iso3.c: Move C++ files to C++ directory. Add mmc{1,2} checking to list of C++ programs compiled. 2005-02-19 rocky * lib/driver/_cdio_sunos.c: Add read_data_sectors 2005-02-18 rocky * configure.ac, test/check_iso.sh.in, test/copying.right, test/joliet-nojoliet.right, test/joliet.right: Wasn't running ISO9660 regression tests. Output now includes file sizes. 2005-02-18 rocky * src/iso-info.c: Add filesystem size --iso9660 output. 2005-02-18 rocky * test/isofs-m1.right: Think this is more correct. 2005-02-18 rocky * src/iso-info.c: Use translated name in directory reporting. 2005-02-18 rocky * lib/iso9660/iso9660_fs.c: Remove bug in Joliet-handling when adding Rock Ridge is not there. 2005-02-18 rocky * lib/driver/mmc.c: Mode sense changes. Not sure about this though. 2005-02-18 rocky * lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/cd-info.c: iso9660_fs.c: reallocate filename when Rock-Ridge name is bigger. rock.c: variable name changes cd-info.c: don't translate file name when there are Rock-Ridge Extensions. 2005-02-17 rocky * lib/driver/_cdio_bsdi.c, lib/driver/libcdio.sym: Add read_data_sectors to exported symbols and to BSDI. 2005-02-17 rocky * lib/driver/cd_types.c, lib/iso9660/iso9660_fs.c, src/cd-info.c: Remove more of the no longer needed distinction (that we sometimes got wrong) of Mode 1 vs Mode 2 data reading. 2005-02-17 rocky * include/cdio/mmc.h, include/cdio/read.h, lib/driver/_cdio_linux.c, lib/driver/cdio_private.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h, lib/driver/read.c, lib/iso9660/iso9660_fs.c: Move forward in getting better ISO-9660 reading by eliminating "Mode 1/2" specification in API. 2005-02-17 rocky * test/check_nrg.sh.in: Ooops: added a bug in trying give more info. Fixed now. 2005-02-17 rocky * include/cdio/mmc.h, include/cdio/read.h, lib/driver/FreeBSD/freebsd.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/cdio_private.h, lib/driver/generic.h, lib/driver/image.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h, lib/driver/read.c, lib/iso9660/iso9660_fs.c: Add routine for reading data independent of or mode1 and mode2 format. Should help with ISO 9660 reading. Add generic MMC READ_CD routine. Warning - even more breakage in some situations. (But there's promise of an overall brighter future.) 2005-02-17 rocky * test/check_nrg.sh.in: Show failing invocation. 2005-02-14 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c, src/iso-info.c, test/isofs-m1.right: First semblance of being able to handle Rock Ridge names. 2005-02-14 rocky * include/cdio/iso9660.h, lib/iso9660/rock.c: Remove assumption that OS has POSIX file definitions (mode_t, nlink_t, gid_t, uid_t, time_t, etc.) 2005-02-14 rocky * lib/driver/mmc.c: gcc < 3.0 compilation fix 2005-02-13 rocky * include/cdio/iso9660.h, include/cdio/rock.h, lib/iso9660/Makefile.am, lib/iso9660/iso9660_fs.c, lib/iso9660/rock.c: Merge in more Rock Ridge code. Not working yet. Hopefully not much breakage. (But there may be some especially on less-POSIX OS's.) 2005-02-13 rocky * doc/libcdio.texi: Small correction - note cd-drive better. 2005-02-13 rocky * include/cdio/Makefile.am, include/cdio/iso9660.h, include/cdio/rock.h, include/cdio/xa.h: Add header for Rock-Ridge extensions. 2005-02-12 rocky * include/cdio/iso9660.h, include/cdio/xa.h, lib/iso9660/iso9660.c, lib/iso9660/xa.c: iso9660.h, iso9660.c, xa.c, xa.h: Add const char's for debugging use. iso9660.h: go over yet again for more info from the ECMA 119 spec. 2005-02-12 rocky * include/cdio/iso9660.h: Add type definitions for achar, dchar and ISO 9660 7.1.1 - ISO 7.3.3 types and use them. This frees up space for better comments about he field names of a PVD or SVD. 2005-02-12 rocky * include/cdio/device.h, include/cdio/mmc.h: Remove doxygen references to get_speed() routines. They don't exist and seem to confuse people. 2005-02-12 rocky * include/cdio/iso9660.h, lib/iso9660/iso9660.c, lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, test/check_sizeof.c: All structure tags now end in _s and we have typedefs for all of them (ending in _t). iso9660.h: abc -> a.b.c for ISO fields. 2005-02-12 rocky * doc/libcdio.texi: Document _e, _s, and _t suffixes 2005-02-12 rocky * include/cdio/xa.h: signature is probably better typed as a char rather than a uint8_t. We now define structures with the _s suffix. 2005-02-12 rocky * include/cdio/bytesex.h: Doxygen document ISO 9660 conversion routines a tad better. 2005-02-12 rocky * include/cdio/mmc.h: Correct CDB acronym. 2005-02-12 rocky * doc/glossary.texi, doc/libcdio.texi: Add IDE, Command Packet and SCSI CDB. Revise ATAPI definition. Correct acronym for CDB. 2005-02-11 rocky * lib/driver/MSWindows/win32_ioctl.c, lib/driver/mmc.c: mmc.c: mmc_mode_sense can't use cdio_have_atapi (without further check) or else we may get an infinite recursion. win32_ioctl.c: deal with an error message that can't be converted to a string. 2005-02-11 rocky * lib/driver/MSWindows/win32.c: Stylistic changes. 2005-02-11 rocky * lib/driver/MSWindows/win32.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/mmc.c, test/check_paranoia.sh.in: Bug fix for mmc_have_interface. checK_paranoia.sh.in: fix bug in returning success on a core dump win32.c: some small changes - more later. image/*.c: set run_mmc_cmd NULL explicitly. 2005-02-10 rocky * include/cdio/mmc.h, lib/driver/_cdio_sunos.c, lib/driver/mmc.c: Use solaris ioctl for blocksize set/get. Prototype corrections. 2005-02-10 rocky * lib/driver/mmc.c: Think I have how to get MMC media changed worked out. 2005-02-10 rocky * include/cdio/cdio.h, include/cdio/device.h, include/cdio/mmc.h, include/cdio/types.h, lib/cdda_interface/interface.c, lib/driver/device.c, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/iso9660/iso9660_fs.c: Add generic mode_sense(), add cdio_have_atapi() and use these. API number bumped Add bool_3way_t (yes, nope, dunno) 2005-02-09 rocky * lib/driver/image/nrg.c: Turn a number of the info messages into debug messages. 2005-02-09 rocky * example/.cvsignore, example/Makefile.am, example/README, example/{iso4.c => isofuzzy.c}, include/cdio/mmc.h, lib/driver/mmc.c, lib/driver/mmc_private.h, test/check_fuzzyiso.sh: Add mode_sense6() and mode_sense10() MMC commands. Use them to hopefully clean up code a little. Remove some unused MMC "private" commands. iso4 -> isofuzzy 2005-02-09 rocky * src/util.c: small formatting change 2005-02-09 rocky * lib/driver/mmc.c: Add "Rigid Restricted Overwrite" string. 2005-02-08 rocky * test/Makefile.am, test/check_fuzzyiso.sh: Add regression test for fuzzy ISO detection. Probably will rename iso4 to something else. 2005-02-08 rocky * example/mmc2.c, include/cdio/mmc.h, lib/driver/libcdio.sym, lib/driver/mmc.c, src/util.c: Add enum for feature profiles. Add feature to string conversion routines. 2005-02-07 rocky * include/cdio/mmc.h: Probably "interface" is reserved in some Windows contexts 2005-02-07 rocky * src/util.c: Small formatting changes. 2005-02-07 rocky * include/cdio/mmc.h, src/util.c: Add more MMC features and profiles such as ones used by the Plextor DVDR PX-716A 2005-02-07 rocky * example/.cvsignore: [no log message] 2005-02-07 rocky * lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_linux.c: Break out DVD detection. More verbose comments about the issues here. 2005-02-07 rocky * TODO: Revise. 2005-02-07 rocky * example/mmc1.c, example/mmc2.c, include/cdio/Makefile.am, include/cdio/mmc.h, include/cdio/scsi_mmc.h, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/libcdio.sym, lib/driver/mmc.c, lib/driver/mmc_private.h: lib/drivermmc.{c,h}: Add mmc_have_interface() to see if we've got SCSI or ATAPI or whatever. cdda_interface: Use mmc_have_inteface() we don't have anything for this except in GNU/Linux. May reduce the unnecessary data_bigendianp() calls which cause lots of disc reading. Turn #defines for MMC Profiles into enumeration. Add enumeration for "core" interface types #include -> #include 2005-02-06 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: Windows fixes. Read TOC via MMC only when media is not DVD. 2005-02-06 rocky * configure.ac, example/Makefile.am, example/README, example/{sample2.c => device.c}, lib/driver/_cdio_linux.c, lib/driver/libcdio.sym, lib/driver/portable.h, lib/paranoia/overlap.c, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c: Various portability fixes mostly for MSVC which doesn't have drand and doesn't allow dynamic local arrays. v_fragment -> v_fragment_t libcdio.sym: more external symbols defined /lib/_cdio_linux.c: harmless type mismatch example/sample2.c -> example/device.c 2005-02-06 rocky * autogen.sh: Try another approach to getting version.texi made. 2005-02-06 rocky * doc/.cvsignore, doc/version.texi: Get rid of version.tex again. Bogus check ins keep appearing and conflicts in CVS updates. I hate automake. 2005-02-06 rocky * lib/driver/libcdio.sym: scsi_mmc -> mmc name change. 2005-02-06 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c: FreeBSD fixes. 2005-02-06 rocky * lib/driver/_cdio_osx.c: OSX fixes. 2005-02-06 rocky * lib/driver/_cdio_bsdi.c: BSDI fixes for get_media_changed. Fix mostly harmless type mismatch from before media_changed work. 2005-02-06 rocky * doc/version.texi, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, lib/driver/image_common.c, lib/driver/image_common.h, lib/iso9660/iso9660_fs.c: iso9660_fs.c: wrong order of initialization. correct types on get_media_changed_mmc Solaris fixes. 2005-02-06 rocky * example/mmc1.c, example/mmc2.c, example/scsi-mmc1.c, example/scsi-mmc2.c, include/cdio/device.h, include/cdio/scsi_mmc.h, lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_osx.c, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/mmc.c, lib/driver/mmc_private.h: Start to implement ability to a detect media change. scsi_mmc -> mmc. Warning: some breakage may occur. 2005-02-06 rocky * include/cdio/device.h, include/cdio/sector.h, include/cdio/track.h, lib/driver/sector.c, lib/driver/track.c: Move track things out off sector.h 2005-02-05 rocky * include/cdio/cdda.h, lib/cdda_interface/scan_devices.c: Another typo 2005-02-05 rocky * include/cdio/cdda.h, lib/cdda_interface/scan_devices.c: Typo. 2005-02-05 rocky * include/cdio/cdda.h, lib/cdda_interface/scan_devices.c: Another "cooked" name bites the dust. Some doxygen cleanup too. 2005-02-05 rocky * Makefile.am, configure.ac, doc/version.texi, lib/cdda_interface/common_interface.h, lib/cdda_interface/scan_devices.c: Deal with OS's that don't have a stat'able filesystem. More SuSe spec removal. More SuSE spec removal 2005-02-05 rocky * example/iso4.c, lib/iso9660/iso9660_fs.c: Check in Mode 1 or Mode 2 on fuzzy searching. 2005-02-05 rocky * lib/iso9660/iso9660_fs.c: Check header for PVD MSF. Get XA mode more often. 2005-02-05 rocky * include/cdio/xa.h, lib/iso9660/iso9660_fs.c, lib/iso9660/xa.c: xa.h: add enumeration for debugging rest: better understanding of when there might be XA and when there might not be. Don't give a warnings about missing XA attributes when the format isn't supposed to have it. 2005-02-05 rocky * lib/cdda_interface/Makefile.am, lib/cdda_interface/{cooked_interface.c => cddap_interface.c}, lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h: cooked -> cddap. It has been observed that the use of "cooked" causes confusion and derision among the small-minded; and the code doesn't use cooked reading anyway. 2005-02-05 rocky * include/cdio/cdio.h, include/cdio/disc.h, include/cdio/scsi_mmc.h, include/cdio/sector.h, lib/driver/disc.c, lib/driver/sector.c, src/cd-info.c: Move discmode things out of sector and over to disc.h and disc.c. 2005-02-05 rocky * Makefile.am, package/.cvsignore, package/libcdio-suse.spec.in: Remove SuSE spec - it is not likely to be very general purpose. It is also not the real one which needs to be modified for each version and vcdimager/libcdio/libcddb collection and undergoes Language translation outside of the spec file. 2005-02-05 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32_ioctl.c: scsi_mmc -> mmc 2005-02-05 rocky * lib/driver/Makefile.am, lib/driver/_cdio_generic.c, lib/driver/cdio_private.h, lib/driver/{scsi_mmc.c => mmc.c}, lib/driver/{scsi_mmc_private.h => mmc_private.h}: scsi_mmc -> mmc 2005-02-05 rocky * include/cdio/cdda.h, include/cdio/iso9660.h, include/cdio/sector.h, lib/cdda_interface/common_interface.c, lib/driver/sector.c, lib/iso9660/iso9660.c: Make debugger-helping enums extern'd and define once elsewhere. 2005-02-05 rocky * doc/libcdio.texi, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/read.c, lib/driver/sector.c, lib/iso9660/iso9660_fs.c, lib/iso9660/iso9660_private.h, lib/iso9660/libiso9660.sym, src/util.c: First attempt at smart iso9660 reading in CD images. _cdio_stream.*: return is now cdio_driver_return_t 2005-02-05 rocky * lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: Remove d->interface. 2005-02-05 rocky * include/cdio/cdda.h, include/cdio/device.h, include/cdio/iso9660.h, include/cdio/sector.h: all: Add various enums to allow debugging using #define names. cdda: remove interface field (COOKED, SCSI). It's not going to be used. iso9660.h: add fuzzy iso9660 search. 2005-02-04 rocky * example/README: SCSI-MMC -> MMC. 2005-02-04 rocky * example/.cvsignore, example/Makefile.am, example/iso4.c, example/mmc1.c, example/mmc2.c: scsi-mmc{1,2} -> mmc{1,2} iso4.c: fuzzy ISO 9660 searching 2005-02-04 rocky * lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c: const removal to match proper run_scsi_cmd prototype. Bug in reporting TOC lsn's. Thanks to Bobbin007. 2005-02-04 rocky * lib/iso9660/iso9660_fs.c: remove cdio_malloc() and replace with calloc() 2005-02-03 rocky * configure.ac, lib/cdda_interface/scan_devices.c: Test and workaround another Unixism - pwd.h, getuid/getpwuid. 2005-02-03 rocky * configure.ac, lib/cdda_interface/scan_devices.c: Test for presence of lstat (optionally used in scan_devices of cdda_interface). 2005-02-03 rocky * include/cdio/util.h: Remove cdio_malloc(). Please use calloc instead. 2005-02-03 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_osx.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stream.c, lib/driver/_cdio_sunos.c, lib/driver/cdio.c, lib/driver/ds.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/util.c: remove cdio_malloc and replace with calloc which does functionally exactly the same thing (but is standard). In some drivers _data -> p_data. 2005-02-03 rocky * example/iso1.c, example/iso2.c: Allow one to specify an input file on input. iso1.c: guard better against an error in reading the directory. 2005-02-03 rocky * configure.ac: Okay, we're really in 0.73cvs now. 2005-02-03 rocky * lib/cdda_interface/low_interface.h: Remove a number of GNU/Linux and/or Unix #includes that probably don't belong. #ifdef some of the others, although I think they'll likely be there. 2005-02-03 rocky * doc/.cvsignore, doc/version.texi: Even though this file is automatically generated, CVS for the automake project seems to have this checked into CVS presumably to handle the problem of a missing version.texi for on initial checkout/bootstrap. Seems odd, but I'm assuming automake developers know what they are doing. (On the other hand, given the quantity of hassles using automake, I could be very very wrong.) 2005-02-01 rocky * include/cdio/xa.h: Typo. 2005-02-01 rocky * doc/libcdio.texi: cdrdao Grammar missing MSF for START and END. 2005-02-01 rocky * parse/toc.y: grammar missing optional msf for START and END. 2005-02-01 rocky * doc/libcdio.texi: More typos. 2005-02-01 rocky * configure.ac: Require automake 1.8. Kudos to Steve Schultz; raspberries to automake. 2005-01-31 rocky * configure.ac: Add substitution for mkdir -p Get ready for 0.72 2005-01-31 rocky * parse/.cvsignore, parse/Makefile, parse/toc.y, parse/toclexer.c, parse/toclexer.h: First attempt at Bison TOC parser. 2005-01-31 rocky * doc/glossary.texi, doc/libcdio.texi: Improve cdrdao grammar. More on SVCD. Minor index and other corrections. Probably the last lookover before the 0.72 release. 2005-01-30 rocky * lib/driver/image/bincue.c: More variable renamings. 2005-01-30 rocky * lib/driver/image/bincue.c: env -> p_env user_data -> p_user_data 2005-01-30 rocky * README.libcdio: grammatical improvement 2005-01-30 rocky * libcdio_paranoia.pc.in: Picking up wrong library: need libcdio_cdda, not cdda_interface 2005-01-30 rocky * libcdio_cdda.pc.in, libcdio_paranoia.pc.in, libiso9660.pc.in: libcdio_*: names probably need to be something other that libcdio which is already in use. libsio9660: minor title change 2005-01-29 rocky * lib/driver/libcdio.sym: Missing cdio_error. 2005-01-29 rocky * configure.ac: Hopefully last release candidate. 2005-01-29 rocky * doc/libcdio.texi, example/scsi-mmc1.c, example/scsi-mmc2.c, include/cdio/bytesex.h, include/cdio/bytesex_asm.h, include/cdio/cdda.h, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/device.h, include/cdio/iso9660.h, include/cdio/paranoia.h, include/cdio/scsi_mmc.h, include/cdio/track.h, include/cdio/version.h.in, lib/driver/scsi_mmc.c, test/check_cd_read.sh: Doxygen changes. 2005-01-29 rocky * doc/libcdio.texi: More small corrections. 2005-01-29 rocky * test/check_common_fn.in, test/check_cue.sh.in, test/check_iso.sh.in, test/check_opts.sh: Slightly more descriptive and accurate error messages when regression tests fail. Also if no Joliet support, one test is skipped. 2005-01-29 rocky * doc/glossary.texi, doc/libcdio.texi, example/paranoia.c, example/scsi-mmc1.c, example/scsi-mmc2.c: Add section on SCSI mmc. Go over and spell check. example/*.c some trivial typos 2005-01-29 rocky * src/cd-paranoia/doc/Makefile.am, src/cd-paranoia/doc/en/Makefile.am, src/cd-paranoia/doc/jp/Makefile.am: Forgot to install default manpages. 2005-01-29 rocky * configure.ac, doc/.cvsignore, doc/doxygen/.cvsignore, src/cd-paranoia/Makefile.am, src/cd-paranoia/doc/.cvsignore, src/cd-paranoia/doc/Makefile.am, src/cd-paranoia/doc/en/.cvsignore, src/cd-paranoia/doc/en/Makefile.am, src/cd-paranoia/doc/{ => en}/cd-paranoia.1.in, src/cd-paranoia/doc/jp/.cvsignore, src/cd-paranoia/doc/jp/Makefile.am, src/cd-paranoia/doc/{cd-paranoia.1.jp.in => jp/cd-paranoia.1.in}: Put Japanese man page in man/jp. 2005-01-28 rocky * doc/glossary.texi, doc/libcdio.texi: Go over documentation yet again. In particular: Move section on image formats out of Appendix and expand. Add a chapter on program internals glossary: add item to concept index and regularize index names. 2005-01-28 rocky * lib/driver/image/bincue.c: [no log message] 2005-01-27 rocky * lib/driver/_cdio_osx.c: fix harmless prototype mismatches. 2005-01-27 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/aspi32.h, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32.h, lib/driver/MSWindows/win32_ioctl.c, lib/driver/scsi_mmc.c, lib/driver/scsi_mmc_private.h: cygwin fixes mostly. 2005-01-27 rocky * configure.ac, lib/driver/FreeBSD/freebsd.c: Add check for to and use in freebsd.c to stop warning. 2005-01-27 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd.h, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c: Some FreeBSD fixes. 2005-01-27 rocky * Makefile.am, lib/driver/Makefile.am, lib/iso9660/Makefile.am: Attempt to get library version numbers correct for release. 2005-01-27 rocky * configure.ac: Okay, we'll call this rc1. 2005-01-27 rocky * configure.ac, include/cdio/cd_types.h, include/cdio/cdda.h, include/cdio/cdtext.h, include/cdio/paranoia.h, include/cdio/track.h, lib/cdda_interface/common_interface.c, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c, lib/driver/_cdio_generic.c, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/cdtext.c, lib/driver/generic.h, src/cd-info.c: cdparanoia: add ability to disable byte swapping configure.ac: remove AIX driver for now - it doesn't really work remove some (but not all) of the valgrind errors in cd-text Some stylistic things, doxygen comment improvements typos, etc. 2005-01-26 rocky * include/cdio/cdda.h, include/cdio/paranoia.h: Add an easy way to turn off paranoia compatibility. 2005-01-26 rocky * example/paranoia2.c, include/cdio/cdda.h, lib/cdda_interface/interface.c, lib/driver/_cdio_generic.c, lib/driver/device.c: Add a cdda_close that doesn't free the p_cdio pointer for those cases where an application may want to keep that pointer open. All routines now are distinct from parnaoia routines with suitable #defines for compatibility. 2005-01-25 rocky * configure.ac, example/paranoia2.c, include/cdio/cdda.h, include/cdio/paranoia.h, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c, libcdio_cdda.pc.in, test/testparanoia.c: libcdio_cdda.pc.in: had wrong cdda_interface library Rename paranoia routines to cdio-specific names so both libraries can coexist. And I think it makes debugging a little easier if not clearer. 2005-01-25 rocky * .cvsignore, libcdio.pc.in, libcdio_cdda.pc.in, libcdio_paranoia.pc.in, libiso9660.pc.in: Move pc files back into root of source tree. 2005-01-25 rocky * package/.cvsignore, package/libcdio.pc.in, package/libcdio_cdda.pc.in, package/libcdio_paranoia.pc.in, package/libiso9660.pc.in: Move package config files back to root of source tree. 2005-01-25 rocky * Makefile.am, package/.cvsignore, package/libcdio-suse.spec.in: SuSE spec file from Stanislav Brabec 2005-01-25 rocky * libcdio.pc.in, libcdio.spec.in, libcdio_cdda.pc.in, libcdio_paranoia.pc.in, libiso9660.pc.in: Now located in package. 2005-01-25 rocky * .cvsignore, configure.ac, example/paranoia2.c, package/libcdio.pc.in, package/libcdio.spec.in, package/libcdio_cdda.pc.in, package/libcdio_paranoia.pc.in, package/libiso9660.pc.in: Add package directory for various package files. paranoia2.c: comment typo 2005-01-24 rocky * lib/driver/_cdio_aix.c: Compilation fixes 2005-01-24 rocky * doc/libcdio.texi: Add cdrdao grammar, cd paranoia example program and lots of little documentation updates. More later... 2005-01-24 rocky * doc/libcdio.texi: Add CD Text, CDDB, and CD+G information. CdIo->CdIo_t 2005-01-24 rocky * lib/driver/MSWindows/win32.c: Wrong return type. 2005-01-24 rocky * lib/driver/_cdio_osx.c: Synatx error. 2005-01-24 rocky * lib/driver/_cdio_bsdi.c: syntax error. 2005-01-24 rocky * lib/driver/_cdio_sunos.c: Wrong return type. 2005-01-24 rocky * NEWS, include/cdio/disc.h, include/cdio/scsi_mmc.h, lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/FreeBSD/freebsd_ioctl.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_osx.c, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, lib/driver/disc.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/libcdio.sym, lib/driver/scsi_mmc.c, lib/driver/scsi_mmc_private.h: stat_size -> get_disc_last_lsn. Now returns lsn_t and CDIO_INVALID_LSN on error. Add MMC version of get_disc_last_lsn. More regularization of driver_return_code_t and get_disc_last_lsn There's probably some small driver breakage which will be fixed soon. 2005-01-23 rocky * include/cdio/cdio.h, include/cdio/device.h, include/cdio/read.h, lib/driver/FreeBSD/freebsd.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/read.c, lib/driver/scsi_mmc.c, lib/driver/scsi_mmc_private.h: Change read routines so the use the driver_return_code_t enumeration. It's a little cleaner and may make things clearer in debugging. 2005-01-23 rocky * lib/driver/MSWindows/win32.c: Use SCSI-MMC routine for reading audio sectors. ioctl READRAW doesn't always word and is slow. 2005-01-23 rocky * lib/cdda_interface/interface.c, lib/paranoia/paranoia.c: Work around problem where we were accessing outside of an allocate range when the drive endian was different than the CD-ROM endianness. We do this by always allocating an extra block, but it would be better to understand whether this is correct or whether some logic needs to be fixed. 2005-01-23 rocky * test/testparanoia.c: Remove access of uninitialized memory. 2005-01-23 rocky * test/testdefault.c: Remove memory leak. Not used in regression testing though. 2005-01-23 rocky * lib/cdda_interface/scan_devices.c, lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_linux.c, lib/driver/image_common.c, lib/paranoia/isort.c, lib/paranoia/p_block.c, lib/paranoia/paranoia.c, test/testparanoia.c: Remove some valgrind-caught memory leaks or use of uninitialized regions. 2005-01-23 rocky * lib/driver/_cdio_sunos.c: Valgrind-caught memory leak. 2005-01-23 rocky * test/Makefile.am, test/bad-file.toc, test/data5.toc, test/data6.toc, test/data7.toc, test/testtoc.c: Since we have better TOC checking we now have to give real filenames. Adjust for this. Also added a regression test with a bad file name. 2005-01-23 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: Nope. Didn't get it right this time either with the byteswapping. However we've at least reduced the customness. 2005-01-23 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: Use common byte-swapping routines and remove cdparanoia-specific ones. (This time, for sure!) 2005-01-23 rocky * NEWS: [no log message] 2005-01-22 rocky * lib/driver/image.h, lib/driver/image/cdrdao.c, test/Makefile.am, test/check_cue.sh.in, test/vcd_demo.toc, test/vcd_demo_toc.right: Improve cdrdao to handle MSF-length. Remove vcd_demo_toc.right since the cd-info output is now the same as vcd_demo.right vcd_demo.toc adjusted accordingly. 2005-01-22 rocky * src/cd-drive.c, src/cd-info.c, src/iso-info.c, src/iso-read.c: Version information now includes build. 2005-01-22 rocky * include/cdio/version.h.in, src/cd-paranoia/version.h, test/check_paranoia.sh.in: check_paranoia.sh.in: Add a more aggressive paranoia test. *version.h*: Include build name in version listings. 2005-01-22 rocky * test/check_paranoia.sh.in: Was missing move of jitter output. 2005-01-22 rocky * example/README: More about where to look for examples. 2005-01-22 rocky * example/README: Programs have been added and renamed. 2005-01-22 rocky * example/.cvsignore, test/.cvsignore: [no log message] 2005-01-22 rocky * include/cdio/cdda.h, lib/cdda_interface/cooked_interface.c, src/cd-paranoia/cd-paranoia.c, test/check_paranoia.sh.in: Add jitter simulation and jitter-correction testing. 2005-01-22 rocky * lib/driver/FreeBSD/freebsd.c: Add a CAM read audio now that CDIOREADAUDIO deosn't work on newer FreeBSDs. Deal with recent generic->mmc name changes. 2005-01-22 rocky * lib/driver/_cdio_stream.c: Don't attempt to see before the beginning of a file. 2005-01-22 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/scan_devices.c: Add routines which allow cdio object to be opened before cdda_open. common_interface.h: data_bigendianp() is now public (in cdio/cdda.h) 2005-01-22 rocky * include/cdio/cdda.h: Add interfaces which allow opening a cdio object before running paranoia. data_bigendianp is too neat to keep it private. 2005-01-22 rocky * example/Makefile.am, example/paranoia.c, example/paranoia2.c: Add an example which opens the cdio object first. Also show off data_bigendianp(). 2005-01-22 rocky * cvs2cl_usermap: Add Justin's info. 2005-01-21 rocky * lib/driver/_cdio_osx.c: Use strerror in all ioctl to give additional info. 2005-01-21 rocky * lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_osx.c, lib/driver/_cdio_sunos.c, lib/driver/scsi_mmc.c, lib/driver/scsi_mmc_private.h: Remove a number of const's since Darwin's run_scsi_mmc doesn't work that way :-( 2005-01-21 rocky * lib/driver/MSWindows/win32.c: routine name change. 2005-01-21 rocky * NEWS, lib/driver/_cdio_stream.c, lib/driver/image.h, lib/driver/image/cdrdao.c, test/vcd_demo_toc.right: _cdio_stream.c: replace assert's with failures. Make cdrdao be able to handle the kind of images vcdimager produces. There was a slight regression (perhaps so vcd_demo_toc.right may in fact not be right. Deal with some other time. 2005-01-21 rocky * lib/driver/_cdio_osx.c: Remove get_scsi for now. 2005-01-21 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, lib/driver/generic.h, lib/driver/scsi_mmc.c, lib/driver/scsi_mmc_private.h: Move some of the "generic" routines using MMC into SCSI-MMC. Think is a little bit clearer and cleaner. 2005-01-21 rocky * lib/driver/read.c: Remove probably some serious lapses: Now check all reads for exceeding end of disc and info messages can be logged. We were also returning 0 on error reads. Regularize by using a couple of macros. 2005-01-20 rocky * lib/driver/FreeBSD/freebsd.c: Missed a couple of env -> p_env's 2005-01-20 rocky * lib/driver/_cdio_osx.c: Add Scott Wood's code for issuing SCSI-MMC command. It doesn't work though. 2005-01-20 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/FreeBSD/freebsd_cam.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, lib/driver/generic.h: Add get_blocksize. There may be some breakage as I haven't tested all of the various drivers yet. 2005-01-20 rocky * include/cdio/device.h, include/cdio/iso9660.h, include/cdio/paranoia.h, include/cdio/read.h: Various doxygen improvements. 2005-01-20 rocky * include/cdio/scsi_mmc.h: Turn a bunch of defines into an enumeration. Makes debugging a bit nicer. 2005-01-20 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_stdio.c, lib/driver/_cdio_stdio.h, lib/driver/_cdio_stream.c, lib/driver/_cdio_stream.h, lib/driver/_cdio_sunos.c, lib/driver/cdio_private.h, lib/driver/generic.h, lib/driver/image.h, lib/iso9660/iso9660_fs.c: Move a set_speed and set_blocksize (via MMC)from driver-specific places to generic. Add _t to yet another type. 2005-01-20 rocky * include/cdio/device.h, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/cdio.c, lib/driver/device.c, lib/driver/scsi_mmc.c: Add DRIVER_OP_UNINIT and change appropriate DRIVER_OP_ERROR's to DRIVER_OP_UNINIT. 2005-01-19 rocky * lib/driver/MSWindows/win32_ioctl.c: Type cast that might make this more robust. 'Dunno. 2005-01-19 rocky * lib/cdda_interface/scan_devices.c: Even though this may not be nstrictly the way the original cdda_interface does things, add a spaces between the vendor, model, and revision number. 2005-01-19 rocky * src/cd-paranoia/cd-paranoia.c: Accommodate Windows that sometimes gives an argc that seems one greater than what's not NULL in argv. And it is probably a good idea anyway to test for null strings before calling strdup() 2005-01-19 rocky * lib/driver/_cdio_bsdi.c: Change to use driver_return_t 2005-01-19 rocky * lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/image_common.c: Change to use driver_return_t. 2005-01-19 rocky * include/cdio/cdio.h, include/cdio/device.h, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/cdio.c, lib/driver/device.c, lib/driver/generic.h, lib/driver/image_common.c, lib/driver/scsi_mmc.c: Try to regularize driver operation return codes via a new enumeation return type. (I may regret this later as we return ioctl's int value in some cases). cdio.h: get/set_arg moved to device. 2005-01-18 rocky * lib/cdda_interface/interface.c: Do not try to process if we got errors. More needs to be done, but this is a start. 2005-01-18 rocky * src/cd-paranoia/doc/cd-paranoia.1.in: Note change in -g option and that we scan for a CD-DA (rather than merely a CD-ROM). 2005-01-18 rocky * lib/driver/device.c: Got test backwards. 2005-01-18 rocky * src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/usage.txt.in: --force-generic-device -g is an alias for --force-cdrom-device -d 2005-01-18 rocky * src/cd-paranoia/doc/.cvsignore: The usual. 2005-01-18 rocky * include/cdio/scsi_mmc.h, lib/driver/MSWindows/win32.c, lib/driver/scsi_mmc.c: Attempt SCSI-MMC speed setting (e.g. for M$). 2005-01-18 rocky * lib/driver/FreeBSD/freebsd.c: Add FreeBSD set speed routine. 2005-01-18 rocky * NEWS, test/Makefile.am: test/Makefile.am: forgot to add vcd2.toc NEWS: what's up. 2005-01-18 rocky * test/testparanoia.c: gcc < 3.0 compilation fix. 2005-01-18 rocky * lib/cdda_interface/scan_devices.c: Bug in accessing via snprintf a NULL string. 2005-01-18 rocky * example/Makefile.am, lib/driver/_cdio_osx.c: Add set_speed for OSX. 2005-01-18 rocky * lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c: Add set_speed for Solaris via ioctl and set_blocksize via SCSI-MMC. Update comments in GNU/Linux driver. 2005-01-18 rocky * include/cdio/device.h, include/cdio/scsi_mmc.h, lib/cdda_interface/cooked_interface.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/generic.h, lib/driver/image/cdrdao.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/scsi_mmc.c, src/cd-paranoia/cd-paranoia.c: Add interface for setting speed and blocksize. Reinstated it in cd-paranoia libraries and command. Some more variable convention regularizations. 2005-01-17 rocky * lib/driver/FreeBSD/freebsd.c, lib/driver/MSWindows/win32.c, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_osx.c, lib/driver/_cdio_sunos.c, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/device.c, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c: add _t to another time. driver_id inside p_cdio wasn't initialized. 2005-01-17 rocky * example/paranoia.c: We don't need driver_id, so simplify this code a little bit. 2005-01-16 rocky * configure.ac, src/cd-paranoia/Makefile.am, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/doc/{cd-paranoia.1 => cd-paranoia.1.in}, src/cd-paranoia/doc/{cd-paranoia.1.jp => cd-paranoia.1.jp.in}, src/cd-paranoia/usage.txt.in: Work on documentation. cd-paranoia name is now properly substituted. Offset option described better. 2005-01-16 rocky * src/cd-paranoia/Makefile.am, src/cd-paranoia/{ => doc}/cd-paranoia.1, src/cd-paranoia/{ => doc}/cd-paranoia.1.jp: Move cd-paranoia documentation into its own directory. 2005-01-16 rocky * test/testtoc.c: Add another VCD toc test. We can't actually handle this fully, but at least we can parse it correctly (I think). 2005-01-16 rocky * test/vcd2.toc: Add another TOC test. This one taken from one modified from Steve Schultz's VCD collection. 2005-01-16 rocky * lib/driver/image/cdrdao.c: At least parse DATAFILE lines more fully. Things are better but we're still having problems reading the ISO-9660 of sms VCD's. 2005-01-16 rocky * lib/driver/image.h: It appears for cdrdao datastart needs to be larger. Could possibly be unsigned too. 2005-01-16 rocky * include/cdio/cdda.h: Redo bit masks for test flags. Should accommodate what is in (even if not working) in cdparanoia. 2005-01-16 rocky * test/.cvsignore, test/Makefile.am: Remove testparanoia .raw output on clean Also ignore these for CVS if they are around. 2005-01-15 rocky * include/cdio/cdda.h, src/cd-paranoia/cd-paranoia.c: Remove a couple of unused SCSI fields. 2005-01-15 rocky * include/cdio/cdda.h, lib/cdda_interface/Makefile.am, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c, src/cd-paranoia/cd-paranoia.c, test/check_paranoia.sh.in: Add regression-test mechanism. Right now we only have underrun testing. Perhaps more later... cd-paranoia: -x option added to specify what to test. 2005-01-15 rocky * src/cd-paranoia/cd-paranoia.c: Replace some paranoia-specific copystring's with strdups. 2005-01-15 rocky * test/Makefile.am, test/check_paranoia.sh.in: Start another cd-paranoia test. This one uses image reading so it doesn't require a CD-DA loaded. 2005-01-15 rocky * lib/cdda_interface/scan_devices.c: Redo in a way simpler way that and in a way that valgrind doesn't think there's a memory leak. 2005-01-15 rocky * lib/cdda_interface/cooked_interface.c, src/cd-paranoia/cd-paranoia.c: cooked_interface.c: check for TOC-read error. cd-paranoia.c: check that list of drives isn't just NULL list. 2005-01-14 rocky * lib/driver/_cdio_osx.c: Small error. Used the wrong variable for extracting the revision. 2005-01-14 rocky * lib/driver/MSWindows/win32.c: More changes to deal with error conditions. 2005-01-14 rocky * test/Makefile.am: Need to put in libcdio libs for testparanoia. 2005-01-14 rocky * lib/driver/MSWindows/win32.c, lib/driver/device.c, test/testparanoia.c: win32.c: was not indicating a failure when reading the TOC failed. testparanoia.c: better check that there are drives. device.c: I think better checking on drive capability. At least we now check for the TOC failure case and not add a drive there. 2005-01-14 rocky * test/testparanoia.c: Use a more statistical approach to determining if cd-paranoia worked. We still are really testing the error correction part which may be the most interesting (and useful). 2005-01-14 rocky * lib/cdda_interface/interface.c, test/testparanoia.c: Looked at WAV spec format. Probably (but I'm not certain) the thing that was wrong was the test program which needs to byte swap. What confuses me now is how the media players sort this out. 2005-01-14 rocky * lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: The sense I'm getting is that while the bigendianp detection is clever, it isn't complete. It may be that we need to use this along in conjunctin with the endianness of the OS. That is instead of big/little endian, what's needed is same/not same endian. For now, the simplest thing is to just disable all of this and wait to discover a CD-ROM drive where we have a problem. 2005-01-14 rocky * test/testparanoia.c: Spelling mistake. 2005-01-14 rocky * src/cd-paranoia/Makefile.am: I think I've finally got things worked out so that usage.h gets created before it is needed. 2005-01-14 rocky * lib/paranoia/paranoia.c: Fix a couple memory leaks by freeing resources. 2005-01-14 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.c, lib/cdda_interface/utils.h: Reinstate more of the libcdio routines. 2005-01-13 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/utils.h: Put back original cdparanoia byte-swapping routines until we smoke out what's going wrong on cygwin. 2005-01-13 rocky * src/cd-drive.c: . 2005-01-13 rocky * lib/driver/MSWindows/win32_ioctl.c: Fix syntax error of last commit 2005-01-13 rocky * lib/driver/MSWindows/win32_ioctl.c: Remove warning and make sure variable is initialized 2005-01-13 rocky * src/cd-drive.c: Just list the drivers that are available. 2005-01-13 rocky * include/cdio/paranoia.h, lib/paranoia/paranoia.c: Add array to convert paranoia_mode_cb into a string. 2005-01-13 rocky * test/Makefile.am, test/testparanoia.c: Start of a paranoia regression test program. 2005-01-12 rocky * lib/driver/FreeBSD/freebsd.c: Save track flags for FreeBSD (preemphasis, # number of audio channels and copy permit) 2005-01-12 rocky * example/iso1.c, include/cdio/bytesex.h, include/cdio/ds.h, include/cdio/iso9660.h, lib/driver/ds.c, lib/driver/image/nrg.c, lib/driver/image_common.h, lib/iso9660/iso9660_fs.c, src/cd-info.c, src/iso-info.c, test/vcd_demo_toc.right: Non-functional changes: Small coding style changes: add _t to some types, p_/psz_ to some variables Update/add doxygen comments add missing regression test output 2005-01-12 rocky * example/.cvsignore: [no log message] 2005-01-12 rocky * example/Makefile.am, example/paranoia.c: Add an example of using paranoia with libcdio. 2005-01-12 rocky * src/cd-paranoia/Makefile.am: I really don't understand how Makefile's. Put in an explicit dependency between usage.h and usage.txt since the generic one isn't sufficient. 2005-01-11 rocky * src/cd-paranoia/Makefile.am: Install program and manpage according to name specified in --with-cdparnoia-name 2005-01-11 rocky * src/cd-paranoia/Makefile.am: 2nd try at getting tarball built right. This time, ... 2005-01-11 rocky * src/cd-paranoia/Makefile.am: Missing two headers. 2005-01-11 rocky * configure.ac, include/cdio/paranoia.h, src/cd-paranoia/.cvsignore, src/cd-paranoia/Makefile.am, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/doc/FAQ.txt, src/cd-paranoia/doc/overlapdef.txt, src/cd-paranoia/pod2c.pl, src/cd-paranoia/usage.txt.in: doc: add some paranoia documentation. src: Cleaner way to get usage and allow it to be customized to a particular name configure.ac: add --with-cd-paranoia-name to allow customization of the cd-paranoia name. More work is needed to get the binary renamed. 2005-01-11 rocky * lib/driver/Makefile.am, lib/iso9660/Makefile.am, lib/iso9660/libiso9660.sym: lib/{driver,iso9660}/Makefile.am: new improved script for handling the case where there are no local symbols (or global symbols). libsio9660.sym: The last remaining local symbol really should be global. Change made on behalf of Nicolas Boullis. 2005-01-10 rocky * lib/cdda_interface/interface.c: Had commented out bigendiap avoidance. Use - things go much faster. 2005-01-10 rocky * include/cdio/cdda.h, lib/cdda_interface/toc.c, lib/paranoia/p_block.c: toc.c: don't assume first sector is 1. cdda.h: document TOC better. p_block.c: revise getting paranoia first/last sector 2005-01-09 rocky * src/cd-drive.c: Another slight error message change. 2005-01-09 rocky * src/cd-paranoia/cd-paranoia.c: Let people customize what program name to call this. More accurate error message when auto-detecting drive fails. 2005-01-09 rocky * src/util.c: Some OS's (e.g. BSDI) have limitations on var_arg routines. Accommodate this. 2005-01-09 rocky * lib/driver/scsi_mmc.c, test/vcd_demo.right: scsi_mmc.c: style differences. Need to do something about checking to make sure we don't exceed the disc though. vcd_demo.right: output has changed yet again. 2005-01-09 rocky * include/cdio/Makefile.am, include/cdio/cdio.h, include/cdio/device.h, include/cdio/disc.h, include/cdio/read.h, lib/cdda_interface/interface.c, lib/driver/Makefile.am, lib/driver/cdio.c, lib/driver/device.c, lib/driver/disc.c, lib/driver/read.c, lib/driver/track.c: cdio.{c,h}: moved various reading and device/driver routines out into the below read.{c,h}: separate include for the reading routines. disc.{c,h}: more moved here from corresponding cdio. device.c: a place for device/driver related routines. interface.c: break up line to make debugging easier. 2005-01-09 rocky * src/cd-paranoia/cd-paranoia.c: Better error message when CD audio scanning failed. 2005-01-09 rocky * lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h: Got BE and LE conversion backwards. Caused cdda-endianess determination to fail. 2005-01-09 rocky * lib/cdda_interface/cooked_interface.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/scan_devices.c, lib/driver/_cdio_sunos.c: Fix my recent breakage in adding back GNU/Linux endian determination. Need to seet nsectors if not GNU/Linux. Some lint things for non-GNU/Linux. 2005-01-09 rocky * lib/cdda_interface/cooked_interface.c, lib/driver/_cdio_sunos.c: Fix a bad bug where we were requesting potentially a huge number of blocks (-1 unsigned). Fix both the driver to disallow such a nonsensical thing as well as just don't make the request. 2005-01-09 rocky * lib/driver/cdio.c: Handle the case were we want to open only real CD-ROM devices versus those where we're willing to open CD-images and real CDs. Don't know why I never fixed this earlier. 2005-01-09 rocky * src/cd-drive.c, src/cd-info.c, src/cd-read.c, src/util.c, src/util.h, test/cdda-read.right, test/check_common_fn.in, test/isofs-m1-read.right: Create open_input() for common input open routines. Input error messages have been gone over. cd-read is a little more like the rest. Regression output now has NO-WARRANTY. 2005-01-08 rocky * lib/cdda_interface/scan_devices.c: Compilation fix for non-GNU/linux 2005-01-08 rocky * configure.ac, include/cdio/cdda.h, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c: Put back some of the GNU/Linux-ism for detecting drive endian-ness. The data-driven endian correction isn't working correctly. Ultimately though this code should move down into libcdio (and get removed from here.) 2005-01-08 rocky * lib/cdda_interface/scan_devices.c: Better about handling non-Unix devices. 2005-01-07 rocky * configure.ac, lib/cdda_interface/low_interface.h, src/cd-paranoia/cd-paranoia.c: Remove a GNU/Linux includes that isn't used any more. Move other GNU/Linux tests to the linux-specific part of configure. 2005-01-07 rocky * lib/paranoia/isort.c, lib/paranoia/isort.h, lib/paranoia/overlap.c, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c: Small convention changes. 2005-01-07 rocky * lib/cdda_interface/common_interface.c: Initialize buff in case read doesn't do it. (But I'm no sure why the read isn't doing this properly.) 2005-01-06 rocky * include/cdio/cdda.h: Doxygen documentatoin on more routines. Remove some things that aren't usable any more. 2005-01-06 rocky * lib/cdda_interface/toc.c: Add doxygen doc for exxternal routines. 2005-01-06 rocky * src/cd-paranoia/cd-paranoia.c: When verbose, show cdio info messages. 2005-01-06 rocky * lib/cdda_interface/scan_devices.c, lib/driver/MSWindows/win32_ioctl.c: Remove some Unixisms in checking drive. Rely on libcdio to do the checking - it's platform independent. win32_ioctl.c: more detailed info message. 2005-01-06 rocky * src/cd-paranoia/cd-paranoia.1: Revise for libcdio's name (cd-paranoia). 2005-01-06 rocky * src/Makefile.am: Various small bugs in setting variables to disable utility programs. 2005-01-06 rocky * configure.ac, src/cd-paranoia/Makefile.am, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/getopt.c, src/cd-paranoia/getopt.h, src/cd-paranoia/getopt1.c: Test for GNU getopt_long() and add to cd-paranoia sources. Compile a local copy if not available. 2005-01-06 rocky * src/Makefile.am: Fix bug in disabling building of utility programs: cd-info, cd-read. Bug noticed by Steve Schultz. 2005-01-06 rocky * lib/driver/_cdio_osx.c: Include code to save audio pre-emphasis, # of tracks and copy-permit bit. I think cd-paranoia may do something now on Darwin. 2005-01-06 rocky * lib/cdda_interface/common_interface.h, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c, lib/cdda_interface/toc.c: More portability fixes. I think this now does something on BSDI. 2005-01-06 rocky * configure.ac, lib/cdda_interface/common_interface.c, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/version.h: Lots of portability fixes to make non GNU/Linux-specific. Now runs on Solaris! 2005-01-06 rocky * lib/cdda_interface/cooked_interface.c, lib/cdda_interface/interface.c, lib/driver/cdio.c, lib/paranoia/paranoia.c, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/report.c, src/cd-paranoia/utils.h, src/cd-paranoia/version.h: First working all-libcdio cd-paranoia (modulo various omissions and memory leaks). 2005-01-05 rocky * lib/cdda_interface/low_interface.h: Conditional code for non-linux 2005-01-05 rocky * configure.ac: Another header for Linux and cdparanoia. 2005-01-05 rocky * include/cdio/Makefile.am, include/cdio/{cdda_interface.h => cdda.h}, include/cdio/cdio.h, include/cdio/device.h, include/cdio/scsi_mmc.h, lib/cdda_interface/Makefile.am, lib/cdda_interface/common_interface.c, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h, lib/cdda_interface/scan_devices.c, lib/cdda_interface/toc.c, lib/driver/track.c, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c: The first all libcdio cdda_interface. There are some gaps could be filled. cdda_inteface.h renamed to cdda.h cdio_destroy moved from cdio.h to device.h 2005-01-04 rocky * include/cdio/Makefile.am, include/cdio/cdio.h, include/cdio/device.h, include/cdio/disc.h, include/cdio/track.h, lib/driver/disc.c: Add device for drive(r)/device things. Reorganize more to pull things out of cdio and into their respective units. 2005-01-04 rocky * src/util.c: CdIo -> CdIo_t 2005-01-04 rocky * example/cdtext.c, example/iso2.c, example/sample2.c, example/sample3.c, example/sample4.c, example/tracks.c: Revise for current conventions. 2005-01-04 rocky * include/cdio/Makefile.am, include/cdio/cdio.h, include/cdio/disc.h, include/cdio/sector.h, include/cdio/track.h, include/cdio/types.h, lib/driver/Makefile.am, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/disc.c, lib/driver/generic.h, lib/driver/image.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/image_common.h, lib/driver/libcdio.sym, lib/driver/track.c: Break out track and disc routines. (Disc needs more work) Add more convenience track routines. Set access-mode for image routines to be the image drivers - for uniformity. Some name regularization. And we're in 2005 now. 2005-01-02 rocky * src/cd-drive.c, src/cd-info.c: CdIo -> CdIo_t 2005-01-02 rocky * include/cdio/cdio.h, include/cdio/track.h, lib/driver/_cdio_aix.c, lib/driver/_cdio_bsdi.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/cd_types.c, lib/driver/cdio.c, lib/driver/scsi_mmc.c, lib/iso9660/iso9660_fs.c: Add Cdio_t, move some more stuff into track.h 2005-01-01 rocky * test/cdda-mcn.right, test/cdda.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/vcd_demo_vcdinfo_toc.right, test/videocd.right: Regression output changed again. 2005-01-01 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32_ioctl.c, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, lib/driver/generic.h, lib/driver/image_common.c: Add common routine for setting track flags. 2005-01-01 rocky * lib/driver/image/nrg.c: Typo. 2005-01-01 rocky * src/cd-info.c: Show raw and formatted sizes. 2005-01-01 rocky * lib/driver/_cdio_linux.c, lib/driver/image/nrg.c: NRG: get track flags working. linux: small cleanup in track flags. more to come. 2005-01-01 rocky * include/cdio/sector.h: Typo in CDIO_FRAMSIZE_RAW0 definition. 2005-01-01 rocky * lib/driver/MSWindows/aspi32.c, lib/driver/MSWindows/win32.c, lib/driver/MSWindows/win32_ioctl.c: Add track control info for Doze. 2004-12-31 rocky * lib/driver/_cdio_linux.c, lib/driver/_cdio_sunos.c, test/check_cue.sh.in, test/vcd_demo.right: Add track flags for solaris. Regression test without vcdinfo corrected. 2004-12-31 rocky * lib/driver/Makefile.am, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image/nrg.c, lib/driver/image_common.c, lib/driver/image_common.h, src/cd-info.c, test/Makefile.am, test/cdda-mcn.right, test/cdda.cue, test/cdda.right, test/cdda.toc, test/check_cue.sh.in, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/vcd_demo_vcdinfo_toc.right, test/videocd.right: Add image driver track flag reporting. Reorganize code for image drivers a little better (via image_common.c). Update regression tests for more expanded cd-info output. 2004-12-31 rocky * include/cdio/track.h: Track-related calls go here. 2004-12-31 rocky * include/cdio/Makefile.am, include/cdio/cdio.h, lib/driver/_cdio_generic.c, lib/driver/_cdio_linux.c, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/generic.h, lib/driver/image/bincue.c, lib/driver/image/cdrdao.c, lib/driver/image_common.h, lib/driver/libcdio.sym, src/cd-info.c: Start to fill in cdio_get_preemphasis, cdio_get_copy_permit, and cdio_get_channels. Internals reworked a little for this. 2004-12-30 rocky * include/cdio/cdda_interface.h, include/cdio/cdio.h, lib/driver/_cdio_generic.c, lib/driver/cdio.c, lib/driver/cdio_private.h, lib/driver/generic.h: Add cd-paranoia's track flag routines: copy-permitted, pre-emphasis, channels. Updates to drivers to set this properly is still needed. 2004-12-27 rocky * lib/iso9660/libiso9660.sym: Perhaps this is okay. 2004-12-27 rocky * lib/iso9660/libiso9660.sym: Remove some semicolons at the end of lines. 2004-12-24 rocky * Makefile.am: Typo causing "make install" to fail. Problem found by Steve Schultz. 2004-12-23 rocky * test/vcd_demo.right: We now list the CD size on the leadout line. 2004-12-23 rocky * src/cd-paranoia/Makefile.am: Correct bin_PROGRAMS name. cd-paranoia/.deps/cd-paranoia$(EXEEXT).Po was getting created when when it should be cd-paranoia/.deps/cd-paranoia.Po Problem reported by C.Y.M. 2004-12-22 rocky * test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right: Regress last regression test output change. 2004-12-22 rocky * test/.cvsignore: Add derived paranoia regression test. 2004-12-22 rocky * lib/Makefile.am, lib/iso9660/Makefile.am, src/Makefile.am: Until we put in more fine-grain control, don't make libcdio_paranoia and libcdda_interface libraries if we aren't making cd-paranoia. src/Makefile.am: correct way to disable cd-paranoia. 2004-12-22 rocky * test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right: discmode output changed its Data Mode2 not Data Form1. 2004-12-22 rocky * lib/paranoia/isort.c, lib/paranoia/overlap.c, lib/paranoia/p_block.c, lib/paranoia/paranoia.c: Read in configuration settings from config.h. paranoia was GNU/Linux based so the #includes had been set specific to that. 2004-12-22 rocky * lib/driver/_cdio_osx.c: CDIO_DRIVE_CAP_{MCN,ISRC} are now CDIO_DRIVE_CAP_READ_{MCN,ISRC} respectively. Thanks yet again to Steve Schultz. 2004-12-19 rocky * NEWS: Much has been going on. Note it. 2004-12-19 rocky * include/cdio/cdda_interface.h, lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/interface.c, lib/cdda_interface/scan_devices.c, lib/cdda_interface/scsi_interface.c, lib/cdda_interface/utils.h, src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/utils.h, test/Makefile.am: More integration/cleanup. Now uses cdio bytesex.h's BE/LE routines. copystring -> strdup. Some int's changed to track_t. But I need to be careful *not* to change cdda_interface.h. 2004-12-19 rocky * configure.ac, lib/cdda_interface/interface.c, lib/cdda_interface/utils.h, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/utils.h, test/Makefile.am, test/check_paranoia.sh.in: test/*, configure.ac: First paranoia regression test. It's run automatically as it assumes that you have a *flawless* CD-DA in a drive. *.{c,h}: more integration toward libcdio routines. In particular remove swap16 and swap32. 2004-12-18 rocky * configure.ac, src/Makefile.am, src/cd-info.c, src/cd-paranoia/Makefile.am, src/iso-info.c, test/cdda-mcn.right, test/cdda.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: cd-info now shows size of CD. iso-info takes options -l and -f to be a little more like isoinfo configure.ac now allows for disabling cd-paranoia, iso-read, iso-drive, cd-drive. Regression tests adjusted to new output and more drive reading capabilities. 2004-12-18 rocky * .cvsignore, Makefile.am, configure.ac, include/cdio/Makefile.am, include/cdio/cdda_interface.h, include/cdio/cdio.h, include/cdio/paranoia.h, include/cdio/scsi_mmc.h, include/cdio/types.h, lib/.cvsignore, lib/Makefile.am, lib/cdda_interface/.cvsignore, lib/cdda_interface/Makefile.am, lib/cdda_interface/common_interface.c, lib/cdda_interface/common_interface.h, lib/cdda_interface/cooked_interface.c, lib/cdda_interface/drive_exceptions.h, lib/cdda_interface/interface.c, lib/cdda_interface/low_interface.h, lib/cdda_interface/scan_devices.c, lib/cdda_interface/scsi_interface.c, lib/cdda_interface/smallft.c, lib/cdda_interface/smallft.h, lib/cdda_interface/test_interface.c, lib/cdda_interface/toc.c, lib/cdda_interface/utils.c, lib/cdda_interface/utils.h, lib/driver/.cvsignore, lib/{ => driver}/FreeBSD/Makefile, lib/{ => driver}/FreeBSD/freebsd.c, lib/{ => driver}/FreeBSD/freebsd.h, lib/{ => driver}/FreeBSD/freebsd_cam.c, lib/{ => driver}/FreeBSD/freebsd_ioctl.c, lib/{ => driver}/MSWindows/Makefile, lib/{ => driver}/MSWindows/aspi32.c, lib/{ => driver}/MSWindows/aspi32.h, lib/{ => driver}/MSWindows/win32.c, lib/{ => driver}/MSWindows/win32.h, lib/{ => driver}/MSWindows/win32_ioctl.c, lib/driver/Makefile.am, lib/{ => driver}/_cdio_aix.c, lib/{ => driver}/_cdio_bsdi.c, lib/{ => driver}/_cdio_generic.c, lib/{ => driver}/_cdio_linux.c, lib/{ => driver}/_cdio_osx.c, lib/{ => driver}/_cdio_stdio.c, lib/{ => driver}/_cdio_stdio.h, lib/{ => driver}/_cdio_stream.c, lib/{ => driver}/_cdio_stream.h, lib/{ => driver}/_cdio_sunos.c, lib/{ => driver}/cd_types.c, lib/{ => driver}/cdio.c, lib/{ => driver}/cdio_assert.h, lib/{ => driver}/cdio_private.h, lib/{ => driver}/cdtext.c, lib/{ => driver}/cdtext_private.h, lib/{ => driver}/ds.c, lib/{ => driver}/generic.h, lib/{ => driver}/image.h, lib/{ => driver}/image/Makefile, lib/{ => driver}/image/bincue.c, lib/{ => driver}/image/cdrdao.c, lib/{ => driver}/image/nrg.c, lib/{ => driver}/image/nrg.h, lib/{ => driver}/image_common.h, lib/{ => driver}/libcdio.sym, lib/{ => driver}/logging.c, lib/{ => driver}/portable.h, lib/{ => driver}/scsi_mmc.c, lib/{ => driver}/scsi_mmc_private.h, lib/{ => driver}/sector.c, lib/{ => driver}/util.c, lib/iso9660/.cvsignore, lib/iso9660/Makefile.am, lib/{ => iso9660}/iso9660.c, lib/{ => iso9660}/iso9660_fs.c, lib/{ => iso9660}/iso9660_private.h, lib/{ => iso9660}/libiso9660.sym, lib/{ => iso9660}/xa.c, lib/paranoia/.cvsignore, lib/paranoia/Makefile.am, lib/paranoia/gap.c, lib/paranoia/gap.h, lib/paranoia/isort.c, lib/paranoia/isort.h, lib/paranoia/overlap.c, lib/paranoia/overlap.h, lib/paranoia/p_block.c, lib/paranoia/p_block.h, lib/paranoia/paranoia.c, libcdio_cdda.pc.in, libcdio_paranoia.pc.in, src/Makefile.am, src/cd-info.c, src/cd-paranoia/.cvsignore, src/cd-paranoia/Makefile.am, src/cd-paranoia/buffering_write.c, src/cd-paranoia/buffering_write.h, src/cd-paranoia/cd-paranoia.1, src/cd-paranoia/cd-paranoia.1.jp, src/cd-paranoia/cd-paranoia.c, src/cd-paranoia/header.c, src/cd-paranoia/header.h, src/cd-paranoia/report.c, src/cd-paranoia/report.h, src/cd-paranoia/utils.h, src/cd-paranoia/version.h, src/util.c, test/Makefile.am: BIG REORGANIZATION. Reorganize directory structure for inclusion of cd-paranoia. Works for GNU/Linux. Other OS's may be broken. Regression test output needs to be adjusted too. Move: lib/driver (split off of lib) lib/iso9660 (split off of lib) Add from paranoia: lib/cdda_interface lib/paranoia src/paranoia Also made some small changes to capability identification to show more reading capabilities and show that. cd-info now shows the total disc size. 2004-12-17 rocky * lib/image/nrg.c: Classified one more disc mode perhaps. Variable name change and probably clarification. 2004-12-17 rocky * lib/cdio.c: Change wording of discmode2str. 2004-12-17 rocky * test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/monvoisin.right, test/svcdgs.right, test/videocd.right: cd-info output changed. Stupid me: I keep getting mode/form confusted. Discs are Mode 1, 2, CDDA or mixed. (Not form 1 and 2). 2004-12-15 rocky * configure.ac, include/cdio/cdio.h, lib/Makefile.am, lib/_cdio_aix.c, lib/cdio.c: Towards getting an AIX driver working. 2004-12-09 rocky * configure.ac: As per Tilman Linneweh FreeBSD 6 is like FreeBSD 5. 2004-12-06 rocky * lib/_cdio_sunos.c: Add better discmode detection via FULLTOC that we use on GNU/Linux. 2004-12-06 rocky * lib/scsi_mmc.c: scsi_mmc_get_discmode: As per Justin B Ruggles, SCSI, MMC-5 may require setting db.field[1] = CDIO_CDROM_MSF. 2004-12-04 rocky * include/cdio/scsi_mmc.h: Small typo. 2004-12-04 rocky * THANKS: Add Justin B. Ruggles. 2004-12-04 rocky * include/cdio/scsi_mmc.h, include/cdio/sector.h, lib/_cdio_linux.c, lib/cdio.c, lib/scsi_mmc.c: Move scsi mmc discmode determination to scsi-mmc. Add discmode for CD-i. 2004-12-04 rocky * src/cd-info.c: Add cast to remove compiler warning. 2004-12-04 rocky * lib/_cdio_linux.c: Justin B Ruggles reports: GNU/Linux ioctl(.., CDROM_DISC_STATUS does not return "CD DATA Form 2" for SVCD's when I know they are form 2, so we read a FULL TOC in an attempt to make it more accurate. Most of the info was obtained the SCSI MMC draft spec revision 10a from http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf Pages 56 to 62 give more details. Libcdio does not have CD-i as a discmode, so I just have it treat CD-i as if it is CD-XA. This doesn't work for the SVCD I tried but it is probably a step in the right direction. And when things settle down, it should be done on other OS drivers as well. 2004-12-04 rocky * lib/Makefile.am: Small typo. 2004-12-01 rocky * TODO: Small update. 2004-11-29 rocky * autogen.sh: Make sure we have automake version 1.6 or greater. Problem reported by C.Y.M 2004-11-22 rocky * lib/Makefile.am: make -j4 was failing because the Makefile variable libcdio_la_dependencies was not getting set. I don't know why this happens, but I've worked around the problem by removing this variable and adding the value of it (libcdio.la) in the places libcdio_la_dependencies is used. Problem reported by Goetz Waschk. 2004-11-22 rocky * example/.cvsignore: Add C++ binaries. 2004-11-22 rocky * example/iso3cpp.cpp: C++ version of iso3.c 2004-11-22 rocky * example/README: Add C++ programs. 2004-11-22 rocky * configure.ac, example/Makefile.am, example/iso1cpp.cpp, example/iso2.c, example/iso2cpp.cpp, example/iso3.c, include/cdio/ds.h: Fix up ability to use in C++ programs. Add some C++ example programs to make sure those compile. 2004-11-21 rocky * NEWS, configure.ac, include/cdio/iso9660.h, lib/iso9660.c: configure.ac: in 72cvs now. iso9660.{c,h}: "new" is a reserved word in C++. Don't use it as a parameter name 2004-11-21 rocky * example/iso1.c: Add cast to make this possible to compile via g++ 2004-11-21 rocky * doc/libcdio.texi: Update OS section and note ISO 9660 library in the history part. 2004-11-21 rocky * doc/glossary.texi, doc/libcdio.texi: Go over. Add section on Joliet. Add iso-info sample output. Break out info nodes for tracks and sectors. Some small improvements. 2004-11-21 rocky * test/Makefile.am: Solaris creates core files not, core.$pid. Change to make "make distcheck" work. 2004-11-20 rocky * lib/_cdio_bsdi.c: Make sure we initialize get_hwinfo expliscitly. 2004-11-20 rocky * lib/_cdio_linux.c: Make sure get_hwinfo is initialized. Add cdio_ in front of to/from_bcd8 2004-11-19 rocky * src/cd-info.c: Add cdio_ in front of to_bcd8 and from_bcd8. 2004-11-19 rocky * lib/_cdio_bsdi.c: Add cdio_ in front of to_bcd8 and from_bcd8. 2004-11-19 rocky * src/cd-info.c: Add "toc-file" option for cdrdao images. 2004-11-18 rocky * lib/_cdio_sunos.c, lib/sector.c: _cdio_sunos.c: fix bug in audio mode reading. *.c: replcate {from,to}_bcd8 with corresponding cdio_ names. 2004-11-16 nboullis * lib/Makefile.am: When a list of exported symbols is modified, the corresponding library should be rebuilt. 2004-11-16 nboullis * lib/libcdio.sym: libcdio's ABI should provide all the symbols required by the API. 2004-11-16 nboullis * configure.ac: If ld is not GNU ld, --without-versioned-libs is assumed, so it is useless to fail if make is also not GNU make. 2004-11-16 nboullis * Makefile.am: Lots of files referenced in EXTRA_DIST were not actually available; remove them from EXTRA_DIST. 2004-11-15 nboullis * lib/Makefile.am: Access libcdio.sym and libiso9660.sym through $(srcdir) to enable building outside the source directory. (Used by "make distcheck".) 2004-11-15 nboullis * lib/libcdio.sym: There is no _cdio_list_preappend symbol, but _cdio_list_prepend instead. 2004-11-15 rocky * Makefile.am: Don't need config.rpath and don't recall why it was needed. 2004-11-15 nboullis * include/cdio/util.h: "static inline __attribute__((deprecated))" functions are not available in standard C; only use them with GCC 3 and above, and replace them with simple #defines for other compilers. 2004-11-15 rocky * lib/libcdio.sym: Add symbols that VCDimager uses. 2004-11-15 rocky * include/cdio/util.h, lib/Makefile.am, lib/libcdio.sym, lib/util.c: rename to_bcd8 and from_bcd8 to cdio_to_bcd8 and cdio_from_bcd8. (N. Boullis) lib/Makefile.am: avoid non-GNU ld options when --without-versioned-libs is in effect. 2004-11-14 rocky * lib/libiso9660.sym: Move local files to global. 2004-11-14 rocky * Makefile.am: Remove more unused .m4 files. Probably a hold over from requiring gettext. (So we may yet add these back in sometime in the future.) 2004-11-14 rocky * Makefile.am, configure.ac, lib/Makefile.am: lib/Makefile.am: make sure we include .sys files in distribution. configure.ac: get ready for 0.71 Makefile.am: one of those m4's doesn't exist here. 2004-11-14 nboullis * lib/Makefile.am, lib/libiso9660.sym: Only export the required symbols of libiso9660. 2004-11-14 nboullis * lib/Makefile.am, lib/libcdio.sym: Only export the required symbols of libcdio. 2004-11-14 rocky * src/cd-drive.c: Opens cd driver a little less and checks for NULL. Helps things especially on AIX. 2004-11-13 rocky * lib/_cdio_sunos.c: Add explicit NULL for get_hwinfo. 2004-11-13 rocky * lib/_cdio_sunos.c: env -> p_env 2004-11-13 rocky * example/scsi-mmc1.c: Small typo. 2004-11-12 rocky * lib/Makefile.am: Guidance from Nicolas Boullis on how to library versioning works or should work. 2004-11-08 rocky * lib/cdtext.c: cdtext.c: was not converting arranger string properly. 2004-11-07 rocky * NEWS, lib/image/bincue.c, lib/image/cdrdao.c, lib/portable.h: Hoist common "portable" definitions into portable.h NEWS - rearrange. 2004-11-07 rocky * configure.ac: fixes to make run on AIX 2004-11-07 rocky * lib/MSWindows/aspi32.c: Revert last changes. 2004-11-07 rocky * lib/MSWindows/aspi32.c: Compilation fix. 2004-11-07 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c: win32_ioctl.c: minor comment or function name changes. aspi32.c: use length definitions better. 2004-11-07 rocky * lib/MSWindows/win32_ioctl.c: Read TOC buf fixes. Now tries MMC FULLTOC and then falls back to Windows' DeviceIoCtl READ_TOC. 2004-11-06 rocky * lib/iso9660_fs.c: Small warning change when we don't have nl_langinfo(CODESET). 2004-11-06 rocky * test/testtoc.c: Remove erroneous free()'s. This now give a valgrind error that looks to me bogus. 2004-11-06 rocky * configure.ac: Clean up headers - remove "obsolete" names. Some OS's weren't testing some, and some OS-specific we were testing for. 2004-11-06 rocky * Makefile.am, configure.ac, lib/Makefile.am: Automake woes. Think I have PACKAGE and VERSION set right now. lib/Makefile.am: we'll say libcdio has new interfaces 2004-11-06 rocky * lib/Makefile.am: Change library numbers. 2004-11-06 rocky * Makefile.am: Typo. 2004-11-06 rocky * NEWS, src/util.c, src/util.h: src/util.{c,h}: use report more often. NEWS - what's up 2004-11-06 rocky * src/util.c, test/cdda.right: src/util.c: remove extra white space test/cdda.right: adjust for recently found bug. 2004-11-06 rocky * src/cd-info.c: Bug in showing cdtext for individual tracks. 2004-11-04 rocky * MSVC/stdint.h, configure.ac, src/cd-drive.c, src/cd-info.c, src/cd-read.c, src/iso-info.c, src/iso-read.c, src/util.c, src/util.h: Common output routine in utility programs as a concession to environments which may no have or prefer stdout/stderr such as XBOX. 2004-11-04 rocky * libiso9660.pc.in: Wrong Version substitution. Thanks again to Steve Schultz. 2004-11-04 rocky * libcdio.pc.in: Wrong substitution name. Thanks to Steve Schultz for finding this problem. 2004-11-01 rocky * lib/MSWindows/win32_ioctl.c: Compilation fix. Add line/file/fn info on XBOX. 2004-11-01 rocky * lib/MSWindows/win32_ioctl.c: Add common FORMAT_ERROR. XBOX/MSVC deficiencies shouldn't be so in your face. 2004-11-01 rocky * MSVC/config.h, MSVC/stdint.h, Makefile.am, lib/_cdio_generic.c, lib/portable.h: Merging in MSVC/XBOX from John Oseman 2004-11-01 rocky * configure.ac: Set some package strings. 2004-11-01 rocky * configure.ac: Typo. 2004-10-31 rocky * lib/MSWindows/win32.c: Compilation fixes. 2004-10-31 rocky * lib/MSWindows/win32.c, lib/scsi_mmc.c: scsi_mmc.c: get CD-Text length before reading CD-Text. win32.c: make sure we can't set ASPI when XBOX. Other small changes for XBOX compatibility. 2004-10-31 rocky * lib/logging.c, lib/portable.h: portable.h: remove rcsid. logging.c: include portable.h 2004-10-31 rocky * NEWS, configure.ac, example/iso2.c, example/iso3.c, lib/Makefile.am, lib/_cdio_generic.c, lib/iso9660_fs.c, lib/portable.h, src/iso-read.c: configure.ac, lib/*, example/*.c, src/iso-read.c: start to separate compiler/OS deficiencies into "portable.h" configure.ac, lib/iso9660_fs.c: use AM_LANGINFO_CODESET rather than code in our ouwn langinfo.h and CODESET tests. 2004-10-31 rocky * include/cdio/logging.h, include/cdio/util.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: Mostly portability issues from or inspired by mog's changes for XBOX. image/*.c: initialize func structure to 0 (NULL). include/cdio/*.h: add "extern C" for C++ compilations where appropriate. 2004-10-31 rocky * lib/MSWindows/win32.c: Change to make compatible for MSVC 6 and older C compilers. 2004-10-31 rocky * lib/iso9660_fs.c: Fixes when no Joliet support. 2004-10-31 rocky * configure.ac: Fix up Joliet detection or lack thereof. 2004-10-30 rocky * lib/scsi_mmc.c: Add include of stdlib.h (From mog for XBOX) 2004-10-30 rocky * MSVC/README, MSVC/cd-info.vcproj, MSVC/libcdio.sln, MSVC/libcdio.vcproj: Files for compiling with MSVC. Courtesy of John Oseman (mog). 2004-10-30 rocky * lib/MSWindows/win32_ioctl.c: Fixes while trying to merge some of the XBOX changes. 2004-10-30 rocky * lib/iso9660_fs.c: NLS fixups. Wrong preprocessor symbol used. 2004-10-30 rocky * configure.ac, lib/iso9660.c, lib/iso9660_fs.c, src/iso-info.c: configure.ac, iso9660.c: test for tzname variable. configure.ac, iso9660_fs.c: test for nls_langinfo() and #include iso-info.c: some OS's need 2 args for multi-arg defines. 2004-10-30 rocky * libiso9660.pc.in: libiso9660 needs iconv. Also, we're not libvcdino. 2004-10-30 rocky * configure.ac, lib/iso9660.c: *: test for daylight and timezone configure.ac: test for stdbool.h 2004-10-29 rocky * lib/iso9660_fs.c, src/cd-info.c, src/iso-info.c: Conditional compilation of Joliet support. 2004-10-28 rocky * test/Makefile.am: Add joliet regression test files. 2004-10-28 rocky * configure.ac, lib/MSWindows/win32_ioctl.c, lib/iso9660_fs.c, test/Makefile.am, test/check_common_fn.in, test/check_iso.sh.in, test/joliet-nojoliet.right, test/joliet.right: configure.ac: Add --disable-joliet and disable joliet if iconv is not around iso9660_fs.c: Setting string length on of UCBE wrong? test/*: add joliet regression test. 2004-10-28 rocky * include/cdio/Makefile.am: cdio.h accidentally got removed. 2004-10-28 rocky * lib/cdtext_private.h: Add more fields from the MMC-3 spec. 2004-10-28 rocky * lib/Makefile.am: bytesex files have moved from private to public. Forgot to remove them for "make dist" 2004-10-28 rocky * include/cdio/iso9660.h: A small change which caused a hard-to-find bug in using Joliet filenames. 2004-10-27 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c: Cygwin fixes. 2004-10-26 rocky * lib/iso9660_fs.c: iconv manpages sys the return is size_t not int 2004-10-26 rocky * lib/iso9660_fs.c: Reinstate -1 test. 2004-10-26 rocky * lib/iso9660_fs.c: Respect --no-joliet better. 2004-10-26 rocky * configure.ac: Remove some gettext fascism. 2004-10-26 rocky * configure.ac, example/Makefile.am, src/Makefile.am, test/Makefile.am, test/vcd_demo.right: Solaris fixes test/vcd_demo.right: fix when vcd-info is not installed. 2004-10-26 rocky * src/cd-info.c: Add --no-joliet option 2004-10-26 rocky * lib/FreeBSD/freebsd.c, lib/MSWindows/win32.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, src/cd-info.c: Various valgrind-detected memory leaks and uninitialized variable errors. 2004-10-26 rocky * configure.ac, lib/iso9660.c: Test for presence of tzset(). 2004-10-26 rocky * lib/cdio.c, lib/image/bincue.c, lib/iso9660.c, lib/iso9660_fs.c, src/cd-info.c, test/Makefile.am, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/testbincue.c, test/testiso9660.c, test/vcd_demo_vcdinfo.right, test/videocd.right: Joliet filename detection for CD images is now done. Various valgrind-caught errors fixed Output changed: we no longer print root block number. (It is still shown when XA attributes are printed.) 2004-10-25 rocky * lib/iso9660.c: root_directory accounting is now a little different since we don't count the filename as part of the root_directory record. 2004-10-24 rocky * example/iso2.c, include/cdio/cdio.h, include/cdio/iso9660.h, lib/_cdio_generic.c, lib/_cdio_stream.c, lib/cdio.c, lib/generic.h, lib/image/bincue.c, lib/iso9660.c, lib/iso9660_fs.c, src/cd-info.c: First attempt to extent Joliet to CD reading portion. 2004-10-24 rocky * .cvsignore, Makefile.am, configure.ac: Makefile.am: "make test" now means the same thing as "make check" configure.ac: make sure we test for iconv. gettext isn't all that important right now. 2004-10-24 rocky * lib/iso9660_fs.c: Was looking at wrong place for joliet/non-joliet. 2004-10-24 rocky * example/Makefile.am, lib/iso9660_fs.c, src/Makefile.am, test/Makefile.am: Add libiconv libraries where needed. 2004-10-24 rocky * configure.ac: Try to reduce duplicate header tests. 2004-10-24 rocky * .cvsignore, doc/doxygen/.cvsignore: Add more derived files from recent changes. 2004-10-24 rocky * Makefile.am, configure.ac, doc/Makefile.am, doc/doxygen/{Doxyfile => Doxyfile.in}, src/iso-info.c: configure.ac: test for intl and iconv needed for Joliet support iso-info.c: add --no-joliet option Doxyfile*, configure.ac: Automatically update some of the Doxyfile information 2004-10-24 rocky * include/cdio/iso9660.h, lib/iso9660_fs.c: Various portability fixes when libiconv isn't available or is broken. 2004-10-23 rocky * TODO: [no log message] 2004-10-23 rocky * TODO: [no log message] 2004-10-23 rocky * TODO: Revise. Note iso-tar. 2004-10-23 rocky * NEWS, configure.ac, doc/glossary.texi, include/cdio/iso9660.h, lib/iso9660.c, lib/iso9660_fs.c, src/iso-info.c, test/testbincue.c: First cut at Joliet support for ISO 9660 images. More work is needed to integrate this into CD reading. 2004-10-22 rocky * src/iso-info.c: Slightly better error messages. 2004-10-22 rocky * doc/glossary.texi: Update definition of ISO 9660 2004-10-22 rocky * NEWS: What's up. 2004-10-22 rocky * include/cdio/Makefile.am, {lib => include/cdio}/bytesex.h, {lib => include/cdio}/bytesex_asm.h, include/cdio/iso9660.h, lib/Makefile.am, lib/image/nrg.c, lib/iso9660.c, lib/iso9660_fs.c, lib/xa.c, src/cd-info.c, src/iso-info.c: iso9660.h, iso9660_fs.c: Add iso9660_ifs_is_xa() a routine to determine if an iso image has XA attributes. bytesex.h and bytesex_asm.h are now public. (Down the line should use glib though.) Package has been revised to the move. iso-info.c: shows XA attributes what that it is available. 2004-10-12 rocky * THANKS: Add Ian MacIntosh. 2004-10-10 rocky * include/cdio/iso9660.h: small formatting change. 2004-10-10 rocky * NEWS: What's changed. 2004-10-10 rocky * doc/libcdio.texi, example/.cvsignore, example/Makefile.am, example/README, example/{sample8.c => cdtext.c}, example/{sample5.c => drives.c}, example/iso1.c, example/{sample6.c => iso2.c}, example/{sample7.c => iso3.c}, example/{sample9.c => scsi-mmc1.c}, example/{sample10.c => scsi-mmc2.c}, example/{sample1.c => tracks.c}: Rename many of the "sample" programs to something more descriptive. libcdio.texi: add a SCSI-MMC example program. 2004-10-09 rocky * include/cdio/iso9660.h, lib/iso9660_fs.c: Change some void * return types to what they really are. The void * was helping to propagate the mistake of not exporting CdioList in ds.h. CVS: ----------------------------------------------------------------------include/cdio/iso9660.h lib/iso9660_fs.c CVS: ---------------------------------------------------------------------- 2004-10-09 rocky * example/Makefile.am, include/cdio/Makefile.am, {lib => include/cdio}/ds.h, include/cdio/iso9660.h, lib/Makefile.am, lib/ds.c, lib/image/nrg.c, lib/image_common.h, lib/iso9660_fs.c, src/cd-info.c, src/iso-info.c: Make ds.h public. It should have been that way since it *is* public. Eventually though we'll redo things using glib and then ds.h will get removed. 2004-09-11 rocky * src/Makefile.am: Apply Patch #3043 Thanks to mccarthy from U of Alberta: Building libcdio with libcddb in a non-standard directory --prefix causes make to fail. 2004-09-06 rocky * TODO: Update wish-list. 2004-09-05 rocky * include/cdio/cdtext.h, test/Makefile.am, test/testbincue.c, test/testtoc.c: cdtext.h: minor doxygen improvemtn others: make "make distcheck" work again. 2004-09-04 rocky * doc/doxygen/Doxyfile, include/cdio/cdio.h, include/cdio/cdtext.h, include/cdio/dvd.h, include/cdio/iso9660.h, include/cdio/logging.h, include/cdio/scsi_mmc.h: Changes to make doxygen doc better. 2004-09-04 rocky * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, test/cdda-mcn.right, test/cdda.right, test/check_cue.sh.in, test/check_nrg.sh.in, test/check_opts.sh, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Add get_hwinfo functions in image drivers. 2004-09-03 rocky * configure.ac, include/cdio/types.h, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio_private.h, lib/cdtext.c, lib/cdtext_private.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/scsi_mmc.c, lib/sector.c, lib/util.c: configure.ac: now in 0.71cvs *.c: lint-like changes. Tested on Sun's SUNPRO cc compiler. Removed field initialization lingo (even if it is C99). 2004-09-02 rocky * lib/_cdio_osx.c: Fix bugs in discmode determination. And actually in general due to moving i_first_track to generic structure. 2004-09-02 rocky * lib/_cdio_osx.c: Remove include which is not needed. 2004-09-02 rocky * src/cd-info.c: Possibly some C compilers need at least 2 arguments. Noticed on old FreeBSD box. 2004-09-02 rocky * lib/Makefile.am: Update for release. I think I have it right this time. (Well, at least Nicolas Boullis doesn't strongly *disagree*). 2004-09-01 rocky * configure.ac: Update for release. 2004-08-30 rocky * THANKS: How could I have forgotten... 2004-08-30 rocky * lib/cdtext.c: Put in later after tested. 2004-08-30 rocky * src/cd-info.c: Error messages was slightly incorrect. And add another one of that ilk. 2004-08-30 rocky * lib/_cdio_osx.c: Use generic routines for getting first track and number of tracks. 2004-08-30 rocky * lib/_cdio_osx.c, src/cd-info.c: _cdio_osx.c: wasn't returning CDIO_INVALID_TRACK on TOC read error. cd-info.c: abort sooner if we can't read the TOC. 2004-08-30 rocky * include/cdio/sector.h, src/cd-info.c: cd-info.c: bug in DVD test. sector.h: redo the way the dvd and cd tests work. Isn't strictl necessary, but this is has fewer implicit dependencies. 2004-08-30 rocky * include/cdio/sector.h, lib/cdtext.c, lib/cdtext_private.h, src/cd-info.c: sector.h: add routines for determining if discmode is DVD or CD. cdtext*: adjust for bigendian or not. Check for double-byte characters. cd-info.c: new option --dvd. Don't attempt to understand DVD unless this is given. 2004-08-29 rocky * lib/Makefile.am: Incremented the wrong thing. 2004-08-29 rocky * lib/Makefile.am: Increment before release. 2004-08-29 rocky * lib/_cdio_osx.c, lib/cdio.c: cdio.c: missing string for discmode enumeration. _cdio_osx.c: fix a couple of bus faults. Detects DVD-RW properly now. Better error message for failing to read TOC. 2004-08-29 rocky * lib/_cdio_osx.c: CD-ROM media type does not indicate whether a CD is CD-DA or CD-DATA 2004-08-29 rocky * lib/MSWindows/win32_ioctl.c: Better error reporting when TOC reading fails. Well at least we try to do better. env -> p_env some places. 2004-08-28 rocky * NEWS: Note CD-text addition. 2004-08-28 rocky * lib/_cdio_osx.c: Some cleanups, possibly bug fixes. Hack in optimistic guess for drive properties. 2004-08-28 rocky * lib/_cdio_generic.c, lib/_cdio_osx.c, lib/cdio.c, lib/cdio_private.h, lib/generic.h: _cdio_osx.c: add getting hw info. Get some read/write capabilities and disc info. *generic*: split off CD discmode classification so it can be used by OSX cdio: env -> p_env 2004-08-27 rocky * example/sample9.c, include/cdio/cdio.h, lib/_cdio_linux.c, lib/scsi_mmc.c, src/cd-drive.c, src/cd-info.c: add psz_ to hwinfo type. _cdio_linux.c: go back to using SCSI MMC drive cap routine. 2004-08-27 rocky * example/sample7.c: Add p_ where appropriate. 2004-08-27 rocky * example/sample6.c: add p_ where appropriate. 2004-08-27 rocky * example/sample5.c: cd_drives -> ppsz_cd_drives 2004-08-27 rocky * example/.cvsignore: [no log message] 2004-08-27 rocky * doc/doxygen/.cvignore, doc/doxygen/.cvsignore: filename typo: .cvignore -> .cvsignore 2004-08-27 rocky * include/cdio/cdio.h, lib/cdio.c: Add constant variable to indicate which OS driver we've got in build. 2004-08-27 rocky * NEWS: What's up. 2004-08-27 rocky * include/cdio/cdio.h, lib/cdio.c, src/cd-drive.c, src/cd-info.c: Add a couple of routines to pass back the driver used in getting a drive. Speeds up a little the task of opening the drive. Is now used in cd-drive and cd-info. 2004-08-27 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, lib/MSWindows/win32_ioctl.c: Use generic SCSI MMC code for getting drive capabilities. 2004-08-27 rocky * lib/_cdio_osx.c: Wrong access for setting drive capabilities to unknown. 2004-08-27 rocky * include/cdio/cdio.h, include/cdio/scsi_mmc.h, lib/cdio.c, lib/cdio_private.h, lib/scsi_mmc.c, src/cd-drive.c, src/cd-info.c: Expose hwinfo call as a cdio command. It was SCSI-MMC. This may help on OSX. 2004-08-27 rocky * lib/_cdio_linux.c, lib/scsi_mmc.c: scsi_mmc.c: more aggressive about getting drive capabilities. Try to get length first. Also try CAPABILITIES_PAGEs as well as ALL_PAGEs. 2004-08-27 rocky * lib/_cdio_osx.c: Devices list fixed, compilation error and give up on drive capabilities for now 2004-08-27 rocky * src/util.c: Show status unknown when it is unknown 2004-08-26 rocky * lib/_cdio_linux.c: Small variable name changes 2004-08-26 rocky * lib/_cdio_osx.c: Small formatting changes 2004-08-22 rocky * lib/_cdio_osx.c: Save more IOkit information in private structure and separate this from reading TOC. Many small changes that I hope will eventually get us closer to getting more drive and CD information although for now it doesn't help all that much. 2004-08-19 rocky * lib/_cdio_osx.c: Partial OSX improvements -- more work is needed. 2004-08-19 rocky * configure.ac: Another attempt at a pkgconfig bug workaround 2004-08-19 rocky * configure.ac, libcdio.pc.in: Fixes for making libcdio work with pkg-config on Darwin when linking vcdimager and when linking just libcdio. From Steven M. Schultz: I blew a couple minutes tinkering with libcdio.pc and found that manually adding a quote character (not even a matched set of quotes!) around the second -framework was enough. What works for now is manually editing libcdio.pc after it's been installed: Libs: -L${libdir} -lcdio -lm -Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,IOKit to: Libs: -L${libdir} -lcdio -lm -Wl,-framework -Wl,CoreFoundation "-Wl,-framework" -Wl,IOKit is enough to get vcdimager compiled and linked. Appears that the thing to do is somehow get the quotes into libcdio.pc but not into $LIBS - or something like that at any rate. 2004-08-18 rocky * lib/_cdio_osx.c: Make sure pp_scsiTaskDeviceInterface is initialized. The code should probably be reorganized better for this. For now this probably works. 2004-08-16 rocky * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: Set toc_init even on image drivers. Never know when the could will start needing this, but may as well do now. 2004-08-16 rocky * lib/FreeBSD/freebsd.c, lib/_cdio_bsdi.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c: Initialize gen.toc_init 2004-08-16 rocky * lib/_cdio_osx.c: Forgot to init CD-Text variables. 2004-08-16 rocky * lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c: _cdio_osx.c: first attempt at issuing general SCSI-MMC passthrough command. others: small changes. 2004-08-15 rocky * lib/_cdio_osx.c: First attempt at getting drive capabilities. 2004-08-15 rocky * lib/_cdio_osx.c: Compilation fix. 2004-08-13 rocky * lib/_cdio_generic.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h: Merge common cdtext code into image drivers. 2004-08-13 rocky * lib/_cdio_osx.c: Compilation fixes. 2004-08-12 rocky * README.libcdio: Add instructions for CVS. 2004-08-10 rocky * lib/FreeBSD/freebsd.c: Now that all of the generic cdtext code is in place, it is trivial to add CD-Text support to FreeBSD. 2004-08-10 rocky * lib/MSWindows/win32.c: typo. 2004-08-10 rocky * example/sample10.c, lib/MSWindows/win32.c, lib/Makefile.am, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, lib/generic.h, src/util.c: lib/*.c: create and use get_cdtext_generic. lib/generic.h: prototypes for _cdio_generic.c (move out of _cdio_private.h) example/sample10.c, src/util.c: small print format improvement 2004-08-10 rocky * src/util.c: Ooops. Debug info creapt in. 2004-08-10 rocky * lib/MSWindows/win32.c, lib/MSWindows/win32.h, src/util.c: Compilation fixes for Win32 and cd-text breakage. 2004-08-10 rocky * example/.cvsignore: We now have 10 samples so it's sample?? as well as sample? 2004-08-10 rocky * lib/_cdio_bsdi.c: Compilation fixes from cd-text breakage. Also make style more like the others. 2004-08-10 rocky * lib/_cdio_sunos.c: compilation fix 2004-08-10 rocky * test/vcd_demo.right: More correct output and add additional capability lines 2004-08-10 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h: 1st attempt to reduce duplicate CD-Text code. (It works on GNU/Linux)... 2004-08-10 rocky * example/sample10.c, include/cdio/scsi_mmc.h, lib/FreeBSD/freebsd_ioctl.c, src/util.c: Add a couple of "features". freebsd_ioctl.c: hopefully less-erroneous MCN extraction. 2004-08-08 rocky * lib/Makefile.am: Pedantic alphabetization. 2004-08-08 rocky * example/sample10.c, src/util.c: Print hardware serial number if given by feature. 2004-08-08 rocky * src/util.c: Add more feature info. 2004-08-08 rocky * lib/MSWindows/win32.c: Compilation fixes. 2004-08-07 rocky * lib/_cdio_bsdi.c: Make like the others. 2004-08-07 rocky * lib/FreeBSD/freebsd.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, lib/scsi_mmc.c: Add b_cdtext_init and b_cdtext_error to generic structure. If we can't read cdtext once, mark as an error and don't try to read again. 2004-08-07 rocky * doc/libcdio.texi: Add section to Give complete list of example programs. A few small updates, spelling corrections, typo is other places. 2004-08-07 rocky * src/cd-drive.c: Bug: listing wrong drive capabilities. Was using wrong source_name. 2004-08-07 rocky * example/sample1.c, example/sample2.c, example/sample3.c, example/sample4.c: cdio->p_cdio 2004-08-07 rocky * example/README: [no log message] 2004-08-07 rocky * lib/FreeBSD/freebsd.c: Attempt getting disc mode. 2004-08-07 rocky * example/sample10.c, lib/FreeBSD/freebsd_cam.c, lib/scsi_mmc.c, src/util.c: FreeBSD and gcc < 3.0 fixes Some variable name changes to match style. 2004-08-07 rocky * lib/FreeBSD/freebsd.c: Compilation bug: need the conversion assignment. 2004-08-07 rocky * example/sample10.c, src/util.c: Add power management feature display. 2004-08-07 rocky * include/cdio/scsi_mmc.h: Add more feature codes. 2004-08-07 rocky * example/sample10.c, src/util.c: Add more feature descriptions. 2004-08-07 rocky * example/sample10.c, include/cdio/scsi_mmc.h, src/cd-drive.c, src/util.c, src/util.h: util.*, cd-drive: Add feature listing to cd-drives. sample10.c: More feature information printed scsi_mmc.h: more doxygen comments about features. 2004-08-06 rocky * include/cdio/scsi_mmc.h, lib/scsi_mmc.c: small changes. 2004-08-06 rocky * include/cdio/scsi_mmc.h: Add more feature definitions. 2004-08-06 rocky * example/README: Update. 2004-08-06 rocky * example/Makefile.am, example/sample10.c: SCSI MMC example to show feature list of a drive. 2004-08-06 rocky * lib/MSWindows/win32.c, src/util.c: win32.c: initialize capabilities before setting them. util.c: typo was using read parameter for determining CD-RW writing. 2004-08-06 rocky * include/cdio/scsi_mmc.h: Fill out GET_CONFIGURATION - add some feature info and return types. 2004-08-06 rocky * test/cdda-mcn.right, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Output had been erroneously showing CD-RW write capability. We also now show DVD-RW and DVD+RW capabilities. 2004-08-06 rocky * include/cdio/types.h: Comment corrections. 2004-08-06 rocky * src/cd-info.c, src/util.c: cd-info.c: should not try to print out MCN for DVD's - they don't have any such thing. util.c: wasn't reading right/write params when showing write capabilities. now also show DVD+RW and DVD-RW capabilities. 2004-08-05 rocky * NEWS: What's up. 2004-08-05 rocky * lib/FreeBSD/freebsd.c: Don't need to call initialization of TOC here. Was done to mask a bug somewhere else that has since (I think) been fixed. 2004-08-05 rocky * lib/_cdio_linux.c: As with Win32 was passing the wrong pointer (p_cdio instead of p_env). CD-TEXT now sometimes works on GNU/Linux! 2004-08-05 rocky * lib/scsi_mmc.c: Up the timeout. Seems to work a little better. Probably also need either to retry or try a timeout of 0. 2004-08-05 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/scsi_mmc.c: Was passing in the wrong pointer (p_cdio instead of p_env) 2004-08-03 rocky * lib/FreeBSD/freebsd.c, lib/MSWindows/win32.c: Initialization bugs. 2004-08-03 imacintosh * lib/_cdio_sunos.c: Now uses DKIOCGMEDIAINFO to get discmode and handles Solaris media 2004-08-01 rocky * lib/FreeBSD/freebsd_cam.c: Compilation fix. 2004-08-01 rocky * lib/FreeBSD/freebsd_cam.c: Initialize ccb. Could this be the problem? 2004-08-01 rocky * include/cdio/scsi_mmc.h: Add GET_CONFIGURATION. 2004-08-01 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd_cam.c, lib/scsi_mmc.c: scsi_mmc.c: doc change FreeBSD: use generic routines more often. Initialize TOC before getting drive capabilities (seems to be desired, not completely sure or sure why this would be so.) 2004-07-31 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c: More in line with rest of MMC stuff. 2004-07-31 rocky * lib/FreeBSD/freebsd.h: source_name is now in gen. 2004-07-31 rocky * lib/FreeBSD/freebsd.c: Compilation fix. 2004-07-31 rocky * include/cdio/scsi_mmc.h, lib/_cdio_linux.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h, src/cd-drive.c, src/cd-info.c, src/cd-read.c, src/util.h: Add scsi_mmc_get_hwinfo. 2004-07-29 rocky * example/sample8.c: message->psz_msg 2004-07-29 rocky * doc/libcdio.texi: Small changes. 2004-07-29 rocky * include/cdio/scsi_mmc.h: Add lengths of hardware vendor, model, and revision. 2004-07-29 rocky * example/Makefile.am, example/README, example/sample8.c, example/sample9.c: sample9: A program to show issuing a SCSI-MMC command. sample8: cdio->p_cdio; update copyright 2004-07-29 rocky * lib/scsi_mmc.c: Bug: passing wrong object. 2004-07-29 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Use more common routines. ioctl - not tested. ASPI has bug probably in running scsi command. 2004-07-29 rocky * lib/_cdio_bsdi.c: Convert to use generic routines for first track, num tracks and getting discmode. 2004-07-29 rocky * lib/_cdio_sunos.c: compilation fix. 2004-07-29 rocky * include/cdio/scsi_mmc.h, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h, test/cdda-mcn.right, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/monvoisin.right, test/svcdgs.right, test/videocd.right: Tighten code by putting more generic routines in cdio_generic: to get first track number and number of tracks to get discmode everybody now has gen.i_tracks and gen.i_first_track. test/* format of output changed yet again. 2004-07-28 rocky * example/sample8.c, include/cdio/cdio.h, lib/cdio.c, src/cd-info.c: Add discmode to string array. Simplifies some code a bit. 2004-07-28 rocky * doc/libcdio.texi: Add CD-TEXT example. Note existence of MMC interface. 2004-07-28 rocky * lib/MSWindows/win32_ioctl.c: Bug in generic run_scsi_cmd_win32ioctl: wasn't copying CDB in and wasn't setting length. 2004-07-28 rocky * include/cdio/scsi_mmc.h, lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/_cdio_linux.c, lib/scsi_mmc.c: Make setting read lengths more precise (and correct). 2004-07-28 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: compilation fixes 2004-07-28 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32_ioctl.c: msecs 2 secs cleanup 2004-07-28 rocky * lib/scsi_mmc_private.h: Typo in fn name. 2004-07-28 rocky * include/cdio/dvd.h, include/cdio/scsi_mmc.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/_cdio_bsdi.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: Make sure milliseconds get converted to seconds if needed. Some function renaming, and a typo in a DVD book type. 2004-07-27 rocky * lib/scsi_mmc.c, lib/util.c: fixes for DVD handling 2004-07-27 rocky * lib/_cdio_bsdi.c: Add CD-TEXT 2004-07-27 rocky * lib/_cdio_bsdi.c: Add disc mode and small bug fixes 2004-07-27 rocky * lib/_cdio_bsdi.c: Best guess of how to do scsi_mmc_run_cmd. Thanks to Steven M. Schultz 2004-07-27 rocky * lib/_cdio_bsdi.c: compilation fixes 2004-07-27 rocky * include/cdio/scsi_mmc.h, lib/_cdio_sunos.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: Yet more alternate "_generic" to simplify CD-ROM drivers (like all of them except Windows) were there is in fact only one MMC passthrough command. 2004-07-27 rocky * lib/MSWindows/win32.c, lib/MSWindows/win32_ioctl.c: Misc consolidation fixes. Some mode2 reading seems broken still. 2004-07-27 rocky * lib/_cdio_sunos.c, test/vcd_demo.right: Compilation fixes. Added get_discmode. 2004-07-27 rocky * lib/MSWindows/aspi32.c: compilation typo 2004-07-27 rocky * include/cdio/scsi_mmc.h, lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c, lib/_cdio_bsdi.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, lib/scsi_mmc.c, lib/scsi_mmc_private.h: More consolidation of code by adding routines to scsi_mmc. 2004-07-26 rocky * lib/MSWindows/win32_ioctl.c: Don't use the cdtext_set_field macro any more. 2004-07-26 rocky * lib/MSWindows/aspi32.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: get_dvd_physical common routine now works. 2004-07-26 rocky * include/cdio/scsi_mmc.h, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/_cdio_linux.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: Try to make get_dvd_physical a common routine. (Haven't tested yet.) 2004-07-26 rocky * lib/MSWindows/win32.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: Start to break out routines into a device-callable routine as well as a publicly callable routine. The device-callable routine will be able to change the passthrough routine as M$ has two distinct routines for aspi and ioctl. 2004-07-26 rocky * include/cdio/scsi_mmc.h, lib/Makefile.am, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/scsi_mmc.c, lib/scsi_mmc_private.h: Big change! We now are starting to have universal MMC routines. To do this we need to have function pointers to the OS-specific MMC send/run command. Expect some breakage. Down the line though this will increase code reuse, reliabilty, and make the library more user-customizable. 2004-07-25 rocky * lib/MSWindows/win32.c: Got test backwards. 2004-07-25 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Add ioctl disc mode detection. - Not fully tested yet. 2004-07-25 rocky * lib/MSWindows/aspi32.c: Disc mode detection done for aspi. 2004-07-25 rocky * example/sample8.c: Enumeration has changed. 2004-07-25 rocky * include/cdio/sector.h, lib/_cdio_linux.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/sector.c, src/cd-info.c, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/monvoisin.right, test/svcdgs.right, test/videocd.right: Reduce overall number of CD disc modes. I thing the main purpose that will be used is to separate CD Audio from CD Data, XA and DVD's. On GNU/Linux it seems that the implementation is a bit artificial. 2004-07-25 rocky * lib/_cdio_linux.c: Pedantic ordering. 2004-07-25 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, src/cd-info.c: MSWindows: add DVD type determination. cd-info.c: poor disc-mode error message string 2004-07-25 rocky * include/cdio/scsi_mmc.h: Typo 2004-07-25 rocky * include/cdio/Makefile.am: Add dvd.h to list of includes. 2004-07-25 rocky * lib/FreeBSD/freebsd.h: We use p_env now. 2004-07-25 rocky * lib/_cdio_linux.c: Typo and small formatting changes. 2004-07-25 rocky * include/cdio/dvd.h: Typo 2004-07-25 rocky * lib/FreeBSD/freebsd.c: Remove duplicate toc_init field and use gen.toc_init like other drivers use. 2004-07-25 rocky * lib/_cdio_linux.c: Better testing to see if TOC is initialized by read_toc_linux before using info based on that. Order of routines alphabetized a little bit better. 2004-07-25 rocky * src/cd-info.c: Some weird problem when --no-cddb and libcddb was not around. I'd rather switch than fight it. 2004-07-25 rocky * include/cdio/dvd.h: Definitions for DVD access. 2004-07-25 rocky * lib/FreeBSD/freebsd.c: Set initialization of TOC when that's done. Test for TOC initialization success in routines that depend on that. 2004-07-25 rocky * lib/MSWindows/aspi32.c: Compilation fix: run_scsi_cmd is no longer static. 2004-07-25 rocky * test/cdda.cue, test/cdda.right, test/cdda.toc, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.cue, test/isofs-m1.right, test/isofs-m1.toc: Not sure if we can have a MCN on a CD-DATA filesystem, but I know we can have one on a CD-DA. So remove it from the ISO and add it to the CD-DA. Also isofs-m1 is now reports that it is a CD-DATA CD since that's what it is. 2004-07-25 rocky * lib/FreeBSD/freebsd_cam.c: Add some checks for failed initialization and NULL pointers. Thanks to Steve Schultz. 2004-07-25 rocky * example/sample8.c, include/cdio/scsi_mmc.h, include/cdio/sector.h: Changes to facilitate DVD detection. 2004-07-25 rocky * include/cdio/sector.h, lib/_cdio_linux.c, src/cd-info.c: sector.h: add more DVD types. _cdio_linux.c: Add ability in GNU/Linux to determine if a drive has a DVD in it. cd-info: show the drive type. 2004-07-24 rocky * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h, src/cd-info.c, test/cdda-mcn.right, test/cdda.right, test/check_cue.sh.in, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Add get_disc_mode to image readers. Add it in cd-info display. Update regression tests. I'm not sure disc_mode is all that helpful or correct. 2004-07-24 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c: FreeBSD compilation fixes. 2004-07-24 rocky * example/README, example/sample8.c: sample8 program shows CD-TEXT and Disc mode info. 2004-07-24 rocky * lib/FreeBSD/freebsd.c: Allow scsi mmc commands to get invoked from outside (for CAM access). 2004-07-24 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h: Add get_drive_cap and generic get_mcn routines. 2004-07-24 rocky * include/cdio/sector.h, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/_cdio_linux.c: freebsd: add scsi_mmc_cmd_run and use it. Others: small changes. 2004-07-23 rocky * lib/FreeBSD/freebsd.c: Typo. 2004-07-23 rocky * lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Allow scsi_mmc_run_cmd to get called from outside. 2004-07-23 rocky * lib/MSWindows/win32_ioctl.c: Add scsi_mmc_run_cmd_win32ioctl and use it. 2004-07-23 rocky * include/cdio/scsi_mmc.h, include/cdio/sector.h: Formatting and small name change. 2004-07-23 rocky * lib/MSWindows/aspi32.c: Create uniform scsi_mmc_run_cmd routine and use this more pervasively. 2004-07-23 rocky * lib/FreeBSD/freebsd.c: Reinstate MCN guess. 2004-07-23 rocky * lib/_cdio_sunos.c: Oops mande MCN buffer too short. More intelligible and tighter code. 2004-07-23 rocky * lib/_cdio_sunos.c: More small changes. 2004-07-23 rocky * lib/_cdio_sunos.c: Small changes - perhaps not really in the category of bugfixes. 2004-07-23 rocky * lib/_cdio_sunos.c: Use common SCSI MMC routine where possible. 2004-07-22 rocky * lib/_cdio_linux.c, lib/cdio_private.h: Wasn't allowing call of new scsi_mmc_run_cmd. 2004-07-22 rocky * lib/_cdio_linux.c: Fell into the a common C pitfall 2004-07-22 rocky * include/cdio/scsi_mmc.h, include/cdio/sector.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, lib/scsi_mmc.c: Work on SCSI MMC layer. Some things may be broken. 2004-07-21 rocky * lib/cdio.c: Turn an assertion into a return failure. 2004-07-21 rocky * include/cdio/scsi_mmc.h: Add more SCSI MMC-3 commands 2004-07-21 rocky * example/sample8.c: Correct for get_disctype to get_discmode change. 2004-07-21 rocky * include/cdio/sector.h: Correct discmode comments. 2004-07-21 rocky * example/sample8.c, include/cdio/cdio.h, include/cdio/scsi_mmc.h, include/cdio/sector.h, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h: Add get_discmode to return what kind of CD or DVD we've got. This is no where near finished. In fact I just started it on GNU/Linux. CD-TEXT on GNU/Linux: turn "warning" into "info". Reduce the chance of error (although we still don't get the CD-TEXT.) 2004-07-19 rocky * lib/MSWindows/win32.c: A little less convoluted 2004-07-19 rocky * lib/FreeBSD/freebsd_cam.c, lib/_cdio_sunos.c: Initialize/null out drive capabilities before setting them. 2004-07-19 rocky * include/cdio/scsi_mmc.h, include/cdio/types.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/scsi_mmc.c: Add READTOC format defines. 2004-07-19 rocky * doc/glossary.texi: Add CD+G. 2004-07-18 rocky * lib/FreeBSD/freebsd.h: Compilation fix from Steven M. Schultz. 2004-07-18 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Modified for expanded CD-TEXT handling. 2004-07-18 rocky * lib/cdio.c: gcc 2.95 vs 3.0 fix. Thanks yet again to Steven Schultz. 2004-07-18 rocky * test/cdda-mcn.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right: Output has changed again. "eject" seems to be more commonly used than "open tray." 2004-07-18 rocky * lib/FreeBSD/freebsd_cam.c: Some compilation fixes from Steven M. Schultz. Thanks! get_drive_cap_freebsd_cam updated to expanded API. 2004-07-18 rocky * example/sample2.c, include/cdio/types.h, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/scsi_mmc.c, src/util.c, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/vcd_demo.right, test/videocd.right: MMC mode page capabilities gone over. Some more were added. 2004-07-17 rocky * example/sample2.c, include/cdio/cdio.h, include/cdio/scsi_mmc.h, include/cdio/types.h, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio_private.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h, lib/scsi_mmc.c, src/cd-drive.c, src/cd-info.c, src/util.c, src/util.h, test/cdda-mcn.right, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Expand getting drive capabilities. We now have 3 masks where we had only one before. 2004-07-17 rocky * src/iso-read.c: Check that mandatory options are mandatory and note in help where they are. Error messages gone over a little. Closes bug #9675 http://savannah.gnu.org/bugs/?func=detailitem&item_id=9675 2004-07-17 rocky * lib/_cdio_sunos.c: Make use of more CDIO_CDROM_LBA and CDIO_CDROM_MSF #defines. 2004-07-17 rocky * include/cdio/sector.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c, lib/_cdio_sunos.c: Add common defines for some subchannel commands, and use them. 2004-07-17 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Hoist common CD-TEXT routines. 2004-07-17 rocky * lib/_cdio_sunos.c: Fix for Sunos and new CD-TEXT API. 2004-07-17 rocky * lib/cdtext_private.h: Fix for Win32. 2004-07-17 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Win32 fixes for new CD-TEXT interface. 2004-07-17 rocky * lib/_cdio_linux.c, lib/cdtext.c, lib/cdtext_private.h: Add common routine to extract cdtext data. 2004-07-17 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/_cdio_linux.c, lib/_cdio_sunos.c: Corrections for new cdtext interface. Some more precise track handling when the first track is not 1. Some of this needs to be tested. 2004-07-17 rocky * example/sample8.c, include/cdio/cdio.h, include/cdio/cdtext.h, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h, lib/image/bincue.c, lib/image_common.h, src/cd-info.c, test/cdda-mcn.right, test/cdda.right: Expand get_cdtext to include a track number. 0 = disc info. 2004-07-16 rocky * include/cdio/cdtext.h, lib/cdtext.c, src/cd-info.c, src/cd-read.c, test/cdda-mcn.right, test/cdda.right, test/cdda.toc: Add cdtext display to cd-info and adjust regression tests accordingly. cd-read.c: don't try to print null strings. 2004-07-16 rocky * lib/MSWindows/win32.c: Wasn't calling CD-TEXT win32 ioctl routine. CD-TEXT now works on win32 ioctl. 2004-07-16 rocky * lib/_cdio_sunos.c: insignificant changes 2004-07-16 rocky * lib/MSWindows/win32_ioctl.c: CDB for READ_CD has only 12 bytes. 2004-07-16 rocky * lib/MSWindows/win32_ioctl.c: Misplaced #endif 2004-07-16 rocky * lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Add CD-TEXT handling 2004-07-16 rocky * lib/MSWindows/aspi32.c: routine name change. 2004-07-16 rocky * lib/MSWindows/win32_ioctl.c: Use more universal C style 2004-07-16 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c: Finish get_MCN for aspi. Use conventions to make look more like other SCSI passthrough routines. 2004-07-15 rocky * lib/_cdio_sunos.c: Get MCN now works. Retrieving CD TEXT no longer causes core dump. (It still doesn't give useful info back though.) Code cleanups. 2004-07-15 rocky * lib/_cdio_linux.c: cmd -> cdb to match MMC terminology and Solaris naming. 2004-07-15 rocky * lib/_cdio_sunos.c: Closer to getting CDTEXT working. 2004-07-15 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.h, lib/_cdio_linux.c, lib/cdio.c: MSWindows: comment corrections _cdio_linux.c: perhaps closer to getting CD TEXT correct. 2004-07-14 rocky * lib/MSWindows/aspi32.c: small cleanup changes. 2004-07-14 rocky * lib/MSWindows/aspi32.c: Start to consolidate SCSI MMC passthrough code. 2004-07-13 rocky * example/sample2.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c: MSWindows lint. 2004-07-13 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/_cdio_linux.c, lib/image_common.h: Yet more code cleanups. 2004-07-13 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c: Some code cleanups - more may follow. 2004-07-13 rocky * example/sample8.c, lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c, lib/cdio_private.h, lib/image_common.h: Add CD-TEXT to MS-Windows ASPI driver. (The first real CD driver!) In the process we've had to remove "const" from get_aspi. 2004-07-12 rocky * test/bad-cat1.cue: Bad catalog cue test 1. 2004-07-12 rocky * test/bad-msf-3.cue: Bad MSF cue test 3. 2004-07-12 rocky * test/bad-msf-1.cue: MSF cue test 1 2004-07-12 rocky * include/cdio/sector.h, lib/MSWindows/aspi32.c, lib/MSWindows/win32_ioctl.c: MS Windows compilation fixes. 2004-07-11 rocky * example/sample8.c, include/cdio/cdio.h, include/cdio/cdtext.h, lib/cdio.c, lib/cdio_private.h, lib/cdtext.c, lib/image.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h, test/cdda.cue: Redo CD-TEXT handling. First minimally working version for CD bin/cue and cdrdao images. 2004-07-11 rocky * test/Makefile.am, test/cdtext.toc, test/testtoc.c: Add cdtext regression test. 2004-07-11 rocky * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: Initialize cdtext to NULL and other add some initializations that should have been done. 2004-07-11 rocky * lib/cdtext.c: Correct some string initialization bugs in cdtext_keywords. We switched from binary search to linear search for now. 2004-07-10 rocky * lib/image/nrg.c: Save modes types now that we have that in the disc structure. Information for this comes courtesy extractnrg.pl 2004-07-10 rocky * lib/image.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h: Hoist some more common image routines and make image drivers look more common. In particular we now have a "cue", "source", and "access-mode" parameters defined even when "cue" and "source" are the same as in NRG. The _img_private_t's for the image drivers are now more similar if not the same. Some memory leaks when there are error conditions in opening image drivers have been fixed. 2004-07-10 rocky * include/cdio/sector.h, lib/Makefile.am, lib/image.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image_common.h: Hoist common track mode, disk format and disk flags into sector.h Hoist track information into image.h 2004-07-10 rocky * include/cdio/sector.h, lib/MSWindows/win32_ioctl.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/sector.c: Pull out mmssff_to_lba routine and fix bug when in error reporting when frame >= 100. Add msf3_to_lba and use that where possible (win32_ioctl.c for example). 2004-07-10 rocky * test/.cvsignore, test/Makefile.am, test/bad-cat3.cue, test/bad-mode1.cue, test/bad-msf-2.cue, test/bad-msf-3.toc, test/testbincue.c, test/testtoc.c: More cue tests. Add another bad msf toc test. If argc > 1 in testtoc, testbincue, then we give debug output. 2004-07-09 rocky * lib/image/bincue.c, lib/image/cdrdao.c: bincue: check catalog string for validity. cdrdao: slightly more precise error messages for CATALOG. 2004-07-09 rocky * test/Makefile.am, test/bad-cat2.cue, test/bad-cat2.toc, test/bad-cat3.cue, test/testbincue.c: Add some bincue regression tests. 2004-07-09 rocky * NEWS: Buzz, buzz, buzz. Tell me what's a happenin'. 2004-07-09 rocky * lib/image/cdrdao.c: Forgot to close file descriptor. Some variable name changes to make more consistent with variable-name conventions. 2004-07-09 rocky * lib/image/bincue.c: Now uses cuetools-based cue parsing. A more complete job is now done. Cue files are completely parsed for validity in cdio_is_cuefile. Remove sector 2336 (PSX) hack. It's now gotta be in the cue file. Get a c(l)ue. If you don't have one, we're no longer going to try to fake one up (which we did poorly anyway.) 2004-07-09 rocky * include/cdio/cdio.h: API version change. If it's not already it will be with planned CDTEXT changes, capability return changes and get_default drive returning the driver used. 2004-07-09 rocky * THANKS: Note that Svend also supplied CUE parsing code. 2004-07-09 rocky * lib/cdtext.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/image/nrg.h, lib/image_common.h: mcn -> psz_mcn and other psz variables. bincue.c: a little closer to getting cuetools parse_cuefile usable. 2004-07-09 rocky * include/cdio/cdtext.h: Small changes. 2004-07-09 rocky * lib/image/bincue.c: Fill in a tad more. In particular the mmssff_to_lba routine. 2004-07-09 rocky * example/sample8.c, include/cdio/cdtext.h, lib/Makefile.am, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h, lib/cdtext.c, lib/cdtext_private.h, lib/image/bincue.c, lib/image/cdrdao.c: Start to merge in cue parsing from cuetools. Also moves forward CDTEXT from a different direction. 2004-07-08 rocky * lib/_cdio_sunos.c: Small changes. 2004-07-08 rocky * include/cdio/scsi_mmc.h, lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/_cdio_sunos.c: Sun drive capabilities improved. Sun and Windows ASPI use common MODE_SENSE defines defines now. 2004-07-08 rocky * lib/FreeBSD/freebsd_cam.c, lib/_cdio_sunos.c: #define changed name. Fix compilation error. 2004-07-08 rocky * example/Makefile.am, include/cdio/Makefile.am, include/cdio/cdtext.h, include/cdio/scsi_mmc.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h: Regularize MMC commands more. Add ALLOW_PREVENT_MEDIUM. Start CDTEXT. _cdio_linux.c: better at reporting errors. 2004-07-01 rocky * libcdio.spec.in: All files in cdinfo should be owned by root and the root group. Change from Manfred Tremmel in response to a problem reported by Gabriel L. Somlo. 2004-07-01 rocky * test/vcd_demo.right: Update for more capabilities in vcd-info -enabled cd-info. 2004-07-01 rocky * lib/image/nrg.c, lib/image/nrg.h: Note the existence of CD-TEXT even if we don't know how to parse it yet. 2004-06-30 rocky * README.libcdio: Spelling mistake. 2004-06-29 rocky * include/cdio/iso9660.h: Preparation for handling Joliet (and RockRidge?) extensions. 2004-06-28 rocky * lib/MSWindows/win32_ioctl.c: Use common MODE SENSE routines in scsi-mmc.c 2004-06-28 rocky * lib/scsi_mmc.c: Compilation fix. 2004-06-28 rocky * lib/scsi_mmc.c: Add multisession test. 2004-06-28 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h: Correct compilation problems. Fill out more ASPI defines. 2004-06-27 rocky * include/cdio/scsi_mmc.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/Makefile.am: Add common SCSI MMC routine for getting drive capabilities. 2004-06-27 rocky * lib/scsi_mmc.c: Add common routine for SCSI MMC. 2004-06-27 rocky * lib/_cdio_sunos.c: Compilation fix. Remove magic number 100. Use common mmc routine for drive capabilities. 2004-06-27 rocky * test/cdda-mcn.right, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Changed drive capability output. 2004-06-27 rocky * src/util.c: Print out more of the capabilities. 2004-06-27 rocky * lib/_cdio_linux.c: Revert last change. Need to return char * for MCN. Also replace that magic number 100 with MAX_TRACKS+1. 2004-06-27 rocky * configure.ac: Don't know how $target_os got in there, but it's not defined. $host_os will work although there probably is something better for cross-compiling. 2004-06-27 rocky * configure.ac, doc/glossary.texi, include/cdio/cdio.h, include/cdio/sector.h, include/cdio/types.h, lib/FreeBSD/freebsd.h, lib/MSWindows/aspi32.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: Add type for holding MCN and ISRC. Add type for session Replace magic constant 100 with CDIO_MAX_TRACK+1 where appropriate. _cdio_osx: save session number and presumably some tighter coding. nrg.c: make sure we add zero byte to end of MCN. 2004-06-26 rocky * configure.ac: thesin says the double -Wl,-framework is necessary when building vcdimager. 2004-06-26 rocky * README: Update to mention/include cdrdao, iso-info, iso-read and kiso. 2004-06-26 rocky * lib/_cdio_osx.c: Use .adr rather than session number to determine if we've got a valid track. 2004-06-26 rocky * configure.ac, include/cdio/scsi_mmc.h: configure.ac: we're now in 0.70cvs scsi_mmc.h: add doxygen comment. 2004-06-26 rocky * include/cdio/xa.h: Typo. 2004-06-26 rocky * lib/FreeBSD/freebsd_ioctl.c, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h: Reduce cut and paste - add common routine, to _cdio_generic.c: cdio_read_mode1_sector. 2004-06-25 rocky * configure.ac: Get ready for real 0.69 release. 2004-06-25 rocky * NEWS, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c: fewer error exits in drivers. Instead, a failure code is returned. 2004-06-25 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd_cam.c: Don't terminate on error but just return a failure and let the caller decide to exit or not. 2004-06-25 rocky * lib/FreeBSD/freebsd_ioctl.c: mode1 reading fixed up. Some cdio_error's turned into cdio_warn's as we really shouldn't abort in the driver if there is an error discovered but instead just return failure. 2004-06-25 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.h: Fill in LUN's on requests. Add common routine for checking/initializing ASPI availability. 2004-06-25 rocky * doc/glossary.texi: Add SPTI and ASPI. 2004-06-24 rocky * lib/_cdio_osx.c: Non-critical cdio_error's changed to cdio_warn's or cdio_info as more appropriate. 2004-06-23 rocky * THANKS: Credit where it is due. 2004-06-23 rocky * include/cdio/cd_types.h, lib/cd_types.c, src/cd-info.c: Add getting UDF label and major/minor version numbers. cd_types.c: also replace unsafe use of sprintf with strncpy. 2004-06-23 rocky * lib/Makefile.am: Update library numbers as per libtool documentation instructions. libiso9660: added read_pvd routines. libcdio: added cdio_get_drive_cap 2004-06-23 rocky * include/cdio/cd_types.h, lib/cd_types.c, src/cd-info.c: More (but not all) UDF stuff from the Xbox project. 2004-06-23 rocky * NEWS: What's new. 2004-06-23 rocky * lib/_cdio_osx.c: Clarification of 0xA0, 0xA2 and 0xAA. 2004-06-22 thesin * lib/_cdio_osx.c: Changed a few warns to debugs for release version 2004-06-22 thesin * lib/_cdio_osx.c: Remove noisy debug code, or at least hide it for now 2004-06-22 thesin * lib/_cdio_osx.c: OSX support works...now to get into the eject and drive caps next 2004-06-22 rocky * lib/_cdio_osx.c: correct some of the many bugs (I hope) 2004-06-21 rocky * lib/iso9660_fs.c: Don't abort if we can't read the PVD. 2004-06-21 rocky * lib/MSWindows/win32_ioctl.c: Give string error message descriptions now. 2004-06-21 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/aspi32.h, lib/MSWindows/win32.h: Can now get drive capabilities in ASPI driver ASPI headers from win32.h moved to aspi32.h some more cleanups. 2004-06-20 rocky * lib/FreeBSD/Makefile, lib/MSWindows/Makefile, lib/Makefile.am, lib/image/Makefile: Add boilerplate Makefiles for convenience 2004-06-20 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/MSWindows/win32_ioctl.c: Add mode1 reading Lint changes, routine renaming to be like others. More const's, fewer void *. Attempt drive detection. There are still many bugs. The code is just a little less bogus. 2004-06-19 rocky * include/cdio/cd_types.h, lib/_cdio_generic.c, lib/_cdio_stdio.c, lib/cd_types.c, lib/cdio.c, lib/image/bincue.c, lib/util.c, src/cd-info.c, src/iso-info.c, src/util.c: Lint-like things. Add X-BOX detection courtesy of the xmbc project. 2004-06-19 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c: Put the right suffix on ATAPI devices. More const's, fewer void *'s. 2004-06-19 rocky * configure.ac: libvcdinfo is used by cd-info not cd-read. 2004-06-19 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h: Add "c" at end of drive specification if not FreeBSD 5.x. Handle not getting default drive more gracefully. As always changes based on suggestions from Heiner. 2004-06-19 rocky * include/cdio/cdio.h: Note that getting default drive and listing all drives may change depending on OS/driver and whether media is installed. 2004-06-19 rocky * src/cd-info.c, src/iso-info.c: More information about ISO 9660 images is printed. 2004-06-19 rocky * test/check_opts0.right, test/check_opts1.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Changes as a result of printing more ISO 9660 information in cd-info. 2004-06-19 rocky * NEWS, include/cdio/iso9660.h, lib/iso9660_fs.c: Add const's where possible. Add cdio mode2 read routine. 2004-06-19 rocky * include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-info.c: iso9660_iso_... -> iso9660_ifs_... 2004-06-19 rocky * include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-info.c: iso9660*.{c,h}: Add PVD read for ISO 9660 images. iso-info now shows this info. 2004-06-18 rocky * include/cdio/iso9660.h, lib/iso9660.c: Add some trivial routines to get volumeid, volumeset id, application id and system id. Moved over from vcdimager. Thanks to Stephan (mephisto..@...) for the suggestion. 2004-06-18 rocky * lib/image/nrg.c: Fix bugs in merging with extractnrg.pl. 2004-06-17 rocky * lib/_cdio_osx.c: Ignore info where session is 0. At least for now. 2004-06-17 rocky * lib/_cdio_osx.c: Make sure we get TOC info for a single session. For new we can really only deal with a single-session CD. 2004-06-17 rocky * lib/_cdio_osx.c: Note OSX LBA is cdio LSN. 2004-06-17 rocky * lib/_cdio_osx.c: Don't need to set i_leadout twice. 2004-06-17 rocky * lib/_cdio_osx.c: getFirstrack_osx and getNumberOfTracks_osx do duplicate scanning that could be done when looking for the leadout track. Revised code to removes these routines, consolidating the searching in one loop. To be *very* conservative, a first loop finds the positions of the leadout, first track and last track. This code then doesn't assume that the track numbers are in order. They could be given track 3, 2, and then 1 or 2, 3, and then 1. Another loop then maps first_track..last_track 0..number_of_tracks - 1 2004-06-16 thesin * lib/_cdio_osx.c: Works with all burnt media, bought media is different some how. Still better then it was since it didn't work at all. 2004-06-14 rocky * lib/image/nrg.c: Add more info from extractnrg.pl 2004-06-14 rocky * lib/_cdio_osx.c: Wait a minute - the 0xa2 *is* larger than CDIO_CD_MAX_TRACKS. But I guess we still should consider ptrackDescriptors[i_descriptors]. 2004-06-13 rocky * lib/_cdio_osx.c: Probably more correct. 2004-06-13 rocky * lib/_cdio_sunos.c: Move include of glob.h inside conditional Solaris include since that's only where it is needed. configure on cygwin erroneously sets HAVE_GLOB_H and although that too should be fixed, there's no reason to have that failure cause one here. 2004-06-12 rocky * lib/FreeBSD/freebsd.c: Compilation lint 2004-06-12 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h: Some of the needed changes for FreeBSD 5.x. More may be needed. From Heiner - thanks! 2004-06-12 rocky * configure.ac: Allow FreeBSD 5.X: Heiner says it sort of works. 2004-06-12 rocky * lib/sector.c: Use %2.2x rather than %.2x. Is there a difference? 2004-06-12 rocky * src/cd-info.c, test/cdda-mcn.right, test/cdda.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Go back to 8-place MM:SS:FF. 2004-06-11 rocky * configure.ac: It is a tad nicer to switch off --without-versioned-libs when GNU ld isn't around rather than give and error and halt. 2004-06-09 rocky * NEWS: Duplicate entry. 2004-06-09 rocky * lib/FreeBSD/freebsd_cam.c: Change a couple of places to use scsi_mmc.h more. 2004-06-07 rocky * README.libcdio: It's cd-info, not cd-read. Note other alternatives to the elusive "circular" dependency. 2004-06-07 rocky * lib/cdio.c: Bug: wasn't adding drives with detected capability, but the first drive on the list of drives. Don't know how this went undetected this long. 2004-06-06 rocky * doc/libcdio.texi: Refer to libcdio constants more. Note OSX and FreeBSD drivers. Note there is a maximum LSN/LBA/MSF value. 2004-06-06 rocky * include/cdio/cdio.h: Ooops spelling typo. 2004-06-06 rocky * include/cdio/cdio.h: Doc fixes and some parameter name renamings. 2004-06-06 rocky * lib/_cdio_linux.c, lib/_cdio_sunos.c: Comment fixes. 2004-06-06 rocky * lib/_cdio_linux.c: Doc fix. 2004-06-06 rocky * lib/_cdio_sunos.c: Remove another first track is 1 assumption. 2004-06-06 rocky * lib/_cdio_linux.c: Remove another first_track = 1 assumption. 2004-06-06 rocky * lib/_cdio_linux.c, lib/_cdio_osx.c: Back off of testing for unread TOC. Probably a good idea to do lazy TOC reading. 2004-06-06 rocky * lib/_cdio_sunos.c: Compilation fixes. 2004-06-06 rocky * lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c: More work on removing assumption that first_track is 1. 2004-06-05 rocky * THANKS: Put in alphabetical order (by first name). 2004-06-05 rocky * THANKS: Add Heiner. Note cuetools. 2004-06-05 rocky * TODO: Current estimation of what's needed. 2004-06-05 rocky * lib/sector.c, test/cdda-mcn.right, test/cdda.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Go back to two-digit format for minutes in MSF. CD's really can't have more than 99 minutes in them. So we shouldn't give the illusion they can. 2004-06-05 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c: CAM mode2 form1 and form2 reading fixes. Default device lists default to CAM device name. Simplify, correct and make more complete CAM support. With the above we can finally use libcdio for cd-read, vcdimager and probably vlc and xine. Many thanks to Heiner. 2004-06-03 rocky * lib/_cdio_bsdi.c: Compilation fixes. 2004-06-03 rocky * lib/_cdio_bsdi.c: Fix all those *env = env after renaming; It should be *env = user_data. 2004-06-03 rocky * lib/_cdio_linux.c: Minor coding changes. 2004-06-02 thesin * lib/Makefile.am: Fix the -I-I here instead, sorry about that 2004-06-02 rocky * configure.ac: Revert last change which is at least wrong for me. 2004-06-02 rocky * lib/iso9660_private.h: #include "config.h" got deleted. 2004-06-02 rocky * lib/_cdio_osx.c: # include vs #include a problem? 2004-06-02 thesin * configure.ac, lib/_cdio_osx.c: Few fixed for the big rename and fixed a long standing mmmm thing that bothered me, -I-I../lib ;) 2004-06-02 thesin * NEWS: Fixed my name in NEWS 2004-06-02 rocky * lib/_cdio_osx.c: Compilation fixes. 2004-06-02 rocky * include/cdio/sector.h, lib/FreeBSD/freebsd.c, lib/Makefile.am, lib/_cdio_bsdi.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, lib/image_common.h: Remove some of the bogus assume 1 is first track. Renamings: env -> user_data _obj -> env 2004-06-02 rocky * lib/iso9660_private.h: Some compilers can't hack "# include" 2004-06-02 rocky * lib/image/nrg.c: Typo. 2004-06-01 thesin * lib/_cdio_osx.c: Now knows XA and CD-i tracks, thought I'm not sure it's working 100%, reads the correct amount of tracks, still need to fix the MCN code. 2004-06-01 rocky * lib/image/bincue.c: Avoid subtraction of unsigned numbers. 2004-06-01 rocky * lib/image/bincue.c: Bug in conversion logic. 2004-06-01 rocky * lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c: Some variable renaming. Also less pervasive assumption that the first track is 1. 2004-06-01 rocky * lib/image/nrg.c, lib/image/nrg.h: Break out file NRG format structures into a header. 2004-06-01 rocky * lib/image/nrg.c: Make use of return code from parse_nrg() A mode1/2 fixup. Some small code reorganization. Closer to being able to parse without opening. 2004-06-01 thesin * lib/_cdio_osx.c: Now knows the difference between DATA and Audio tracks on OSX, also temp change to eject command till I find the right way to implement it in code. 2004-05-31 rocky * NEWS: What's up. 2004-05-31 rocky * THANKS: Acknowledge debt to Micheal Kukat 2004-05-31 thesin * configure.ac, lib/_cdio_osx.c: Fix compile on OS X 10.3, should work on 10.2 and 10.3, still testing for 10.1, OS X Drivers still incomplete this is just to fix compiling. 2004-05-31 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h: Some variable renaming. env is the environment, user_data is what is passed in. 2004-05-31 rocky * src/cd-read.c: Make sure source_name a malloc'd, so we can uniformly free it when not needed. 2004-05-31 rocky * lib/image/nrg.c: Merge more information in from extractnrg.pl 2004-05-31 rocky * test/check_nrg.sh.in, test/svcdgs.right: check_nrg.sh.in: add NRG 5.5 cdda MCN test. svcdgs.right: we now have a MCN. 2004-05-31 rocky * lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_sunos.c: Hopefully improve names. "user_data" comes from user. "env" an environment is really what this is. "obj" is just to vague. 2004-05-31 rocky * src/cd-info.c: Handle error reporting with null source correctly. 2004-05-31 rocky * lib/FreeBSD/freebsd_cam.c: Duplicate free bug fix from tracked down by Heiner. 2004-05-31 rocky * test/vcd_demo.right: Added another 0 to MSF output. (Having 2nd thoughts though since the maximum msf minute value is two places.) 2004-05-31 rocky * test/cdda-mcn.right: NRG MCN CDDA test. 2004-05-31 rocky * src/cd-info.c: Strive to make source_name always a malloc'd variable (so it can always be free'd). 2004-05-31 rocky * lib/image/nrg.c: Better DAOI and DAOX information based on extractnrg.pl. 2004-05-27 rocky * lib/FreeBSD/freebsd.c: Remove the bogus assumption that the first track is always 1. May help down the line with multi-session CDs. 2004-05-27 rocky * lib/_cdio_linux.c: Remove some of the bogosity in assuming the first track starts at 1. (Probably will be useful on multi-session CD's). 2004-05-27 rocky * lib/_cdio_osx.c: We shouldn't terminate if we can't get an MCN. 2004-05-27 rocky * src/Makefile.am: Put LIBPOPT_CFLAGS after local include in case LIBPOPT has headers common to those in LIBCDIO_CFLAGS. 2004-05-27 rocky * lib/cdio_private.h: Fix prototype mismatch. 2004-05-27 rocky * lib/cdio.c: Correct mismatched prototypes. 2004-05-26 rocky * include/cdio/scsi_mmc.h, include/cdio/types.h: scsi_mmc.h: add definition for SET_SPEED types.h: add size of MCN. 2004-05-26 rocky * lib/image/nrg.c: Improve slightly (or possibly break slightly) based on information from extractools.pl. 2004-05-26 rocky * NEWS: [no log message] 2004-05-26 rocky * src/cd-read.c: Add --hexdump and --no-hexdump options. We now can hexdump to a file and dump bytes stdout (which may be useful in a pipe). 2004-05-24 rocky * lib/FreeBSD/freebsd.h: Make default CAM since that works best. It might help the single FreeBSD user of libcdio. 2004-05-24 rocky * src/cd-info.c: Test variable is not already free before freeing. 2004-05-19 rocky * include/cdio/cdio.h, lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/cdio.c, lib/sector.c: Add cdio_open_am_cd. Use network order for FreeBSD lsn/lba's and other small FreeBSD patches. Thanks again to Heiner. 2004-05-16 rocky * lib/FreeBSD/freebsd.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/image/cdrdao.c, src/cd-info.c: MSWindows/*: get access mode working better. ASPI support is faulty though freebsd.c: it's "ioctl" not "IOCTL"; cdrdao: it's cdrdao, not "toc" cd-info: slightly better error message? 2004-05-13 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_ioctl.c, lib/_cdio_linux.c: Go over FreeBSD code based on output from Heiner. Hopefully 3 bugs are fixed: - we get the leadout track now, no core dumps - MSF reporting is corrected - track format and mode _cdio_linux.c: use cdio #define rather than GNU/Linux one. 2004-05-13 rocky * include/cdio/cdio.h, lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/_cdio_generic.c, lib/cdio.c, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, src/cd-info.c: Allow more freedom in specifying access mode. Image drivers now have an "image" access mode. 2004-05-13 rocky * lib/MSWindows/win32.c: Allow more flexibility in specifying access mode. "IOCTL" -> "ioctl". 2004-05-12 rocky * lib/FreeBSD/freebsd_ioctl.c: Correct size. Thanks to Heiner. 2004-05-11 rocky * include/cdio/cdio.h, lib/sector.c: cdio.h: update doxygen documentation sector.c: remove erroneous fix. 2004-05-11 rocky * NEWS, include/cdio/scsi_mmc.h, include/cdio/sector.h, include/cdio/types.h, lib/image/bincue.c, lib/image/cdrdao.c, lib/image/nrg.c, lib/sector.c: - Redo types of lsn and lba to allow negative values. Should model MMC3 specs. Add max/min values for lsn. - More complete MMC command set 2004-05-10 rocky * include/cdio/Makefile.am, {lib => include/cdio}/scsi_mmc.h, include/cdio/sector.h, lib/FreeBSD/freebsd_cam.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/MSWindows/win32_ioctl.c, lib/Makefile.am, lib/_cdio_linux.c, lib/_cdio_sunos.c: Make scsi_mmc.h public. 2004-05-10 rocky * include/cdio/sector.h: Minor format change. 2004-05-09 rocky * test/Makefile.am: Add bad catalog tests. 2004-05-09 rocky * lib/cdio.c: Check for invalid LSNs. Turn some asserts into just returning failed status. 2004-05-09 rocky * include/cdio/cdio.h: Small typo. 2004-05-09 rocky * src/cd-info.c, test/cdda.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/data7.toc, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Output of LSN has one more place just to be sure. cd-info.c: use new msf_to_str routine. 2004-05-09 rocky * configure.ac: It's now AC_HEADER_STDC rather than AC_STDC_HEADERS. Woopie doo. 2004-05-09 rocky * include/cdio/sector.h: Add cdio_msf_to_str - convert MSF to string representation of MSF. 2004-05-09 rocky * include/cdio/cdio.h: Add cdio_is_nrg to check if name is Nero NRG image. 2004-05-09 rocky * lib/sector.c: Even more checking on conversion routines. Add cdio_msf_to_str. 2004-05-09 rocky * lib/image/nrg.c: Check some validity of NRG image. More will come later.... 2004-05-08 rocky * lib/image/cdrdao.c: More error message fixups. 2004-05-08 rocky * test/Makefile.am: That's data7.toc, not doc. 2004-05-08 rocky * NEWS, lib/FreeBSD/freebsd_ioctl.c, lib/image/cdrdao.c, test/Makefile.am, test/bad-cat1.toc, test/bad-cat2.toc, test/bad-cat3.toc, test/data1.toc, test/data2.toc, test/data5.toc, test/data6.toc, test/testtoc.c: freebsd_ioctl.c: Erroneous data size. Thanks again to Heiner. toc: better error messages and more tests. 2004-05-08 rocky * lib/FreeBSD/freebsd_cam.c: wild guesses at get_drive_mcn and get_drive_cap. 2004-05-08 rocky * lib/FreeBSD/freebsd_cam.c: Compilation fix. 2004-05-08 rocky * lib/MSWindows/win32.c: A better guess when we don't know for sure. 2004-05-08 rocky * lib/FreeBSD/freebsd_cam.c: Don't open gen.fd more than once. Thanks to Heiner for pointing this out. 2004-05-08 rocky * include/cdio/types.h: Doc change on what CDIO_DRIVE_CAP_CD_R means. 2004-05-08 rocky * lib/cdio.c: Be more optimistic about CD drive capabilities. 2004-05-08 rocky * configure.ac: Make sure entire warning is printed. 2004-05-07 rocky * lib/FreeBSD/freebsd.c: Test was backwards. Thanks to Heiner for directing my attention to this. 2004-05-07 rocky * configure.ac: Warn when cd-drive, cd-info, cd-read, iso-info and iso-read don't get built. 2004-05-07 rocky * lib/sector.c: Don't try to convert bad LBA's/LSN's. I wonder how many cascaded problems this has caused in the past. 2004-05-07 rocky * lib/image/cdrdao.c: Better error reporting. 2004-05-07 rocky * test/.cvsignore, test/Makefile.am, test/bad-mode1.toc, test/bad-msf-1.toc, test/bad-msf-2.toc, test/t1.toc, test/t2.toc, test/t3.toc, test/t4.toc, test/t5.toc, test/t6.toc, test/t7.toc, test/t8.toc, test/t9.toc, test/testdefault.c, test/testtoc.c: cdrdo TOC parsing regression tests. testdefault.c: more verbose about what's going on. 2004-05-07 rocky * lib/_cdio_osx.c: deal with disc-image device properly. 2004-05-07 rocky * lib/_cdio_osx.c: Typo. 2004-05-07 rocky * lib/FreeBSD/freebsd.c: Do the right cam initialization (when it is ultimately handled.) 2004-05-07 rocky * test/check_cd_read.sh, test/check_iso.sh.in, test/check_opts.sh: Error reporting improved to make debugging easier. 2004-05-06 rocky * src/.cvsignore: Add cd-drive. 2004-05-06 rocky * test/check_common_fn.in, test/check_cue.sh.in: Log command used when there's an error. Redo error message to make cut and paste of command line easier. 2004-05-06 rocky * test/vcd_demo.cue: CUE sheet for VCD demo program. 2004-05-06 rocky * test/check_cue.sh.in: Cater to old shells 2004-05-06 rocky * lib/MSWindows/win32.c, lib/MSWindows/win32_ioctl.c: Bring in line with other drivers. 2004-05-06 rocky * lib/_cdio_bsdi.c: Detect disc-image and don't open this device driver for that. 2004-05-06 rocky * test/check_cue.sh.in: Test for presence of vcd_demo.bin, not vcd_demo.cue to see if we can run this regression test. 2004-05-06 rocky * lib/_cdio_freebsd.c, lib/_cdio_linux.c: _cdio_freebsd.c: is now in FreeBSD (with some cam code) _cdio_linux.c - minor name changes. 2004-05-06 rocky * lib/_cdio_sunos.c: Detect disc-image and don't open this device driver for that. 2004-05-06 rocky * lib/FreeBSD/freebsd.c: open driver shouldn't return true if we do not have a device but an disc-image file. 2004-05-05 rocky * lib/_cdio_generic.c, lib/image/cdrdao.c: memory freeing issues. 2004-05-05 rocky * include/cdio/logging.h, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/_cdio_linux.c: Small fixes. 2004-05-05 rocky * lib/FreeBSD/freebsd_cam.c: Compilation fixes. 2004-05-05 rocky * include/cdio/logging.h: A doc elaboration for cdio_error. 2004-05-04 rocky * configure.ac: CDRDAO->cdrdao. 2004-05-04 rocky * test/Makefile.am: typo. 2004-05-04 rocky * lib/FreeBSD/freebsd.c: deal with device properly. 2004-05-04 rocky * lib/FreeBSD/freebsd.c: compilation fix. 2004-05-04 rocky * test/cdda.toc: CDDA test TOC. 2004-05-04 rocky * THANKS, include/cdio/cdio.h, include/cdio/types.h, lib/Makefile.am, lib/cdio.c, lib/image/cdrdao.c, src/cd-info.c, src/cd-read.c, src/util.h, test/Makefile.am, test/check_cue.sh.in, test/isofs-m1.toc, test/vcd_demo.toc: Add some cdrdao image reading support from Svend S. Sorensen's cuetools cdio.c: remove some complicated and extraneous code for auto-driver detection. 2004-05-04 rocky * lib/_cdio_linux.c: Don't give "source not a device message" for uniformity with other drivers. 2004-05-04 rocky * include/cdio/iso9660.h: Don't use "new" as a parameter names. C++ barfs on it. Closes bug #8786. 2004-05-03 rocky * configure.ac, lib/FreeBSD/freebsd.c: Another patch from Heiner Eichmann. 2004-05-02 rocky * lib/FreeBSD/freebsd.c: Another correction from Heiner Eichmann. 2004-05-02 rocky * lib/FreeBSD/freebsd.c: Compilation fixes from Heiner Eichmann - Thanks! 2004-05-01 rocky * lib/_cdio_osx.c: Compilation fix. 2004-04-30 rocky * lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/_cdio_sunos.c: Compilation fixes after adjustments. 2004-04-30 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c, lib/MSWindows/aspi32.c, lib/MSWindows/win32.c, lib/_cdio_linux.c, lib/scsi_mmc.h: Compilation fixes and modulization improvements. 2004-04-30 rocky * lib/FreeBSD/freebsd.c, lib/FreeBSD/freebsd.h, lib/FreeBSD/freebsd_cam.c, lib/FreeBSD/freebsd_ioctl.c, lib/Makefile.am: Attempt to add FreeBSD CAM access method. Hope I haven't broken FreeBSD otherwise. 2004-04-30 rocky * lib/MSWindows/{ioctl.c => win32_ioctl.c}: ioctl.c -> win32_ioctl.c 2004-04-30 rocky * lib/MSWindows/ioctl.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h: compilation fixes. 2004-04-30 rocky * lib/_cdio_sunos.c: Compilation fixes. 2004-04-30 rocky * doc/libcdio.texi, include/cdio/cdio.h, lib/MSWindows/aspi32.c, lib/MSWindows/ioctl.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h, lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_linux.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio_private.h, lib/image/bincue.c, lib/image/nrg.c: Add cdio_open_am to allow specifying an access method use for reading/controlling CD. 2004-04-27 rocky * lib/scsi_mmc.h: Add READ_TOC 2004-04-26 rocky * lib/_cdio_freebsd.c, lib/_cdio_linux.c, lib/scsi_mmc.h: More procedure canonicalization, some #defines added and used. 2004-04-26 rocky * lib/_cdio_freebsd.c: Remove unused _read_mode2. 2004-04-25 rocky * doc/libcdio.texi: More on the libcdio plight. 2004-04-25 rocky * lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_osx.c: Add const on get_mcn prototype and initialization of get_drive_cap in func structure 2004-04-25 rocky * include/cdio/cdio.h, lib/_cdio_freebsd.c, lib/_cdio_osx.c: Missing a couple of const's in get_mcn when prototype changed. cdio.h: doc fix. 2004-04-25 rocky * lib/_cdio_freebsd.c, lib/_cdio_linux.c, lib/_cdio_osx.c: More regularization of names. Warning: untested on freebsd and osx. 2004-04-25 rocky * lib/image/bincue.c, lib/image/nrg.c, lib/image_common.h: Regularize and I hope simplify names a bit more. image/*.c: (bogus) eject media now frees resources bincue.c: missing default_devices routine in function initialization table. 2004-04-25 rocky * example/sample2.c, include/cdio/types.h, lib/MSWindows/ioctl.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio.c, lib/image/bincue.c, lib/image/nrg.c, src/util.c: CDIO_DRIVE -> CDIO_DRIVE_CAP 2004-04-25 rocky * lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio_private.h, lib/image_common.h, lib/scsi_mmc.h, src/cd-drive.c, src/util.c: get_mcn parameter is const. solaris: failed attempt to get mcn and drive capabilities. Some boilerplate routines used. scsi_mmc: more defines. src/cd-drive.c: bugfix when cdio is null src/util.c: small enhancement. 2004-04-25 rocky * lib/_cdio_linux.c, lib/image/bincue.c, lib/image/nrg.c: Regularize naming convention of static routines a little bit. 2004-04-25 rocky * include/cdio/cdio.h, include/cdio/types.h, lib/MSWindows/ioctl.c, lib/cdio.c, lib/image/bincue.c, lib/image/nrg.c, lib/image_common.h, src/Makefile.am, src/cd-drive.c, src/cd-info.c, src/util.c, src/util.h, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/vcd_demo_vcdinfo.right, test/videocd.right: lib/*c, include/cdio/*.h: Add more drive capability info util.{c,h}: common routine for printing capbilities cd-info.c: use above. *.right: update for capability display of above cd-drive.c: new program to show drive capabilities 2004-04-24 rocky * lib/scsi_mmc.h: Small doxygen comment. 2004-04-24 rocky * src/cd-info.c: Slightly better drive capability display. Will probably get moved to a separate program. 2004-04-24 rocky * lib/MSWindows/ioctl.c: Fix bugs in getting drive capabilities; 2004-04-24 rocky * lib/MSWindows/win32.c: Fix a simple bug: get_mcn wasn't. 2004-04-24 rocky * include/cdio/cdio.h, lib/MSWindows/ioctl.c, lib/MSWindows/win32.c, lib/scsi_mmc.h, src/cd-info.c: More drive capability fixups. (Not sure about win32 fixes yet though.) 2004-04-24 rocky * include/cdio/cdio.h: Composite definitions for reader or writer. (More work needed.) 2004-04-24 rocky * src/cd-info.c: Better formatting of drive capabilities. 2004-04-24 rocky * lib/MSWindows/ioctl.c, lib/MSWindows/win32.c, lib/MSWindows/win32.h: A little better about detecting drive type via SCSI-3 passthrough. Still has some problems though. 2004-04-23 rocky * NEWS, example/sample2.c, include/cdio/cdio.h, lib/MSWindows/ioctl.c, lib/cdio.c, src/cd-info.c: cdio.{c,h}: get_drive_cap -> get_drive_cap_dev and add get_drive_cap. cd-info.c, sample2.c: use it. 2004-04-23 rocky * lib/Makefile.am, lib/image/bincue.c, lib/image/nrg.c, lib/{image/common.c => image_common.h}, test/vcd_demo_vcdinfo.right: image/common.h -> image_common.h. I'd rather switch than fight. I still hate automake. 2004-04-23 rocky * example/sample2.c, lib/Makefile.am, lib/_cdio_linux.c, lib/image/bincue.c, lib/image/common.c, lib/image/nrg.c, src/cd-info.c, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: image/common.c, Makefile.am: common image routines. src/cd-info.c, *.right: Now show file images under "drive capability" bincue.c/nrg.c: report file image "drive capability" 2004-04-22 rocky * README.libcdio, configure.ac, example/sample2.c, include/cdio/cdio.h, include/cdio/types.h, lib/_cdio_linux.c, lib/cdio.c, lib/cdio_private.h: *.{c,h}: add cdio_get_drive_cap to determine what kind of CDROM device we've got. README.libcdio: suggest stronger making a separate package for cd-info configure.ac: we are in 0.69cvs now 2004-04-21 rocky * README, libcdio.spec.in: Spelling typo. 2004-04-21 rocky * src/cd-info.c: Remove duplicate short option on --no-cddb. On CDDB error give a better error message. 2004-04-03 rocky * doc/glossary.texi: Small addition. 2004-04-03 rocky * doc/libcdio.texi: Add section on Green Book. Revise sample programs to explicitly free resources on exit. 2004-04-03 rocky * example/sample7.c: Remove unused code. 2004-03-24 rocky * test/svcdgs.right, test/vcd_demo_vcdinfo.right: Output changes due to %e -> %d change in strftime 2004-03-24 rocky * src/cd-info.c, test/vcd_demo.right: Change for -mno-cygwin to which doesn't support %e in strftime. 2004-03-24 rocky * configure.ac: 0.68 release. 2004-03-23 rocky * NEWS: [no log message] 2004-03-22 rocky * lib/image/bincue.c: Compilation fix: declarations need to come before statements for gcc < 3.0. 2004-03-21 rocky * lib/cdio.c: Yet another valgrind-found memory leak. 2004-03-21 rocky * example/sample5.c: Cosmetic changes. 2004-03-21 rocky * example/sample6.c, example/sample7.c: memory leaks found by valgrind 2004-03-21 rocky * lib/iso9660_fs.c: Allocation of buffer too short caught by valgrind. 2004-03-20 rocky * lib/Makefile.am: Revision number got bumped - but reconsidered changing interface. So back to the old one. 2004-03-20 rocky * example/sample5.c, include/cdio/cdio.h, lib/Makefile.am, lib/_cdio_generic.c, lib/cdio.c, lib/image/bincue.c, lib/image/nrg.c, src/cd-info.c, test/testdefault.c: Remove more memory leaks caught by valgrind. 2004-03-20 rocky * example/sample6.c: Remove memory leaks found by valgrind. 2004-03-20 rocky * lib/image/bincue.c: Remove memory leaks found by valgrind. 2004-03-20 rocky * example/sample3.c, example/sample4.c: Fix memory leak caught by valgrind. 2004-03-20 rocky * example/sample2.c: Remove memory leak (detected by valgrind). 2004-03-20 rocky * include/cdio/version.h.in: Improve doxygen doc. 2004-03-20 rocky * configure.ac, include/cdio/version.h.in: Add C-Preprocessor define CDIO_VERSION so this can easily be tested in C/C++ applications. 2004-03-20 rocky * lib/_cdio_osx.c: Fix compilation bug. 2004-03-20 rocky * lib/Makefile.am: Bump revision of libcdio before release. 2004-03-20 rocky * lib/_cdio_bsdi.c: Add mode1 reading in a hacky way. 2004-03-20 rocky * configure.ac: Check for GNU ld if --with-versioned-libs. 2004-03-20 rocky * NEWS: [no log message] 2004-03-16 rocky * NEWS: What's shaken. 2004-03-16 rocky * lib/_cdio_sunos.c: From Ian MacIntosh: Modifications that it doesn't use the uscsi commands anymore and so all IDE and SCSI drives go through the same code path - a major simplification. This works with all the CD drives that work with Solaris (IDE or SCSI) as the ioctl's for CDROMCDXA in Solaris just end up doing uscsi calls anyway, but directly from the kernel. The added advantage of not using uscsi is that the user doesn't need to be root - which is important in Sunray environments. 2004-03-13 rocky * include/cdio/types.h: MINGW seems now to define ssize_t. 2004-03-13 rocky * src/iso-info.c: Cater to implementations that don't implement Single Unix strftime. Like mingw. 2004-03-11 rocky * example/sample6.c, example/sample7.c: make cygwin -mno-cygwin work. 2004-03-11 rocky * src/iso-read.c: Make work under cygwin with -mno-cygwin. 2004-03-10 rocky * configure.ac, lib/image/bincue.c, lib/logging.c: Changes to make -mno-cygwin (no POSIX emulation on M$) work. In the process, in configure.ac might have broken cygwin when -mno-cygwin isn't used. We'll see. 2004-03-10 rocky * lib/MSWindows/ioctl.c, lib/cdio.c: ioctl: printf lint for cygwin (and perhaps others) cdio.c: define SEEK_SET for cygwin -mno-cygwin (and perhaps others) 2004-03-09 rocky * lib/_cdio_osx.c: Best guess right now at what might work for mode1/mode2. 2004-03-07 rocky * libcdio.pc.in: Add OS-specific libs. For cygwin -lwinmm is needed, not sure about -mcygwin. Also not sure if @LIBS@ is the right thing to add. 2004-03-07 rocky * lib/_cdio_linux.c: mode{1,2}_form2 -> b_form2 2004-03-07 rocky * lib/MSWindows/win32.c: Bug in read_mode2 sectors fixed. With this, vcd-info, vcdxrip, vlc and xine should be able to read okay on win2k! 2004-03-07 rocky * lib/_cdio_linux.c: Not sure why we had *exclusive* access just to see if a CD-ROM is around. Was causing failure to discover CD-ROM drives. 2004-03-06 rocky * include/cdio/cdio.h, lib/MSWindows/win32.c, lib/cdio.c: regular *mode2 variable name. 2004-03-06 rocky * lib/_cdio_sunos.c, lib/image/bincue.c, lib/image/nrg.c: regularize variable names mode{1,2}_form2 -> b_form2 2004-03-06 rocky * lib/MSWindows/ioctl.c, lib/MSWindows/win32.c: win32.c: wasn't passing along mode2 form1 when requested. 2004-03-06 rocky * lib/MSWindows/ioctl.c: update #include file name. 2004-03-06 rocky * lib/_cdio_sunos.c: Bogosity fixup for Solaris. Could be better. 2004-03-06 rocky * lib/_cdio_linux.c: GNU/Linux mode1 sector bogosity reduction. (Could be greatly improved.) 2004-03-06 rocky * test/check_common_fn.in: Typo. 2004-03-06 rocky * configure.ac: We're 0.68cvs now. 2004-03-06 rocky * lib/win32ioctl.c: Moved to MSWindows. 2004-03-06 rocky * lib/MSWindows/ioctl.c: Moved from parent directory into MSWindows directory. 2004-03-06 rocky * lib/image/nrg.c: Fix up mode1 sector reading. 2004-03-06 rocky * lib/image/bincue.c: Small changes. 2004-03-06 rocky * lib/image/bincue.c: See previous log entry. 2004-03-06 rocky * lib/image/bincue.c: The logic in _cdio_read_mode2_sector seems a bit wrong and convoluted to me, but passes the regression tests. (Perhaps it is why we get valgrind errors in vcdxrip). Leave it the way it was for now. Review this sector 2336 stuff later. 2004-03-05 rocky * lib/{wnaspi32.c => MSWindows/aspi32.c}, lib/{wnaspi32.h => MSWindows/aspi32.h}, lib/{_cdio_win32.c => MSWindows/win32.c}, lib/{_cdio_win32.h => MSWindows/win32.h}, lib/Makefile.am, lib/{_cdio_bincue.c => image/bincue.c}, lib/{_cdio_nrg.c => image/nrg.c}: *: Create OS-specific directories. bincue.c: remove more bogus behavior in mode1/mode2 sector reading. 2004-03-05 rocky * lib/_cdio_bincue.c, lib/_cdio_win32.c, lib/_cdio_win32.h, lib/cdio.c, lib/cdio_private.h, lib/win32ioctl.c: Work on mode1 reading. Remove some of the bogusity in cdio.c and bincue.c win2, now works! 2004-03-05 rocky * doc/doxygen/.cvsignore, doc/doxygen/html/.cvsignore: CVS lint. 2004-03-04 rocky * doc/libcdio.texi: Some typos. 2004-03-04 rocky * include/cdio/xa.h: Doxygen addition 2004-03-04 rocky * lib/win32ioctl.c: mode2 reading works on win2k via ioctl (so probably on WINNT and xp as well. 2004-03-03 rocky * lib/_cdio_win32.c, lib/win32ioctl.c: Long needed start to improve WIN2k native support. 2004-03-02 rocky * configure.ac: Get ready for 0.67 release. 2004-03-01 rocky * lib/Makefile.am: shared library numbers - this time, for sure! 2004-03-01 rocky * NEWS: [no log message] 2004-03-01 rocky * README.libcdio: And note Solaris problems too. 2004-03-01 rocky * README.libcdio: Note that you need to use GNU make. 2004-03-01 rocky * configure.ac: FreeBSD/NetBSD too gets versioned library variables. 2004-03-01 rocky * lib/Makefile.am: Change AGE not CURRENT on libiso9660. 2004-02-29 rocky * test/check_common_fn.in: diff program and opts somehow sneaked in here. 2004-02-29 rocky * src/iso-read.c: Make older C compilers happy. 2004-02-29 rocky * Makefile.am, test/check_common_fn.in, test/check_iso.sh.in: Add iso-read regression test. 2004-02-29 rocky * test/Makefile.am: Need to include copying.iso for ISO 9660 regression image test(s). 2004-02-29 rocky * README.libcdio: Note something about --without-versioned-libs. 2004-02-29 rocky * test/Makefile.am: Comparison file for check_iso.sh 2004-02-29 rocky * configure.ac, test/.cvsignore, test/Makefile.am, test/check_iso.sh.in, test/copying.right: Add test of iso-info program (which means, of course, another test of libiso9660). 2004-02-29 rocky * doc/glossary.texi, doc/libcdio.texi: glossary.texi: add most of the terms used in the doc. libcdio.texi: Add a section for OS drivers. 2004-02-28 rocky * doc/glossary.texi: typo. 2004-02-28 rocky * doc/glossary.texi: More terms. 2004-02-28 rocky * doc/libcdio.texi: Add some info (however meager) regarding cd-info, cd-read, iso-info and iso-read. 2004-02-28 rocky * lib/Makefile.am: libiso9660 has changed - the fs_stat_translate routines added and that packed attribute on XA. Thus we've got to update "current" in libiso9660. 2004-02-28 rocky * src/Makefile.am: Add iso-read to list of binaries in package. 2004-02-28 rocky * configure.ac: If GNU make isn't found, then we should have --without-versioned-libs FreeBSD/NetBSD (but now BSDI) don't use versioned libs. 2004-02-27 rocky * configure.ac: Bug in setting enable_versioned_libs. 2004-02-27 rocky * NEWS: [no log message] 2004-02-27 rocky * NEWS: [no log message] 2004-02-27 rocky * doc/.cvsignore: The documentation has advanced to such a stage that We are now in the realm of more than one info file. 2004-02-27 rocky * README, configure.ac, doc/libcdio.texi, lib/Makefile.am: configure.ac, Makefile.am: don't do library symbol version on BSDis variants libcdio.texi: minor example improvements. 2004-02-26 rocky * doc/libcdio.texi: New section on the purpose which mentions cd-read, iso-read, iso-info. A couple more examples included Nodes for the examples. 2004-02-26 rocky * doc/libcdio.texi: Looked up how to enter an umlaut correctly. 2004-02-26 rocky * lib/_cdio_bincue.c, lib/_cdio_nrg.c: Need to make failure less severe. Especially in light of the ability to scan for devices. 2004-02-26 rocky * lib/_cdio_nrg.c: Bug fix: don't try to free NRG track mapping DS if it wasn't allocated. 2004-02-26 rocky * lib/iso9660_fs.c: Remove a couple of compiler sprintf warnings. 2004-02-26 rocky * NEWS, example/sample7.c, include/cdio/iso9660.h, lib/iso9660_fs.c, src/iso-read.c: libiso9660 stat routines that match level 1 ISO-9600 filenames translating them into Unix-style names (i.e. lowercased letter with version numbers dropped.) 2004-02-25 rocky * Makefile.am: Add hvr's auto-changelog target. 2004-02-25 rocky * src/.cvsignore, src/Makefile.am: Add iso-read program. 2004-02-25 rocky * src/iso-read.c: Add program for extracting files from an ISO-9660 image. (Until we change the iso9660_ifs_stat interface, names of files extracted have to have version numbers, e.g. ;1 after them. 2004-02-25 rocky * README: Update. The iso-read part isn't true yet, but will be (one way or another) by the next release. 2004-02-25 rocky * include/cdio/xa.h: Herbert Valerio Riedel has determined that the alignment problem seen on ARM noticed by Nicolas Boullis will be fixed if this change in order is done. Since it doesn't make things any worse, let's try it. 2004-02-25 rocky * Makefile.am: Include README.libcdio 2004-02-25 rocky * doc/libcdio.texi: Small modifications. 2004-02-25 rocky * doc/glossary.texi: Small additions. 2004-02-25 rocky * configure.ac: Better wording of what happens when libvcdinfo is not around. 2004-02-25 rocky * libpopt.m4: Check for libpopt 1.7 or greater. 2004-02-22 rocky * doc/libcdio.texi: Note SCSI library. 2004-02-22 rocky * README.libcdio: libcdio-specific installation. 2004-02-22 rocky * configure.ac: Give URLs for vcdimager and libcddb when packages are not found or are new enough. 2004-02-21 rocky * configure.ac: We're in 0.67 CVS now. 2004-02-21 rocky * src/iso-info.c: Valgrind lint. Not sure if I'd classify this truly as memory leaks rather than explicit deallocations before terminating. 2004-02-21 rocky * lib/_cdio_stdio.c: Reduce severity of not being able to open a stdio from "error" (unrecoverable) to "warn". 2004-02-21 rocky * lib/_cdio_linux.c: More memory leaks found by valgrind. 2004-02-21 rocky * src/.cvsignore: [no log message] 2004-02-21 rocky * autogen.sh: Create ChangeLog if it doesn't first exist (which it won't the first time around). Change from corresponding vcdimager autogen.sh. 2004-02-21 rocky * .cvsignore, doc/.cvsignore, src/.cvsignore: [no log message] 2004-02-21 rocky * doc/Makefile.am, doc/libcdio.texi: Makefile.am: fix to build from CVS libcdio.texi: title change, add automatically generated date to manual, internal texinfo code cleanup. 2004-02-21 rocky * doc/glossary.texi: Glossary of terms. Some of this culled from vcdimager. 2004-02-21 rocky * cvs2cl_header: Add header for ChangeLog file. 2004-02-21 rocky * cvs2cl_usermap: account to email mapping file for cvs2cl. 2004-02-21 rocky * ChangeLog: ChangeLog is derived from cvs2cl and is now in Makefile.am 2004-02-21 rocky * NEWS: typo. 2004-02-21 rocky * include/cdio/cdio.h: spelling. 2004-02-21 rocky * src/cd-info.c: Add option to list all drives. 2004-02-15 rocky * libcdio.spec.in: Corrections from Manfred Tremmel who I am yet again indebted. 2004-02-14 rocky * libcdio.spec.in: This time, I think it builds. 2004-02-14 rocky * libcdio.spec.in: Wrong abbreviation for September. 2004-02-14 rocky * libcdio.spec.in: Regularize email address. 2004-02-14 rocky * doc/libcdio.texi: Small compile errors. 2004-02-14 rocky * ChangeLog, NEWS: What's shaking. 2004-02-14 rocky * THANKS: Acknowledge what is only right. 2004-02-14 rocky * libcdio.spec.in: Require 0.7.20 of vcdimager. 2004-02-14 rocky * doc/Makefile.am, doc/fdl.texi, doc/gpl.texi: Add GPL info. 2004-02-14 rocky * doc/libcdio.texi: Go over. Add CD-image format, ISO 9660 characters and glossary from vcdimager documentation. Numerous small corrections. 2004-02-13 rocky * NEWS: Note library symbol versioning (from Nicolas Boullis). 2004-02-12 rocky * lib/Makefile.am: code reorganization from Nicolas Boullis. 2004-02-11 rocky * lib/Makefile.am: lib/Makefile.am (Nicolas Boullis): Mostly some cleanup... First, this tries to keep the versioning separated from the rest of the Makefile. I used the "foo := $(foo) bar" syntax rather than "foo += bar" as I think the += is not available on all versions of make. Moreover, I replaced "$(LIBCDIO_LIBS)" with "libcdio.la" as "$(LIBCDIO_LIBS)" is "../lib/libcdio.la". That make a difference if you try to build libiso9660.la while libcdio.la is not available. Make knows how to make libcdio.la but not ../lib/libcdio.la. 2004-02-11 rocky * lib/.cvsignore: Ignore library version file. 2004-02-10 rocky * lib/Makefile.am: Versioned library symbols from Nicolas Boullis. Much appreciated. 2004-02-09 rocky * THANKS, lib/Makefile.am: Clean up library versioning. Use LIBADD since as best as I can tell, that's what supposed to be used. Many thanks to Nicolas Boullis. 2004-02-08 rocky * lib/_cdio_win32.c: Pick up prototype for cdio_is_device_win32. 2004-02-08 rocky * configure.ac: Get ready for another release. 2004-02-08 rocky * lib/Makefile.am: libiso9660 needs to have libcdio listed in its load flags for Solaris. 2004-02-08 rocky * lib/Makefile.am, lib/_cdio_bincue.c, src/iso-info.c: Makefile.am: bump release number. iso-info.c: mem leak _cdio_bincue.c: minor formatting change. 2004-02-08 rocky * NEWS: What's new. 2004-02-08 rocky * lib/_cdio_nrg.c: More memory leaks found with valgrind. 2004-02-08 rocky * lib/_cdio_bincue.c: Memory leak found by valgrind. 2004-02-07 rocky * lib/_cdio_bincue.c, lib/_cdio_generic.c, lib/_cdio_nrg.c, lib/_cdio_stdio.c, lib/_cdio_stdio.h, lib/_cdio_stream.c, lib/_cdio_stream.h, lib/cdio_private.h, lib/iso9660_fs.c: More valgrind-found memory leaks. (More to come...) 2004-02-07 rocky * ChangeLog, lib/_cdio_linux.c, lib/cdio.c, src/cd-info.c, src/cd-read.c, src/iso-info.c, src/util.c, src/util.h: Fix some of the memory leaks and uninitialized variables which valgrind notices. 2004-02-07 rocky * lib/wnaspi32.c: Microsoft Windows ASPI code for libcdio. 2004-02-07 rocky * lib/Makefile.am, lib/_cdio_win32.c, lib/wnaspi32.h: Split out much of the ASPI code into wnaspi32.c. 2004-02-05 rocky * lib/_cdio_win32.c, lib/_cdio_win32.h, lib/win32ioctl.c: Move more of IoControl out of _win_32 and into win32ioctl. 2004-02-04 rocky * lib/_cdio_win32.c, lib/_cdio_win32.h, lib/win32ioctl.c: More cleanup. Still sucks. 2004-02-04 rocky * lib/Makefile.am, lib/_cdio_win32.c, lib/_cdio_win32.h, lib/win32ioctl.c: Add better DeviceIocontrol support. It still sucks, but sucks less. 2004-02-04 rocky * example/sample6.c: printf lint for Doz. 2004-02-02 rocky * NEWS: What's up. 2004-02-02 rocky * configure.ac: 0.65's been released. We're now into 0.66 CVS. 2004-02-02 rocky * lib/Makefile.am, lib/wnaspi32.h: Move APSI stuff into a separate file. 2004-02-02 rocky * lib/_cdio_win32.c: Small changes. Bigger changes should follow later. 2004-02-01 rocky * example/sample7.c: More printf lint. 2004-02-01 rocky * example/Makefile.am: libiso9660 depends on libcdio. Cygwin (and perhaps others) then require that libiso9660 be listed in the link order before things that it depends on. 2004-02-01 rocky * src/iso-info.c: ISO Info - prints various information about a ISO 9660 image. 2004-02-01 rocky * lib/_cdio_nrg.c: 2nd try at getting lint messages removed across all architectures. 2004-02-01 rocky * lib/_cdio_nrg.c: remove debug output lint warnings 2004-01-29 rocky * doc/libcdio.texi: Typo. 2004-01-29 rocky * example/README, example/sample6.c, example/sample7.c: Update text commentary for sample6 & sample7. 2004-01-18 rocky * example/.cvsignore: Added yet another sample program. 2004-01-18 rocky * include/cdio/iso9660.h: Don't pack our own iso9660_t. 2004-01-18 rocky * include/cdio/iso9660.h: Move tm struct around so the alignment will be on a word boundary. Do we need GNUC_PACKED here? 2004-01-15 hvr * libpopt.m4: fixed underquoted definition warning 2004-01-10 rocky * : Sample ISO 9660 image. 2004-01-10 rocky * include/cdio/iso9660.h, lib/iso9660_fs.c, src/util.c: iso-info now does something useful now that readdir routine fixed up for iso images. 2004-01-10 rocky * example/Makefile.am, example/sample6.c, example/sample7.c, include/cdio/iso9660.h, lib/_cdio_stdio.c, lib/_cdio_stdio.h, lib/_cdio_stream.c, lib/_cdio_stream.h, lib/iso9660_fs.c, src/Makefile.am: Add routines to open an ISO-9660 image independent of being part of a CD. 2004-01-09 rocky * lib/_cdio_bincue.c: Remove duplicate assignment 2004-01-03 rocky * lib/_cdio_nrg.c: More guesses as to NRG format. Guess blocksizes, handle some mixed-mode CDs. 2003-12-31 rocky * lib/_cdio_nrg.c: Some code consolidation. 2003-12-31 rocky * lib/_cdio_nrg.c: More Disk-at-once corrections. 2003-12-30 rocky * lib/_cdio_nrg.c: Slightly better disk-at-once and track-at-once parsing. Am able to read a tao mode1 form1 now. 2003-12-28 uid67423 * lib/_cdio_nrg.c: Attempt getting various non-mode2/form2 track modes correct. 2003-12-24 uid67423 * example/sample6.c: add ISO9660 sample program 2003-12-24 uid67423 * example/.cvsignore: [no log message] 2003-12-24 uid67423 * NEWS, example/Makefile.am, example/README: Add ISO9660 sample program. 2003-12-24 uid67423 * configure.ac: Require vcdimager 0.7.20 or greater. Bump libcdio version for last release. 2003-12-24 uid67423 * include/cdio/iso9660.h: Documentation in comment bug. 2003-12-03 rocky * configure.ac: Remove extraneous cygwin LIB set. 2003-11-18 rocky * include/cdio/cd_types.h, include/cdio/iso9660.h, include/cdio/types.h, include/cdio/util.h, src/Makefile.am: More documentation changes. Makefile.am: Don't build man pages if not in MAINTAINER mode. 2003-11-17 rocky * doc/Makefile.am, include/cdio/cd_types.h, include/cdio/cdio.h, include/cdio/iso9660.h, include/cdio/logging.h, include/cdio/sector.h, include/cdio/types.h, include/cdio/xa.h: Related to doxygen documentation. 2003-11-17 rocky * include/cdio/version.h.in: Add doxygen comment and CVS Id line. 2003-11-16 rocky * doc/Makefile.am, include/cdio/iso9660.h, lib/iso9660_fs.c, src/cd-info.c: iso9600_stat now has filename inside it. iso9660_fs_readdir now returns a list of iso9660_stat_t's rather than filenames. This should reduce by a small amount the number of CD reads since we store more information in the iso9660_fs_readdir return. However all of this is in preparation for greatly reducing the number of CD reads when picking out segment lsn information. 2003-11-11 rocky * doc/libcdio.texi: libcdio.info was missing a @dircategory and @direntry section. See http://savannah.nongnu.org/bugs/?func=detailbug&bug_id=6470&group_id=3845Thanks to dweimer for pointing this out and providing a patch. 2003-11-10 rocky * include/cdio/iso9660.h, lib/iso9660_fs.c: Smallish cosmetic changes. Bigger ones to iso9660_fs_readdir will probably occur later... 2003-11-10 rocky * NEWS: [no log message] 2003-11-10 rocky * src/cd-read.c: Allow setting debug level in library for default log handler. 2003-11-09 rocky * src/cd-info.c: Was filling out source_name for a device even when it wasn't. 2003-11-09 rocky * lib/_cdio_nrg.c: Revise info on MTYP - more debugging here too. 2003-11-09 rocky * doc/doxygen/.cvsignore: The usual. 2003-11-09 rocky * doc/doxygen/run_doxygen: Program to run doxygen. 2003-11-09 rocky * lib/logging.c, src/cd-info.c: Be able to set/disable default log handler logging. 2003-11-09 rocky * Makefile.am: Add doxygen target. 2003-11-09 rocky * doc/doxygen/Doxyfile: Slightly customized configuration setting for running doxygen. 2003-11-09 rocky * include/cdio/iso9660.h: doxygen changes. 2003-11-05 rocky * include/cdio/cdio.h, include/cdio/iso9660.h, include/cdio/sector.h: update/add More doxygen tagging 2003-11-05 rocky * example/sample3.c, example/sample4.c, include/cdio/cd_types.h, lib/cd_types.c, lib/cdio.c, src/cd-info.c: cdio_analysis -> cdio_iso_analysis 2003-11-04 rocky * include/cdio/cd_types.h, include/cdio/cdio.h, include/cdio/logging.h: doxygen changes. 2003-11-04 rocky * include/cdio/cd_types.h, include/cdio/iso9660.h, include/cdio/logging.h, lib/logging.c: Start to document using doxygen. 2003-11-04 rocky * lib/_cdio_bincue.c: Got return value on _cdio_audio_sectors backwards. 2003-10-28 rocky * configure.ac, doc/libcdio.texi, include/cdio/iso9660.h, src/util.c: configure.ac: changes suggested by Karl Berry (karl@freefriends.org) which may make work for autoconf 1.7.8 libcdio.texi: remove colophon and correct copyright notice iso9660.h: trivial comment addition util.c: Correct copyright line. 2003-10-20 rocky * lib/_cdio_win32.c: Retry YellowMode2 if XA fails - but I think we need a better overall method. 2003-10-20 rocky * src/cd-read.c: Don't print blocks if read failed. 2003-10-19 rocky * configure.ac: Life goes on. Bump version number. 2003-10-18 rocky * lib/_cdio_win32.c: More WIN32 fixes. 2003-10-18 rocky * lib/_cdio_win32.c: More fixes on non ASPI side. 2003-10-17 rocky * lib/_cdio_win32.c: Track format's if no ASPI are probably close. Reading probably closer to correct. 2003-10-16 rocky * src/cd-read.c: Typo. 2003-10-15 rocky * NEWS: [no log message] 2003-10-15 rocky * lib/_cdio_win32.c: Some of the many necessary fixes needed to make Win32 handling more complete. Some bugs remain (and will so until after the release). 2003-10-15 rocky * src/cd-read.c: [no log message] 2003-10-15 rocky * src/cd-info.c, src/cd-read.c, test/cdda.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/vcd_demo_vcdinfo.right, test/videocd.right: Show green status for each track. cd-info.c: above + fewer assertions cd-read.c: direction we'll go when after release. 2003-10-14 rocky * lib/_cdio_sunos.c: Back off some of the modularization until we figure out what's gone wrong. 2003-10-13 rocky * lib/_cdio_osx.c: Compilation bugs. 2003-10-13 rocky * configure.ac: The real release. 2003-10-13 rocky * ChangeLog: [no log message] 2003-10-08 rocky * include/cdio/sector.h, lib/_cdio_osx.c: OSX fixups and #define bugs from thedj. 2003-10-07 rocky * lib/_cdio_nrg.c: Detect Audio CDs (probably). 2003-10-06 rocky * lib/cd_types.c, src/cd-info.c, test/check_cue.sh.in, test/check_nrg.sh.in, test/check_opts.sh: cd_types: sector 0 rarely needs to be read, and when it doesn't, it's not an error if it can't be read cd-info: give more info by default - source location and driver. test/*: as a result of cd-info changes need now to pass option --quiet. 2003-10-05 rocky * lib/_cdio_osx.c: Get Media Catalog Number - courtesy of thedj! 2003-10-05 rocky * configure.ac: Accept more freebsd versions. 2003-10-05 rocky * include/cdio/logging.h, lib/_cdio_osx.c, lib/logging.c: Default logger now allows level to be set and we use a reasonable setting, e.g. no DEBUG 2003-10-04 rocky * include/cdio/cdio.h, lib/cdio.c: Add OSX device scanning. 2003-10-04 rocky * lib/cdio.c: Clean up comment. 2003-10-04 rocky * lib/cdio.c: A better fix by Gildas Bazin. 2003-10-04 rocky * lib/cdio.c: Check on open that we didn't hit an error. 2003-10-04 rocky * lib/_cdio_osx.c: Wrong define. Thanks thedj! 2003-10-04 rocky * configure.ac: Back to 2.52 for our OSX users. 2003-10-04 rocky * configure.ac: Force vcdimager 0.7.19 to be used because that uses iso9660 and an earlier one will cause our use of iso9660 to fail. Is there a better way to do this? 2003-10-03 rocky * libcdio.spec.in: Update Spec file. 2003-10-03 rocky * lib/_cdio_bsdi_old.c: This shouldn't have been in CVS. 2003-10-03 rocky * lib/_cdio_bsdi.c: Small BSDI fix from Steve Schultz 2003-10-03 rocky * NEWS: [no log message] 2003-10-03 rocky * example/sample1.c, example/sample3.c: Practice more defensive programming. 2003-10-03 rocky * lib/_cdio_nrg.c, lib/_cdio_stream.c: Abort less often - just report an error. 2003-10-03 rocky * configure.ac, include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_freebsd.c: FreeBSD fixes mostlyh. 2003-10-03 rocky * lib/_cdio_freebsd.c: Closer.... 2003-10-03 rocky * lib/_cdio_bsdi.c, lib/_cdio_freebsd.c: OS fixes. 2003-10-03 rocky * lib/_cdio_bsdi.c: [no log message] 2003-10-03 rocky * lib/_cdio_bsdi.c: Cosmetic changes to Make it look more like the others. 2003-10-03 rocky * lib/_cdio_sunos.c: Need to provide get_devices when not compiling for Solaris too. 2003-10-03 rocky * test/.cvsignore: [no log message] 2003-10-03 rocky * NEWS, include/cdio/cdio.h, lib/_cdio_bincue.c, lib/cdio.c: cdio.{c,h}: update initializations for get_devices. 2003-10-03 rocky * lib/_cdio_sunos.c: Add Solaris get_devices. 2003-10-03 rocky * lib/_cdio_bsdi.c: BSDI fixes. 2003-10-03 rocky * example/sample4.c: Lint found by BSDI. 2003-10-03 rocky * src/cd-read.c, test/testdefault.c: Lint that BSDI caught. 2003-10-03 rocky * lib/_cdio_linux.c: Use bool where appropriate. 2003-10-03 rocky * include/cdio/cdio.h, lib/_cdio_win32.c: Add get_devices. 2003-10-03 rocky * test/Makefile.am: Remove testdefault until I can figure out how to make work via make distcheck. 2003-10-03 rocky * example/sample1.c: More platform independent and no less complex. 2003-10-02 rocky * example/sample5.c, include/cdio/cd_types.h, include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/cdio.c, src/cd-read.c, test/testdefault.c: BSDI Fixes. 2003-10-01 rocky * test/testdefault.c: Regression test for cdio_get_devices, cdio_get_devices_with_cap(), and cdio_free_device_list(). 2003-09-30 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/cdio.c, lib/cdio_private.h, test/check_cue.sh.in, test/check_nrg.sh.in: Fill out autoscan devices/images to image drivers. API is probably closer to more complete. 2003-09-29 rocky * example/.cvsignore: [no log message] 2003-09-29 rocky * configure.ac, example/.cvsignore, example/sample5.c, include/cdio/cdio.h, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/cdio.c, lib/cdio_private.h, test/Makefile.am, test/check_cue.sh.in, test/vcd_demo_vcdinfo.right: Closer to autoscan working better. globbing for *.nrg in NRG. Will probably do likewise in bin/cue when NRG is working. 2003-09-28 rocky * example/Makefile, test/Makefile.am: Misc lint. 2003-09-28 rocky * Makefile.am, configure.ac, example/.cvsignore, example/Makefile, example/Makefile.am, example/sample1.c, example/sample2.c, example/sample3.c, example/sample4.c, example/sample5.c: Use automake to build sample programs. 2003-09-28 rocky * example/README: typo. 2003-09-28 rocky * NEWS: [no log message] 2003-09-28 rocky * NEWS: [no log message] 2003-09-28 rocky * example/Makefile, example/sample5.c, include/cdio/cd_types.h, include/cdio/cdio.h, include/cdio/types.h, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/cd_types.c, lib/cdio.c, lib/cdio_private.h, src/cd-info.c: First-cut to auto-scan for device capabilities 2003-09-28 rocky * src/cd-info.c: Wasn't respecting --no-vcd, Or vcd-info when SVCD or CVD. 2003-09-28 rocky * test/monvoisin.right, test/vcd_demo.right: Wasn't respecting --no-vcd 2003-09-28 rocky * test/cdda.cue, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.cue, test/isofs-m1.right: Not sure if MCN can be on a CD-DA so move it to iso 9660 image. 2003-09-28 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, test/cdda.cue, test/cdda.right: Implement MCN for bincue. 2003-09-27 rocky * configure.ac, include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, src/cd-info.c, src/cd-read.c, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Replace techno-wizard message "Get MCN" with more layman "Media Catalog Number" 2003-09-26 rocky * lib/_cdio_sunos.c: read_audio_sectors done better. 2003-09-25 rocky * src/cdinfo-linux.c: Fix up so this works again. 2003-09-25 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_osx.c, lib/_cdio_win32.c, lib/cdio.c, lib/cdio_private.h, src/cd-info.c, test/cdda.right, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Add get_mcn, although it really only works on GNU/Linux right now. 2003-09-22 rocky * configure.ac: Add manpage generation. 2003-09-22 rocky * src/.cvsignore: [no log message] 2003-09-22 rocky * src/Makefile.am, src/cd-read.c: More flexibility: allow any two of start, end, count. If only one or none are given, we'll supply default values. 2003-09-21 rocky * src/cd-read.c, test/check_cd_read.sh, test/isofs-m1-read.right: Make cd-read more user-friendly and do more things: Add start/end/count options for cd-read, Input argument doesn't need a specifier (-i or --cue-file) now. block sizes for various formats have been set correctly now. 2003-09-21 rocky * configure.ac, lib/iso9660.c: Test for presence of gmtoff for braindead cygwin 2003-09-21 rocky * lib/_cdio_win32.c: Compilation problems. 2003-09-21 rocky * src/cd-info.c: More tidy. 2003-09-21 rocky * src/Makefile.am, src/cd-info.c, src/cd-read.c, src/util.c, src/util.h: Break out common standalone routines from cd-info and cd-read. 2003-09-21 rocky * NEWS, src/cd-info.c, src/cd-read.c, test/check_cd_read.sh, test/isofs-m1-read.right: Add options processing to cd-read. Had not very useful output on mode1 format1 test. 2003-09-21 rocky * include/cdio/iso9660.h: [no log message] 2003-09-21 rocky * include/cdio/iso9660.h, include/cdio/xa.h, lib/iso9660.c, lib/iso9660_fs.c, lib/xa.c, test/monvoisin.right, test/svcdgs.right, test/testiso9660.c: More ISO 9660 date cleanup. Hopefully cleaner structure definitions and more function documentation. 2003-09-20 rocky * lib/iso9660.c: Bug in iso9660_set_ltime. Probably snprintf putting in \0 at the end of each string messed up internal format (which doesn't have the \0's. 2003-09-20 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_osx.c, lib/_cdio_sunos.c, lib/_cdio_win32.c, lib/cdio.c, lib/cdio_private.h, lib/scsi_mmc.h: Change interface for read_audio_sectors. 2003-09-20 rocky * include/cdio/iso9660.h, lib/iso9660.c: Add "long" date setting routine and more precise definitions there as well. 2003-09-20 rocky * include/cdio/iso9660.h, lib/iso9660.c, lib/iso9660_fs.c: More precise ISO9660 date definition 2003-09-20 rocky * test/Makefile.am, test/check_cd_read.sh, test/check_cue.sh.in, test/check_nrg.sh.in, test/check_opts.sh: incorrect usage of cd test/ if ! test -> if test ! 2003-09-19 rocky * configure.ac: {v,}cdinfo -> {v,}cd-info. Configure for cd-read. Test for memset and bzero. 2003-09-19 rocky * Makefile.am: Hack to make sure check_nrg.sh and check_cue.sh are executable. 2003-09-19 rocky * lib/_cdio_linux.c: Clean up mmc code a bit 2003-09-19 rocky * lib/scsi_mmc.h: Add some of the read types and macro to set it 2003-09-19 rocky * src/cd-read.c: Adjust block length for mode1 read 2003-09-19 rocky * test/check_cd_read.sh, test/isofs-m1-read.right: add mode1 test 2003-09-19 rocky * src/cd-read.c: Silence cdio output 2003-09-19 rocky * test/Makefile.am, test/cdda-read.right, test/check_cd_read.sh, test/check_common_fn.in, test/check_cue.sh.in: Add CD-DA reading test via cd-read; Add GPL 2003-09-18 rocky * lib/_cdio_bincue.c: Use macro definition of bzero 2003-09-18 rocky * lib/_cdio_bincue.c: Tidy up #includes a bit 2003-09-18 rocky * lib/cdio_assert.h, lib/cdio_private.h: Check and include config.h so includer's don't. 2003-09-18 rocky * lib/_cdio_bincue.c: Adjustment for reading audio cd. Also break out MMC stuff a little bit better. 2003-09-18 rocky * lib/_cdio_linux.c, lib/scsi_mmc.h: Put more into scsi_mmc.h 2003-09-17 rocky * src/.cvsignore: [no log message] 2003-09-17 rocky * lib/_cdio_linux.c: Don't turn a LSN into an LBA when reading audio. 2003-09-17 rocky * example/Makefile, example/dbg_read.c: Moved into src/cd-read. 2003-09-17 rocky * src/Makefile.am, src/cd-read.c: Add cd-read.c for debugging CD reading problems. 2003-09-17 rocky * example/dbg_read.c: Do it! 2003-09-17 rocky * test/Makefile.am: Use a bigger hammer to get automess to what really should be a simple simple thing - specify mode and permissions of the files it creates. 2003-09-15 rocky * configure.ac: Test for OSX presence of IOKit and CoreFoundation and add to list of libraries. Change format of drivers reported. 2003-09-15 rocky * lib/_cdio_osx.c: More lba, lsn confusion. 2003-09-14 rocky * configure.ac, lib/_cdio_osx.c: Changes from Derk-Jan Hartman for OSX support. 2003-09-14 rocky * lib/_cdio_osx.c: Loop went the wrong way. 2003-09-14 rocky * lib/_cdio_osx.c: Go back to 0xa2 for "leadout" 2003-09-14 rocky * lib/cdio.c: Bug if we had a get_track_lba but no get_track_msf. Guard against that. 2003-09-14 rocky * lib/scsi_mmc.h: A place right now for common SCSI MMC (multimedia command). 2003-09-14 rocky * lib/Makefile.am, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/_cdio_win32.c, src/cd-info.c, test/Makefile.am: Use new common scsi_mmc.h. 2003-09-14 rocky * configure.ac, test/Makefile.am: Finally get regression testing to work with expected failure and on cygwin. 2003-09-14 rocky * lib/_cdio_nrg.c, lib/cd_types.c: More I/O format lint. 2003-09-14 rocky * lib/iso9660_fs.c: More I/O format lint. 2003-09-14 rocky * lib/_cdio_bincue.c: I/O lint. 2003-09-14 rocky * test/Makefile.am: Reuse noinst_PROGRAMS variable. 2003-09-14 rocky * test/check_cue.sh.in: The program is now called cd-info. 2003-09-14 rocky * lib/_cdio_osx.c: Change default device, use normal leadout track, fix doc typo(s). 2003-09-13 rocky * configure.ac, include/cdio/cdio.h, include/cdio/sector.h, lib/Makefile.am, lib/_cdio_osx.c, lib/cdio.c: Rudimentary beginnings for Darwin OS X CD support. 2003-09-11 rocky * lib/sector.c: _vcd_lba_to_msf_str -> cdio_lba_to_msf_str; 2003-09-10 rocky * include/cdio/iso9660.h, lib/iso9660.c: Documentation update 2003-09-10 rocky * include/cdio/iso9660.h: Allow C++ to call. 2003-09-10 rocky * libcdio.spec.in: small fixes really from Frantisek Dvorak 2003-09-07 rocky * include/cdio/iso9660.h, lib/iso9660.c, lib/iso9660_fs.c: add parameters to set times on directory entries, pvd's. 2003-09-07 rocky * test/cdda.right, test/check_cue.sh.in, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Output time format change in cd-info. Hopefully the last one. 2003-09-07 rocky * ChangeLog, NEWS: [no log message] 2003-09-07 rocky * src/cd-info.c: Yet another time format output change on listing. Hopefully the last one 2003-09-07 rocky * configure.ac: Change version to note another CVS version 2003-09-07 rocky * test/check_common_fn.in: Make sure to set TZ and LC_TIME so we get predictable results 2003-09-06 rocky * test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Update for normal filenames from the ISO-9660 names. 2003-09-06 rocky * include/cdio/iso9660.h, lib/iso9660.c, lib/iso9660_fs.c, lib/iso9660_private.h, src/cd-info.c: Add iso9660_name_translate() to remove ISO-name cruft. Document iso9660_fs_stat(). 2003-09-06 rocky * include/cdio/types.h: Small comment change. 2003-09-05 rocky * include/cdio/cdio.h, include/cdio/iso9660.h, lib/cdio.c, lib/iso9660_fs.c: Move ISO-9660 lsn-finding routine from vcdimager here. More prototypes are "const CdIo *". 2003-09-01 rocky * lib/_cdio_bincue.c: Test for NULL binfile - as odd as this sounds, it could cause core dump if no CD loaded. 2003-09-01 rocky * configure.ac: Remove -Wsign-promo which is not relevant for C programs. 2003-09-01 rocky * src/cd-info.c: Always have no-vcdinfo option. 2003-09-01 rocky * libcdio.spec.in: Translation kindly and graceously provided by Manfred Tremmel 2003-09-01 rocky * include/cdio/iso9660.h: Did packing incorrectly on pvd_t. 2003-09-01 rocky * lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_linux.c, lib/_cdio_sunos.c: Note TOC's initialized so we don't reread. Add some int's to unsigned. 2003-09-01 rocky * include/cdio/iso9660.h, lib/iso9660.c: Start to document library routines. An "int" was changed to the more correct "bool". 2003-09-01 rocky * test/.cvsignore: [no log message] 2003-09-01 rocky * test/Makefile.am, test/testiso9660.c: Add minimal test of new iso9660 library. 2003-09-01 rocky * include/cdio/iso9660.h, include/cdio/xa.h, lib/iso9660_private.h: Merge in and tidy up with mkisofs's iso9660.h. If that is correct (and it probably is), there were erroneous field definitions. 2003-09-01 rocky * configure.ac: Wrong AC_SUBST variable for CDDB. 2003-09-01 rocky * libcdio.spec.in: Add commentary about cd-info. Update dependencies to latest versions of packages which is really needed. 2003-09-01 rocky * src/cd-info.c: Have to rely more on other XA test since track indicator seems faulty. Missing "break;" in switch caused us to not print iso9660 filesystems. 2003-09-01 rocky * test/check_cue.sh.in, test/check_nrg.sh.in: Was setting options all wrong and using wrong CDDB substitution variable. As Bullwinkle says, "This time, for sure!" 2003-09-01 rocky * lib/_cdio_linux.c: Wasn't noting that we read TOC so we were re-reading it every time. 2003-08-31 rocky * src/cd-info.c: Deal with gcc warning. Think it was spurious, but just in case. 2003-08-31 rocky * ChangeLog, Makefile.am, THANKS, libcdio.spec.in: Fixes from Frantisek Dvorak 2003-08-31 rocky * NEWS: [no log message] 2003-08-31 rocky * lib/iso9660_fs.c, src/cd-info.c, test/check_cue.sh.in, test/isofs-m1.right: Make mode1 format filesystem print work. 2003-08-31 rocky * include/cdio/cdio.h, include/cdio/iso9660.h, include/cdio/sector.h, lib/_cdio_bincue.c, lib/cd_types.c, lib/cdio.c, lib/iso9660_fs.c, src/cd-info.c: Straighten out mode1 vs mode2 mess. 2003-08-31 rocky * include/cdio/iso9660.h: Define EMPTY_ARRAY_SIZE if it is not defined previously. 2003-08-31 rocky * include/cdio/iso9660.h, include/cdio/xa.h, lib/iso9660_fs.c, lib/xa.c: Final tidy up. 2003-08-31 rocky * lib/iso9660_fs.h: Most of this is public now. 2003-08-31 rocky * lib/xa.c, test/check_sizeof.c: [no log message] 2003-08-31 rocky * include/cdio/iso9660.h, include/cdio/xa.h, lib/Makefile.am, lib/iso9660_fs.c, lib/xa.c, lib/xa.h, src/cd-info.c, test/cdda.right, test/check_cue.sh.in, test/check_nrg.sh.in, test/monvoisin.right, test/vcd_demo.right: I think I have the XA encapsulation down so that it will work in vcdimager (and others). 2003-08-31 rocky * configure.ac: Rely more on PKG_INFO and remove header checks which didn't test for --enable-xxx. 2003-08-31 rocky * include/cdio/Makefile.am, include/cdio/iso9660.h, include/cdio/xa.h: Separate and make XA information public. 2003-08-31 rocky * include/cdio/iso9660.h, lib/Makefile.am, lib/iso9660_fs.c, lib/iso9660_fs.h, lib/xa.h, src/Makefile.am, src/cd-info.c, test/check_cue.sh.in, test/check_nrg.sh.in, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Move over reading ISO-9660 filesystems from vcdimager. Handling of XA attributes also moved over. 2003-08-31 rocky * include/cdio/iso9660.h, lib/iso9660.c, lib/iso9660_private.h, test/check_sizeof.c: Expose primary volume descriptor (pvd) and directory structures since they *are* part of the spec. and be done with it. 2003-08-31 rocky * src/cd-info.c: A tad closer to being able to print ISO-9660 filesystems 2003-08-31 rocky * include/cdio/iso9660.h, lib/cd_types.c, lib/iso9660_private.h: cd_types: tighter use of ISO #defines. Make some of the private ones public to reduce "private" use in vcdimager. 2003-08-31 rocky * include/cdio/iso9660.h, lib/iso9660.c, src/cd-info.c: iso_directory_record_t -> iso9660_dir_t 2003-08-31 rocky * include/cdio/iso9660.h, lib/iso9660.c: pvd_t -> iso9660_pvd_t 2003-08-31 rocky * include/cdio/iso9660.h, lib/iso9660.c: two routines are buggy. Back out until they've been fixed. 2003-08-31 rocky * configure.ac, include/cdio/iso9660.h, include/cdio/types.h, lib/iso9660.c: Opaque type declaration for iso9660 moved into well iso9660.h (from cdio/types.h). Opaque type for iso_directory_record defined and access routines added to libiso9660. 2003-08-31 rocky * autogen.sh: Minor changes. 2003-08-30 rocky * NEWS: [no log message] 2003-08-29 rocky * test/check_cue.sh.in, test/check_nrg.sh.in, test/check_opts.sh: Invalid substituiton variable. Allow cd-info tests to be skipped. 2003-08-29 rocky * src/cd-info.c: Declarations have to all be together for gcc < 3.0 2003-08-29 rocky * lib/iso9660_private.h: Wrong include. We've moved from vcdimager to cdio. 2003-08-29 rocky * Makefile.am: Add sample3 & 4 2003-08-29 rocky * ChangeLog, NEWS: [no log message] 2003-08-17 rocky * NEWS, example/.cvsignore, example/sample3.c: [no log message] 2003-08-17 rocky * example/Makefile, example/sample4.c: Yet another example. 2003-08-17 rocky * test/.cvsignore, test/Makefile.am, test/check_sizeof.c: Makefile.am: add check_sizeof and testischar 2003-08-17 rocky * libiso9660.pc.in: Remove dependence on vcd. We also don't use glib just yet. 2003-08-17 rocky * .cvsignore, Makefile.am, configure.ac, include/cdio/Makefile.am, include/cdio/iso9660.h, include/cdio/types.h, lib/Makefile.am, lib/cd_types.c, lib/iso9660.c, lib/iso9660_private.h, libiso9660.pc.in, test/.cvsignore, test/Makefile.am, test/testassert.c, test/testischar.c: Add iso9660 library and regression test. Will be deleted from vcdimager-cdio branch. cd_types.c: forgot to add previously. 2003-08-16 rocky * example/sample3.c: Typo in comment. 2003-08-16 rocky * configure.ac: Make sure we have the latest vcdinfo 2003-08-16 rocky * example/Makefile, example/sample3.c, src/cd-info.c: Add simple program to show CD-type and filesystem determination. cd-info.c: minor code cleanups. 2003-08-16 rocky * example/.cvsignore: Add sample3 2003-08-16 rocky * test/check_cue.sh: Is derived from check_cue.sh.in 2003-08-16 rocky * include/cdio/Makefile.am, include/cdio/cd_types.h, lib/Makefile.am, src/Makefile.am, src/analyze.c, src/analyze.h, src/cd-info.c, test/check_cue.sh: Move routine to analyze/guess what type of CD image we have got into the library. 2003-08-16 rocky * src/Makefile.am: Oooops--test version of Makefile.am got checked in. Revert it. 2003-08-16 rocky * src/Makefile.am, src/analyze.c, src/analyze.h, src/cd-info.c, test/check_cue.sh, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Fix bug in storing iso_9660 volume sector count. cd-info.c reduce global variables. Regression tests output was incorrect with this long-standing bug. 2003-08-14 rocky * src/Makefile.am, src/analyze.c, src/analyze.h, src/cd-info.c: First cut at separating disc analysis part from standalone source. More modularity is needed. 2003-08-13 rocky * src/cd-info.c: Messed up on SVCD test. 2003-08-13 rocky * src/cd-info.c: Set VCD log handler. 2003-08-11 rocky * lib/_cdio_win32.c: A simple stupid mistake. Not sure why it wasn't caught before. 2003-08-10 rocky * test/check_cue.sh: VCD tests when available. 2003-08-10 rocky * doc/.cvsignore, example/.cvsignore: lint. 2003-08-10 rocky * configure.ac, src/Makefile.am, src/cd-info.c: Changes brought about by recent vcdimager-cdio changes. - We use vcdinfo_t ** on vcdinfo_open. - Now make use of pkg-config for vcdimager in configure. - Remove reference to info_private.h. 2003-08-09 rocky * ChangeLog: [no log message] 2003-08-09 rocky * ChangeLog, Makefile.am, doc/Makefile.am, example/sample1.c, example/sample2.c: *Makefile/am Get sample documentation is in distribution. example/*.c: remove trailing blanks at end of file. 2003-08-09 rocky * NEWS: [no log message] 2003-08-06 rocky * libcdio.spec.in: - fixes really Manfred Tremmel at http://www.iiv.de/schwinde/buerger/tremmel/ 2003-08-03 rocky * doc/libcdio.texi: Fill out how to use: add example programs 1 and 2. 2003-08-03 rocky * example/sample2.c: Sample program to - show what driver is automatically selected - what device will be used for that - list all the drivers that exist showing whether they are available or not 2003-08-02 rocky * NEWS: [no log message] 2003-08-02 rocky * Makefile.am: Remove that directory in EXTRA_DIST! 2003-08-02 rocky * example/README, example/sample1.c: Add a sample program. More will follow later... 2003-08-02 rocky * doc/libcdio.texi: typo. 2003-07-30 rocky * doc/libcdio.texi: More verbiage. Alas not on how to use *this* package, but we are getting there if by virtue of not being able to postpone it too much more. 2003-07-28 rocky * doc/libcdio.texi: Small additions and edits. 2003-07-28 rocky * doc/.cvsignore: [no log message] 2003-07-28 rocky * Makefile.am, configure.ac, doc/Makefile.am, doc/libcdio.texi: First feeble attempt at documentation. 2003-07-27 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c: Small comment change. 2003-07-12 rocky * parse/Makefile, parse/test/runall: Add simple regression testing driver. 2003-06-22 rocky * ChangeLog, include/cdio/cdio.h, lib/cdio.c, lib/cdio_private.h, src/cd-info.c: MIN_DRIVER, MIN_DEVICE_DRIVER, MAX_DEVICE_DRIVER -> CDIO_... Add CDIO_MAX_DRIVER (distinct from CDIO_MAX_DEVICE_DRIVER cdio.c (cdio_open): was only scanning devices. Change to scan disk image files as well. 2003-06-16 rocky * NEWS: [no log message] 2003-06-13 rocky * configure.ac: Order of libraries is important in cygwin (and perhaps others): -lvcdinfo comes before -lvcd. 2003-06-13 rocky * src/cd-info.c: Now use cdio enum rather than vcd enum for unknown driver type. 2003-06-12 rocky * lib/_cdio_generic.c, lib/_cdio_linux.c, lib/cdio_private.h, src/cd-info.c: Make GNU/Linux smarter about finding a default device -- code sort of from SDL. Better error checking all around. 2003-06-12 rocky * lib/_cdio_win32.c: Pedantic change: subroutine name is probably better. 2003-06-11 rocky * test/.cvsignore: [no log message] 2003-06-11 rocky * include/cdio/cdio.h, lib/cdio.c, src/Makefile.am: Enumeration had grew but hadn't changed string array accordingly. 2003-06-11 rocky * lib/_cdio_win32.c: Bug fixes for NT-derived systems 2003-06-10 rocky * configure.ac: It's '=' not '==' 2003-06-08 rocky * configure.ac, test/check_common_fn.in: Better way to deal with diff vs. cmp and diff options. 2003-06-08 rocky * configure.ac, test/{check_common_fn => check_common_fn.in}: Use diff rather than cmp if possible. Also if possible do a unified diff and for M$DOG strip whitespace for the \r\n vs \n differences. 2003-06-07 rocky * src/cd-info.c: Reverting change (for now). 2003-06-07 rocky * src/cd-info.c: Is this right? 2003-06-07 rocky * lib/_cdio_win32.c: More bugs. By far not the last of them though.... 2003-06-07 rocky * include/cdio/cdio.h, lib/_cdio_win32.c, lib/cdio.c: With M$ we can no longer assume we can open a fd ant it will read properly. Add yellow-mode reads interface. There's lots of cleanup to do... 2003-06-07 rocky * test/cdda.right, test/check_common_fn, test/check_opts0.right, test/check_opts1.right, test/check_opts2.right, test/check_opts3.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: Remove headers. Run with --no-header now. 2003-06-07 rocky * src/cd-info.c: Add option to nuke header for regression tests. With M$ can no longer assume file descriptors do the right thing. Have pay more attention to track formats. 2003-06-07 rocky * include/cdio/cdio.h, lib/_cdio_win32.c, lib/cdio.c: More MinGW things. Need generic routine for determining if a string is a device 2003-06-07 rocky * lib/_cdio_generic.c: Add generic routine to determine if a string refers to a device or not. 2003-06-07 rocky * lib/cdio_private.h: Add customized routines for determining if whether a string refers to a device or not. 2003-06-07 rocky * lib/_cdio_win32.c: First inkling of this actually working. 2003-06-07 rocky * include/cdio/types.h, lib/_cdio_win32.c: More MinGW fixes. 2003-06-07 rocky * src/cd-info.c: Show default device on version command. Don't put /dev in front of device name if win32. 2003-06-07 rocky * configure.ac, lib/_cdio_win32.c, src/cd-info.c: More MinGW fixes. 2003-06-07 rocky * configure.ac, src/cd-info.c: cygwin/mingw improvements cd-info: list drivers and exit when --version requested. 2003-06-07 rocky * include/cdio/cdio.h, lib/cdio.c: Add access routine to return driver string 2003-06-01 rocky * configure.ac, src/Makefile.am, src/cd-info.c: Require libcddb 0.9.4 or nothing at all. We now allow: - setting cache directory - disabling caching altogther - setting timeout on CDDB network operations - setting email address reported to CDDB server - setting name of CDDB server - printing/suppressing messages from CDDB 2003-05-30 rocky * test/check_common_fn: report name of cd-info program more accurately and precisely 2003-05-30 rocky * lib/_cdio_generic.c: Not everyone has sys/ioctl.h. 2003-05-27 rocky * lib/_cdio_freebsd.c: Another holdover from constants that were renamed. 2003-05-27 rocky * configure.ac, include/cdio/cdio.h, include/cdio/types.h, lib/Makefile.am, lib/_cdio_win32.c, lib/cdio.c, parse/.cvsignore: Closer to having WIN32 CD-ROM support 2003-05-27 rocky * lib/_cdio_freebsd.c: Miscellaneous constant changes and typos 2003-05-26 rocky * include/cdio/sector.h: more pedantic types (which in fact match the implementation). 2003-05-25 rocky * lib/_cdio_freebsd.c: Another small comment correction 2003-05-25 rocky * lib/_cdio_freebsd.c: small eject comment correction 2003-05-24 rocky * src/cd-info.c: Revert version number change since I'm not prepared to change the regression test numbers. 2003-05-24 rocky * lib/cdio_private.h: Add field for and save driver id used. 2003-05-24 rocky * src/cd-info.c: Print out driver selected. 2003-05-24 rocky * lib/cdio.c: Add cdio_get_driver_name: routine to list name of driver selected. 2003-05-24 rocky * include/cdio/cdio.h: Add cdio_get_driver_name: routine to return driver selected. 2003-05-20 rocky * ChangeLog: [no log message] 2003-05-20 rocky * : Test NRG file. 2003-05-20 rocky * configure.ac: Solaris needs -lnsl and -lgethostbyname for libcddb 2003-05-20 rocky * lib/_cdio_bincue.c: Wrong name: was testing uninit variable. 2003-05-20 rocky * configure.ac: Get ready for version 0.6 2003-05-20 rocky * NEWS: [no log message] 2003-05-18 rocky * ChangeLog, NEWS: [no log message] 2003-05-18 rocky * test/check_cue.sh.in: Add a test using --bin 2003-05-18 rocky * lib/_cdio_bincue.c: Wasn't handling bin correctly. 2003-05-18 rocky * TODO: [no log message] 2003-05-18 rocky * include/cdio/cdio.h, lib/_cdio_bincue.c, lib/cdio.c: Add routine to open check for bin file (cdio_is_binfile). Code simplified a little. 2003-05-17 rocky * ChangeLog, NEWS: [no log message] 2003-05-17 rocky * libcdio.pc.in: We don't really use glib-2.0 for now. BSDI test box doesn't have. 2003-05-16 rocky * test/check_nrg.sh.in: BSDI doesn't handle skipped tests (exit 77) properly. I'd rather switch than fight. 2003-05-16 rocky * lib/cdio.c: Wasn't nulling correctly. Eject test faulty too. 2003-05-16 rocky * include/cdio/cdio.h, lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_linux.c, lib/_cdio_sunos.c, lib/cdio.c, parse/Makefile: Bug in eject: need to close internal file descriptor before ejecting. eject interface now nulls cdio pointer after a successful eject. 2003-05-11 rocky * ChangeLog, parse/.cvsignore, parse/Makefile, parse/cue.L, parse/cue.y, parse/test/t1.cue, parse/test/t2.cue, parse/test/t3.cue: Towards CUE parser via flex/bison. 2003-04-29 rocky * misc/libcdio.ebuild: Gentoo ebuild file courtesy of Kris Verbeeck * THANKS: More appreciation. 2003-04-28 rocky * test/.cvsignore: Do I trust Savannah? 2003-04-28 rocky * NEWS: [no log message] 2003-04-28 rocky * test/Makefile.am, test/{check_nrg.sh => check_nrg.sh.in}: check_nrg.sh is now derived since we may or may not have Video CD info displayed. 2003-04-26 rocky * configure.ac, src/Makefile.am, src/cd-info.c, test/cdda.right, test/check_cue.sh.in, test/check_nrg.sh, test/check_opts0.right, test/check_opts1.right, test/check_opts4.right, test/check_opts5.right, test/check_opts6.right, test/check_opts7.right, test/isofs-m1.right, test/monvoisin.right, test/svcd_ogt_test_ntsc.right, test/svcdgs.right, test/vcd_demo.right, test/videocd.right: cd-info: Use libvcdinfo if it is around to list out general Video CD properties (format version, album description, preparer id, volume number and count). cd-info output changed slightly. 2003-04-25 rocky * .cvsignore, src/.cvsignore: [no log message] 2003-04-25 rocky * ChangeLog, Makefile.am, src/Makefile.am, src/{cdinfo.c => cd-info.c}, test/check_common_fn, test/check_opts.sh: rename cdinfo to cd-info to accommodate previously existing cdinfo programs. Thanks to Manfred Tremmel for reporting the problem. 2003-04-25 rocky * configure.ac: Make RPM spec file. 2003-04-25 rocky * THANKS: Add Manfred Tremmel 2003-04-25 rocky * libcdio.spec.in: First RPM spec thanks to Manfred Tremmel . 2003-04-24 rocky * test/Makefile.am, test/check_nrg.sh, test/videocd.right: Add a single NRG test. 2003-04-24 rocky * NEWS: [no log message] 2003-04-23 rocky * lib/_cdio_nrg.c, test/svcdgs.right: More blind guesses to CUES format. Still wrong, but works better on the one sample I have to go on: svcdgs.nrg. 2003-04-22 rocky * configure.ac, include/cdio/Makefile.am: Wasn't installing version.h. This time, for sure! 2003-04-22 rocky * test/isofs-m1.cue: ISO 9660 filesystem Mode1 regression test. 2003-04-22 rocky * : Sample CD-DA bin/cue image. 2003-04-22 rocky * test/cdda.cue: Regression test cue. 2003-04-22 rocky * include/cdio/version.h.in: [no log message] 2003-04-22 rocky * include/cdio/.cvsignore: config.h now is no longer derived while version.h now is. 2003-04-22 rocky * Makefile.am, configure.ac, include/cdio/Makefile.am, include/cdio/{cdio.h.in => cdio.h}, lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_stdio.c, lib/_cdio_stream.c, lib/_cdio_stream.h, lib/_cdio_sunos.c, lib/bytesex.h, lib/bytesex_asm.h, lib/cdio.c, lib/cdio_assert.h, lib/cdio_private.h, lib/ds.c, lib/ds.h, lib/logging.c, lib/sector.c, lib/util.c, src/cdinfo.c, {tests => test}/.cvsignore, {tests => test}/Makefile.am, {tests => test}/cdda.right, {tests => test}/check_common_fn, {tests => test}/check_cue.sh.in, {tests => test}/check_nrg.sh, {tests => test}/check_opts.sh, {tests => test}/check_opts0.right, {tests => test}/check_opts1.right, {tests => test}/check_opts2.right, {tests => test}/check_opts3.right, {tests => test}/check_opts4.right, {tests => test}/check_opts5.right, {tests => test}/check_opts6.right, {tests => test}/check_opts7.right, {tests => test}/fsf.right, {tests => test}/isofs-m1.right, {tests => test}/monvoisin.right, {tests => test}/svcd_ogt_test_ntsc.right, {tests => test}/svcdgs.right, {tests => test}/vcd_demo.right, tests/cdda.cue, tests/isofs-m1.cue: tests -> test All public includes are included via #include rather than #include "....h" (removed -I $top_srcdir/include/cdio) 2003-04-22 rocky * lib/_cdio_freebsd.c: Probably closer. 2003-04-22 rocky * Makefile.am: Update regression version. 2003-04-22 rocky * tests/check_nrg.sh: Add another Nero test. 2003-04-22 rocky * tests/svcdgs.right: Yet another Nero test. 2003-04-21 rocky * tests/.cvsignore: [no log message] 2003-04-21 rocky * TODO: Where we might be going... 2003-04-21 rocky * .cvsignore: Now that we're using pkg-config. 2003-04-21 rocky * include/cdio/cdio.h.in: Simple typo. 2003-04-21 rocky * lib/_cdio_nrg.c: Probably much closer to being able to handle Nero CUES format. Seems to have 2336 sector size; 2 second pregap seems to be included at the beginning of the image. 2003-04-21 rocky * src/cdinfo.c: Add tests for CVD. A lot of this probably should be redone. For example, should get basic Video CD info from libvcdinfo if that is around. 2003-04-21 hvr * include/cdio/Makefile.am, include/cdio/logging.h, include/cdio/sector.h, tests/check_cue.sh: public headers must nuse unique #includes! 2003-04-21 hvr * Makefile.am, configure.ac, include/cdio/cdio.h.in, libcdio.pc.in: added pkg-config(1) support 2003-04-20 rocky * ChangeLog, include/cdio/.cvsignore, tests/.cvsignore, tests/check_cue.sh, tests/isofs-m1.right: CVS maintenance 2003-04-20 rocky * NEWS: [no log message] 2003-04-20 rocky * tests/{check_cue.sh => check_cue.sh.in}: May need --no-cddb option. 2003-04-20 rocky * configure.ac, include/cdio/cdio.h, include/cdio/cdio.h.in, src/cdinfo.c, tests/Makefile.am, tests/check_cue.sh, tests/{check_opts.sh.in => check_opts.sh}, tests/check_opts0.right, tests/check_opts1.right, tests/check_opts2.right, tests/check_opts3.right, tests/check_opts4.right, tests/check_opts5.right, tests/check_opts6.right, tests/check_opts7.right, tests/fsf-tompox.right, tests/isofs-m1.cue: Reduce overall size yet again by replaing isofs-m1 for fsf-tompox. cdinfo: Add options for CDDB port and CDDB http enable fix bug if no CD in cdrom drive. 2003-04-20 rocky * include/cdio/cdio.h: add min/max device driver 2003-04-20 rocky * Makefile.am, configure.ac, lib/cdio.c, tests/Makefile.am, tests/cdda.cue, tests/cdda.right, tests/check_cue.sh: Add small cdda test. cdio.c: cdio_open was opening image drivers. 2003-04-20 rocky * ChangeLog, configure.ac, lib/Makefile.am, src/cdinfo.c: Put back in libcddb 0.9.0 checking and use cddb_http_disable(). 2003-04-19 rocky * lib/_cdio_freebsd.c: Add _cdio_read_audio_sector. Try to sync up with other drivers. 2003-04-19 rocky * Makefile.am, NEWS, configure.ac, tests/Makefile.am, tests/check_common_fn, tests/check_cue.sh, tests/check_nrg.sh, tests/check_opts.sh.in, tests/check_opts0.right, tests/check_opts1.right, tests/check_opts2.right, tests/check_opts3.right, tests/check_opts4.right, tests/check_opts5.right, tests/check_opts6.right, tests/check_opts7.right: Break most of the larger regression tests into a separate package. 2003-04-19 rocky * include/cdio/Makefile.am, include/cdio/{cdio.h => cdio.h.in}: Add package version 2003-04-19 rocky * include/cdio/cdio.h: Add an API version number. 2003-04-19 rocky * ChangeLog, Makefile.am, configure.ac, include/.cvsignore, include/Makefile.am, include/cdio/.cvsignore, include/cdio/Makefile.am, {lib => include/cdio}/cdio.h, {lib => include/cdio}/logging.h, {lib => include/cdio}/sector.h, {lib => include/cdio}/types.h, {lib => include/cdio}/util.h, lib/Makefile.am, src/cdinfo.c, tests/.cvsignore: Move public includes to include/cdio. This should facilitate having this source installed locally since it allows #include in the source tree. 2003-04-19 rocky * src/cdinfo.c: Revise to to handle libcddb 0.90. 2003-04-19 rocky * lib/cdio.h: Remove a compile warning noticed by Kris Verbeeck. 2003-04-19 rocky * configure.ac: do chmod +x for test/check_opts.sh Test to see if we have new enough libcddb. 2003-04-19 rocky * README: Update to include CDDB information and note this is ued by CD-DA plugin. 2003-04-15 rocky * lib/_cdio_linux.c: Remove compile warning on non-GNU/Linux servers. 2003-04-14 rocky * THANKS: Need to start *somewhere*. 2003-04-14 rocky * NEWS: Wha's happenin' 2003-04-14 rocky * lib/_cdio_bincue.c: Bug-causing typo. 2003-04-14 rocky * configure.ac, tests/Makefile.am, tests/{check_opts.sh => check_opts.sh.in}: Need to conditionally add --no-cddb so we added check_opts.sh.in. Rewrite for loop in lower-level Bourne-shell style. 2003-04-14 rocky * src/cdinfo.c: One cddb reference not conditionally included. 2003-04-14 rocky * tests/Makefile.am: Add check files to distribution. 2003-04-14 rocky * tests/Makefile.am, tests/check_cue.sh, tests/check_opts.sh, tests/check_opts0.right, tests/check_opts1.right, tests/check_opts2.right, tests/check_opts3.right, tests/check_opts4.right, tests/check_opts5.right, tests/check_opts6.right, tests/check_opts7.right: Add regression test to check cdinfo options processing. 2003-04-14 rocky * src/cdinfo.c: libpopt options need to be integers. Change order of include to accommodate libcddb. Make distcheck now works. 2003-04-14 rocky * src/Makefile.am: Add CDDB_LIB for cdinfo. 2003-04-14 rocky * configure.ac: Check for libcddb and use that if it's there. 2003-04-14 rocky * tests/check_cue.sh: Don't give CDDB info for audio test since it's not valid and we can't assume we're connected to the Internet. 2003-04-14 rocky * lib/_cdio_bincue.c: If we don't think this is a cue file, we now report that rather than give the cryptic message about a null source. 2003-04-14 rocky * src/cdinfo.c: CDDB lookup for audio CD via libcddb. 2003-04-14 rocky * lib/cdio.c: Bad linux default_device initialization. 2003-04-12 rocky * lib/_cdio_bincue.c, lib/_cdio_bsdi.h, lib/cdio.c, lib/cdio.h: Add routine cdio_is_bincue to test if file is a cue file. cdio_open does a better job in automatically determining the type of file. 2003-04-11 rocky * lib/sector.c, lib/sector.h: Tired of all those unused warnings. Remove the static inline stuff. It's probably not worth the performance gains. (And if it is we can turn into a #define) 2003-04-11 rocky * lib/_cdio_sunos.c: Move used #include outside of conditional compilation since strdup's used to get default device. 2003-04-11 rocky * lib/_cdio_bincue.c, lib/_cdio_nrg.c: Forgot to add recently added read_audio_sector to op structure. 2003-04-10 rocky * configure.ac, lib/_cdio_bincue.c, lib/_cdio_nrg.c: configure.ac: bump version bincue/nrg: add cdio_read_audio_sector 2003-04-10 rocky * lib/_cdio_sunos.c: read_mode_audio_sector now works. 2003-04-10 rocky * lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_freebsd.c, lib/_cdio_generic.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio.h, lib/cdio_private.h: get_default_device with NULL will get device *without* trying to open cd. Add read_audio call. 2003-04-10 rocky * lib/_cdio_linux.c: Add ability to read audio (CD-DA) sector. 2003-04-10 rocky * lib/types.h: Add CDIO_INVALID_LSN definition 2003-04-09 rocky * lib/sector.h: CD_MAX_TRACKS -> CDIO_CD_MAX_TRACKS 2003-04-08 rocky * ChangeLog: [no log message] 2003-04-08 rocky * lib/_cdio_linux.c: Small name changes. 2003-04-08 rocky * lib/_cdio_bsdi.c: Changes brought about by sector.h #define changes. 2003-04-08 rocky * lib/_cdio_sunos.c: Revise for changed sector.h 2003-04-07 rocky * lib/cdio_private.h: Add opaque CdIoDataSource type and generic free routine for stream-based drivers (nrg, bincue, network). 2003-04-07 rocky * lib/types.h: Indentation formatting that Emacs prefers. 2003-04-07 rocky * lib/_cdio_nrg.c: Sync up with _cdio_bincue a little. free routine replaced with a generic routine. 2003-04-07 rocky * lib/_cdio_bincue.c: Move free routine into a generic routine. Some numbers replaced by #define constants. 2003-04-07 rocky * lib/_cdio_generic.c: Add generic_stream_free and remove out of disk-image routines. 2003-04-07 rocky * lib/_cdio_stream.h: Opaque type CdioDataSource is now in cdio_private.h. This forces us to use that. (And this might not be the best, but I can't think of anything else that is as simple.) 2003-04-07 rocky * lib/_cdio_stream.c: Grammar typo. 2003-04-07 rocky * lib/_cdio_bincue.c: Another case of not checking the status of operations and returning on error (rather than continuing). Not serious this time... 2003-04-07 rocky * lib/_cdio_bincue.c: Propagate error results from seeks and reads. 2003-04-06 rocky * lib/_cdio_stdio.c, lib/_cdio_stream.c, lib/_cdio_stream.h: Document some of the interfaces. 2003-04-06 rocky * lib/_cdio_bincue.c: Back off a little with the #define thing a little for now. I made a mistake somewhere. (And don't want to track it down further.) 2003-04-06 rocky * lib/sector.h: This time for sure? 2003-04-06 rocky * lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/sector.h, src/cdinfo.c: More #define reductions/fixes. 2003-04-06 rocky * lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_bsdi_old.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_stream.c, lib/_cdio_sunos.c, lib/sector.h, src/cdinfo.c: Change sector.h constants, yet again. This time for Herbert Valiero Riedel. 2003-04-06 rocky * : This file seems to get changed when checking in. 2003-04-06 rocky * tests/Makefile.am: svcd_ogt_test_ntsc.bin corrupted. Makefile: add other bin/cue/nrg's 2003-04-06 rocky * tests/Makefile.am, tests/check_cue.sh, tests/fsf-tompox.right, tests/fsf.right: Add a CD audio test and an ISO 9660 joliet extension tst. Add in the Video CD images I've been using. 2003-04-06 rocky * src/cdinfo.c: Use new sector.h constants. 2003-04-06 rocky * lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c, lib/cdio.h: Use new sector.h constants. More changes will no doubt follow. 2003-04-06 rocky * lib/_cdio_bincue.c: More complete. Fill out seek code. 2003-04-06 rocky * lib/sector.h: Go with Linux definitions rather than invent our own. More changes will no doubt follow. 2003-04-04 rocky * lib/_cdio_bincue.c, lib/cdio_private.h: Close go getting simple read working. Not completely correct, but close. 2003-04-04 rocky * lib/cdio.c, lib/cdio.h: Documentation improvement: Note that get_default_device returns NULL on error. 2003-04-03 rocky * lib/Makefile.am, lib/_cdio_stream.h, lib/bytesex.h, lib/bytesex_asm.h, lib/cdio.h, lib/cdio_assert.h, lib/ds.c, lib/ds.h, lib/logging.h, lib/sector.h, lib/{cdio_types.h => types.h}: cdio_types.h -> types.h 2003-04-02 rocky * lib/cdio.c: Note that device is uninit when destroying, 'cause it is! 2003-03-30 rocky * lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio.h, lib/cdio_private.h: More common routines and structures moved to cdio_generic.c or cdio_private.h respectively. 2003-03-30 rocky * configure.ac: BSDI now requires Steve Schultz's libdvd.a and dvd.h package. 2003-03-30 rocky * configure.ac: Having trouble getting aclocal include libpopt.m4 (and presumably other *.m4's) 2003-03-30 rocky * autogen.sh, configure.ac, src/Makefile.am: Rest: add libpopt autoconfiguration. 2003-03-30 rocky * lib/_cdio_bsdi.c: Extend to larger interface using generic routines. 2003-03-30 rocky * lib/_cdio_freebsd.c: Yet another typo. 2003-03-30 rocky * lib/_cdio_freebsd.c: Change default drive and fix typographical mistake. 2003-03-29 rocky * lib/_cdio_bincue.c, lib/_cdio_generic.c, lib/_cdio_nrg.c, lib/_cdio_sunos.c: Small lint-like errors. Solaris now works again with new read/lseek functions. 2003-03-29 rocky * lib/_cdio_freebsd.c, lib/_cdio_sunos.c: Probably closer towards compiling on those architectures. 2003-03-29 rocky * configure.ac, lib/Makefile.am, lib/_cdio_bincue.c, lib/_cdio_bsdi.c, lib/_cdio_bsdi_old.c, lib/_cdio_freebsd.c, lib/_cdio_generic.c, lib/_cdio_linux.c, lib/_cdio_nrg.c, lib/_cdio_stdio.c, lib/_cdio_stream.c, lib/_cdio_stream.h, lib/_cdio_sunos.c, lib/cdio.c, lib/cdio.h, lib/cdio_private.h, lib/cdio_types.h, lib/sector.h, src/Makefile.am, src/cdinfo.c, tests/monvoisin.right: Add simple (non-mode2) read/seek. _cdio_generic.c: place to save common driver routines add cdio_get_track_sec_count. 2003-03-25 rocky * src/cdinfo.c: gcc < 3.0 compatibility. 2003-03-25 rocky * lib/_cdio_freebsd.c: A stab at FreeBSD support. Not finished. More later... 2003-03-24 rocky * lib/Makefile.am, lib/_cdio_bsdi.c, lib/_cdio_linux.c, lib/cdio.c, lib/cdio.h: _cdio_linux.c: eject routines does it's own open and close. cdio.h, Makefile.am, cdio.c: Add FreeBSD routine (not complete yet). 2003-03-24 rocky * src/cdinfo.c: Small clarity change 2003-03-24 rocky * Initial revision libcdio-2.2.0/INSTALL000066400000000000000000000315331474051130400141550ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== If you are compiling from git sources, see README-develop.md Briefly, the shell command: ./configure && make && sudo make install should configure, build, and install this package. "sudo" may not be in situations where "root" access is not needed to install software. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and send patches to https://savannah.gnu.org/patch/?group=libcdio The file `configure.ac' is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' or `remake' (GNU make with better error reporting, tracing and a debugger) to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs listed in README.develop in order to regenerate files that came with the distribution. 7. You can also type `make uninstall' to remove the installed files again. 8. `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. 9. For a list of all targets if you have remake installed, `remake --tasks' will give a list. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. Also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `cddb' (CDDB lookup support) or `vcd-info' (for enabling VCD support). The botom of file `README.libcdio' has a list of `--enable-' and `--with-' options recognized. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libcdio-2.2.0/Makefile.am000066400000000000000000000112431474051130400151540ustar00rootroot00000000000000# Copyright (C) 2003-2004, 2006, 2008, 2011-2013, 2016, 2019, 2024 # 2023 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ## Process this file with automake to produce Makefile.in ## which configure then turns into a Makefile ... ## which make can then use to produce stuff. Isn't configuration simple? .PHONY: ChangeLog check-leaks check-short test AUTOMAKE_OPTIONS = dist-bzip2 EXTRA_DIST = \ .vs/cd-info.vcxproj \ .vs/cd-info.vcxproj.filters \ .vs/config.h \ .vs/libcdio.vcxproj \ .vs/libcdio.vcxproj.filters \ .vs/README.txt \ .vs/set_version.ps1 \ .vs/unistd.h \ NEWS.md \ README.md \ README-libcdio.md \ THANKS \ example/README \ libcdio++.pc.in \ libcdio.pc.in \ libcdio.sln \ libiso9660++.pc.in \ libiso9660.pc.in \ libudf.pc.in \ make-check-filter.pl \ make-check-filter.rb \ package/libcdio.spec.in \ test/README.multiextent \ $(wildcard test/data/*.bin) \ $(wildcard test/data/*.cue) \ $(wildcard test/data/*.iso) \ $(wildcard test/*.right) SUBDIRS = doc include lib src test example # pkg-config(1) related rules pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcdio.pc \ libiso9660.pc \ libudf.pc if ENABLE_CXX_BINDINGS pkgconfig_DATA += \ libcdio++.pc \ libiso9660++.pc endif $(pkgconfig_DATA): config.status # List of additional files for expanded regression tests DISTFILES_REGRESSION = tests/monvoisin.nrg tests/monvoisin.right \ tests/svcdgs.nrg tests/svcdgs.nrg \ tests/svcd_ogt_test_ntsc.bin \ tests/svcd_ogt_test_ntsc.cue \ tests/svcd_ogt_test_ntsc.right \ tests/vcd_demo.bin tests/vcd_demo.cue \ tests/vcd_demo.right REGRESSION_VERSION = 1.1 distdir_regression = ../$(PACKAGE)-$(REGRESSION_VERSION)-tests #: run regression tests. "test" is the same thing as "check" test: check #: Run all tests without bloated output check-short: $(MAKE) check 2>&1 | ruby @abs_top_srcdir@/make-check-filter.rb #: run valgrind on C programs check-leaks: $(MAKE) -C test/driver check-leaks && \ $(MAKE) -C example check-leaks #: Make documentation via Doxygen http://www.stack.nl/~dimitri/doxygen/ doxygen: -( cd ${top_srcdir}/doc/doxygen && /bin/sh ${srcdir}/run_doxygen ) dist-regression: distdir-regression cd $(distdir) && $(AMTAR) chof - tests | GZIP=$(GZIP_ENV) gzip -c >$(distdir_regression).tar.gz $(am__remove_distdir) distdir-regression: $(DISTFILES_REGRESSION) $(am__remove_distdir) mkdir $(distdir) @list='$(DISTFILES_REGRESSION)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir_regression)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -755 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) check_nrg.sh: $(top_builddir)/config.status check_nrg.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ chmod +x config_nrg.sh check_cue.sh: $(top_builddir)/config.status check_cue.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ chmod +x config_cue.sh check_iso.sh: $(top_builddir)/config.status check_iso.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ chmod +x config_iso.sh MAINTAINERCLEANFILES = ChangeLog *.rej *.orig if MAINTAINER_MODE GIT2CL ?= git2cl #: Create ChangeLog from version control ChangeLog: git log --pretty --numstat --summary | $(GIT2CL) >$@ ACLOCAL_AMFLAGS=-I m4 endif libcdio-2.2.0/NEWS.md000066400000000000000000000636061474051130400142300ustar00rootroot00000000000000NEWS ==== Here we have a summary of the major changes by release. See the git commit history or `ChangeLog` for more fine-grained changes. Version 2.2.0 ------------- 2025-01-09 Revised to note ABI change in ISO-9660 shared library (`.so`) version numbers; bump release version from 2.1.1 to 2.2.0 to note both API and ABI changes. These are the last three bullet items under Version 2.1.1 below. Remove `LIBCDIO_SOURCE_PATH` from `configure.ac`. See https://github.com/libcdio/libcdio/issues/13. Changes noticed and offered by Jan Alexander Steffens. Version 2.1.1 ------------- 2025-01-07 *Note: there was ABI and API breakage between this release and 2.1.0 which is not reflected in dynamic library `.so` version numbers. Please use release 2.2.0 for these corrections.* - More checks of potentially NULL buffers. More `malloc()`/`calloc()` result checks. - Enforce non-widestring ("A" suffixed) calls when we pass `char*` parameters. (Pete Batard) - Use widestring API calls unless otherwise specified. - Remove a deprecation warning of the declaration of `is_cdrom_aspi() `and `GetVersion()`. (Pete Batard) - Updates for compiling on MSVC. (Pete Batard) - Move to github (rocky) - Add github CI checks. (Pete Batard) - Count empty fields as tracks. (John Ernberg) - Add some validity checks to enhance security. (Mansour Gashasbi) - Add support for ISO9660 multi extent files. (Pete Batard) - Fix Recognition of multi-extent in ISO9660 when Joliet is present. (Thomas Schmitt) - Use getmntent/setmntent for reading mounts. (Miguel Borges de Freitas) - Use GNU/Linux new ioctl on kernel v5.16 or newer. (Lukas Prediger) - Use "%s"-style format in cdda-player.c: to make it catch cases when user input is used in place of format. (Sergei Trofimovich) - Remove some memory leaks in C++ code. (Thomas Schmitt) - Allow for DO_NOT_WANT_COMPATIBILITY macro in config.h to disable APIs that are being retired. - Fix win32 implementation of .get_track_msf() for CD with first track number > 1 (Thomas Schmitt) - Fix testing on Windows and remove compilation warnings. (Pete Batard) - Add Rock Ridge deep directory support. (Pete Batard) - Fix and clean up various Rock Ridge issues and adjust tests. (Pete Batard) - Fix double reporting of sizes in cd-info.c. (Pete Batard) - CD-Text character set interpretation more tolerant of bad input. Savannah bug 53929. - Remove homegrown boolean type in favor of . (Thomas Schmitt) - Improve pkg-config configuration detection (Lars Wendler) - Fix crash reading CD TOC on macOS Ventura. (Robert Kausch) - Update freedb references to GnuDB. (Robert Kausch) - Fix charset check in Windows cdio_charset_from_utf8 implementation. (Robert Kausch) - Add support for reading CD-Text on macOS and Windows (Robert Kausch) - API change: Rename some fields in `ecma_167.h` from integer (prefix `i_`) to unsigned (prefix `u_`) to actually match their type - ABI change: Add `u_su_fields` to the end of `iso_rock_statbuf_t` - ABI change: Add `total_size` in the middle of `iso9660_stat_t` Version 2.1.0 ------------- 2019-04-17 Holy Wednesday Most (all?) of the improvements and bug fixes are thanks to Thomas Schmitt and Edd Barrett. This release introduces an OpenBSD driver, courtesy of Edd Barrett, based on the NetBSD driver. - NetBSD driver fixes. Switch from MSF addressing to LBA addressing in driver. (Edd Barrett and Jasper Lievisse Adriaanse) - Fix handling in drivers,libcdio-paranoia and `cd-info` when starting track number is greater than 1. (Edd Barrett and Thomas Schmitt) - More tolerant of non-compliant ISOs such as openSUSE Leap 15.0. - `cdda-player` fixes, such as adding a missing `-d` in cdda-player help (Thomas Schmitt and Edd Barrett) - `cdtext_list_languages_v2()` to be preferred over now deprecated `cdtext_list_languages()`. New API call `cdtext_set_language_index()`. (Thomas Schmitt) - Add `read-disc-struct` example program to show how to use a MMC `DVD_READ_DISC_STRUCTURE`. (Thomas Schmitt) - Various errors in driver reading turned into warnings. (Edd Barrett and Thomas Schmitt) - Some code cleanups and documentation improvements. - Bugs: - [Bug 53170: I/O leak when we can't read ISO file](https://savannah.gnu.org/bugs/index.php?53170) - [Bug 53928: Cdtext not displayed in case of `CDTEXT_LANGUAGE_UNKNOWN`](https://savannah.gnu.org/bugs/index.php?3929) - [Bug 53929: cd-text with invalid characters failing to convert to utf8](https://savannah.gnu.org/bugs/index.php?3928) Version 2.0.0 ------------- 2017-12-31 This release bumps library Version numbers and bumps the major release number. We should have gone from 1.0.0 to 2.0.0 in the last release since there is an API incompatibility. In addition... - Add NetBSD drive detection; correct drive detection in `cd-info.c` Patches from Onno van der Linden - Fix some MinGW and Windows portability issues - Remove some memory leaks in some tests - Lint (a little) with clang static analyzer There are some programs and bindings that will need to be updated if you want to use them with this library. Specifically: - `Device::Cdio` (2.0.0 or greater) - `vcdimager` (2.0.0 or greater) - `pycdio` (2.0.0 or greater) - `rbcdio` (2.0.0 or greater) Version 1.1.0 ------------- 2017-12-10 Dr. Gecko Caveats: `pycdio` and `Device::Perl` will be broken but that'll be fixed later - Remove many remaining memory leaks, invalid reads, writes (as per valgrind) in library, test and demo code - Types `CdioISO9660DirList_t` and `CdioISO9660FileList_t`, `iso9660_{dir,file}list_{new,free}` have been added. - `cdio_list_free()` now takes an additional parameter: a function to free list items. This is not compatible with 1.0.0. More work is needed on MacOS and other OS's where I don't have `valgrind` accessible. AIX is left untouched - that is probably heading for removal in the future. Version 1.0.0 ------------- 2017-11-21 Thanksgiving This is an API breaking change - Remove deprecated items: - OS/2 driver (never really was supported) - BSDI driver remnants - mmc_isrc_track_read_subchannel - CDIO_MIN_DRIVER, CDIO_MIN_DEVICE_DRIVER, CDIO_MAX_DRIVER, CDIO_MAX_DEVICE_DRIVER - CdioList, CdioListNode - Apple Darwin OS X -> macOS - Subdir objects breaks symbol versioning. See - Handle bad iso 9660 better. Fixes Savannah bug - Apple (High) Sierra compatibility - NetBSD patches - Fixes for Rock Ridge SUSP (Thomas Schmitt) - Reduce MinGW compilation warnings - Add asserts to test memory allocations and misc bug fixes (Pete Batard) - Enable CD drivers on current and future versions of FreeBSD and macOS, so we do not have to add every new OS version explicitly. (Robert Kausch) - Cross-compiling friendliness (Ozkan Sezer) - Small texinfo doc fixes (Wieland Hoffmann) - Simplify making doc from autogen.sh - Bug fix for (Thomas Schmitt) - Bug fixes for #45017,#52265, and #52264 - Add more compiler warning flags, i.e. -Wshadow, -Wundef, ... - Reduce numerous memory leaks (more though remain) Version 0.94 ------------- 2016-10-27 - CD-Text fixes and improvements - Expose mmc_read_cdtext as a publicly accessible function Removes some redundant error reporting in `mmc_read_cdtext()` Also fixes some incorrect lengths for isrc and mcn. - Fix inconsistent maximal length in CD-Text extraction - Added new low level functions for READ SUB-CHANNEL and READ TOC/PMA/ATIP for CD-Text extraction. - Add cdtext binary parser and track number to public api - Increase track # for short CD-Text fields - Eject fixes: - Fix disc eject for Cocoa apps and support ejecting CD-Extra discs on OS X. - Make sure device is opened in read/write mode when trying to eject. Bugs - Add error reporting from_733_with_err. [Bug #45014](https://savannah.gnu.org/bugs/index.php?45014) - Guard against malformed rock ridge iso. [Bug #45015](https://savannah.gnu.org/bugs/index.php?45015) - Malformed so crashes iso-info [Bug #45013:](https://savannah.gnu.org/bugs/index.php?45013:) - Guard against 0-size calloc [Bug #45016](https://savannah.gnu.org/bugs/index.php?45016) - Fix testudf segfaults/fails on big endian arches. [Bug #43995](https://savannah.gnu.org/bugs/index.php?43995). - add get_last_session to the win32 driver. Also fixes cd-paranoia behavior. [Bug #43446](https://savannah.gnu.org/bugs/index.php?43446) - GNU/Linux ioctl treats <= 0 as max speed. [Bug #43428](https://savannah.gnu.org/bugs/index.php?43428) - Fixed cdio_free leaking - Recursion checking in cdio_logv() - g++ greater than 4.0 handles "pack" [Bug #48759](https://savannah.gnu.org/bugs/index.php?48759) - `configure` fixes Updates - Add newer OSX's - Squelch some `clang` error messages Version 0.93 ------------- 2014-09-29 Most of the changes except where noted are courtesy of Robert Kausch - Add cdio_free, iso9660_stat_free, and iso9660_xa_free functions. - Deprecate mmc_isrc_track_read_subchannel - Add mmc_get_track_isrc function. - Update OS versions we recognize - OSX, and MS Windows, ISO 9660 and other bug fixes - Remove Coverty scan warnings and errors - OS/2 driver performance update - KO Myung-Hun Version 0.92 (late SF Release) ------------------------------ 2013-12-15 - Fix the botched the library release numbers, Bump current, and set revision to zero Version 0.91 - don't use ------------------------ 2013-12-14 - Report Joliet level on iso-info, and an option to show whether Rock-Ridge extensions are present - More debug logging in reading LSN sectors - Document how logging works in `libcdio` - Fixes for reading large ISO 9660 images - Enable Rock-Ridge handling in configuration by default - Be able to read an audio CD with exactly 100 tracks - Microsoft Windows fixes (mingw, cygwin, Visual Studio) - Fix UDF library bug on BigEndian CPUs (POWER, SPARC, HP/UX) - libudf: Add udf_get_logical_volume_id() to retrieve a UDF Logical Volume - libcdio: Add cdio_default_log_handler - libiso9660: Add iso9660_have_rr() to show if Rock-Ridge extensions are present version 0.90 ------------- 2012-10-27 - CD-Text overhaul and API change (Leon Merten Lohse) - Works again (somewhat) on MinGW; tolerance for Microsoft's C compiler (Pete Batard) - UDF, Joliet and Rock-Ridge fixes (Pete Batard) - OSX fixes (Natalia Portillo and Robert William Fuller) - paranoia library removed as that is GPL 2-ish. This is now a separate project - file names in cue files are relative to the cue file rather than cwd. - Update mmc.h to include MMC-5 commands. (Or MMC-6 since it adds nothing new) - Add mmc_cmd2str() to show MMC command name. Show that in some errors - Add UDF reading to iso-read and iso-info via --udf or -U (Christophe Fergeau) - bug fixes, more tests, update documentation version 0.83 ------------- 2011-10-27 - Add retrieval SCSI sense reply from the most-recent MMC command. (Thomas Schmitt) - Add exclusive read/write access for devices which is used for experimental writing/burning. Currently only on GNU/Linux and FreeBSD. (Thomas Schmitt) - MMC bug fixes - FreeBSD drive list now shows empty drives. - Add ability to retrieve SCSI tuple for a name and/or fake one up for programs that want to be cd-record compatible. - Tolerance for OS's without timezone in their struct tm (e.g. Solaris) added iso9660_set_{d,l}time_with_timezone - Add mmc_get_disk_erasable - Update MMC Feature Profile list, DVD Book types - Reduce range of seek in paranoia_seek to be int32_t - Remove some potential flaws found by Coverty's static analysis tool - Add ISRC track info to cd-info output. - Don't wrap-around volume adjustment for cdda-player. - Handle double-byte strings in CD-text - --no-header on cd-info omits copyright and warranty version 0.82 ------------- 2009-10-27 - Remove all uses of CDIO_MIN_DRIVER, CDIO_MAX_DRIVER, CDIO_MIN_DEVICE_DRIVER or CDIO_MAX_DEVICE_DRIVER. - FreeBSD get_media_changed fixes - MingGW/Msys compilation issues - Add OS/2 driver - Cross compilations fixes and uclinix is like GNU/Linux - Numerous other bug fixes version 0.81 ------------- 2008-10-27 - license of manual now GFDL 1.2 or later, with no invariant sections. Source is GPL 3. Thanks to Karl Berry. - Nero image handling more complete. CD-Text processing. DAO in read_audio_sectors. ISRC processing. - ISRC query for image files. Thanks to Robert William Fuller on the above two items - Allow reading pregap of a track via `get_track_pregap_lsn()`. Add Section on "CD-DA pregap" in libcdio manual - Allow cross-compiling to mingw32. Patch from Peter Hartley. - Make iso9660 time setting/getting routines (iso9660_{g,s}et_{d,l}time) reentrant and remove bugs in that code. Courtesy Nicolas Boullis. - OSX fixes - Add NetBSD driver version 0.80 ------------- 2008-03-15 - Add get_media_changed for FreeBSD - Add option to log summary output in cd-paranoia - More string bounds checking to eliminate known string overflow conditions, e.g. Savannah bug #21910 - add --mode="any" on cd-read which uses a mmc_read_sectors with read-type CDIO_MMC_READ_TYPE_ANY. - add --log-summary option to cd-paranoia. Unused option --output-info (-i) removed - some small packaging bugs fixed Note: this is probably the last GPL v2 release; GPL v3 on the horizon. version 0.79 ------------- 2007-10-27 - iso-read: Add --ignore -k to ignore errors. - Fix Savannah bugs: - [Bug #18522](https://savannah.gnu.org/bugs/index.php?18522), - [Bug #18563](https://savannah.gnu.org/bugs/index.php?18563), - [Bug #18131](https://savannah.gnu.org/bugs/index.php?18131), - [Bug #19221](https://savannah.gnu.org/bugs/index.php?19221), - [Bug #19880](https://savannah.gnu.org/bugs/index.php?19880), - [Bug #21147](https://savannah.gnu.org/bugs/index.php?21147), and other miscellaneous bugs and memory leaks - `cd-info`: force CDDB disc id to be 32-bits. Problem reported by Eric Shattow. - `cd-paranoia`: allow ripping before the first track. Problem reported by Eric Shattow. Fix erroneous #defines when `DO_NO_WANT_PARANOIA_COMPATIBILITY` is set. Reported by David Stockwell. - Support for multisession CD-Extra Discs. Patch from Patrick Guimond - Add `iso9660_fs_find_lsn_with_path` and `iso9660_ifs_find_lsn_with_path` to report the full filename path of LSN. - improve eject code for OSX version 0.78.2 -------------- 2006-10-31 - preprocessor symbol `LIBCDIO_VERSION` number has to be an integer. (Bug caused by naming version 0.78._1_) version 0.78.1 -------------- 2006-10-27 - Fix bug in libcdio.so version numbering. Also another small bug. Thanks to Janos Farkas version 0.78 ------------ 2006-10-27 - add `mmc-tool` - add `mmc-close-tray` - `libudf`: can now read (extract) file data, at least for ICB strategy type 4. - libcdio is starting to get updated for UTF-8 support. Strings, which are guaranteed to be in UTF-8, are returned as a new type `cdio_utf8_t`, which is typedef'd to char. - fixes to eject. On GNU/Linux we unmount filesystems first. version 0.77 ------------ 2006-03-17 - Add an object-oriented C++ wrapper. (libcdio++ and libiso9660++) - replace libpopt with getopt in `cd-drive`, `cd-info`, `iso-info`, `iso-read` (Peter J. Creath) - Document cd-paranoia (Peter J. Creath) - Add `cdio_eject_media_drive()`. - Add more generic `read_sectors()` - Document that `NULL` also uses default drive in `close_tray()`, `cdio_open()` and `cdio_open_am()`. Document `b_mode2` parameter not used in cdio ISO read. - Some provision for handling Rock-Ridge device numbers. - block read routines return success if asked to read 0 blocks. - Start UDF handling - increase use of enumerations more and decrease use of #defines - OS Support: - DragonFly recognized as FreeBSD, - MinGW better tolerated, - GNU/Linux (and others?) LARGEFILE support - OpenBSD tested (no native CD driver though) - Doxygen formatting improvements. - Misc bugs: - fixed bincue driver caused core dump on set_speed and set_blocksize; it also called the wrong routine (from NRG) to get a list of cd-images. - read.h didn't make sure off_t was defined. - fixed bug in is_device() when driver_id = DRIVER_UNKNOWN or DRIVER_DEVICE. - OSX was freeing too much in listing drives. - get_hwinfo was not respecting fixed-length field boundaries in image drivers (strcpy->strncpy). - A number ISO 9660 time conversion routines corrected with respect to various timezone offsets, daylight savings time, and tm capabilities - small `cdda-player` improvements - shows more CD-Text, and fix bug in non-interactive use (Yes, I sometimes use it.) - NRG checking parses file. string tests were invalid on short < 4 character filenames. - Revise and improve example programs - Security: replace all uses of strcat and strcpy with strncat and strncpy version 0.76 ------------- 2005-09-23 - Better compatibility with C++ - a better `eject()` routine for FreeBSD - Fix bug in not specifying a device name in `libcio_cdda` - Add `S_ISSOCK()` or `S_ISLNK()` macros for Rock-Ridge when environment doesn't have it, e.g. MSYS 1.0.10 with MinGW 3.4.2. - Allow building `cd-paranoia` if Perl is not installed. - More accurate library dependency tracking in linking and `pkg-config` - Miscellaneous minor bug fixes. - `cdio/cdda.h` headers no longer depends on cdio/paranoia.h but vice versa is true. This may require an #include in some applications that used `` but didn't include it. version 0.75 ------------- 2005-07-11 - audio volume level fix on Microsoft Windows - fix build when `--enable-shared`, `--disable-static` - CD-Text retrieval fix - allow the MMC timeout to be adjusted by the application - cd-paranoia: Add option --mmc-timeout (-m) to set MMC timeout. We now check that integer arguments are integers and are within range. - changes for `libcddb 1.1.0` API change - remove `gcc` 4.0 warnings - miscellaneous small bug fixes, removal of questionable idioms or memory leak fixes version 0.74 ------------- 2005-05-13 - `cd-paranoia` fixes - `cdda-player` fixes - `cd-drive` shows MMC level - CD Text improvements/fixes - eject of empty CD-ROM drives on GNU/Linux - FreeBSD audio sub-channel time reporting fixed version 0.73 ------------- 2005-04-15 - Rock Ridge Extension support added - CD audio support (play track/index, pause, set volume, read audio subchannel) - add close tray interface (may need more work on more OSes) - utility `cdda-player` to (show off audio audio support) added - file time/size attributes fixes - `cd-info`/`iso-info` show more ls-like attributes and more often - ISO 9660 more accurate more often - Add ability to look for ISO 9660 filesystem in unknown Disc image formats - Add routine for getting ISO 9660 long date; short date fixes - remove even more memory leaks - Add enumerations and symbols to facilitate debugging - Break out C++ example programs into a separate directory. More C++ programs. - `gcc` 4 fixes version 0.72 ------------- 2005-01-31 - `cdparanoia` included - with regression tests and sample library programs - added setting/getting CD speed, finding the track containing an LSN. - improve `cdrdao` image reading - `iso-info` options more like cdrtools isoinfo. - `cd-drive`/`cd-info` show more reading capabilities and show that. - `cd-info` now shows the total disc size. - Filesystem reorganization to better support growth and paranoia inclusion - FreeBSD 6 tolerated, CAM audio read mode works. - improve Win32 driver, e.g. audio read mode works better for ioctl. - mode detection fixes - all read routines check and adjust the LSN so we don't try to access beyond the end of the disc - C++ fixes - Update documentation version 0.71 ------------- 2005-11-20 - Some Joliet support. - Portability fixes for C++ and older C compilers. - Work towards XBOX support. - TOC for DVD's works more often - Make generic list routines and declarations and byte swapping routines public. Eventually everything will use glib. - list-returning routines like `iso9660_fs_readdir()` and `iso9660_ifs_readdir()` no longer return `void *` (and require casting) but return the correct type. - Some example programs have been renamed to more give meaningful names. - Add `iso9660_ifs_is_xa()` a routine to determine if an iso image has XA attributes. - `iso-info` now shows XA attributes if that is available. - Some bug fixes version 0.70 ------------- 2004-09-02 - SCSI MMC interface routine (all except Darwin) - CD-Text support (all except Darwin) - Distinguish DVD's from CD's - Code clean-ups and reduced code duplication - Better CUE parsing - Reporting drive capability is more accurate - add constant driver_id for kind of hardware driver in build - new drive scanning routines which pass back driver as well as drive string. Speeds up subsequent opens. version 0.69 ------------- 2004-06-25 - Add interface returning drive capabilities (`cdio_get_drive_cap()`). - Minimal `cdrdao` image reading (thanks to Svend S. Sorensen) - Some important (I think) bug fixes - Redo types of LSN and LBA to allow negative values. Should model MMC3 specs. Add max/min values for LSN. - More complete MMC command set - FreeBSD driver ioctl and CAM reading works better (thanks to Heiner) - OSX drive reading works better (thanks to Justin F. Hallett) - `cd-read` allows dumping bytes to stdout and hexdumps to a file via options `--no-hexdump` and `--hexdump` - fewer error exits in drivers. Instead, a failure code is returned. - better NRG reading (thanks to Michael Kukat via extractnrg.pl) - better tracking of allocated variables (cd-read, `cd-info`, FreeBSD) - iso9660: Add interface to read PVD and pick out some of the fields in that. `cd-info` now shows more PVD info for ISO 9660 filesystems - `cd-info`: X-Box CD detection (via xbox team mediacenter) version 0.68 ------------- 2004-03-23 - More honest about mode1 reading in backends. Remove some of the bogusness. - Fixes and simplifications to Solaris (from Ian MacIntosh): no longer requires root access on Sunray environments - Win32 ioctl works now on win2k and XP (and probably NT and ME) - compiles on cygwin with `-mno-cygwin` (needed for videolan's _vlc_) - option `--with-versioned-libs` now checks for GNU ld. version 0.67 ------------- 2004-03-01 - portability for ARM - add `iso-read` program and regression tests - `libiso9960`: stat routines that match level 1 ISO-9600 filenames translating them into Unix-style names (i.e. lowercase letters, with version numbers dropped.) - expand/improve documentation. - more graceful exits when there is no CD or can't read it. - add `--without-versioned-libs` - add README.libcdio and note possible problems on different OSs without GNU make version 0.66 ------------- 2004-02-15 - Add interface for reading an ISO-9660 image - portability fixes (Solaris, cygwin) - Microsoft Windows ASPI/ DeviceIoControl code reorganization - NRG image reading improvements - Remove memory leaks - library symbol versioning (from Nicolas Boullis) - Go over documentation version 0.65 ------------- 2003-12-13 - tag headers to give doxygen API documentation - `cd-info`/`cd-read` now can specify library level of output - sample program using `libiso9660` added. version 0.64 ------------- 2003-11-22 - add routines to return a list of devices or scan a list of devices which satisfy any/all things in a capability mask. Should be useful for plugins that want to find a CD-DA to play or find a plugin that handles a particular device. - cd-read: new program to help diagnose reading problems. - cd-info: now displays date on iso9660 listing and translates filename to normal conventions, gives track "green" info - Add/expose routines to get/set time. time is reported back in entry stat. Routines to create ISO-9660 directories and entries must now supply the time to set on the entry. - Darwin and FreeBSD drivers closer to having native CD support, MinGW fixes (but not complete either) - BSDI fixes - Document more functions. version 0.63 ------------- - create libiso9660 library and install that. - More sample programs. - add library routine cdio_guess_cd_type to analyze/guess what type of CD or CD image we've got. - `cd-info` can list the files of a ISO-9660 filesystem via libiso9660 with option `--iso9660` version 0.62 ------------- - Some minimal documentation. More will follow. - Add a simple sample programs. - Add a simple regression test driver. - "Smart" open was scanning devices rather than devices + image drivers. version 0.61 ------------- - Cygwin/MinGW port. - get-default-device reworked to be smarter about finding devices. - cd-info: add `--no-headers`. version ID is from package now. Show default device on `--version` output. - API: add routine report if string refers to a device or not - Make use of features in libcddb 0.9.4. version 0.6 ------------- - Bug: eject wouldn't. - If given `.bin`, find corresponding `.cue`. If no cue, complain. version 0.5 ------------- - Add RPM spec file. Thanks to Manfred Tremmel - `cdinfo` renamed to `cd-info` to avoid conflicts with other existing programs - bug in ejecting CD's fixed - find `cue` file if given `bin`. - `cd-info`: If `libvcdinfo` is installed show general Video CD properties version 0.4 ------------- - More regression tests. - Use `pkg-config(1)` support - NRG may be closer to being correct. version 0.3 ------------- - reduced overall size of package. Some regression moved to a separate (large) package. - facilitate inclusion into another project's local source tree (e.g. xine) - version number in include - `cdinfo`: lists number of CDDB matches, display error message on failure, and can set CDDB port and http proxy - Bug: Narrow drivers to devices when source is a device. - fix some small compile warnings and configure bugs. Require libcddb 0.9.0 or greater. version 0.2 ------------- - Added Support for reading audio sectors - cdinfo can use [libcddb](http://libcddb.sourceforge.net). If installed and we have a CD-DA disk, we dump out CDDB information. - Regression tests added. - Don't need to open device to give get a default device. - Better device driver selection: We test for file/device-ness. - Bugs fixed (default device name on GNU/Linux), version 0.1 ------------- Routines split off from VCDImager. libcdio-2.2.0/README-develop.md000066400000000000000000000022611474051130400160330ustar00rootroot00000000000000# Building `libcdio` from git source Here is software you'll need to build a development version libcdio - git - GNU make (or even better "remake") - autoconf version 2.67 or better (which contains programs autoconf and autoreconf) - automake version 1.11.1 or better - libtool (for building shared libraries) - m4 (used by autoconf) - texinfo (for building documentation) - help2man (turns help for libcdio standalone programs into manual pages) This is in addition to the software needed to build starting from a the source tar. See README-libcdio.md for that additional software. Older versions of autoconf and automake might work, I've just not tested that. The source code lives the [github](https://github.com/libcdio/libcdio.git). The older GNU Savannah main page is [here](https://savannah.gnu.org/projects/libcdio/). If you check out the source code, you'll need `git` installed. Once you have git: git clone https://github.com/libcdio/libcdio.git Change into the libcdio directory that just created and run the "autogen.sh" shell script: cd libcdio sh ./autogen.sh Please see [README-libcdio.md](README-libcdio.md) and follow those instructions starting at step 3. libcdio-2.2.0/README-libcdio.md000066400000000000000000000174101474051130400160040ustar00rootroot00000000000000Building `libcdio` from released source ======================================= See [README-develop.md](README-develop.md) if you plan use the git or development version. * To compile the source, you'll need a POSIX shell and utilities (sh, sed, grep, cat), an ANSI C compiler like gcc, and a POSIX "make" program like GNU make or remake. You may also want to have "libtool" installed for building portable shared libraries. * Uncompress and unpack the source code using for example "tar". Recent versions of GNU tar can do this in one step like this: ```shell tar -xpf libcdio-*.bz # or libcdio-*.gz ``` * Go into the directory, run "configure" followed by "make": ```shell cd libcdio-* sh ./configure MAKE=make # or remake or gmake ``` * If step 2 works, compile everything: ```shell make # or remake ``` * Run the regression tests if you want: ```shell make check # or remake check ``` * Install. If the preceding steps were successful: ```shell make install # you may have to do this as root # or "sudo make install" ``` If you have problems linking libcdio or libiso9660, see the BSD section. You might also try the option `--without-versioned-libs`. However this option does help with the situation described below so it is preferred all other things being equal. If you are debugging libcdio, the libtool and the dynamic libraries can make things harder. I suggest setting `CFLAGS` to include `-fno-inline -g` and using `--disable-shared` on `configure`. VCD dependency --------------- One thing that confuses people is the "dependency" on libvcdinfo from vcdimager, while vcdimager has a dependency on libcdio. This libcdio dependency on vcdimager is an optional (i.e. not mandatory) dependency, while the vcdimager dependency right now is mandatory. libvcdinfo is used only by the utility program cd-info. If you want cd-info to use the VCD reporting portion and you don't already have vcdimager installed, build and install libcdio, then vcdimager, then configure libcdio again and it should find libvcdinfo. People who make packages might consider making two packages, a libcdio package with just the libraries (and no dependency on libvcdinfo) and a libcdio-utils which contains cd-info and iso-info, cd-read, iso-read. Should you want cd-info with VCD support then you'd add a dependency in that package to libvcdinfo. Another thing one can do is "make install" inside the library, or run "configure --without-vcd-info --without-cddb" (since libcddb also has an optional dependency on libcdio). Microsoft Windows ----------------- Building under Microsoft Windows is supported for cygwin (). You need to have the cygwin libiconv-devel package installed. For MinGW () also works provided you have libiconv installed. Support for Microsoft compilers (e.g. Visual C) is not officially supported. You need to make your own "project" files. Don't undertake this unless you are willing to spend time hacking. In the past xboxmediacenter team folks I believe have gone this route, as has Pete Batard in his rufus project. You may be able to use their project files as a starting point. XBOX ----- Consult the [xboxmediacenter team](https://www.xboxmediacenter.de) BSD, FreeBSD, NetBSD --------------------- Unless you use `--without-versioned-libs` (not recommended), you need to use GNU make or [remake](http://bashdb.sf.net/remake). GNU make can be found under the name "gmake". If you use another make you are likely to get problems linking libcdio and libiso9660. Solaris ------- You may need to use --without-versioned-libs if you get a problem building libcdio or libiso9660. If you get a message like: libcdio.so: attempted multiple inclusion of file because you have enable vcd-info and it is installed, then the only way I know how to get around is to use configure with --disable-shared. OS Support ----------- Support for Operating Systems's is really based on the desire, ability and willingness of others to help out. I use GNU/Linux so that probably works best. Before a release I'll test on servers I have available. I also announce a pending release on and ask others to test out. Specific libcdio configure options and environment variables ------------------------------------------------------------ ```shell --disable-cxx Disable C++ bindings (default enabled) --enable-cpp-progs make C++ example programs (default enabled) --disable-example-progs Don't build libcdio sample programs --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-largefile omit support for large files --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-joliet don't include Joliet extension support (default enabled) --disable-rpath do not hardcode runtime library paths --enable-rock include Rock-Ridge extension support (default enabled) --enable-cddb include CDDB lookups in cd_info (default enabled) --enable-vcd-info include Video CD Info from libvcd --enable-maintainer-mode create documentation and manual packages. For this you need texinfo and help2man installed ``` Optional Packages: ```shell --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-cd-drive don't build program cd-drive (default with) --without-cd-info don't build program cd-info (default with) --without-cd-paranoia don't build program cd-paranoia and paranoia libraries (default with) --without-cdda-player don't build program cdda-player (default with) --with-cd-paranoia-name name to use as the cd-paranoia program name (default cd-paranoia) --without-cd-read don't build program cd-read (default with) --without-iso-info don't build program iso-info (default with) --without-iso-read don't build program iso-read (default with) --without-versioned-libs build versioned library symbols (default enabled if you have GNU ld) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir ``` Some influential environment variables: ```shell CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. `-L` __lib_dir__ if you have libraries in a nonstandard directory __lib dir__ LIBS libraries to pass to the linker, e.g. -l __library__ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I __include dir__ if you have headers in a nonstandard directory __include dir__ CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility CDDB_CFLAGS C compiler flags for CDDB, overriding pkg-config CDDB_LIBS linker flags for CDDB, overriding pkg-config VCDINFO_CFLAGS C compiler flags for VCDINFO, overriding pkg-config VCDINFO_LIBS linker flags for VCDINFO, overriding pkg-config ``` libcdio-2.2.0/README.md000066400000000000000000000064051474051130400144030ustar00rootroot00000000000000[![Packaging status](https://repology.org/badge/tiny-repos/libcdio.svg)](https://repology.org/project/libcdio/versions) [![latest packaged version(s)](https://repology.org/badge/latest-versions/libcdio.svg)](https://repology.org/project/libcdio/versions) # Introduction _Note: See [README-libcdio.md](README-libcdio.md) for installation instructions._ The libcdio package contains a library for CD-ROM and CD image access. Applications wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM or of the specific details of various CD-image formats may benefit from using this library. A library for working with ISO-9660 filesystems libiso9660 is included. A generic interface for issuing MMC (multimedia commands) is also part of the libcdio library. Also included is a library for working with ISO-9660 filesystems. The CD-DA error/jitter correction library from [cdparanoia](http://www.xiph.org/paranoia) is included as a separate library licenced under GPL v2. Some support for disk image types like CDRWin's BIN/CUE format, cdrdao's TOC format, and Nero's NRG format are available. Therefore, applications that use this library also have the ability to read disc images as though they were CD's. The library is written in C, however there are OO C++, Perl, Python and Ruby wrappers to interface to the library. However C++ is the only one that is bundled with this package, and the interfaces provide only a subset of the full features of the library. Also included in the libcdio package are a number of utility programs: * `cd-info` - displays CD information: number of tracks, CD-format and if possible basic information about the format. If [libcddb](http://libcddb.sourceforge.net) is available, the `cd-info` program will display CDDB matches on CD-DA discs. And if a new enough version of `libvcdinfo` is available (from the vcdimager project), then `cd-info` shows basic VCD information. * `cd-read` - performs low-level block reading of a CD or CD image, * `iso-info` - displays ISO-9660 information from an ISO-9660 image, * `iso-read` - extracting files from an ISO-9660 image, a version of the CD-DA extraction tool cdparanoia which corrects for CD-ROM jitter, and a simple curses-based CD player, cdda-player using the analog CD-ROM output. * `cd-paranoia` - port of cdparanoia (CD-DA jitter and error correction) using libcdio back-end CD-reading. There is very limited low-level support for MMC commands on some platforms. Using MMC writing can be done. However there is currently little higher level-support for writing. Other libraries like `libburn`, `libdi`, `libscg`, or `libdvdread` may be helpful. Some of the projects using libcdio are the Video CD authoring and ripping tools [VCDImager](http://vcdimager.org), a navigation-capable Video CD plugin and CD-DA plugins for the media players [xine](http://xinehq.de), videolan's [vlc](http://videolan.org), media players [mplayerxp](http://mplayerxp.sourceforge.net/) and [gmerlin](http://gmerlin.sourceforge.net), [kiso](http://kiso.sourceforge.net), a KDE GUI for creating, extracting and editing ISO-9600 images and a Samba vfs module that allows exporting a CD without mounting it (). libcdio-2.2.0/THANKS000066400000000000000000000057021474051130400140360ustar00rootroot00000000000000Burkhard Plaum some GNU/Linux and CD-Text patches Carlo Bramini fixes for Mingw+MSYS and DLL support Chris Clayton 2.0.0 testing Christophe Fergeau Add UDF reading to iso-read and iso-info Dagobert Michelsen Solaris compilation issues and the wonderful test Solaris test platform opencsw.org Diego 'Flameeyes' Petten patches to FreeBSD and making Gentoo-friendly Edd Barrett Current OpenBSD driver (based on NetBSD driver) Frank Endres mmc_get_disc_erasable Frantisek Dvorak : bug reports and miscellaneous fixes Geoff Bailey FreeBSD debugging & testing Heiner FreeBSD CAM support and FreeBSD debugging & testing Ian MacIntosh Sun-related things. Justin B. Ruggles SCSI MMC discmode determination via Read TOC. Justin F. Hallett Fink packaging and matters OSX KO Myung-Hun OS/2 Driver (since removed - see him for older versions) Kris Verbeeck : CDDB library support from libcddb http://libcddb.sourceforge.net Gentoo ebuild-file Leon Merten Lohse Redo CD-Text handling Manfred Tremmel : RPM spec file and inclusion of libcdio into http://packman.links2linux.de/ Mansour Gashasbi Security checks for heap and buffer overflows Michael Kukat , for the hints in extractnrg.pl Natalia Portillo OSX BluRay support on OSX 10 and other OSX fixes Nicolas Boullis Build issues, library symbol versioning, Debian packaging and issues Nigel Pearson nigel at ind dot tansu dot com dot au OSX 10 fixes Patrick Guimond CD-Extra audio data boundaries Pete Batard UDF, MinGW and Microsoft Visual C++ support. "offset" type fixes for Joliet and Rock Ridge. Peter Hartley Cross-compiling to mingw32 Peter J. Creath removal of libpopt, paranoia documentation, some bug fixes to cd-* programs and the paranoia lib Steven M. Schultz All things BSDI and the use of a really fabulous Darwin G5 box. Svend S. Sorensen cdrdao TOC-reading and CDRWin CUE parsing code based on cuetools http://cuetools.sourceforge.net/ xboxmediacenter team (www.xboxmediacenter.de) X-Box detection and XDF filesystem things Thomas Schmitt Recording and retrieval of SCSI sense reply. Write/burning interface. MMC bug fixes Daniel Schwarz log-summary option in cd-paranoia. Robert Kausch Portability fixes on Windows, and other OS's. Add mmc_get_track_isrc Robert William Fuller get_track_pregap_lba, get_track_pregap_lsn. Section on "CD-DA pregap" in libcdio manual. various fixes to Nero driver and cd-text for Nero Scot C. Bontrager mmc routine to get the ISRC information on a CD that is in the q subchannel but not showing up in the CDTEXT. Addition of this information to cd-info. libcdio-2.2.0/TODO000066400000000000000000000077161474051130400136220ustar00rootroot00000000000000It isn't look hard to find a gap in libcdio or libiso9660 or think of something you'd like added. Here are some of the many known problems and feature requests. * UDF support. * API overhaul. hvr has expressed interest but it's unlikely he'll ever have the time to do. It could be done in conjunction with a wrappers for C++, Perl, Python, ... The idea is that those interfaces would not show the ugliness of the current C interface. For example instead of read_mode2, read_mode1, read_audio, there might be a read(mode, ...). - Address static loglevel variable (nboullis at debian.org) * All of the API should be finished on all OS's (or the API adjusted). * Fix the current gaps: - SCSI-MMC on OSX, - CD-Text support working more often? wide character support (Burkhard Plaum has indicated he might do) - more accurate drive capabilities - wxwindows interface to cd-drive - more accurate CD track classification (Form 1/2, Mode 1/2) - complete the image readers, e.g. "silence" and ability to use more than one file in cdrdao. - multi-session CDs * mmc_read_cd often doesn't work when request reading a large number of blocks. * Is paranoia correct? Get a better handle on it. Ensure more of the drive and OS-specific features that work on GNU/Linux work elsewhere. Regression tests over more kinds of failures. * Exclusive access of CD-ROM versus non-exclusive? * Adjusting operations based on known models. Via MMC, We often have the ability to find out what drive is in use. That could be used (as it was in cdparanoia) to customize the method used for various operations. Alternatively it could be read from a configuration file, but right now there's no internal structure for holding all of the capabilities. * Combine iso-read and iso-info into an "iso-tar" for listing or extracting files". Ideally something matching the relevant command set of "tar" would be nice, as that is widely used and probably fairly complete in thing that might be desired for listing/extracting. * Add something to show what kind of CD media is in a drive. Ideally: CD (purchased), CD Write Once, CD Read/Write, but what is there is probably something like Cyanine, PhthaloCyanine, Metallized Azo, Advanced PhthaloCyanine, Formazan. See http://www.cdmediaworld.com/hardware/cdrom/cd_dye.shtml or http://www.cd-info.com/CDIC/History/Commentary/Parker/stcroix.html The discmode type can be used to classify DVD media and it also classifies for CD track formats (in addition to CD *content* classification). Note there is nothing for DVD content; see the below list of things which probably won't get added. Given the mismatch between DVD and CD meanings in discmode, the discmode type probably needs to be redone. * Write a real cue parser and TOC parser using bison. A pcct grammar is given in cdrdao's trackdb TocParser.g and CueParser.g The parsing is pretty much done, need to fold in semantic routines and improve error reporting. * conversion tools. Assuming parser done, it should be simple to use write simple conversion routines: - CD images's to iso9660 .iso's - TOC <=> CUE * Test more disc image types in regression testing, like CD-I. * Convert to use glib, removing ds.h (Revise vcdimager too) * Delete and rename files in an iso9660 image (mephisto75 at web.de) * Some things where libcdio will probably not expand in: - DVD things, especially DVD-ROM (use libdvdread) - writing applications (use cdrdao or cdrtools) - more proprietary undocumented image format (unless someone else is willing to do the work). But the fuzzy ISO 9660 detection may help here. If there is something you really want done on the above list or have something else you want done, it will go a lot faster if you attempt to undertake doing it. Patches are always welcome (and CVS write access is available for those who have demonstrated reasonable ability through contributions.) $Id: TODO,v 1.11 2005/07/11 11:51:07 rocky Exp $ libcdio-2.2.0/autogen.sh000077500000000000000000000005561474051130400151260ustar00rootroot00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. # Additional options go to configure. # For OpenBSD export AUTOCONF_VERSION=2.69 export AUTOMAKE_VERSION=1.15 echo "Rebuilding ./configure with autoreconf..." autoreconf -f -i if [ $? -ne 0 ]; then echo "autoreconf failed" exit $? fi ./configure --enable-maintainer-mode "$@" (cd doc && make) libcdio-2.2.0/config.rpath000077500000000000000000000442541474051130400154400ustar00rootroot00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2024 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly* | midnightbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly* | midnightbsd*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation, either version 3 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . define(RELEASE_NUM, 2.2.0) define(CDIO_VERSION_STR, $1) AC_PREREQ([2.71]) AC_INIT([libcdio],[CDIO_VERSION_STR(RELEASE_NUM)],[https://savannah.gnu.org/bugs/?group=libcdio]) AC_CONFIG_SRCDIR(src/cd-info.c) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CANONICAL_HOST AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR([m4]) PKG_PROG_PKG_CONFIG # Enable silent build rules by default (Automake v1.11 or later). # Disable by either passing --disable-silent-rules to configure or passing V=1 to make m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) # FIXME: write a m4 macro to convert x.y.zjunk to x*10000 + y*100 + z # LIBCDIO_VERSION_NUM=`echo RELEASE_NUM | cut -d . -f 1 | tr -d a-z` LIBCDIO_VERSION_NUM=20200 AC_SUBST(LIBCDIO_VERSION_NUM) AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) AM_MAINTAINER_MODE AM_SANITY_CHECK AC_ARG_WITH(cd-drive, AS_HELP_STRING([--without-cd-drive],[don't build program cd-drive (default with)]), enable_cd_drive="${withval}", enable_cd_drive=yes) AC_ARG_WITH(cd-info, AS_HELP_STRING([--without-cd-info],[don't build program cd-info (default with)]), enable_cd_info="${withval}", enable_cd_info=yes) AC_ARG_WITH(cdda-player, AS_HELP_STRING([--without-cdda-player],[don't build program cdda-player (default with)]), enable_cdda_player="${withval}", enable_cdda_player=yes) AC_ARG_WITH(cd-read, AS_HELP_STRING([--without-cd-read],[don't build program cd-read (default with)]), enable_cd_read="${withval}", enable_cd_read=yes) AC_ARG_WITH(iso-info, AS_HELP_STRING([--without-iso-info],[don't build program iso-info (default with)]), enable_iso_info="${withval}", enable_iso_info=yes) AC_ARG_WITH(iso-read, AS_HELP_STRING([--without-iso-read],[don't build program iso-read (default with)]), enable_iso_read="${withval}", enable_iso_read=yes) AC_ARG_WITH(versioned-libs, AS_HELP_STRING([--without-versioned-libs],[build versioned library symbols (default enabled if you have GNU ld)]), enable_versioned_libs="${withval}", enable_versioned_libs=yes) AC_ARG_ENABLE([cxx], AS_HELP_STRING([--disable-cxx],[Disable C++ bindings (default enabled)])) AM_CONDITIONAL([ENABLE_CXX_BINDINGS], [test "x$enable_cxx" != "xno"]) AC_ARG_ENABLE(cpp-progs, AS_HELP_STRING([--enable-cpp-progs],[make C++ example programs (default enabled)])) AM_CONDITIONAL(ENABLE_CPP, test "x$enable_cpp_progs" = "xyes") AC_ARG_ENABLE(example-progs, AS_HELP_STRING([--disable-example-progs],[Don't build libcdio sample programs])) AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_example_progs" != "xno") dnl We use C AC_PROG_CC if test "x$enable_cxx" != "xno" ; then AC_PROG_CXX else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi dnl For iso_read test AC_CHECK_PROGS(ISO_MAKING_COMMAND, genisoimage mkisofs) dnl Checks for programs. cd_drivers='cdrdao, BIN/CUE, NRG' WARN_CFLAGS='' if test "x$GCC" != "xyes"; then AC_MSG_WARN([ *** non GNU CC compiler detected. *** This package has not been tested very well with non GNU compilers *** you should try to use 'gcc' for compiling this package.]) else CHECK_CFLAGS=" -Wall -Wbad-function-cast -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdisabled-optimization -Wendif-labels -Winline -Wmissing-prototypes -Wnested-externs -Wno-sign-compare -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings " for OPT in $CHECK_CFLAGS; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $OPT" AC_MSG_CHECKING([whether $CC understands $OPT]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[has_option=yes],[has_option=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT($has_option) if test "x$has_option" = "xyes"; then WARN_CFLAGS="$WARN_CFLAGS $OPT" fi unset has_option unset SAVE_CFLAGS done fi CFLAGS="$CFLAGS $WARN_CFLAGS" # We use Perl for documentation and regression tests AC_PATH_PROG(PERL, perl, false) AC_SUBST(PERL) AM_CONDITIONAL(HAVE_PERL, test "x$PERL" != "xfalse") # We use a diff in regression testing AC_PATH_PROG(DIFF, diff, no) DIFF_OPTS= if test "x$DIFF" = "xno"; then AC_PATH_PROG(DIFF, cmp, no) else # Try for GNU diff options. # MSDOG output uses \r\n rather than \n in tests for diff_opt in -w --unified ; do if $DIFF $diff_opt ./configure ./configure > /dev/null 2>&1; then AC_MSG_RESULT([adding $diff_opt to diff in regression tests]) DIFF_OPTS="$DIFF_OPTS $diff_opt" fi done fi AC_SUBST(DIFF) AC_SUBST(DIFF_OPTS) AC_SUBST(RM) dnl check for large file support AC_SYS_LARGEFILE dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command dnl line because otherwise the system headers risk being included before dnl problems if test "x$ac_cv_sys_largefiles" = "xyes"; then if test "x$ac_cv_sys_file_offset_bits" = "x64"; then LIBCDIO_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" else LIBCDIO_LARGEFILE_FLAGS="-D_LARGE_FILES" fi if test "x$ac_cv_sys_largefile_source" != "xno"; then LIBCDIO_LARGEFILE_FLAGS="$LIBDDIO_LARGEFILE_FLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source" fi CPPFLAGS="$CPPFLAGS $LIBCDIO_LARGEFILE_FLAGS" fi AC_DEFINE(LIBCDIO_CONFIG_H, 1, [Is set when libcdio's config.h has been included. Applications wishing to sue their own config.h values (such as set by the application's configure script can define this before including any of libcdio's headers.]) dnl headers AC_CHECK_INCLUDES_DEFAULT AC_PROG_EGREP AC_CHECK_HEADERS(stdbool.h, [], [AC_MSG_ERROR(["Couldn't find or include stdbool.h"])]) AC_CHECK_HEADERS(alloca.h errno.h fcntl.h glob.h limits.h pwd.h) AC_CHECK_HEADERS(stdarg.h stdbool.h stdio.h sys/cdio.h sys/param.h \ sys/time.h sys/timeb.h sys/utsname.h) AC_STRUCT_TIMEZONE ## FreeBSD 4 has getopt in unistd.h. So we include that before ## getopt.h AC_CHECK_HEADERS(unistd.h getopt.h) AC_SUBST(SBPCD_H) AC_SUBST(UCDROM_H) AC_SUBST(TYPESIZES) ## Check compiler-related things AC_C_BIGENDIAN AC_C_CONST AC_C_INLINE ## ISOC99_PRAGMA AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Pragma("pack(1)")]])],[ ISOC99_PRAGMA=yes AC_DEFINE(HAVE_ISOC99_PRAGMA, [], [Supports ISO _Pragma() macro]) ],[ISOC99_PRAGMA=no]) AC_MSG_RESULT($ISOC99_PRAGMA) ## Check for Windows header files AC_CHECK_HEADERS([ntddcdrm.h ddk/ntddcdrm.h \ ntddscsi.h ddk/ntddscsi.h ddk/scsi.h], [], [], [AC_INCLUDES_DEFAULT #include ]) ## ## Check for S_ISSOCK() and S_ISLNK() macros ## AC_MSG_CHECKING(for S_ISLNK() macro) AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_SYS_STAT_H # include #endif ],[return S_ISLNK(0);])], [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_S_ISLNK, [], [Define this defines S_ISLNK()]) ], [ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([for S_ISSOCK() macro]) AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_SYS_STAT_H # include #endif ],[return S_ISSOCK(0);])], [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_S_ISSOCK, [], [Define this defines S_ISSOCK()]) ], [ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([for struct timespec]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_SYS_TIME_H #include #endif ],[struct timespec ts;])], [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRUCT_TIMESPEC, [], [Define this if you have struct timespec]) ], [ AC_MSG_RESULT(no) ]) dnl empty_array_size AC_MSG_CHECKING([how to create empty arrays]) empty_array_size="xxxx" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[]; } doo;]])],[empty_array_size=""],[]) if test "x$empty_array_size" = "xxxx"; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[0]; } doo;]])],[empty_array_size="0"],[]) fi if test "x$empty_array_size" = "xxxx"; then AC_MSG_ERROR([compiler is unable to creaty empty arrays]) else AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, $empty_array_size, [what to put between the brackets for empty arrays]) changequote(`,') msg="[${empty_array_size}]" changequote([,]) AC_MSG_RESULT($msg) fi dnl LT_INIT tests whether we have GNU ld dnl this must come before checking --with-versioned-libs dnl which requires GNU ld. LT_INIT dnl system # FIXME: # I believe some OS's require -lm, but I don't recall for what function # When we find it, put it in below instead of "cos". AC_CHECK_LIB(m, cos, [LIBS="$LIBS -lm"; COS_LIB="-lm"]) AC_SUBST(COS_LIB) # Do we have GNU ld? If we don't, we can't build versioned symbols. if test "x$with_gnu_ld" != "xyes"; then AC_MSG_WARN([I don't see GNU ld. I'm going to assume --without-versioned-libs]) enable_versioned_libs='no' fi # We also need GNU make to build versioned symbols. if test "x$enable_versioned_libs" = "xyes"; then if test -n "$MAKE" ; then $MAKE --version 2>/dev/null >/dev/null if test "$?" -ne 0 ; then AC_MSG_ERROR(Either set MAKE variable to GNU make or use --without-versioned-libs option) fi else make --version 2>/dev/null >/dev/null if test "$?" -ne 0 ; then AC_MSG_ERROR(Either set MAKE variable to GNU make or use --without-versioned-libs option) fi fi fi AM_CONDITIONAL(CYGWIN, test "x$CYGWIN" = "xyes") AM_CONDITIONAL(BUILD_CD_DRIVE, test "x$enable_cd_drive" = "xyes") AM_CONDITIONAL(BUILD_CDINFO, test "x$enable_cd_info" = "xyes") AM_CONDITIONAL(BUILD_CD_READ, test "x$enable_cd_read" = "xyes") AM_CONDITIONAL(BUILD_ISO_INFO, test "x$enable_iso_info" = "xyes") AM_CONDITIONAL(BUILD_ISO_READ, test "x$enable_iso_read" = "xyes") AM_CONDITIONAL(BUILD_CDINFO_LINUX, test "x$enable_cd_info_linux" = "xyes") AM_CONDITIONAL(BUILD_CDIOTEST, test "x$enable_cdiotest" = "xyes") AM_CONDITIONAL(BUILD_VERSIONED_LIBS, test "x$enable_versioned_libs" = "xyes") AM_CONDITIONAL(DISABLE_CPP, test "x$disable_cpp" = "xyes") dnl Checks for header files. LIBCDIO_CDDA_LIBS='$(top_builddir)/lib/cdda_interface/libcdio_cdda.la' LIBCDIO_CFLAGS='-I$(top_srcdir)/lib/driver -I$(top_builddir)/include -I$(top_srcdir)/include/' LIBCDIO_LIBS='$(top_builddir)/lib/driver/libcdio.la' LIBCDIO_DEPS="$LIBCDIO_LIBS" LIBCDIOPP_LIBS='$(top_builddir)/lib/cdio++/libcdio++.la' LIBISO9660PP_LIBS='$(top_builddir)/lib/cdio++/libiso9660++.la' LIBISO9660_CFLAGS='-I$(top_srcdir)/lib/iso9660/' LIBISO9660_LIBS='$(top_builddir)/lib/iso9660/libiso9660.la' LIBUDF_CFLAGS='-I$(top_srcdir)/lib/udf/' LIBUDF_LIBS='$(top_builddir)/lib/udf/libudf.la' AC_SUBST(LIBCDIO_CDDA_LIBS) AC_SUBST(LIBISO9660PP_LIBS) AC_SUBST(LIBCDIO_LIBS) AC_SUBST(LIBCDIOPP_LIBS) AC_SUBST(LIBCDIO_DEPS) AC_SUBST(LIBISO9660_LIBS) AC_SUBST(LIBUDF_LIBS) AC_MSG_CHECKING([Checking what sed uses for extended regular expressions]) test -n "$SED" || SED=$ac_path_SED SED_EXTENDED_RE_FLAG='-r' result=$(echo 'define' | $SED -r -e 's/^define/foo/' 2>/dev/null) if [[ $? -ne 0 ]] ; then result=$(echo 'define' | $SED -E -e 's/^define/foo/' 2>/dev/null) if [[ $? -eq 0 ]] ; then SED_EXTENDED_RE_FLAG='-E' else AC_MSG_WARN([Don't have SED that understand extended RE's. Some minor compilation issues may fail.]) SED_EXTENDED_RE_FLAG='' fi fi AC_MSG_RESULT($SED_EXTENDED_RE_FLAG) AC_SUBST(SED_EXTENDED_RE_FLAG) dnl Libtool flag for strict linkage LT_NO_UNDEFINED= dnl regression tests need native-style absolute paths. dnl native_abs_top_srcdir is used here. case $srcdir in .) # We are building in place. native_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. native_abs_top_srcdir=$srcdir ;; *) # Relative name. native_abs_top_srcdir=$ac_pwd/$srcdir ;; esac AC_SUBST(native_abs_top_srcdir) case $host_os in aix*) ## Don't use AIX driver until starts to really work ## cd_drivers="${cd_drivers}, AIX" ## AC_DEFINE([HAVE_AIX_CDROM], [1], ## [Define 1 if you have AIX CD-ROM support]) ;; darwin[[6-9]].*|darwin[[1-9]][[0-9]].*) AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h, [have_iokit_h="yes"]) if test "x$have_iokit_h" = "xyes" ; then AC_DEFINE([HAVE_DARWIN_CDROM], [1], [Define 1 if you have Darwin OS X-type CD-ROM support]) DARWIN_PKG_LIB_HACK="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit" dnl Prior to Mac OS X 10.4 (Tiger), DiskArbitration was a private framework. dnl It's now public, and it's needed to do cd/dvd unmount/eject. AC_MSG_CHECKING([for DiskArbitration framework]) ac_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation -framework DiskArbitration" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [have_diskarbitration_framework=yes], [have_diskarbitration_framework=no]) LIBS="$ac_save_LIBS" AC_MSG_RESULT([$have_diskarbitration_framework]) if test "x$have_diskarbitration_framework" = "xyes"; then AC_DEFINE([HAVE_DISKARBITRATION], 1, [Define 1 if you have the Apple DiskArbitration framework]) DARWIN_PKG_LIB_HACK="$DARWIN_PKG_LIB_HACK -Wl,-framework,DiskArbitration" fi AC_SUBST(DARWIN_PKG_LIB_HACK) LIBCDIO_LIBS="$LIBCDIO_LIBS $DARWIN_PKG_LIB_HACK" cd_drivers="${cd_drivers}, Darwin" fi ;; linux*|uclinux) AC_CHECK_HEADERS(linux/version.h linux/major.h) AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"]) if test "x$have_linux_cdrom_h" = "xyes"; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ #include struct cdrom_generic_command test; int has_timeout=sizeof(test.timeout);]])],[AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1], [Define 1 if timeout is in cdrom_generic_command struct])],[]) AC_DEFINE([HAVE_LINUX_CDROM], [1], [Define 1 if you have Linux-type CD-ROM support]) cd_drivers="${cd_drivers}, GNU/Linux" fi ;; sunos*|sun*|solaris*) AC_DEFINE([HAVE_SOLARIS_CDROM], [1], [Define 1 if you have Solaris CD-ROM support]) cd_drivers="${cd_drivers}, Solaris" ;; cygwin*) AC_DEFINE([CYGWIN], [1], [Define 1 if you are compiling using cygwin]) AC_DEFINE([HAVE_WIN32_CDROM], [1], [Define 1 if you have MinGW CD-ROM support]) LIBS="$LIBS -lwinmm" LT_NO_UNDEFINED="-no-undefined" cd_drivers="${cd_drivers}, MinGW" AC_DEFINE([NEED_TIMEZONEVAR], [1], [Define 1 if you need timezone defined to get timzone defined as a variable. In cygwin it is a function too]) ;; mingw*) AC_MSG_CHECKING(for MinGW-w64 headers) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #if !defined(__MINGW64_VERSION_MAJOR) # error not mingw-w64 headers #endif])], [ AC_MSG_RESULT(yes) MINGW_W64_HEADERS=yes AC_DEFINE(MINGW_W64_HEADERS, [], [Define this if mingw-w64 headers are used]) ], [ AC_MSG_RESULT(no) MINGW_W64_HEADERS=no ]) # regression tests need native-style absolute paths. # $native_srcdir is used here. if test "$cross_compiling" != yes; then native_abs_top_srcdir=$(cd $srcdir; /bin/bash.exe -c 'builtin pwd -W') fi AC_CHECK_HEADERS(windows.h) AC_DEFINE([MINGW32], [1], [Define 1 if you are compiling using MinGW]) MINGW32=1 AC_DEFINE([HAVE_WIN32_CDROM], [1], [Define 1 if you have MinGW CD-ROM support]) LIBS="$LIBS -lwinmm" LT_NO_UNDEFINED="-no-undefined" cd_drivers="${cd_drivers}, MinGW " ## Cross-platform LFS support in MinGW requires an override of off_t if test "x$enable_largefile" != "xno"; then AC_MSG_RESULT([enabling support for large files (_FILE_OFFSET_BITS=64)]) if test "x$MINGW_W64_HEADERS" = "xyes" then LIBCDIO_CFLAGS+=' -D_FILE_OFFSET_BITS=64 ' LIBISO9660_CFLAGS+=' -D_FILE_OFFSET_BITS=64 ' else LIBCDIO_CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t' LIBISO9660_CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t' fi fi joliet_supported="yes" if test "x$enable_cdda_player" = "xyes"; then AC_MSG_RESULT([disabling cdda_player (not supported on this platform)]) fi enable_cdda_player="no" ;; freebsd[[4-9]].*|freebsd[[1-9]][[0-9]].*|dragonfly*|kfreebsd*) AC_DEFINE([HAVE_FREEBSD_CDROM], [1], [Define 1 if you have FreeBSD CD-ROM support]) LIBS="$LIBS -lcam" cd_drivers="${cd_drivers}, FreeBSD " ;; netbsd*|openbsd*) AC_DEFINE([HAVE_NETBSD_CDROM], [1], [Define 1 if you have NetBSD CD-ROM support]) # LIBS="$LIBS -lcam" cd_drivers="${cd_drivers}, NetBSD " ;; *) AC_MSG_WARN([Don't have OS CD-reading support for ${host_os}...]) AC_MSG_WARN([Will use generic support.]) ;; esac AC_SUBST(LIBCDIO_CFLAGS) AC_SUBST(LIBISO9660_CFLAGS) AC_SUBST(LT_NO_UNDEFINED) AC_MSG_CHECKING(extern long timezone variable) AC_LINK_IFELSE([AC_LANG_SOURCE([[ #ifdef NEED_TIMEZONEVAR #define timezonevar 1 #endif #include extern long timezone; int main(int argc, char **argv) { long test_timezone = timezone; return 0; } ]]) ], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_TIMEZONE_VAR], 1, [Define if you have an extern long timenzone variable.])], [AC_MSG_RESULT(no)]) dnl AC_SUBST(LINUX_CDROM_TIMEOUT) AC_SUBST(DARWIN_PKG_LIB_HACK) AC_SUBST(HAVE_BSDI_CDROM) AC_SUBST(HAVE_DARWIN_CDROM) AC_SUBST(HAVE_FREEBSD_CDROM) AC_SUBST(HAVE_LINUX_CDROM) AC_SUBST(HAVE_SOLARIS_CDROM) AC_SUBST(HAVE_WIN32_CDROM) AC_SUBST(HAVE_OS2_CDROM) AC_CHECK_FUNCS( [chdir drand48 fseeko fseeko64 ftruncate geteuid getgid \ getuid getpwuid gettimeofday lseek64 lstat memcpy memset mkstemp rand \ seteuid setegid snprintf setenv strndup unsetenv tzset sleep \ _stati64 usleep vsnprintf readlink realpath gmtime_r localtime_r] ) # check for timegm() support AC_CHECK_FUNC(timegm, AC_DEFINE(HAVE_TIMEGM,1, [Define 1 if timegm is available])) AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has the tm_gmtoff member.])], , [#include ]) if test "x$ac_cv_member_struct_tm_tm_gmtoff" = "xyes"; then AC_MSG_CHECKING([whether time.h defines daylight and timezone variables]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include ],[return (timezone != 0) + daylight;])], [AC_DEFINE(HAVE_DAYLIGHT, 1, [Define if time.h defines extern long timezone and int daylight vars.]) has_daylight=yes ],[has_daylight=no]) AC_MSG_RESULT($has_daylight) AC_MSG_CHECKING([whether time.h defines tzname variable]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include ],[return (tzname != NULL);])], [AC_DEFINE(HAVE_TZNAME, 1, [Define if time.h defines extern extern char *tzname[2] variable]) has_tzname=yes ],[has_tzname=no]) AC_MSG_RESULT($has_tzname) fi AM_ICONV if test "x$am_cv_func_iconv" = "xno"; then AC_MSG_ERROR([iconv is needed]) fi AC_ARG_ENABLE(joliet, AS_HELP_STRING([--disable-joliet], [don't include Joliet extension support (default enabled)]), [enable_joliet=$enableval], [enable_joliet=yes]) AM_LANGINFO_CODESET if test "x${enable_joliet}" != "xno"; then joliet_supported="yes" if test "x$joliet_supported" = "xyes"; then AC_DEFINE(HAVE_JOLIET, [1], [Define 1 if you want ISO-9660 Joliet extension support. On most platforms, this requires libiconv to be installed.]) HAVE_JOLIET=1 else AC_MSG_ERROR([You must have iconv installed.]) fi fi AC_SUBST(HAVE_JOLIET) AC_ARG_ENABLE(rock, AS_HELP_STRING([--enable-rock],[include Rock-Ridge extension support (default enabled)]), enable_rock=$enableval, enable_rock=yes) if test "x${enable_rock}" != "xno"; then AC_DEFINE(HAVE_ROCK, [1], [Define 1 if you want ISO-9660 Rock-Ridge extension support.]) HAVE_ROCK=1 fi AC_SUBST(HAVE_ROCK) AC_SUBST(MINGW32) AM_CONDITIONAL(ENABLE_ROCK, test "x$enable_rock" = "xyes") AC_ARG_ENABLE(cddb, AS_HELP_STRING([--enable-cddb],[include CDDB lookups in cd_info (default enabled)]), enable_cddb=$enableval, enable_cddb=check) if test "x$enable_cddb" != "xno"; then PKG_CHECK_MODULES(CDDB, libcddb >= 1.0.1, [ HAVE_CDDB=yes AC_DEFINE(HAVE_CDDB, [], [Define this if you have libcddb installed]) ], [AC_MSG_WARN([new enough libcddb not found. CDDB access disabled. Get libcddb from http://libcddb.sourceforge.net]) HAVE_CDDB=no]) AC_CHECK_LIB(socket, connect) AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) fi AC_SUBST(CDDB_LIBS) AC_ARG_ENABLE(compatibility, AS_HELP_STRING([--disable-compatibility],[disable the use of obsoleted APIs (default enabled)]), enable_compatibility=$enableval, enable_compatibility=yes) if test "x${enable_compatibility}" != "xyes"; then AC_DEFINE(DO_NOT_WANT_COMPATIBILITY, [], [Define this if you do not need compability with obsoleted libcdio APIs.]) DO_NOT_WANT_COMPATIBILITY=1 fi AC_SUBST(DO_NOT_WANT_COMPATIBILITY) # We have to disable cdda_player unless we have either ncurses.h or # curses.h have_ncurses_h='no' if test "x$enable_cdda_player" = "xyes"; then enable_cdda_player='no' AC_CHECK_HEADERS(ncurses.h, [enable_cdda_player='yes'; have_ncurses_h='yes'], [AC_CHECK_HEADERS(curses.h, [enable_cdda_player='yes'], [AC_CHECK_HEADERS(ncurses/ncurses.h, enable_cdda_player='yes') ])]) fi if test "x$enable_cdda_player" = "xyes"; then PKG_CHECK_MODULES(CDDA_PLAYER, ncurses, [AC_DEFINE(HAVE_KEYPAD, [1], [Define this if your libcurses has keypad])], [AC_CHECK_LIB(curses, keypad, [CDDA_PLAYER_LIBS="-lcurses"], [AC_MSG_WARN([Will not build cdda-player - did not find libncurses or libcurses]) enable_cdda_player=no])]) fi AM_CONDITIONAL(BUILD_CDDA_PLAYER, test "x$enable_cdda_player" = "xyes") AC_SUBST(CDDA_PLAYER_LIBS) AC_ARG_ENABLE(vcd_info, AS_HELP_STRING([--enable-vcd-info],[include Video CD Info from libvcd]), enable_vcd_info=${enableval}, enable_vcd_info=no) if test "x$enable_vcd_info" = "xyes"; then PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.21, [AC_DEFINE([HAVE_VCDINFO],1, [Define this if you have libvcdinfo installed])], [AC_MSG_WARN(a new enough libvcdinfo not found. VCD info display in cd-info disabled. libvcdinfo is part of vcdimager. Get it from http://vcdimager.org) enable_vcd_info=no]) fi AC_SUBST(VCDINFO_LIBS) AC_SUBST(VCDINFO_CFLAGS) dnl dnl Newest automake workaround - needed for multi-language manual pages dnl AC_SUBST(mkdir_p, "${MKDIR_P}") AC_CONFIG_COMMANDS([checks], [chmod +x test/check_cue.sh; chmod +x test/check_nrg.sh ]) dnl dnl Output configuration files dnl ## AC_CONFIG_FILES([ po/Makefile.in\ AC_CONFIG_FILES([ Makefile \ example/Makefile \ include/Makefile \ include/cdio/Makefile \ include/cdio++/Makefile \ include/cdio/version.h \ doc/doxygen/Doxyfile \ doc/Makefile \ lib/Makefile \ lib/driver/Makefile \ lib/iso9660/Makefile \ lib/udf/Makefile \ libcdio.pc \ libiso9660.pc \ libudf.pc \ package/libcdio.spec \ src/Makefile \ test/check_common_fn \ test/data/Makefile \ test/driver/Makefile \ test/Makefile \ ]) if test "x$enable_cxx" != "xno" ; then AC_CONFIG_FILES([ example/C++/Makefile \ example/C++/OO/Makefile \ lib/cdio++/Makefile \ libcdio++.pc \ libiso9660++.pc \ ]) fi # AC_CONFIG_FILES([po/Makefile]) AC_CONFIG_FILES([test/check_cue.sh], [chmod +x test/check_cue.sh]) AC_CONFIG_FILES([test/check_iso.sh], [chmod +x test/check_iso.sh]) AC_CONFIG_FILES([test/check_nrg.sh], [chmod +x test/check_nrg.sh]) AC_CONFIG_FILES([test/check_udf.sh], [chmod +x test/check_udf.sh]) AC_CONFIG_FILES([test/check_iso_read.sh], [chmod +x test/check_iso_read.sh]) AC_OUTPUT AC_MSG_NOTICE([ Using CD-ROM drivers : $cd_drivers Building cd-info : $(test "x$enable_cd_info" = "xyes" && echo yes || echo no) Building cd-read : $(test "x$enable_cd_read" = "xyes" && echo yes || echo no) Building cdda-player : $(test "x$enable_cdda_player" = "xyes" && echo yes || echo no) Building iso-info : $(test "x$enable_iso_info" = "xyes" && echo yes || echo no) Building iso-read : $(test "x$enable_iso_read" = "xyes" && echo yes || echo no) Building C++ programs: $(test "x$enable_cxx" != "xno" && echo yes || echo no)]) libcdio-2.2.0/doc/000077500000000000000000000000001474051130400136645ustar00rootroot00000000000000libcdio-2.2.0/doc/.gitignore000066400000000000000000000002711474051130400156540ustar00rootroot00000000000000/*.aux /*.cp /*.cps /*.dvi /*.fn /*.info /*.ky /*.log /*.pdf /*.pg /*.toc /*.tp /*.vr /Makefile /Makefile.in /how-to-make-a-release.html /mdate-sh /stamp-vti /texinfo.tex /version.texi libcdio-2.2.0/doc/2006-summer-of-code.txt000066400000000000000000000113061474051130400176350ustar00rootroot000000000000001. Add, finish or improve an OO API. Some work has been done to extend the API to Python, and Perl (via SWIG), Ruby and C++. With the exception of Ruby these are OO interfaces as well. However most languages do not cover the full language. In particular handling MMC (Multi-media) commands is missing and a CD-Paranoia interface (OO or not) is missing. Pick one of these existing API's or extend to a new API (e.g. Java), preferably an OO one. All of the OO API's are fairly new, so if you feel you want to improve on the API, that's okay too. 2. Add, finish a CD-image format parser. Use it say to write a CD-image format converter. The existing CD-image format parsers are ad hoc. Several image (cdrdao or bin/cue) have a text file and currently libcdio uses C strstr and strtok to parse this. In some cases image reading is incomplete: * cdrdao can only handle reading from one file * CD-Text doesn't allow specification of the encoding * handling "silence" in CUE/BIN Some work has been done to create Bison grammars for cdrdao and cue/bin image formats; some basic tests of these parser has been done, but no semantic actions have been added to integrate this into the library. Add the semantic actions. Feel free to add other (preferably non-proprietary) CD-Image formats. Use the parsers to write a translator between the image formats. Standard good practice is to translate into an intermediate language for the N "languages" and then the generate output language from that. This requires 2N for the N*N combinations (rather than N*N individual translators). 3. Finish UDF and/or ISO 9660 handling. UDF (Universal Data File) is used for example in DVD discs and Data. It will be used by in the new Blue-Ray technology. Think of it as a modernized Unicode version of the old ISO 9660 standard. UDF support is probably the most often requested missing feature of libcdio. Some work has been done to define the UDF structures and there is some UDF handling in the current version (0.77) and even more in will appear in the next 0.78. The full UDF specification is much more than currently will exist even in 0.78. Fill out UDF support. 4. write a "tar" command for ISO 9660 and/or UDF images. There is an ISO 9660 library. An often requested feature is to add something like a "tar" command for ISO 9660 images or UDF images. For ISO 9660, currently there are commands to list the contents of an ISO 9660 image file and extract a single file. In version the next version of libcdio 0.78, there will probably be corresponding commands for UDF. Take GNU tar and extend it to ISO 9660 or UDF images. 5. Add EAC (exact audio copy) features, possibly on top of cd-paranoia. Fix possible cd-paranoia bugs. EAC (http://www.exactaudiocopy.de/) is a freeware program for Microsoft Windows and is used to copy audio data from an audio CD to a stereo WAV file. It is similar to cdparanoia (http://www.xiph.org/paranoia/) and libcdio has a multi-OS port of this. The concensus seems to be that EAC does a better job. cdparanoia can probably be extended to do better, more like EAC. There may be bugs in cdparanoia especially with silence which is confused with the silence that appears in a track gap. More or better regression tests should be done for medium and large jittering. [Peter Creath may want to mentor this.] 6. Modify libcdio to handle CD-ROM drive customization. Some programs which work with CD-ROMs allow for a database of CD-ROM drives capabilities. Most notably xmcd (http://www.amb.org/xmcd/). cdparanoia has such a capability although it is not user-configurable like xmcd. Add a CD-ROM capability database with user customization and modify libcdio to use that for various operations. CD-ROM capabilities might include how to get drive capabilities (e.g. MMC MODE-SENSE page 2A command in either the 6 or 10 byte version or via MMC GET-CONFIGURATION command.) For other capibilities listed those listed in xmcd. 7. Wide character support for CD-Text. [Burkhard Plaum has might want to mentor this. If so he should write a more detailed description than given above] [8. libcdio API overhaul removed. This may not be too difficult for a student project. But if someone is really interested, look in CVS revision 1.1. for what this might entail.] 9. Revise to use glib rather than home-grown routines. libcdio has it's own list-processing, byte swapping routines. In particular the routines in bytesex.h and ds.h. Replace these with the corresponding glib routines. $Id: 2006-summer-of-code.txt,v 1.2 2006/04/17 13:24:56 rocky Exp $ libcdio-2.2.0/doc/CD-TEXT-testfiles000066400000000000000000000116731474051130400166670ustar00rootroot00000000000000Author: Thomas Schmitt Title: Test files for CD-TEXT parsers The CD-TEXT test set nightcats_ii consists of two original input files nightcats_ii.v07t ..... Human readable definition for 3 tracks in english. Sony Text File Format Version 0.7T katzenmusik_ii.v07t ... Human readable definition for 3 tracks in german. From these files were derived via libburnia and cd-info cdtext-libburnia.cdt .. CD-TEXT packs file suitable for e.g. cdrecord option textfile=nightcats_ii_en_de.cdt cdtext-libburnia.right expected output of cd-info It demonstrates: - Multiple language blocks - Short track names - Abbreviated repetition of texts by single TAB -------------------------------------------------------------------------- The .cdt file was created by writing the .v07t files to a CD-RW with 3 arbitrary tracks cdrskin dev=/dev/sr0 -v blank=as_needed -eject \ input_sheet_v07t=nightcats_ii.v07t \ input_sheet_v07t=katzenmusik_ii.v07t \ -sao -audio -swab track1 track2 track3 and by then reading its text packs and truncating the header cdrskin dev=/dev/sr0 -v cdtext_to_textfile=nightcats_ii_en_de.cdt dd skip=4 ibs=1 if=nightcats_ii_en_de.cdt of=cdtext-libburnia.cdt Although the CD-RW written by the first cdrskin run already may serve for generating the file nightcats_ii.right, the CD-RW was overwritten by cdrskin dev=/dev/sr0 -v blank=as_needed -eject \ textfile=nightcats_ii_en_de.cdt \ -sao -audio -swab track1 track2 track3 and then read by and truncating the header cd-info --no-header /dev/sr0 | tail -n+15 > cdtext-libburnia.right The resulting file nightcats_ii.right was then checkread to verify that it matches the original .v07t input. The only detected deviation was that cd-info does not represent these information fields from .v07t: Closed Information = This is not to be shown by CD players Text Data Copy Protection = OFF Closed Information = Dies sollten CD-Spieler nicht anzeigen. Text Data Copy Protection = OFF -------------------------------------------------------------------------- Contents of nightcats_ii.v07t: ============================== Input Sheet Version = 0.7T Text Code = ASCII Language Code = English Album Title = Night Cats II Artist Name = United Cat Orchestra Songwriter = Various Songwriters Composer = Various Composers Arranger = Tom Cat Album Message = For all our fans Catalog Number = 1234567890 Genre Code = Classical Genre Information = Feline classic music Closed Information = This is not to be shown by CD players UPC / EAN = 1234567890123 Text Data Copy Protection = OFF First Track Number = 1 Last Track Number = 3 Track 01 Title = Song of Joy Track 01 Artist = Felix and The Purrs Track 01 Songwriter = Friedrich Schiller Track 01 Composer = Ludwig van Beethoven Track 01 Arranger = Tom Cat Track 01 Message = Fritz and Louie once were punks ISRC 01 = XYBLG1101234 Track 02 Title = The Hunt Track 02 Artist = Catwalk Beauties Track 02 Songwriter = Mother Nature Track 02 Composer = unknown Track 02 Arranger = Tom Cat Track 02 Message = ISRC 02 = XYBLG1100005 Track 03 Title = Mee Owwww Track 03 Artist = Mia Kitten Track 03 Songwriter = Mia Kitten Track 03 Composer = Mia Kitten Track 03 Arranger = Mia Kitten Track 03 Message = ISRC 03 = XYBLG1100006 -------------------------------------------------------------------------- Contents of katzenmusik_ii.v07t: ================================ Input Sheet Version = 0.7T Text Code = 8859 Language Code = German Album Title = Nachtkratz II Artist Name = Vereinigtes Katzenorchester Songwriter = Verschiedene Liedschreiber Composer = Verschiedene Komponisten Arranger = Tom Cat Album Message = Für alle unsere Fans Catalog Number = 1234567890 Genre Code = Classical Genre Information = Klassische Katzenmusik Closed Information = Dies sollten CD-Spieler nicht anzeigen. UPC / EAN = 1234567890123 Text Data Copy Protection = OFF First Track Number = 1 Last Track Number = 3 Track 01 Title = Freudenlied Track 01 Artist = Felix und Die Schnurrer Track 01 Songwriter = Friedrich Schiller Track 01 Composer = Ludwig van Beethoven Track 01 Arranger = Tom Cat Track 01 Message = Fritz und Louie waren einmal Punks ISRC 01 = XYBLG1101234 Track 02 Title = Die Jagd Track 02 Artist = Laufsteg Miezen Track 02 Songwriter = Mutter Natur Track 02 Composer = unbekannt Track 02 Arranger = Tom Cat Track 02 Message = ISRC 02 = XYBLG1100005 Track 03 Title = Mie auu Track 03 Artist = Mia Kätzchen Track 03 Songwriter = Mia Kätzchen Track 03 Composer = Mia Kätzchen Track 03 Arranger = Mia Kätzchen Track 03 Message = ISRC 03 = XYBLG1100006 libcdio-2.2.0/doc/Makefile.am000066400000000000000000000031301474051130400157150ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2008, 2012, 2016, 2019 Rocky Bernstein # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . EXTRA_DIST = doxygen/Doxyfile.in doxygen/run_doxygen info_TEXINFOS = libcdio.texi libcdio_TEXINFOS = fdl.texi glossary.texi reference: -( cd ${top_srcdir} && $(MAKE) doxygen ) #: Create documentation in PDF format pdf: libcdio.pdf cd-text-foramt.pdf #: Create documentation as a text file txt: libcdio.txt #: Create documentation in PostScript format ps: libcdio.ps cd-text-format.ps #: Create documentation in HTML format html: libcdio.html cd-text-format.html %.ps.gz: %.ps gzip -9c $< > $@ .texi.dvi: @echo texi2dvi is broken .texi.pdf: stamp-vti texi2pdf $< .texi.html: stamp-vti texi2html $< .texi.txt: makeinfo --no-headers $< > $@ #: Create documentation in all formats, e.g. PDF, DVI, plain text and HTML all-formats: pdf txt ps html MOSTLYCLEANFILES = \ libcdio.html libcdio.pdf libcdio.ps.gz \ cd-text-foramt.html cd-text-format.pdf cd-text-foramt.ps.gz libcdio-2.2.0/doc/cd-text-format.texi000066400000000000000000000623461474051130400174300ustar00rootroot00000000000000\input texinfo @c -*-texinfo-*- @c @tex @c \globaldefs=1 @c \def\baselinefactor{1.5} @c \setleading{\textleading} @c @end tex @setfilename cd-text-format.info @settitle CD Text Format @copying @quotation Permission is granted to copy, modify, and distribute it, as long as the references to the original information sources are maintained. There is NO WARRANTY, to the extent permitted by law. Copyright @copyright{} 2011-2012 Thomas Schmitt @email{scdbackup@@gmx.net}.@* Copyright @copyright{} 2012 Rocky Bernstein @end quotation @end copying @paragraphindent 0 @exampleindent 0 @titlepage @title CD Text Format @author Thomas Schmitt for libburnia-project.org @vskip 2in plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top CD Text Format @insertcopying CD Text provides a way to give disk and track information in an audio CD. This information is used, for example, in CD players to provide information about the audio CD. This document describes the information available in CD Text, and how to decode and encode it. @menu * Encoding and Decoding CD Text:: * Higher-Level Encoding:: * Acknowlegement:: * List of Tables:: * References:: @end menu @end ifnottex @node Encoding and Decoding CD Text @chapter Encoding and Decoding CD Text @menu * Top-Level CD Text Categories (Pack Types):: * Pack Contents:: * Text Pack Types:: * Misc Pack Types:: * TOC Pack Types:: * Block Size Information Type (0x8f):: @end menu @node Top-Level CD Text Categories (Pack Types) @section Top-Level CD Text Categories (Pack Types) CD Text information is grouped into @emph{blocks}, each one in a particular language. Up to 8 languages (or blocks) can be stored. Within a block, there are 13 categories of information, called @emph{Pack Types}. The CD Text categories are identified by a single-byte code. @xref{table:categories}. @float Table,table:categories @smallexample 0x80: Title 0x81: Performers 0x82: Songwriters 0x83: Composers 0x84: Arrangers 0x85: Message Area 0x86: Disc Identification (in text and binary) 0x87: Genre Identification (in text and binary) 0x88: Table of Contents (in binary) 0x89: Second Table of Contents (in binary) 0x8d: Closed Information 0x8e: UPC/EAN code of the album and ISRC code of each track 0x8f: Block Size Information (binary) @end smallexample @caption{CD Text Categories} @end float Additional notes regarding Pack Types: @itemize @item Pack Types @kbd{0x8a} to @kbd{0x8c} although not specified are reserved for potential future use. @item Pack Types @kbd{0x86}, @kbd{0x87}, @kbd{0x88}, @kbd{0x89}, @kbd{0x8d} (Disc Identification, Genre Identification, Table of Contents, Second Table of Contents and Closed Information respectively) apply to the whole disc, and cannot be attached to individual tracks. @item Pack Types @kbd{0x80}, @kbd{0x81}, @kbd{0x82}, @kbd{0x83}, @kbd{0x84}, @kbd{0x85}, and @kbd{0x8e} (Performers, Songwriters, Composers, Arrangers, and Message Area respectively) have to be attributed to each track if they are present for the whole disc. @item Pack Type @kbd{0x8f} (Block Size Information) describes the overall content of a block and in part of all other blocks. @end itemize The total size of a block's attribute set is restricted by the fact that it has to be stored in at most 253 records with 12 bytes of payload. These records are called @emph{Text Packs} described in the next section. Since information such as the Disc and Genre Identification is often the same across mutiple tracks, a compact way to repeat identical information is provided. @node Pack Contents @section Pack Contents Packs are stored in CD in the sub-channel of the Lead-in of the disc. The file @file{doc/cookbook.txt} of the @url{http://libburnia-project.org/,libburnia} distribution describes how to write the CD Text pack array to CD, and how to read CD Text packs from CD. If you are just interested in a more high-level access CD Text information without having to understand the internal structure, you can use libcdio's CD Text API for getting and setting fields. The format is explained in part in Annex J of (@ref{mmc3r10g.pdf,, MMC-3}), and in part by Sony's documentation @ref{cdtext.zip,,cdtext.zip}. Each pack consists of a 4-byte header, 12 bytes of payload, and 2 bytes of CRC. The first byte of each pack contains the pack type. See @ref{table:categories} for a list of pack types. The second byte often gives the track number of the pack. However, a zero track value indicates that the information pertains to the whole album. Higher numbers are valid for track-oriented packs (types @kbd{0x80} to @kbd{0x85}, and @kbd{0x8e}). In these pack types, there should be one text pack for the disc and one for each track. With TOC packs (types @kbd{0x88} and @kbd{0x89}), the second byte is a track number too. With type @kbd{0x8f}, the second byte counts the record parts from 0 to 2. The third byte is a sequential counter. The fourth byte is the Block Number and Character Position Indicator. It consists of three bit fields: @table @dfn @item bits 0-3 Character position. Either the number of characters which the current text inherited from the previous pack, or 15 if the current text started before the previous pack. @item bits 4-6 Block Number (groups text packs in language blocks) @item bit 7 Is 0 if single byte characters, 1 if double-byte characters. @end table The 12 payload bytes contain pieces of zero terminated data. When double-byte text is used the zero is a double byte, otherwise it is a single ASCII NUL. A text may span over several packs. Unused characters in a pack are used for the next text of the same pack type. If no text of the same type follows, then the remaining text bytes are set to 0. The CRC algorithm uses divisor @kbd{0x11021}. The resulting 16-bit residue of the polynomial division is inverted (xor-ed with @kbd{0xffff}) and written as Big-endian number in bytes 16 and 17 of the pack. The text packs are grouped in up to 8 blocks of at most 256 packs. Each block pertains to one language. Sequence numbers of each block are counted separately. All packs of block 0 come before the packs of block 1. The limitation of block number and sequence numbers imply that there are at most 2048 text packs possible. If a text of a track (pack types @kbd{0x80} to @kbd{0x85} and @kbd{0x8e}) repeats identically for the next track, then it may be represented by a TAB character (ASCII 9) for single byte texts, and two TAB characters for double byte texts. This is desirable because there is a somewhat limited amount of space for CD Text --- 256 * 12 bytes which may have to accomodate up to 99 tracks. The two binary bytes of pack type @kbd{0x87} are written to the first @kbd{0x87} pack of a block. They may or may not be repeated at the start of the follow-up packs of type @kbd{0x87}. @node Text Pack Types @section Text Packs (@kbd{0x80}--@kbd{0x85}, @kbd{0x8e}) Pack types @kbd{0x80} to @kbd{0x85} and @kbd{0x8e} (Title, Performers, Songwriters, Arrangers, Message Area and UPC/EAN code respectively) contain a NUL-termintated string. If double-byte characters are used, then two zero bytes terminate the text. Of these, all except the last, @kbd{0x8e} or UPC/EAN code, are encoded according to their block's Character Code. This could be either as ISO-8859-1 single byte characters, as 7-bit ASCII single byte characters, or as MS-JIS double byte characters. Pack type @kbd{0x8e} is documented by Sony as: @quotation @emph{UPC/EAN Code (POS Code) of the album. This field typically consists of 13 characters.} @end quotation This is always ASCII encoded. It applies to tracks as ``ISRC code [which] typically consists of 12 characters'' and is always ISO-8859-1 encoded. MMC calls these information entities ``Media Catalog Number'' and ``ISRC''. The catalog number consists of 13 decimal digits. ISRC consists of 12 characters: 2 country code [0-9A-Z], 3 owner code [0-9A-Z], 2 year digits (00 to 99), 5 serial number digits (00000 to 99999). @node Misc Pack Types @section Miscellaneous Pack Types (@kbd{0x86}, @kbd{0x87}, @kbd{0x8d}) For pack type @kbd{0x86} (Disc Identification) here is how Sony describes this: @quotation @emph{Catalog Number: (use ASCII Code) Catalog Number of the album} @end quotation So it is not really binary but might be non-printable, and should contain only bytes with bit 7 set to zero. Pack type @kbd{0x87} (Genre Identification) contains 2 binary bytes followed by NUL-byte terminated text. You can either specify a genre code or the supplementary genre information (without the code) or both. Neither is mandatory. Categories associated with their Big-endian 16-bit value are listed in @ref{table:genres}. @float Table,table:genres @smallexample 0x0000: Not Used. Sony prescribes this when no genre applies 0x0001: Not Defined 0x0002: Adult Contemporary 0x0003: Alternative Rock 0x0004: Childrens' Music 0x0005: Classical 0x0006: Contemporary Christian 0x0007: Country 0x0008: Dance 0x0009: Easy Listening 0x000a: Erotic 0x000b: Folk 0x000c: Gospel 0x000d: Hip Hop 0x000e: Jazz 0x000f: Latin 0x0010: Musical 0x0011: New Age 0x0012: Opera 0x0013: Operetta 0x0014: Pop Music 0x0015: Rap 0x0016: Reggae 0x0017: Rock Music 0x0018: Rhythm & Blues 0x0019: Sound Effects 0x001a: Spoken Word 0x001b: World Music @end smallexample @caption{Genre Categories} @end float Sony documents report that this field contains: @quotation @emph{Genre information that would supplement the Genre Code, such as ``USA Rock music in the 60's''.} @end quotation This information is always ASCII encoded. Pack type @kbd{0x8d} Sony documents say: @quotation @emph{Closed Information: (use 8859-1 Code) Any information can be recorded on disc as memorandum. Information in this field will not be read by CD-TEXT players available to the public.} @end quotation One can however read this information with an MMC READ TOC/PMA/ATP command. (See Section 5.23 of @ref{mmc3r10g.pdf}). This field is always ISO-8859-1 encoded. @node TOC Pack Types @section TOC Pack Types (@kbd{0x88}, @kbd{0x89}) Pack type @kbd{0x88} records information from the CD's Table of Contents, as of READ PMA/TOC/ATIP Format @kbd{0010b}. See Table 237 TOC Track Descriptor Format, Q Sub-channel of @ref{mmc3r10g.pdf,, MMC-3}. This information duplicates information stored elsewhere and that can be obtained by an MMC READ TOC/PMA/ATP command. The first pack of type @kbd{0x88} (Table of Contents) records in its payload bytes as follows: @smallexample 0 : PMIN of POINT A1 = First Track Number 1 : PMIN of POINT A2 = Last Track Number 2 : unknown, 0 in Sony example 3 : PMIN of POINT A2 = Start position of Lead-Out 4 : PSEC of POINT A2 = Start position of Lead-Out 5 : PFRAME of POINT A2 = Start position of Lead-Out 6 to 11 : unknown, 0 in Sony example @end smallexample The following packs record @kbd{PMIN}, @kbd{PSEC}, @kbd{PFRAME} of the POINTs between the lowest track number (1 or @code{01h}) and the highest track number (99 or @code{63h}). The payload of the last pack is padded by zeros. Using the @kbd{.TOC} from Sony documents as an example: @smallexample A0 01 A1 14 A2 63:02:18 01 00:02:00 02 04:11:25 03 08:02:50 04 11:47:62 ... 13 53:24:25 14 57:03:25 @end smallexample Encoding the above gives: @smallexample 88 00 23 00 01 0e 00 3f 02 12 00 00 00 00 00 00 12 00 88 01 24 00 00 02 00 04 0b 19 08 02 32 0b 2f 3e 67 2d ... 88 0d 27 00 35 18 19 39 03 19 00 00 00 00 00 00 ea af @end smallexample Pack type @kbd{0x89} (Second Table of Contents) is not yet clear. It might be a representation of Playback Skip Interval, Mode-5 Q sub-channel, POINT 01 to 40 See Section 4.2.6.3 of @ref{mmc3r10g.pdf,, MMC-3}. The time points in the Sony example are in the time range of the tracks numbers that are given before the time points: @smallexample 01 02:41:48 01 02:52:58 06 23:14:25 06 23:29:60 07 28:30:39 07 28:42:30 13 55:13:26 13 55:31:50 @end smallexample Encoding the above gives: @smallexample 89 01 28 00 01 04 00 00 00 00 02 29 30 02 34 3a f3 0c 89 06 29 00 02 04 00 00 00 00 17 0e 19 17 1d 3c 73 92 89 07 2a 00 03 04 00 00 00 00 1c 1e 27 1c 2a 1e 72 20 89 0d 2b 00 04 04 00 00 00 00 37 0d 1a 37 1f 32 0b 62 @end smallexample The track numbers are stored in the track number byte of the packs. The two time points are stored in byte 6 to 11 of the payload. Byte 0 of the payload seems to be a sequential counter. Byte 1 always 4? Byte 2 to 5 always 0? @node Block Size Information Type (0x8f) @section Block Size Information Type (@kbd{0x8f}) Pack type @kbd{0x8f} summarizes the whole list of text packs of a block. So there is one group of three @kbd{0x8f} packs per block. Nevertheless each @kbd{0x8f} group indicates the highest sequence number and the language code of all blocks. The payload bytes of three @kbd{0x8f} packs form a 36-byte record. The track number bytes of the three packs have the values 0, 1, 2. For the format of this pack type see @ref{table:block-pack}. @float Table,table:block-pack @smallexample Byte : 0 : Character code for pack types 0x80 to 0x85: 0x00 = ISO-8859-1 0x01 = 7 bit ASCII 0x80 = MS-JIS (japanese Kanji, double byte characters) 1 : Number of first track 2 : Number of last track 3 : value 3 means CD-TEXT is copyrighted, value 0 means CD-TEXT is not copyrighted 4 - 19 : Pack count of the various types 0x80 to 0x8f. Byte number N tells the count of packs of type 0x80 + (N - 4). I.e. the first byte in this field of 16 counts packs of type 0x80. 20 - 27 : Highest sequence byte number of blocks 0 to 7. 28 - 36 : Language code for blocks 0 to 7 (tech3264.pdf appendix 3) @end smallexample @caption{Block Size Information Type} @end float Table @ref{table:languages} specifies the language codes that are referred to in bytes 28-38 of @ref{table:block-pack}. @float Table,table:languages @smallexample 0x00: Unknown 0x50: Sranan Tongo 0x01: Albanian 0x51: Somali 0x02: Breton 0x52: Sinhalese 0x03: Catalan 0x53: Shona 0x04: Croatian 0x54: Serbo-croat 0x05: Welsh 0x55: Ruthenian 0x06: Czech 0x56: Russian 0x07: Danish 0x57: Quechua 0x08: German 0x58: Pushtu 0x09: English 0x59: Punjabi 0x0a: Spanish 0x5a: Persian 0x0b: Esperanto 0x5b: Papamiento 0x0c: Estonian 0x5c: Oriya 0x0d: Basque 0x5d: Nepali 0x0e: Faroese 0x5e: Ndebele 0x0f: French 0x5f: Marathi 0x10: Frisian 0x60: Moldavian 0x11: Irish 0x61: Malaysian 0x12: Gaelic 0x62: Malagasay 0x13: Galician 0x63: Macedonian 0x14: Iceland 0x64: Laotian 0x15: Italian 0x65: Korean 0x16: Lappish 0x66: Khmer 0x17: Latin 0x67: Kazakh 0x18: Latvian 0x68: Kannada 0x19: Luxembourgian 0x69: Japanese 0x1a: Lithuanian 0x6a: Indonesian 0x1b: Hungarian 0x6b: Hindi 0x1c: Maltese 0x6c: Hebrew 0x1d: Dutch 0x6d: Hausa 0x1e: Norwegian 0x6e: Gurani 0x1f: Occitan 0x6f: Gujurati 0x20: Polish 0x70: Greek 0x21: Portuguese 0x71: Georgian 0x22: Romanian 0x72: Fulani 0x23: Romanish 0x73: Dari 0x24: Serbian 0x74: Churash 0x25: Slovak 0x75: Chinese 0x26: Slovenian 0x76: Burmese 0x27: Finnish 0x77: Bulgarian 0x28: Swedish 0x78: Bengali 0x29: Turkish 0x79: Bielorussian 0x2a: Flemish 0x7a: Bambora 0x2b: Wallon 0x7b: Azerbaijani 0x45: Zulu 0x7c: Assamese 0x46: Vietnamese 0x7d: Armenian 0x47: Uzbek 0x7e: Arabic 0x48: Urdu 0x7f: Amharic 0x49: Ukrainian 0x4a: Thai 0x4b: Telugu 0x4c: Tatar 0x4d: Tamil 0x4e: Tadzhik 0x4f: Swahili @end smallexample @caption{Language Codes} @end float Note: Not all of the language codes in @ref{table:languages} have ever been seen with CD Text. Using the preceding information, we can work out the following example. @smallexample 42 : 8f 00 2a 00 01 01 03 00 06 05 04 05 07 06 01 02 48 65 43 : 8f 01 2b 00 00 00 00 00 00 00 06 03 2c 00 00 00 c0 20 44 : 8f 02 2c 00 00 00 00 00 09 00 00 00 00 00 00 00 11 45 @end smallexample decodes to: @smallexample Byte :Value Meaning 0 : 01 = ASCII 7-bit 1 : 01 = first track is 1 2 : 03 = last track is 3 3 : 00 = copyright (0 = public domain, 3 = copyrighted ?) 4 : 06 = 6 packs of type 0x80 5 : 05 = 5 packs of type 0x81 6 : 04 = 4 packs of type 0x82 7 : 05 = 5 packs of type 0x83 8 : 07 = 7 packs of type 0x84 9 : 06 = 6 packs of type 0x85 10 : 01 = 1 pack of type 0x86 11 : 02 = 2 packs of type 0x87 12 : 00 = 0 packs of type 0x88 13 : 00 = 0 packs of type 0x89 14 : 00 00 00 00 = 0 packs of types 0x8a to 0x8d 18 : 06 = 6 packs of type 0x8e 19 : 03 = 3 packs of type 0x8f 20 : 2c = last sequence for block 0 This matches the sequence number of the last text pack (0x2c = 44) 21 : 00 00 00 00 00 00 00 = last sequence numbers for block 1..7 (none) 28 : 09 = language code for block 0: English 29 : 00 00 00 00 00 00 00 = language codes for block 1..7 (none) @end smallexample @node Higher-Level Encoding @chapter Higher-Level Encoding This part gives examples of two ways to input CD Text for burning. @menu * Sony Text File Format (Input Sheet Version 0.7T):: * CDRWIN Cue Sheet with CD Text:: @end menu @node Sony Text File Format (Input Sheet Version 0.7T) @section Sony Text File Format (Input Sheet Version 0.7T) This text file format provides comprehensive means to define the text attributes of session and tracks for a single block. More than one such file has to be read to form an attribute set with multiple blocks. The information is given by text lines of the following form: purpose specifier [whitespace] = [whitespace] content text [whitespace] is zero or more ASCII 32 (space) or ASCII 9 (tab) characters. The purpose specifier tells the meaning of the content text. Empty content text does not cause a CD Text attribute to be attached. The following purpose specifiers apply to the session as a whole: @smallexample Specifier = Meaning Text Code = Character code for pack type 0x8f "ASCII", "8859" Language Code = One of the language names for pack type 0x8f Album Title = Content of pack type 0x80 Artist Name = Content of pack type 0x81 Songwriter = Content of pack type 0x82 Composer = Content of pack type 0x83 Arranger = Content of pack type 0x84 Album Message = Content of pack type 0x85 Catalog Number = Content of pack type 0x86 Genre Code = One of the genre names for pack type 0x87 Genre Information = Cleartext part of pack type 0x87 Closed Information = Content of pack type 0x8d UPC / EAN = Content of pack type 0x8e Text Data Copy Protection = Copyright value for pack type 0x8f "ON" = 0x03, "OFF" = 0x00 First Track Number = The lowest track number used in the file Last Track Number = The highest track number used in the file @end smallexample The following purpose specifiers apply to particular tracks: @smallexample Track NN Title = Content of pack type 0x80 Track NN Artist = Content of pack type 0x81 Track NN Songwriter = Content of pack type 0x82 Track NN Composer = Content of pack type 0x83 Track NN Arranger = Content of pack type 0x84 Track NN Message = Content of pack type 0x85 ISRC NN = Content of pack type 0x8e @end smallexample The following purpose specifiers have no effect on CD Text: @smallexample Remarks = Comments with no influence on CD Text Disc Information NN = Supplementary information for use by record companies. ISO-8859-1 encoded. NN ranges from 01 to 04. Input Sheet Version = "0.7T" @end smallexample An example @code{cdrskin} run with three tracks: @smallexample $ cdrskin dev=/dev/sr0 -v input_sheet_v07t=NIGHTCATS.TXT \ -audio track_source_1 track_source_2 track_source_3 @end smallexample The contexts of file @file{NIGHTCATS.TXT} used above is: @smallexample Input Sheet Version = 0.7T Text Code = 8859 Language Code = English Album Title = Joyful Nights Artist Name = United Cat Orchestra Songwriter = Various Songwriters Composer = Various Composers Arranger = Tom Cat Album Message = For all our fans Catalog Number = 1234567890 Genre Code = Classical Genre Information = Feline classic music Closed Information = This is not to be shown by CD players UPC / EAN = 1234567890123 Text Data Copy Protection = OFF First Track Number = 1 Last Track Number = 3 Track 01 Title = Song of Joy Track 01 Artist = Felix and The Purrs Track 01 Songwriter = Friedrich Schiller Track 01 Composer = Ludwig van Beethoven Track 01 Arranger = Tom Cat Track 01 Message = Fritz and Louie once were punks ISRC 01 = XYBLG1101234 Track 02 Title = Humpty Dumpty Track 02 Artist = Catwalk Beauties Track 02 Songwriter = Mother Goose Track 02 Composer = unknown Track 02 Arranger = Tom Cat Track 02 Message = Pluck the goose ISRC 02 = XYBLG1100005 Track 03 Title = Mee Owwww Track 03 Artist = Mia Kitten Track 03 Songwriter = Mia Kitten Track 03 Composer = Mia Kitten Track 03 Arranger = Mia Kitten Track 03 Message = ISRC 03 = XYBLG1100006 @end smallexample @node CDRWIN Cue Sheet with CD Text @section CDRWIN Cue Sheet with CD Text A CDRWIN cue sheet file defines the track data source (@kbd{FILE}), various text attributes (@kbd{CATALOG}, @kbd{TITLE}, @kbd{PERFORMER}, @kbd{SONGWRITER}, @kbd{ISRC}), track block types (@kbd{TRACK}), track start addresses (@kbd{INDEX}). The rules for CDRWIN cue sheet files are described at @url{http://digitalx.org/cue-sheet/syntax/} [4]. There are three more text attributes mentioned in the cdrecord manual page for defining the corresponding CD Text attributes: @kbd{ARRANGER}, @kbd{COMPOSER}, @kbd{MESSAGE}. An Example of a CDRWIN cue sheet file: @smallexample CATALOG 1234567890123 FILE "audiodata.bin" BINARY TITLE "Joyful Nights" TRACK 01 AUDIO FLAGS DCP TITLE "Song of Joy" PERFORMER "Felix and The Purrs" SONGWRITER "Friedrich Schiller" ISRC XYBLG1101234 INDEX 01 00:00:00 TRACK 02 AUDIO FLAGS DCP TITLE "Humpty Dumpty" PERFORMER "Catwalk Beauties" SONGWRITER "Mother Goose" ISRC XYBLG1100005 INDEX 01 08:20:12 TRACK 03 AUDIO FLAGS DCP TITLE "Mee Owwww" PERFORMER "Mia Kitten" SONGWRITER "Mia Kitten" ISRC XYBLG1100006 INDEX 01 13:20:33 @end smallexample @node Acknowlegement @unnumbered Acknowlegement Thanks to Leon Merten Lohse. @node List of Tables @unnumbered List of Tables @listoffloats Table @node References @unnumbered References @enumerate @item Correspondence with Leon Merten Lohse in @email{libcdio-devel@@gnu.org}, December 2011. @* Mail archives at @url{http://lists.gnu.org/archive/html/libcdio-devel/2011-12/index.html} @item @emph{SCSI Multimedia Commands --- 3 (MMC-3)},@anchor{mmc3r10g.pdf} Revision 10g, November 12. 2011.@* Google for @file{mmc3r10g.pdf} See especially Section 5.23 (READ TOC/PMA/ATIP Command), see Table 237 (TOC Track Descriptor Format, Q Sub-channel), Annex J (CD Text format in the Lead-in Area) and Sections 4.2.5.3 (Mode-5 Q). @item ``Materials describing the procedure of the procedure of authoring and mastering for creating CD TEXT disks on equipments develooped by Sony HAV Company'',@anchor{cdtext.zip}@* @file{http://www.sonydadc.com/file/cdtext.zip} which was previously found on Sony's web site circa 2007. You may be able to get this from the ``Wayback Archive'', such as @url{http://web.archive.org/web/20070204035327/http://www.sonydadc.com/file/cdtext.zip}@* @item Cue-Sheet Syntax @url{http://digitalx.org/cue-sheet/syntax} @item @emph{libburnia} project @url{http://libburnia-project.org} See @file{doc} directory in that project. @item @emph{libcdio} source code @url{http://www.gnu.org/s/libcdio} @item @emph{cdrecord} source code @url{ftp://ftp.berlios.de/pub/cdrecord/alpha} @item @emph{cdrecord} manual page. @url{http://cdrecord.berlios.de/private/man/cdrecord/cdrecord.1.html} @item @emph{Specification of the EBU Subtitling data exchange format},@* Appendix 3. February 1991 @url{http://tech.ebu.ch/docs/tech/tech3264.pdf} @* Contains CD Text Language codes shown in @ref{table:languages}. @item Genre codes @url{http://helpdesk.audiofile-engineering.com/index.php?pg=kb.page&id=123} @end enumerate @bye libcdio-2.2.0/doc/doxygen/000077500000000000000000000000001474051130400153415ustar00rootroot00000000000000libcdio-2.2.0/doc/doxygen/.gitignore000066400000000000000000000000621474051130400173270ustar00rootroot00000000000000/Doxyfile /Doxyfile.bak /html /latex /libcdio.xml libcdio-2.2.0/doc/doxygen/Doxyfile.in000066400000000000000000002251441474051130400174640ustar00rootroot00000000000000# Doxyfile 1.7.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" "). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or sequence of words) that should # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. PROJECT_NAME = @PACKAGE@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = "The $name class " \ "The $name widget " \ "The $name file " \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding # "class=itcl::class" will allow you to use the command class in the # itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this # tag. The format is ext=language, where ext is a file extension, and language # is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, # C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also makes the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and # unions are shown inside the group in which they are included (e.g. using # @ingroup) instead of on a separate page (for HTML and Man pages) or # section (for LaTeX and RTF). INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and # unions with only public data fields will be shown inline in the documentation # of the scope in which they are defined (i.e. file, namespace, or group # documentation), provided this scope is documented. If set to NO (the default), # structs, classes, and unions are shown on a separate page (for HTML and Man # pages) or section (for LaTeX and RTF). INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penalty. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will roughly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. SYMBOL_CACHE_SIZE = 0 # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given # their name and scope. Since this can be an expensive process and often the # same symbol appear multiple times in the code, doxygen keeps a cache of # pre-resolved symbols. If the cache is too small doxygen will become slower. # If the cache is too large, memory is wasted. The cache size is given by this # formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespaces are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to # do proper type resolution of all parameters of a function it will reject a # match between the prototype and the implementation of a member function even # if there is only one candidate or it is obvious which candidate to choose # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or macro consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and macros in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. The create the layout file # that represents doxygen's defaults, run doxygen with the -l option. # You can optionally specify a file name after the option, if omitted # DoxygenLayout.xml will be used as the name of the layout file. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files # containing the references data. This must be a list of .bib files. The # .bib extension is automatically appended if omitted. Using this command # requires the bibtex tool to be installed. See also # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this # feature you need bibtex and perl available in the search path. CITE_BIB_FILES = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_NO_PARAMDOC option can be enabled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../../include/cdio/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = ../../include/cdio/cdio_config.h # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = ../../example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty or if # non of the patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) # and it is also possible to disable source filtering for a specific pattern # using *.ext= (so without naming a filter). This option only has effect when # FILTER_SOURCE_FILES is enabled. FILTER_SOURCE_PATTERNS = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. Note that when using a custom header you are responsible # for the proper inclusion of any scripts and style sheets that doxygen # needs, which is dependent on the configuration options used. # It is advised to generate a default header using "doxygen -w html # header.html footer.html stylesheet.css YourConfigFile" and then modify # that header. Note that the header is subject to change so you typically # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # style sheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images # according to this color. Hue is specified as an angle on a colorwheel, # see http://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of # the colors in the HTML output. For a value of 0 the output will use # grayscales only. A value of 255 will produce the most vivid colors. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to # the luminance component of the colors in the HTML output. Values below # 100 gradually make the output lighter, whereas values above 100 make # the output darker. The value divided by 100 is the actual gamma applied, # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, # and 100 does not change the gamma. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated # that can be used as input for Qt's qhelpgenerator to generate a # Qt Compressed Help (.qch) of the generated HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see # # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. # # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) # at top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. Since the tabs have the same information as the # navigation tree you can set this option to NO if you already set # GENERATE_TREEVIEW to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. # Since the tree basically has the same information as the tab index you # could consider to set DISABLE_INDEX to NO when enabling this option. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values # (range [0,1..20]) that doxygen will group on one line in the generated HTML # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open # links to external symbols imported via tag files in a separate window. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are # not supported properly for IE 6.0, but are supported on all modern browsers. # Note that when changing this option you need to delete any form_*.png files # in the HTML output before the changes have effect. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax # (see http://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you also need to install MathJax separately and # configure the path to it using the MATHJAX_RELPATH option. USE_MATHJAX = NO # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the # mathjax.org site, so you can quickly see the result without installing # MathJax, but it is strongly recommended to install a local copy of MathJax # before deployment. MATHJAX_RELPATH = http://www.mathjax.org/mathjax # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension # names that should be enabled during MathJax rendering. MATHJAX_EXTENSIONS = # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvantages are that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = letter # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for # the generated latex document. The footer should contain everything after # the last chapter. If it is left blank doxygen will generate a # standard footer. Notice: only use this tag if you know what you are doing! LATEX_FOOTER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See # http://en.wikipedia.org/wiki/BibTeX for more info. LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load style sheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that # overrules the definition found in the source code. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros # that are alone on a line, have an all uppercase name, and do not end with a # semicolon, because these will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = libcdio.xml # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option also works with HAVE_DOT disabled, but it is recommended to # install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will # base this on the number of processors available in the system. You can set it # explicitly to a value larger than 0 to get control over the balance # between CPU load and processing speed. DOT_NUM_THREADS = 0 # By default doxygen will use the Helvetica font for all dot files that # doxygen generates. When you want a differently looking font you can specify # the font name using DOT_FONTNAME. You need to make sure dot is able to find # the font, which can be done by putting it in a standard location or by setting # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the # directory containing the font. DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the Helvetica font. # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to # set the path where dot can find it. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will generate a graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. If you choose svg you need to set # HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible in IE 9+ (other browsers do not have this requirement). DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # Note that this requires a modern browser other than Internet Explorer. # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible. Older versions of IE do not have SVG support. INTERACTIVE_SVG = NO # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the # \mscfile command). MSCFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO libcdio-2.2.0/doc/doxygen/run_doxygen000077500000000000000000000052761474051130400176420ustar00rootroot00000000000000#!/bin/sh # $Id: run_doxygen,v 1.1 2003/11/09 14:11:02 rocky Exp $ # Runs doxygen and massages the output files. # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # # Synopsis: run_doxygen --mode=[user|maint|man] v3srcdir v3builddir # # Originally hacked together by Phil Edwards # We can check now that the version of doxygen is >= this variable. DOXYVER=1.2.15 doxygen= find_doxygen() { v_required=`echo $DOXYVER | \ awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'` testing_version= # thank you goat book set `IFS=:; X="$PATH:/usr/local/bin:/bin:/usr/bin"; echo $X` for dir do # AC_EXEEXT could come in useful here maybedoxy="$dir/doxygen" test -f "$maybedoxy" && testing_version=`$maybedoxy --version` if test -n "$testing_version"; then v_found=`echo $testing_version | \ awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'` if test $v_found -ge $v_required; then doxygen="$maybedoxy" break fi fi done if test -z "$doxygen"; then echo run_doxygen error: Could not find Doxygen $DOXYVER in path. 1>&2 print_usage fi } print_usage() { cat 1>&2 <] MODE is one of: user Generate user-level HTML library documentation. maint Generate maintainers' HTML documentation (lots more; exposes non-public members, etc). man Generate user-level man pages. more options when i think of them Note: Requires Doxygen ${DOXYVER} or later; get it at ftp://ftp.stack.nl/pub/users/dimitri/doxygen-${DOXYVER}.src.tar.gz EOF exit 1 } parse_options() { for o do # Blatantly ripped from autoconf, er, I mean, "gratefully standing # on the shoulders of those giants who have gone before us." case "$o" in -*=*) arg=`echo "$o" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) arg= ;; esac case "$o" in --mode=*) mode=$arg ;; --mode | --help | -h) print_usage ;; *) # this turned out to be a mess, maybe change to --srcdir=, etc if test $srcdir = unset; then srcdir=$o elif test $outdir = unset; then builddir=${o} outdir=${o}/doc/doxygen else echo run_doxygen error: Too many arguments 1>&2 exit 1 fi ;; esac done } # script begins here mode=unset srcdir=unset outdir=unset do_html=no do_man=no enabled_sections= DATEtext=`date '+%Y-%m-%d'` parse_options $* find_doxygen $doxygen ./Doxyfile exit 0 # vim:ts=4:et: libcdio-2.2.0/doc/fdl.texi000066400000000000000000000510301474051130400153230ustar00rootroot00000000000000@c The GNU Free Documentation License. @center Version 1.2, November 2002 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. @end enumerate @page @heading ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: @smallexample @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with@dots{}Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: libcdio-2.2.0/doc/glossary.texi000066400000000000000000000510021474051130400164200ustar00rootroot00000000000000Thomas Schmitt has made significant contributions to this glossary. See also @uref{https://www.videohelp.com/glossary}. @table @dfn @item @anchor{ASPI}ASPI @cindex ASPI See @acronym{Win32 ASPI} @item ATA Advanced Technology Attachment (ATA). The same thing as IDE. @item ATAPI Advanced Technology Attachment (ATA) Packet Interface. The interface provides a mechanism for transferring and executing SCSI CDBs on IDE CD Drives and DVD Drives. IDE (also called ATA) was originally designed for hard drives only, but with the help of ATAPI, it is possible to connect other devices, in particular CD-ROMS to the IDE/EIDE connections. The ATAPI CD-ROM drives understand a subset of SCSI commands. In particular multi-initiator commands are neither needed nor defined for ATAPI devices. @item BIN/CUE A CD-image format developed by Jeff Arnold for CDRWIN software on Microsoft Windows. Many other programs subsequently support using this format. The @code{.CUE} file is a text file that contains CD format and track layout information, while the @code{.BIN} file holds the actual data of each track. @item Blu-ray Disc (BD) @cindex Blu-ray Disc (BD) Optical media with a capacity of 25 GB as a single layer and 50 GB as double layer. See also @pxref{models-profiles,,"Media models and profiles"}. @item CD @cindex CD Compact Disc. Capacity up to 900 MB. See also @pxref{models-profiles,,"Media models and profiles"}. @item CD-DA @cindex CD-DA Compact Disc Digital Audio, described in the ``Red Book'' or IEC 60908 (formerly IEC 908). This is commonly referred to as an audio @acronym{CD} and what most people think of when you play a @acronym{CD} as it was the first to use the @acronym{CD} medium. See @url{http://en.wikipedia.org/wiki/Red_Book_(audio_CD_standard)} @item CD+G @cindex CD+G Compact Disc + Graphics. An extension of the CD audio format contains a limited amount of graphics in subcode channels. This disc works in all audio players but the graphics portion is only available in a special CD+G or Karaoke player. @item CD-i @cindex CD-i Compact Disc Interactive. An extension of the CD format designed around a set-top computer that connects to a TV to provide interactive home entertainment, including digital audio and video, video games, and software applications. Defined by the ``Green Book'' standard. @uref{http://www.icdia.org/}. CD-i for video and video music has largely (if not totally) been superseded by VCDs. @item CD-i Bridge @cindex CD-i Bridge A standard allowing CD-ROM XA discs to play on CD-i. Kodak PhotoCDs are CD-XA Bridge discs. @item CD-ROM @cindex CD-ROM Compact Disc Read Only Memory or ``Yellow Book'' described in Standards ISO/IEC 10149. The data stored on it can be either in the form of audio, computer, or video files. @item CD-ROM Mode 1 and Mode2 The Yellow Book specifies two types of tracks, Mode 1 and Mode 2. Mode 1 is used for computer data and text and has an extra error correction layer. Mode 2 is for audio and video data and has no extra correction layer. CD-ROM/XA An expansion of the CD-ROM Mode 2 format that allows both computer and audio/video to be mixed in the same track. @item CD Text @cindex CD Text CD Text is a technology developed by Sony Corporation and Philips Electronics in 1996 that allowed storing in an audio CD and its tracks information such as artist name, title, songwriter, composer, or arranger. Commercially available audio CDs sometimes contain CD Text information. Information on how CD Text is stored can be found in in older MMC standards. Specifically, try ``Annex J'' of ``mmc3r10g.pdf''. An ``Unofficial CD Text FAQ'' is at @url{http://web.ncf.ca/aa571/cdtext.htm} @item @anchor{XA}CD XA @cindex CD XA CD-ROM EXtended Architecture. A modification to the CD-ROM specification that defines two new types of sectors. CD-ROM XA was developed jointly by Sony, Philips, and Microsoft, and announced in August 1988. Its specifications were published in an extension to the Yellow Book. CD-i, Photo CD, Video CD, and CD-EXTRA have all subsequently been based on CD-ROM XA. CD-XA defines another way of formatting sectors on a CD-ROM, including headers in the sectors that describe the type (audio, video, data) and some additional info (markers, resolution in case of a video or audio sector, file numbers, etc). The data written on a CD-XA is consistent with and can be in ISO-9660 file system format and therefore be readable by ISO-9660 file system translators. But also a CD-I player can read CD-XA discs even if its own `Green Book' file system only resembles ISO 9660 and isn't fully compatible. @item DVD @cindex DVD Digital Versatile Disc. Capacity up to 4.5 GB as single-layer and 8.5 GB as double-layer media. See also @pxref{models-profiles,,"Media models and profiles"}. @item Defect management @cindex Defect management A method to compensate small amounts of bad spots on media by replacing them out of a pool of reserve blocks and performing address translation. The necessary check reading slows down write performance by a factor of 2 or 3. Defect management applies by default to DVD-RAM and BD-RE. Optionally it can be formatted onto CD-RW and DVD+RW, where it has the name "Mount Rainier". Sequential BD-R can be formatted for defect management too. @item Command Packet @cindex Command Packet The data structure that is used to issue an ATAPI command. It contains a SCSI Command Descriptor Block (CDB). @item ECMA-119 (ISO-9660) @cindex ECMA-119 @uref{http://www.ecma-international.org/publications/standards/Ecma-119.htm} is a freely available specification that is technically identical to ISO 9660. @item ECMA-167 (UDF) @cindex ECMA-167 @uref{https://ecma-international.org/publications-and-standards/standards/ecma-167/} is a freely available specification which is also approved as ISO 13346. It serves as the base for UDF. @item ECMA-168 @cindex ECMA-168 @uref{https://ecma-international.org/publications-and-standards/standards/ecma-168/} is a freely available specification which is also approved as ISO 13490. @item FSF @cindex FSF Free Software Foundation, @uref{http://www.fsf.org/} @item GNU @cindex GNU @acronym{GNU} is not @acronym{UNIX}, @uref{http://www.gnu.org/} @item IDE Integrated Drive Electronics. This is a commonly used interface for hard disk drives and CD-ROM drives. It is less expensive than SCSI, but offers slightly less performance. @item ISO @cindex ISO International Standards Organization. @item ISO 13346 @cindex ISO 13346 ISO 13346 / ECMA-167 is a filesystem framework for data exchange on overwriteable or pseudo-overwritable media. It serves as the base of UDF. @item ISO 13490 @cindex ISO 13490 ISO 13490 / ECMA-168 is an attempt to replace ISO 9660 with a format that allows finer write granularity and representation of typical disk file properties. It resembles ECMA-167 which led to UDF. @item ISO 9660 @cindex ISO 9660 ISO 9660 / ECMA-119 is an operating-system-independent filesystem format originally intended for CD-ROM media. It was standardized in 1988 and replaced the High Sierra standard for the logical format on CD-ROM media (ISO 9660 and High Sierra are identical in content, but the exact format is different). ISO 9660 and ECMA-119 are technically identical meanwhile. There are several specification levels. In Level 1, file names must be in the 8.3 format (no more than eight characters in the name, no more than three characters in the suffix) and in capital letters. Directory names can be no longer than eight characters. There can be no more than eight nested directory levels. Level 2 and 3 specifications allow file names up to 32 characters long. Level 3 allows data file sizes to be 4 GB or larger. File data content is stored in extents, i.e. contiguous sequences of blocks. A single extent can hold only up to 2 exp 32 - 1 bytes. So files of 4 GB or larger need more than one extent to be stored. Older operating systems might have trouble with multi-extent files. @item Joliet extensions @cindex Joliet extensions This ISO-9660 upward-compatible standard was developed for Windows 95 and Windows NT by Microsoft as an extension of ISO 9600 which allows the use of Unicode characters and supports file names up to 64 characters. See @uref{https://pismotec.com/cfs/jolspec.html} for the Joliet Specification. The name Joliet comes from the city in Illinois (U.S) where the standard was defined. @item LBA @cindex LBA Logical Block Addressing. Mapped integer numbers from CD Red Book Addressing MSF. The starting sector is -150 and the ending sector is 449849, which correlates directly to MSF: 00:00:00 to 99:59:74. Because an LBA is a single number it is often easier to work with in programming than an MSF. @item Lead in @cindex lead in The area of a CD where the Table Of Contents (TOC) and CD Text are stored. I think it is supposed to be around 4500 (1 min) or more sectors in length. On a CDR(W) the lead-in length is variable, because manufacturers have a different starting position indicated by the ATIP start of lead-in position that is recorded in the ATIP groove on the disk. For example: @table @dfn @item Ricoh Company Limited 97:27:00, 97:27:06, 97:27:66 @item Mitsubishi Chemical (Verbatim) 97:34:21 to 97:34:25 @end table @item LSN @cindex LSN Logical Sector Number. Mapped integer numbers from CD Red Book Addressing MSF. The starting sector is 0 and the ending sector is 449699, which correlates to MSF: 00:00:00 to 99:59:74. Because an LSN is a single number it is often easier to work with in programming than an MSF. Because it starts at 0 rather than -150 as is the case of an LBA it can be represented as an unsigned value. @item MCN @cindex MCN Media Catalog Number. An identification number on an audio CD. Also called a UPC. Another identification number is ISRC. @item @anchor{MMC}MMC @cindex MMC (Multimedia Commands) MMC (Multimedia Commands). MMC are raw commands for communicating with CDROM drives, CD-Rewriters, DVD-Rewriters, etc. They are a subset of the larger SCSI command set. See also @pxref{SCSI,,@acronym{SCSI}}. Many manufacturers have adopted this standard and it also applies to ATAPI versions of their drives. The documents @code{libcdio} makes use of are described in the Multi-Media Commands standard (MMC). This document generally has a numeric level number appended. For example, MMC-6 refers to ``Multi-Media Commands - 6. @item @anchor{models-profiles}Media models and profiles @cindex Media models and profiles MMC classifies media as models, which describe their logical structure, and as profiles, which describe the capabilities of the drive with the particular media. So both are closely related but not identical. There are three model families: CD, DVD, Blu-ray. CD allows special sector formats like audio as well as data sectors of 2048 bytes. DVD and Blu-ray only record data sectors. @table @dfn @item Non-writable media: CD-ROM, DVD-ROM, BD-ROM. @item Write-once media: CD-R, DVD-R, DVD+R, BD-R. @item Reusable media: CD-RW, DVD-RW, DVD+RW, DVD-RAM, BD-RE. @end table Profiles depend on drive type and media state. They are expressed as numbers. It is unfortunate that formatted CD-RW have the same profile number as unformatted ones. ROM drives often announce all media as ROM profiles. Some writer drives show closed sequential media as ROM profile. @table @dfn @item CD-ROM 0x08 @item DVD-ROM 0x10 @item BD-ROM 0x40 @end table Sequentially recordable profiles allow multisession in most cases. Special burn programs are needed for writing to them. @table @dfn @item CD-R 0x09 @item CD-RW 0x0a (unformatted) @item DVD-R 0x11 @item DVD-RW 0x14 (unformatted) @item DVD-R DL 0x15 (double layer) @item DVD-R DL 0x16 (double layer, jump recording) @item DVD+R 0x1a @item DVD+RW DL 0x2a (double layer) @item DVD+R DL 0x2b (double layer) @item BD-R 0x41 (single or double layer, formatted or not) @item HD DVD-ROM 0x50 @item HD DVD-R 0x51 @item HD DVD-RAM 0x52 @end table They can assume three states: @table @dfn @item "Blank" is not readable but writeable from scratch @item "Appendable" is readable and after the readable part still writeable @item "Closed" is only readable @end table CD-RW and DVD-RW can be brought back to a blank state, or they can be formatted to become overwritable. Overwritable profiles allow random read-write access with a granularity of 2 kB or 32 kB. One can hope for having read-write access via the normal POSIX operations lseek(), read(), write() of the operating system. @table @dfn @item CD-RW 0x0a (formatted) @item DVD-RAM 0x12 @item DVD-RW 0x13 (formatted, 32 kB write granularity) @item DVD+RW 0x1a @item BD-R 0x42 (formatted for pseudo-random recording) @item BD-RE 0x43 (single or double layer) @end table BD-R profile 0x42 is defined by MMC but not implemented by the consumer priced Blu-ray burners as of the year 2010. @item Mixed Mode CD @cindex Mixed Mode CD A Mixed Mode is a CD that contains tracks of differing CD-ROM Mode formats. In particular, the first track may contain both computer data (Yellow Book) CD ROM data while the remaining tracks are audio or video data. Video CD's can be Mixed Mode CDs. @item Multisession @cindex Multisession A way of writing to a CD, DVD, or Blu-ray Disc that allows more data to be added to readable discs at a later time. The media must not have been closed by the previous writing session. This applies originally to unformatted CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, and sequential BD-R which all can record more than one session. They hold a table of contents with sessions and tracks. Formatted CD-RW, DVD-RAM, DVD+RW, DVD-RW, and BD-RE have only one track. Multisession on these media needs help from the recorded data formats. Multisession can be used to add a changeset to an existing ISO 9660 filesystem. Typically the add-on session contains a whole new filesystem tree with old and new files. It also contains the data blocks of the newly introduced or freshly overwritten files. The convention for mounting multisession ISO 9660 images is to load the superblock from the start of the first track in the last session as listed in the media table of contents. Formatted media are assumed to have a single track starting at block 0. So ISO 9660 multisession on formatted media has to overwrite the volume descriptors at block 16 ff. with every new session. A chain of recognizable sessions can be achieved by starting the first ISO 9660 image at block 32 so that its descriptors are not overwritten later. @item Nero NRG format file @cindex Nero NRG, CD-Image format A proprietary CD image file format used by a popular program for Microsoft Windows, Ahead Nero. The specification of this format is not to our knowledge published. @item Rock Ridge Extensions @cindex Rock Ridge extensions An extension to the ISO-9660 standard which adds POSIX information to files. It allows long file names, owner, group, access permissions @code{ugo+-rwx}, inode numbers, hard-link count, and file types other than directory or regular file. Rock Ridge is described by unapproved standard IEEE P1282 / RRIP-1.12 and based on unapproved IEEE P1281 / SUSP-1.10. It has become a de-facto standard on X/Open systems like GNU/Linux, FreeBSD, Solaris, et.\ al. @item @anchor{SCSI}SCSI @cindex SCSI Small Computer System Interface. A set of ANSI standard electronic interfaces (originally developed at Apple Computer) that allow personal computers to communicate with peripheral hardware such as CD-ROM drives, disk drives, printers, etc. Although the original hardware has been outdated for years, the SCSI command set nowadays controls most storage devices including all optical disc drives. The contemporary electronic technologies that transport SCSI commands to optical drives are P-ATA, SATA, and USB. A SCSI programming specification made by the SCSI committee T10 organization @url{http://www.t10.org/}. The documents @code{libcdio} makes use of are described in SCSI standards documents SCSI Primary Commands (SPC), SCSI Block Commands (SBC), and Multi-Media Commands (MMC). These documents generally have a numeric level number appended. For example, SPC-3 refers to ``SCSI Primary Commands - 3'. In year 2025, the current versions were SPC-7 (@url{https://www.t10.org/members/w_spc7.htm}), SBC-5 (@url{https://www.t10.org/members/w_sbc5.htm}), MMC-6 (@url{https://t10.org/members/w_mmc6.htm}). @item SCSI CDB @cindex SCSI CDB SCSI Command Descriptor Block. The data structure that is used to issue a SCSI command. @item SCSI Pass Through Interface. @cindex SCSI Pass Through Interface. Yet another way of issuing MMC commands for accessing a CD-ROM. As with MMC or ASPI, the CD-ROM doesn't necessarily have to be a SCSI-attached drive. See also @pxref{MMC,,@acronym{MMC}} and @pxref{ASPI,,@acronym{ASPI}}. @item Session A fully readable complete recording that contains one or more tracks of computer data or audio on a CD. On a DVD or Blu-ray Disc, there are only data sessions. @item SVCD @cindex Super VCD (SVCD) Super @acronym{VCD} An improvement of Video CD 2.0 specification which includes most notably a switch from @acronym{MPEG}-1 (constant bit rate encoding) to @acronym{MPEG}-2 (variable bit rate encoding) for the video stream. Also added was higher video-stream resolution, up to 4 overlay graphics and text (@dfn{OGT}) sub-channels for user switchable subtitle displaying, closed caption text, and command lists for controlling the @acronym{SVCD} virtual machine. See @uref{https://www.videohelp.com/glossary?S#SVCD} @item TOC @cindex TOC (CD Table of Contents) (Compact Disc) Table of Contents. The TOC contains a list of sessions and their tracks. For sessions, it records the starting track number and the last track number. For tracks, it records starting time block address, size, copy protection, linear audio preemphasis, track format (CDDA or data) in that order. Session and track information is also available on sequential DVDs and Blu-ray Discs. Several track properties are fixed to equivalents of CD data. @item Track @cindex track A unit of data of a CD. The size of a track can vary; it can occupy the entire contents of the CD. Most CD standards however require that tracks have a 150 frame (or ``2 second'') lead-in gap. An abstraction of tracks for CD, DVD, and Blu-ray Discs is the Logical Track as of MMC specs. Overwritable media have a single logical track, sequential media can have one or more logical tracks which they describe in their TOC. @item UDF @cindex UDF Universal Disc Format was designed as the successor of ISO 9660. It allows recording long file names and advanced file properties. Although intended as a format for data exchange its main importance is with DVD video players. Video DVDs have to bear a simple UDF filesystem with a prescribed set of files. @item VCD @cindex Video CD (VCD) The Video Compact Disc (@dfn{Video CD} or @dfn{VCD}) is a standardized digital video storage format. It is based on the commonly available Compact Disc technology, which allows for low-cost video authoring. Video CD's can be played in most @acronym{DVD} standalone players, dedicated VCD players, and finally, modern Personal Computers with multimedia support. A Video CD is made up of @acronym{CD-ROM XA} sectors, i.e. @acronym{CD-ROM} mode 2 form 1 & 2 sectors. Non-@acronym{MPEG} data is stored in mode 2 form 1 sectors with a user data area of 2048 byte, which have a similar L2 error correction and detection (@acronym{ECC}/@acronym{EDC}) to @acronym{CD-ROM} mode 1 sectors. While real-time @acronym{MPEG} streams is stored in @acronym{CD-ROM} mode 2 form 2 sectors, which by have no L2 @acronym{ECC}, yield a ~14% greater user data area consisting of 2324 bytes@footnote{actually raw mode 2 sectors have a 2336 byte user data area, but parts of it are used for error codes and headers when using the mode 2 form 1 or form 2 configurations.} @uref{https://www.videohelp.com/glossary?V#VCD} @item Win32 ASPI @cindex ASPI The ASPI interface specification was developed by Adaptec for sending commands to a SCSI host adapter (such as those controlling CD and DVD drives) and used on Windows 9x/NT and later. Emulation for ATAPI drives was added so that the same sets of commands worked in those even though the drives might not be SCSI nor might there even be a SCSI controller attached. However, in Windows NT/2K/XP, Microsoft provides their Win32 ioctl interface, and has taken steps to make using ASPI more inaccessible (e.g. requiring administrative access to use ASPI). See also @pxref{MMC,,@acronym{MMC}}. @uref{https://www.videohelp.com/glossary?A#ASPI} @item Win32 ioctl driver Ioctl (Input Output ConTroLs). A Win32 function, implemented in all Microsoft Windows. It is used for sending commands to devices using defined codes and structures. @item XA @cindex XA @xref{XA,,@acronym{CD-ROM XA}}. @end table libcdio-2.2.0/doc/how-to-make-a-release.md000066400000000000000000000076201474051130400201770ustar00rootroot00000000000000 Table of Contents ================= - [Let people know of a pending release](#let-people-know-of-a-pending-release) - [Coordinate with libcdio-paranoia release](#coordinate-with-libcdio-paranoia-release) - [Test](#test) - [Go over version number, Update Release notes](#go-over-version-number-update-release-notes) - [Update Documention](#update-documention) - [Are sources up to date?](#are-sources-up-to-date) - [Bump release](#bump-release) - [Push and tag release](#push-and-tag-release) - [Upload to ftp.gnu.org](#upload-to-ftpgnuorg) - [Update documentation](#update-documentation) - [copy libcdio manual to web page](#copy-libcdio-manual-to-web-page) - [Bump to git version](#bump-to-git-version) - [Let libcdio-devel know of release](#let-libcdio-devel-know-of-release) Let people know of a pending release ==================================== Let people know on the [libcdio-devel mailing list](mailto://libcdio-devel@gnu.org). No major changes before release, please. Coordinate with libcdio-paranoia release ========================================= ... to be filled in Test ==== * Test on lots of platforms; gcc compile farm, for example. * `make distcheck` should work. * Look for/fix/apply [patches](https://savannah.gnu.org/patch/?group=libcdio) and [outstanding bugs](https://savannah.gnu.org/bugs/?group=libcdio) on Savannah GNU. Go over version number, Update Release notes ============================================= ``` $ make ChangeLog` ``` Go over `Changelog` and add to `NEWS`. Update date of release. Remove "git" from `configure.ac`'s release name. E.g. ``` define(RELEASE_NUM, 2.1.0) define(LIBCDIO_VERSION_STR, $11git) ^^^ ... ``` Update Documention ================== Make doxygen documentation: ``` $ (cd doc/doxygen; doxygen -u; ./run_doxygen) ``` remove any errors. Are sources up to date? ======================= Make sure sources are current and checked in: ``` $ git pull $ ./autogen.sh && make && make check ``` Bump release ============ The whole semantic versioning thing should have been decided on in advance ``` $ export LIBCDIO_VERSION=2.0.0 # adjust $ git commit -m"Get ready for release ${LIBCDIO_VERSION}" . ``` Push and tag release ==================== ``` $ make ChangeLog ``` Tag release in git: ``` $ git push $ git tag release-${LIBCDIO_VERSION} $ git push --tags ``` `make distcheck` one more time. Upload to ftp.gnu.org ===================== Get onto http://ftp.gnu.org. Use `gnupload` from the `automake` distribution. ``` $ locate gnupload $ /src/external-vcs/coreutils/build-aux/gnupload --to ftp.gnu.org:libcdio libcdio-${LIBCDIO_VERSION}.tar.* # (Use "is" password) ``` Update documentation ==================== Copy doxygen and html to web pages: ``` $ cd ../libcdio-www/doxygen $ rm *.html $ cp ../../libcdio/doc/doxygen/html/*.html . $ cvs update . ``` For each "U" html *except libcdio.html* that is put back, remove it with `rm` and then `cvs remove`. For example, put in file `/tmp/libcdio-remove.txt`. ``` $ rm `cat /tmp/libcdio-remove.txt` $ cvs remove `cat /tmp/libcdio-remove.txt` ``` For each new "?" html add it. For example, put in file `/tmp/libcdio-new.txt` and run: ``` $ cvs add `cat /tmp/libcdio-new.txt` $ cvs -m"Update for $LIBCDIO_VERSION release" commit . ``` copy libcdio manual to web page -------------------------------- ``` cd libcdio-www (cd ../libcdio/doc && make libcdio.html) cp ../libcdio/doc/libcdio.html . cvs commit -m"Update for $LIBCDIO_VERSION release" libcdio.html ``` Bump to git version =================== Bump version in `configure.ac` and add "git". See place above in removal. Let libcdio-devel know of release ================================= Again: [libcdio-devel mailing list](mailto://libcdio-devel@gnu.org). libcdio-2.2.0/doc/libcdio.texi000066400000000000000000003045011474051130400161670ustar00rootroot00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename libcdio.info @include version.texi @settitle GNU @code{libcdio}: Compact Disc Input, Output, and Control Library @c %**end of header @c Karl Berry informs me that this will add straight quotes in @c typewriter text. @c See the "Inserting Quote Characters" node in the Texinfo manual @set txicodequoteundirected @set txicodequotebacktick @copying This manual documents @code{libcdio}, the GNU CD Input, Output, and Control Library. Copyright @copyright{} 2003-2008, 2010, 2012-2014, 2025 Rocky Bernstein and Herbert Valerio Riedel. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end quotation @end copying @paragraphindent 0 @exampleindent 0 @set libcdio @code{libcdio} @set program @kbd{libcdio} @c A macro for defining terms variables. @macro term{varname} @c @cindex{\varname\} @emph{\varname\} @end macro @dircategory Software libraries @direntry * libcdio: (libcdio). GNU Compact Disc Input, Output, and Control Library. @end direntry @titlepage @title GNU @code{libcdio} @subtitle GNU Compact Disc Input, Output, and Control Library @subtitle for version @value{VERSION}, @value{UPDATED} @author Rocky Bernstein et al. (@email{bug-libcdio@@gnu.org}) @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top GNU @value{libcdio} @insertcopying @menu * History:: How this came about * Previous Work:: The problem and previous work * Purpose:: What is in this package (and what's not) * CD Formats:: A tour through the CD-specification spectrum * CD Image Formats:: A tour through various CD-image formats * CD Units:: The units that make up a CD * How to use:: Okay enough babble, lemme at the library! * Utility Programs:: Diagnostic programs that come with this library * CD-ROM Access and Drivers:: CD-ROM access and drivers * Internal Program Organization:: Looking under the hood Appendices * ISO-9660 Character Sets:: * Glossary:: * GNU Free Documentation License:: Indices * General Index:: Overall index @end menu @end ifnottex @node History @chapter History As a result of the repressive Digital Millennium Copyright Act, DMCA, I became aware of Video CD's (VCD's). Video CD's are not subject to the DMCA and therefore enjoy the protection afforded by copyright but no more. But in order for VCD's to be competitive with DVD's, good tools -- including GPL tools -- are needed for authoring and playing them. And so through VCD's, I became aware of the excellent Video CD tools by Herbert Valerio Riedel which form the @kbd{vcdimager} package. Although vcdimager is great for authoring, examining, and extracting parts of a Video CD, it is not a VCD player. And when I looked at the state of Video CD handling in existing VCD players: @code{xine}, @code{MPlayer}, and @code{vlc}, I was a bit disappointed. None handled playback control, menu selections, or playing still frames and segments from track 1. Version 0.7.12 of vcdimager was very impressive, however it lacked exportable libraries that could be used in other projects. So with the blessing and encouragement of Herbert Valerio Riedel, I took to extract and create libraries from this code base. The result was two libraries: one to extract information from a VCD which I called libvcdinfo, and another to do the reading and control of a VCD. Well, actually, at this point I should say that a Video CD is really just Video put on a existing well-established Compact Disc or CD format. So the library for this is called @value{libcdio} rather than @kbd{libvcdio}. While on the topic of the name @value{libcdio}, I should also explain that the library really doesn't handle writing or output (the final "o" in the name). However it was felt that if I put @code{libcdi} that might be confused with a particular CD format called CD-I. Later on, the ISO-9660 filesystem handling component from @kbd{vcdimager} was extracted, expanded and made a separate library. Next the ability to add MMC commands was added, and then CD paranoia support. And from there, the rest is history. @node Previous Work @chapter The problem and previous work If around the year 2002 you were to look at the code for a number of free software CD or media players that work on several platforms such as vlc, MPlayer, xine, or xmms to name but a few, you'd find the code to read a CD sprinkled with conditional compilation for this or that platform. That is there was @emph{no} OS-independent programmer library for CD reading and control even though the technology was over 10 years old; yet there are media players which strive for OS independence. One early CD player, @kbd{xmcd} by Ti Kan, was I think a bit better than most in that it tried to @emph{encapsulate} the kinds of CD control mechanisms, e.g.\ SCSI, Linux ioctl, Toshiba, in a "CD Audio Device Interface Library" called @code{libdi}. However this library is for Audio CD's only and I don't believe this library has been used outside of xmcd. Another project, Simple DirectMedia Layer also encapsulates CD reading. @quotation SDL is a library that allows you portable low-level access to a video framebuffer, audio output, mouse, and keyboard. With SDL, it is easy to write portable games which run on ... @end quotation Many of the media players mentioned above do in fact can make use of the SDL library but for @emph{video} output only. Because the encapsulation is over @emph{many} kinds of I/O (video, joysticks, mice, as well as CD's), I believe that the level of control provided for CD a little bit limited. (However to be fair, it may have only been intended for games and may be suitable for that). Applications that just want the CD reading and control portion I think will find quite a bit overhead. Another related project is J@"org Schilling's SCSI library. You can use that to make a non-SCSI CD-ROM act like one that understands SCSI MMC commands which is a neat thing to do. However it is a little weird to have to install drivers just so you can run a particular user-level program. Installing drivers often requires special privileges and permissions and it is pervasive on a system. It is a little sad that along the way to creating such a SCSI library a library similar to @value{libcdio} wasn't created which could be used. Were that the case, this library certainly never would have been written. At the OS level there is the ``A Linux CD-ROM Standard'' by David van Leeuwen from around 1999. This defines a set of definitions and ioctl's that mask hardware differences of various Compact Disc hardware. It is a great idea, however this ``standard'' lacked adoption on OS's other than GNU/Linux. Or maybe it's the case that the standard on other OS's lacked adoption on GNU/Linux. For example on FreeBSD there is a ``Common Access Method'' (CAM) used for all SCSI access which seems not to be adopted in GNU/Linux.@footnote{And I'm thankful for that since, at least for MMC commands, it is inordinately complicated and in some places arcane.} Finally at the hardware level where a similar chaos exists, there has been an attempt to do something similar with the MMC (multimedia commands). This attempts to provide a uniform command set for CD devices like PostScript does for printer commands.@footnote{I wrote ``attempts'' because over time the command set has changed and now there are several different commands to do a particular function like read a CD table of contents and some hardware understands some of the version of the commands set but might not others} In contrast to PostScript where there one in theory can write a PostScript program in a uniform ASCII representation and send that to a printer, for MMC although there are common internal structures defined, there is no common syntax for representing the structures or an OS-independent library or API for issuing MMC-commands which a programmer would need to use. Instead, each Operating System has its own interface. For example Adaptec's ASPI or Microsoft's DeviceIoControl on Microsoft Windows, or IOKit for Apple's OS/X, or FreeBSD's CAM. I've been positively awed at how many different variations and differing levels of complexity, there are for doing basically the same thing. The ease with which one can issue an MMC command from a program varies from easy to very difficult. And mastering the boilerplate code to issue an MMC command on one OS doesn't help much in figuring out how to do it on another OS. So in @value{libcdio} we provide a common (and hopefully simple) API to issue MMC commands. @node Purpose @chapter What is in this package (and what's not) The library, @command{libcdio}, encapsulates CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. Also included is a library, @command{libiso9660}, for working with ISO-9660 filesystems. Some support for disk-image types like cdrdao's TOC, CDRWIN's BIN/CUE and Ahead Nero's NRG format is available, so applications that use this library also have the ability to read disc images as though they were CDs. @command{libcdio} also provides a way to issue SCSI ``MultiMedia Commands'', MMC. MMC is supported by many hardware CD-ROM manufacturers; and in some cases where a CD-ROM doesn't understand MMC directly, some Operating Systems (such as GNU/Linux, Solaris, or FreeBSD or Microsoft Windows ASPI to name a few) provide the MMC emulation.@footnote{This concept of software emulation of a common hardware command language is common for printers such as using ghostscript to private postscript emulation for a non-postscript printer.} As a separate package under a separate GPL2 license are @command{libcdio_paranoia}, and @command{libcdio_cdda} libraries for applications which want to use cdparanoia's error-correction and jitter detection. The first use of the library in this package are the Video CD authoring and ripping tools, VCDImager (@url{http://vcdimager.org}). See @url{http://www.gnu.org/software/libcdio/projects.html} for a list of projects using @command{libcdio}. A version of the CD-DA extraction tool cdparanoia, @url{http://www.xiph.org/paranoia}, and its library which corrects for CD-ROM jitter are part of the distribution. Also included in the libcdio package is a utility program @command{cd-info} which displays CD information: number of tracks, CD-format and if possible basic information about the format. If libcddb (@url{http://libcddb.sourceforge.net}) is available, the @command{cd-info} program will display CDDB matches on CD-DA discs. And if a new enough version of libvcdinfo is available from the vcdimager project, then @command{cd-info} shows basic VCD information. Other utility programs in the libcdio package are: @table @code @item @code{cdda-player} shows off @value{libcdio} audio and CD-ROM control commands. It can play a track, eject or load media and show the the status of a CD-DA that is might be currently played via the audio control commands. It can be run in batch mode or has a simple curses-based interface. If libcddb is available or a CD has CD-Text and your CD-ROM drive supports CD-Text, track/album information about the CD can be shown. @item @code{cd-drive} shows what drivers are available and some basic properties of cd-drives attached to the system. Media may have to be inserted in order to get this info. The program also lists out drive capabilities @item cd-read performs low-level block reading of a CD or CD image @item @code{iso-info} displays ISO-9660 information from an ISO-9660 image. Below is a sample invocation and output. @smallexample $ iso-info -l test/data/joliet.iso iso-info version 2.1.1 x86_64-pc-linux-gnu Copyright (c) 2003-2005, 2007-2008, 2011-2015, 2017, 2025 R. Bernstein This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. __________________________________ ISO 9660 image: test/data/joliet.iso Application : K3B THE CD KREATOR VERSION 0.11.12 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM Preparer : K3b - Version 0.11.12 Publisher : Rocky Bernstein System : LINUX Volume : K3b data project Joliet Level: 3 __________________________________ ISO-9660 Information /: d [LSN 31] 2048 Oct 22 2004 18:44:59 . d [LSN 31] 2048 Oct 22 2004 18:44:59 .. d [LSN 32] 2048 Oct 22 2004 18:44:59 libcdio /libcdio/: d [LSN 32] 2048 Oct 22 2004 18:44:59 . d [LSN 31] 2048 Oct 22 2004 18:44:59 .. - [LSN 34] 17992 Mar 12 2004 02:18:03 COPYING - [LSN 43] 2156 Jun 26 2004 06:01:09 README - [LSN 45] 2849 Aug 12 2004 05:22:23 README.libcdio d [LSN 33] 2048 Oct 22 2004 18:44:59 test /libcdio/test/: d [LSN 33] 2048 Oct 22 2004 18:44:59 . d [LSN 32] 2048 Oct 22 2004 18:44:59 .. - [LSN 47] 74 Jul 25 2004 05:52:32 isofs-m1.cue @end smallexample @item @code{iso-read} Extracts files from an ISO-9660 image. Below is a sample invocation and output. @smallexample $ iso-read -i test/data/joliet.iso -e libcdio/README -o /tmp/README $ ls -l /tmp/README -rw-rw-r-- 1 rocky rocky 2156 Jan 4 10:30 /tmp/README @end smallexample @item @code{mmc-tool} a program for issuing some MMC commands @end table Historically, @code{libcdio} did not support write access to drives. In conjunction with additional work in a separate project @code{libburn}, Thomas Schmitt has modified @code{libcdio} to enable sending SCSI write commands on some of the drivers. This enables other programs like @code{libburn} to write to CD's, DVD's and Blu-Ray discs. For the OS drivers which are lacking write access, volunteers are welcome. @node CD Formats @chapter CD Formats Much of what I write in this section can be found elsewhere. See for example @url{http://www.pctechguide.com/08cd-rom.htm} or @url{http://www.pcguide.com/ref/cd/format.htm} We give just enough background here to cover Compact Discs and Compact Disc formats that are handled by this library. The Sony and Philips Corporations invented and Compact Disc (CD) in the early 1980s. The specifications for the layout is often referred to by the color of the cover on the specification. @menu * Red Book:: Red Book (CD-DA) CD Text, CDDB * Yellow Book:: Yellow Book (CD-ROM Digital Data) * Green Book:: Green Book (CD-i) * White Book:: White Book (DV, Video CD) @end menu @node Red Book @section Red Book (CD-DA) @cindex Red Book @menu * CD Text:: CD Text and CD+G * CDDB:: Internet CD Database (CDDB) @end menu The first type of CD that was produced was the Compact Disc Digital Audio (CD-DA) or just plain ``audio CD''. The specification, ICE 60908 (formerly IEC 908) is commonly called the ``Red Book'', @cite{@url{http://en.wikipedia.org/wiki/Red_Book_(audio_CD_standard)}}. Music CD's are recorded in this format which basically allows for around 74 minutes of audio per disc and for that information to be split up into tracks. Tracks are broken up into "sectors" and each sector contains up to 2,352 bytes. To play one 44.1 kHz CD-DA sampled audio second, 75 sectors are used. The minute/second/frame numbering of sectors or MSF format is based on the fact that 75 sectors are used in a second of playing of sound. (And for almost every other CD format and application the MSF format doesn't make that much sense). In @value{libcdio} when you you want to read an audio sector, you call @code{cdio_read_audio_sector()} or @code{cdio_read_audio_sectors()}. @cindex subchannel In addition the the audio data ``channel'' a provision for other information or @term{subchannel} information) can be stored in a sector. Other subchannels include a Media Catalog Number (also abbreviated as MCN and sometimes a UPC), or album meta data (also called CD-Text). Karioke graphics can also be stored in a format called @term{CD+G}. @node CD Text @subsection CD Text, CD+G @cindex CD Text @cindex CD+G CD Text is an extension to the CD-DA standard that adds the ability to album and track meta data (titles, artist/performer names, song titles) and graphical (e.g. Karaoke) information. For an alternative way to get album and track meta-data see @xref{CDDB}. Information is stored in such a way that it doesn't interfere with the normal operation of any CD players or CDROM drives. There are two different parts of the CD where the data can be stored. The first place the information can be recorded is in the R-W sub codes in the lead in area of the CD. This information is stored as a single block of data and is the format. The method for reading this data from a CDROM drive is covered under the Sony proposal to the MMC specification. The format of the data is partially covered in the MMC specification. CD Text information is stored in this area. The format that follows the Interactive Text Transmission System (ITTS) is the same data transmission standard used by such things as Digital Audio Broadcasting (DAB), and virtually the same as the data standard for the MiniDisc. The second place the information can be recorded is in the R-W sub codes in the program area of the CD giving a data capacity of roughly 31MB. CD+G (CD w/graphics) uses this method. The methods for reading this data from a CD-ROM drive were first covered by the programming specs from the individual drive manufacturers. In the case of ATAPI drives, the SFF8020 spec covers the reading of the RW subcodes. Subsequently it has been encorporated into the MMC specifications. Not all drives support reading the RW subcodes from the program area. However for those that do, @value{libcdio} provides a way to get at this information via @code{cdtext_get()} and its friends. There is a separate document in this distribution describing CD-Text information and how it is encoded. @node CDDB @subsection Internet CD Database (CDDB) @cindex CDDB CDDB is an database on the Internet of of CD album/track, artist, and genre information similar to CD Text information. Using track information (number of tracks and length of the tracks), devices that have access to the Internet can query for meta information and contribute information for CD's where there is no existing information. When storage is available (such as you'd expect for any program using @value{libcdio}, the information is often saved for later use when the Internet is not available; people tend request the same information since they via programs play the same music. Obtaining CD meta information when none is encoded in an audio CD is useful in media players or making one's own compilations from audio CDs. There are currently two popular CDDB services on the Internet. The original database has been renamed Gracenote and is a profit-making entity. GnuDB (@url{https://gnudb.org} is an open source CD information resource that is free for developers and the public to use. As there already is an excellent library for handling CDDB libcddb (@url{http://libcddb.sourceforge.net} we suggest using that. Our utility program @command{cd-info} will make use of it if it is available and it's what we use in our applications that need it. @node Yellow Book @section Yellow Book (CD-ROM Digital Data) The CD-ROM specification or the ``Yellow Book'' followed a few years later (Standards ISO/IEC 10149), and describes the extension of CD's to store computer data, i.e. CD-ROM (Compact Disk Read Only Memory). The specification in the Yellow Book defines two modes: Mode 1 and Mode 2. @menu * ISO 9660:: * Mode 1:: Mode 1 Format * Mode 2:: Mode 2 Format @end menu @node ISO 9660 @subsection ISO 9660 @cindex ISO 9660 @menu * ISO 9660 Level 1:: * ISO 9660 Level 2:: * ISO 9660 Level 3:: * Joliet Extensions:: * Rock Ridge Extensions:: @end menu The Yellow Book doesn't specify how data is to be stored on a CD-ROM. It was feared that different companies would implement proprietary data storage formats using this specification, resulting in incompatible data CDs. To prevent this, representatives of major manufacturers met at the High Sierra Hotel and Casino in Lake Tahoe, NV, in 1985, to define a standard for storing data on CDs. This format was nicknamed High Sierra Format. In a slightly modified form, it was later adopted as ISO the ISO 9660 standard. This standard is further broken down into 3 "levels", the higher the level, the more permissive. @node ISO 9660 Level 1 @subsubsection ISO 9660 Level 1 Level 1 ISO 9660 defines names in the 8+3 convention so familiar to MS-DOS: eight characters for the filename, a period, and then three characters for the file type, all in upper case. The allowed characters are A-Z, 0-9, ".", and "_".Level 1 ISO 9660 requires that files occupy a contiguous range of sectors. This allows a file to be specified with a start block and a count. The maximum directory depth is 8. For a table of the characters, see @xref{ISO-9660 Character Sets}. @node ISO 9660 Level 2 @subsubsection ISO 9660 Level 2 Level 2 ISO 9660 allows far more flexibility in filenames, but isn't usable on some systems, notably MS-DOS. @node ISO 9660 Level 3 @subsubsection ISO 9660 Level 3 Level 3 ISO-9660 allows non-contiguous files, useful if the file was written in multiple packets with packet-writing software. There have been extensions to the ISO 9660 CD-ROM file format. One extension is Microsoft's Joliet specification, designed to resolve a deficiencies in the original ISO 9660 Level 1 file system, and in particular to support the long file names used in Windows 95 and subsequent versions of Windows. Another extension is the Rock Ridge Interchange Protocol (RRIP), which enables the recording of sufficient information to support POSIX File System semantics. @node Joliet Extensions @subsubsection Joliet Extensions @cindex Joliet extensions Joliet extensions were an upward-compatible extension to the ISO 9660 specification that removes the limitation initially put in to deal with the limited filename conventions found in Microsoft DOS OS. In particular, the Joliet specification allows for long filenames and allows for UCS-BE (BigEndian Unicode) encoding of filenames which include mixed case letters, accented characters, spaces, and various symbols. The way all of this is encoded is by adding a second directory and filesystem structure in addition to or in parallel to the original ISO 9600 filesystem. The root node of the ISO 9660 filesystem is found via the @term{Primary Volume Descriptor} or @term{PVD}. The root of the Joliet-encode filesystem is found in a Supplementary Volume Descriptor or @term{SVD} defined in the ISO 9660 specification. The SVD structure is almost identical to a PVD with a couple of unused fields getting used and with the filename encoding changed to UCS-BE. @node Rock Ridge Extensions @subsubsection Rock Ridge Extensions @cindex Rock Ridge extensions Using the Joliet Extension one overcomes the limitedness of the original ISO-9660 naming scheme. But another and probably better method is to use the Rock Ridge Extension. Not only can one store a filename as one does in a POSIX OS, but the other file attributes, such as the various timestamps (creation, modification, access), file attributes (user, group, file mode permissions, device type, symbolic links) can be stored. This is much as one would do in XA attributes; however, the two are not completely interchangeable in the information they store: XA does @emph{not} address filename limitations, and the Rock Ridge extensions don't indicate if a sector is in Mode 1 or Mode 2 format. The Rock Ridge extension makes use of a hook that was defined as part of the ISO 9660 standard. @node Mode 1 @subsection Mode 1 (2048 data bytes per sector) @cindex Mode 1 Mode 1 is the data storage mode used to store computer data. There are 3 layers of error correction. A Compact Disc using only this format can hold at most 650 MB. The data is laid out in basically the same way as in an audio CD format, except that the 2,352 bytes of data in each block are broken down further. 2,048 of these bytes are for ``real'' data. The other 304 bytes are used for an additional level of error-detecting and correcting code. This is necessary because data CDs cannot tolerate the loss of a handful of bits now and then, the way audio CDs can. In @value{libcdio} when you you want to read a mode1 sector you call the @code{cdio_read_mode1_sector()} or @code{cdio_read_mode1_sectors()}. @node Mode 2 @subsection Mode 2 (2336 data bytes per sector) @cindex Mode 2 Mode 2 data CDs are the same as mode 1 CDs except that the error-detecting and correcting codes are omitted. So still there are 2 layers of error correction. A Compact Disc using only this mode can thus hold at most 742 MB. Similar to audio CDs, the mode 2 format provides a more flexible vehicle for storing types of data that do not require high data integrity: for example, graphics and video can use this format. But in contrast to the Red Book standard, different modes can be mixed; this is the basis for the extensions to the original data CD standards known as CD-ROM Extended Architecture, or CD-ROM XA. CD-ROM XA formats currently in use are CD-I Bridge formats, Photo CD, Video CD, and Sony's PlayStation. In @value{libcdio} when you you want to read a mode1 sector you call the @code{cdio_read_mode2_sector()} or @code{cdio_read_mode2_sectors()}. @node Green Book @section Green Book (CD-i) @cindex Green Book This was a CD-ROM format developed by Philips for CD-i (an obsolete embedded CD-ROM application allowing limited user interaction with films, games, and educational applications). The format is ISO 9660 compliant and introduced mode 2 form 2 addressing. It also contains XA (Extended Architecture) attributes. Although some Green Book discs contain CD-i applications that can only be played on a CD-i player, others have films or music videos. Video CDs in Green-Book format are labeled "Digital Video on CD." The Green Book for video is largely superseded by the White book CD-ROM which draws on this specification. @node White Book @section White Book (DV, Video CD) @cindex Green Book The White Book was released by Sony, Philips, Matsushita, and JVC in 1993, defines the Video CD specification. The White Book is also known as Digital Video (DV). A Video CD contains one data track recorded in CD-ROM XA Mode 2 Form 2. It is always the first track on the disc (Track 1). The ISO-9660 file structure and a CD-i application program are recorded in this track, as well as the Video CD Information Area which gives general information about the Video Compact Disc. After the data track, the video is written in one or more subsequent tracks within the same session. These tracks are also recorded in Mode 2 Form 2. In @value{libcdio} when you you want to read a mode2 format 2 audio sector you call the @code{cdio_read_mode2_sector()} or @code{cdio_read_mode2_sectors()} setting @code{b_form2} to @code{true}. @node CD Image Formats @chapter CD Image Formats @menu * CDRDAO TOC Format:: * CDRWIN BIN/CUE Format:: * NRG Format:: @end menu In both the @command{cdrdao} and bin/cue formats there is one meta-file with extensions @code{.toc} or @code{.cue} respectively and one or more files (often with the extension @code{.bin}) which contain the content of tracks. The format of the track data is often interchangeable between the two formats. For example, in @value{libcdio}'s regression tests we make use of this to reduce the size of the test data and just provide alternate meta-data files (@code{.toc} or @code{.cue}). In contrast to the first two formats, the NRG format consists of a single file. This has the advantage of being a self-contained unit: in the other two formats the meta file can refer to a file that can't be found. A disadvantage of the NRG format is that the metadata can't be easily viewed or modified say in a text file as it can be with the first two formats. In conjunction with this disadvantage is another disadvantage that the format is not documented, so how @value{libcdio} interprets an NRG image is based on inference. It is recommended that one of the other forms be used instead of NRG where possible. @node CDRDAO TOC Format @section CDRDAO TOC Format This is @command{cdrdao}'s CD-image description format. Since this program is GPL and everything about it is in the open, it is the preferred format to use. (Alas, at present it isn't as well supported in @value{libcdio} as the BIN/CUE format.) The @emph{toc}-file describes what data is written to the media in the @acronym{CD-ROM}; it allows control over track/index positions, pre-gaps, and sub-channel information. It is a text file, so a text editor can be used to create, view, or modify it. The @cite{cdrdao(1) manual page}, contains more information about this format. @subsection CDRDAO Grammar Below are the lexical tokens and grammar for a cdrdao TOC. It was taken from the cdrdao's pacct grammar; the token and nonterminal names are the same. @example #lexclass START #token Eof "@@" #token "[\t\r\ ]+" #token Comment "//~[\n@@]*" #token "\n" #token BeginString "\"" #token Integer "[0-9]+" #tokclass AudioFile @{ "AUDIOFILE" "FILE" @} #lexclass STRING #token EndString "\"" #token StringQuote "\\\"" #token StringOctal "\\[0-9][0-9][0-9]" #token String "\\" #token String "[ ]+" #token String "~[\\\n\"\t ]*" @end example @example ::= ( "CATALOG" | )* @{ @} ( )+ Eof ::= "TRACK" @{ @} ( "ISRC" | @{ "NO" @} "COPY" | @{ "NO" @} "PRE_EMPHASIS" | "TWO_CHANNEL_AUDIO" | "FOUR_CHANNEL_AUDIO" )* @{ @} @{ "PREGAP" @} ( | "START" @{ msf @} | "END" @{ msf @} )+ ( "INDEX" )* ::= AudioFile @{ "SWAP" @} @{ "#" @} | "DATAFILE" @{ "#" @{ @} @} | "FIFO" | "SILENCE" | "ZERO" @{ dataMode @} @{ @} ::= BeginString ( String | StringQuote | StringOctal )+ EndString ::= BeginString ( String | StringQuote | StringOctal )* EndString ::= Integer ::= Integer ::= Integer ":" Integer ":" Integer ::= | ::= | ::= "AUDIO" | "MODE0" | "MODE1" | "MODE1_RAW" | "MODE2" | "MODE2_RAW" | "MODE2_FORM1" | "MODE2_FORM2" | "MODE2_FORM_MIX" ::= "AUDIO" | "MODE1" | "MODE1_RAW" | "MODE2" | "MODE2_RAW" | "MODE2_FORM1" | "MODE2_FORM2" | "MODE2_FORM_MIX" ::= "RW" | "RW_RAW" ::= "CD_DA" | "CD_ROM" | "CD_ROM_XA" | "CD_I" ::= "TITLE" | "PERFORMER" | "SONGWRITER" | "COMPOSER" | "ARRANGER" | "MESSAGE" | "DISC_ID" | "GENRE" | "TOC_INFO1" | "TOC_INFO2" | "RESERVED1" | "RESERVED2" | "RESERVED3" | "RESERVED4" | "UPC_EAN" | "ISRC" | "SIZE_INFO" ::= "@{" @{ Integer ( "," Integer )* @} "@}" ::= ( | ) ::= "LANGUAGE" Integer "@{" ( )* "@}" ::= "LANGUAGE_MAP" "@{" ( Integer ":" ( Integer | "EN" ) )+ "@}" ::= "CD_TEXT" "@{" ( )* "@}" ::= "CD_TEXT" "@{" @{ @} ( )* "@}" @end example @node CDRWIN BIN/CUE Format @section CDRWIN BIN/CUE Format @cindex BIN/CUE, CD Image Format The format referred to as @emph{CDRWIN BIN/CUE Format} in this manual is a popular CD image format used in the @acronym{PC} world. Not unlike @command{cdrdao}'s TOC file, the @emph{cue} file describes the track layout, i.e. how the sectors are to be placed on the CD media. The @emph{cue} file usually contains a reference to a file traditionally having the @file{.bin} extension in its filename, the @emph{bin} file. This @emph{bin} file contains the sector data payload which is to be written to the CD medium according to the description in the @emph{cue} file. The following is an attempt to describe the subset of the @file{.cue} file syntax used in @value{libcdio} and vcdimager in an EBNF-like notation: @subsection BIN/CUE Grammar @example @cartouche ::= +( + ) ::= "0" | "1" ... "8" | "9" ::= + ::= ":" ":" ::= "FILE" ::= [ "\"" ] [ "\"" ] | "\"" "\"" ::= "BINARY" ::= [ ] [ ] * [ ] ::= "FLAGS" * ::= "DCP" ::= "TRACK" ::= "PREGAP" ::= "INDEX" ::= "POSTGAP" ::= "AUDIO" | "MODE1/2048" | "MODE1/2352" | "MODE2/2336" | "MODE2/2352" ::= "REM" * @end cartouche @end example @node NRG Format @section NRG Format @cindex Nero NRG, CD-Image format The format referred to as @emph{NRG Format} in this manual is another popular CD image format. It is available only on Nero software on a Microsoft Windows Operating System. It is proprietary and not generally published, so the information we have comes from guessing based on sample CD images. So support for this is incomplete and using this format is not recommended. Unlike @command{cdrdao}'s TOC file the BIN/CUE format everything is contained in one file that one can edit. Meta information such as the number of tracks and track format is contained at the end of the file. This information is not intended to be edited through a text editor. @node CD Units @chapter The units that make up a CD @menu * Tracks:: Tracks * Sectors:: Block addressing (MSF, LSN, LBA) * Pre-gaps:: Track pre-gaps @end menu @node Tracks @section tracks --- disc subdivisions @cindex track @cindex gaps In this section, we describe CD properties and terms that we make use of in @value{libcdio}. A CD is formatted into a number of @term{tracks}, and a CD can hold at most 99 such tracks. This is defined by @code{CDIO_CD_MAX_TRACKS} in @file{cdio/sector.h}. Between some tracks CD specifications require a ``2 second'' in gap (called a @term{lead-in gap}. This is unused space with no ``data'' similar to the space between tracks on an old phonograph. The word ``second'' here really refers to a measure of space and not really necessarily an amount of time. However in the special case that the CD encodes an audio CD or CD-DA, the amount of time to play a gap of this size will take 2 seconds. @cindex lead out The beginning (or inner edge) of the CD is supposed to have a ``2 second'' lead-in gap and there is supposed to be another ``2 second'' @term{lead-out} gap at the end (or outer edge) of the CD. People have discovered that they can put useful data in the @term{lead-in} and @term{lead-out} gaps and their equipment can read this, violating the standards but allowing a CD to store more data. To determine the number of tracks on a CD and where they start, commands are used to get this table-of-contents or @term{TOC} information. Asking about the start of the @term{lead-out track} gives the amount of data stored on the Compact Disk. To make it easy to specify this leadout track, a special constant 0xAA (decimal 170) is used to indicate it. This is safe since this is higher than the largest legal track position. In @value{libcdio}, @code{CDIO_CDROM_LEADOUT_TRACK} is defined to be this special value. @node Sectors @section block addressing (MSF, LSN, LBA) @cindex MSF @cindex LSN @cindex LBA @cindex sectors @cindex frames A track is broken up into several 2352-byte @emph{blocks} which we sometimes call @emph{sectors} or @emph{frames}. Whereas tracks may have a gap between them, a block or sector does not. (In @value{libcdio} the block size constant is defined using @code{CDIO_CD_FRAMESIZE_RAW}). A Compact Disc has a limit on the number of blocks or sectors. This value is defined by constant @code{CDIO_CD_MAX_LSN} in @file{cdio/sector.h}. One can address a block in one of three formats. The oldest format is by its minute/second/frame number, also referred to as @term{MSF} and written in time-like format MM:SS:FF (e.g. 30:01:40). It is best suited in audio (Red Book) applications. In @value{libcdio}, the type @code{msf_t} can be used to declare variables to hold such values. Minute, second, and frame values are one byte @emph{and stored BCD notation}.@footnote{Perhaps this is a @value{libcdio} design flaw. It was originally done I guess because it was convenient for VCDs.} There are @value{libcdio} conversion routines @code{cdio_from_bcd8()} and @code{cdio_to_bcd8()} to convert the minute, second, and frame values into or out of integers. If you want to print a field in a BCD-encoded MSF, one can use the format specifier @code{%x} @emph{(not @code{%d})} and things will come out right. In the MSF notation, there are 75 ``frames'' in a ``second,'' and the familiar (if awkward) 60 seconds in a minute. @emph{Frame} here is what we called a @emph{block} above. The CD specification defines ``frame'' to be @emph{another} unit which makes up a block. Very confusing. A frame is also sometimes called a sector, analogous to hard-disk terminology. Even more confusing is using this time-like notation for an address or a length. Too often people confuse the MSF notation with an amount of time. A ``second'' (or @code{CDIO_CD_FRAMES_PER_SEC} blocks) in this notation is only a second of playing time for something encoded as CD-DA. It does @emph{not} necessarily represent the amount of time that it will take to play a Video CD---usually, you need more blocks than this. Nor does it represent the amount of data used to play a second of an MP3---usually you need fewer blocks than this. It is also not the amount of time your CD-ROM will take to read a ``second'' of data off a Compact Disc: for example a 12x CD player will read 12x @code{CDIO_CD_FRAMES_PER_SEC} @code{CDIO_CD_FRAMSIZE_RAW}-byte blocks in one second. When programming, unless one is working with a CD-DA (and even here, only in a time-like fashion), is generally more cumbersome to use an MSF rather than an LBA or LSN described below, since the subtraction of two MSF's have an awkwardness akin to subtraction using Roman Numerals. A simpler way to address a block is to use a ``Logical Sector Number'' (@term{LSN}) or a ``Logical Block Address (@term{LBA}). In the MMC-6 glossary, these are synonymous terms. However, historically it has been used differently. In libcdio, to convert an LBA into an LSN you subtract 150. Both LBA's and LSN's can be negative. @node Pre-gaps @section track pre-gaps -- @acronym{CD-DA} discs and gaps @cindex CD-DA @cindex gaps @cindex lead in @cindex lead out @cindex pre-gap @cindex Q sub-channel Gaps are possibly one of the least understood topics in audio discs. In the case of @acronym{CD-DA} discs, standards require a silent 2 second gap before the first audio track and after the last audio track (in each session.) These are respectively referred to as @term{lead-in} and @term{lead-out} gaps. No other gaps are required. It is important not to confuse the required @term{lead-in} and @term{lead-out} gaps with the optional track @term{pre-gap}s. Track @term{pre-gap}s are the gaps that may occur between audio tracks. Typically, track @term{pre-gap}s are filled with silence so that the listener knows that one song has ended, and the next will soon begin. However, track @term{pre-gap}s do not have to contain silence. One exception is an audio disc of a live performance. Because the performer may seamlessly move from one piece of the performance to the next, it would be unnatural for the disc to contain silence between the two pieces. Instead, the track number updates with no interruption in the performance. This allows the listener to either hear the entire performance without unnatural interruptions or to conveniently skip to certain pieces of the performance. Finally, some @acronym{CD-DA} discs--whose behavior will be described below--lack track @term{pre-gap}s altogether although they must still include the @term{lead-in} and @term{lead-out} gaps. To understand the track @term{pre-gap}s that occur between audio tracks, it is necessary to understand how CD players display the track number and time. Embedded in each block of audio data is non-audio information known as the @term{Q sub-channel}. The @term{Q sub-channel} data tells the CD player what track number and time it should display while it is playing the block of audio data in which the @term{Q sub-channel} data is embedded. Near the end of some tracks, the @term{Q sub-channel} may instruct the CD player to update the track number to the next track and display a count down to the next track, often starting at -2 seconds and proceeding to zero. This is known as an audio track @term{pre-gap}. It may either contain silence, or as previously discussed--in the case of live performances--it may contain audio. Almost as often as not, there is no @term{pre-gap} whatsoever. Regardless, an audio track @term{pre-gap} is purely determined by the contents of the @term{Q sub-channel}, which is embedded in each audio sector. This has some interesting implications for the track forward button. When the track forward button is pressed on a CD player, the CD player advances to the next track, skipping that track's @term{pre-gap}. This is because the CD player uses the starting address of the track from the disc's table of contents (TOC) to determine where to start playing a track when either the track forward or track backward buttons are pressed. So to hear a @term{pre-gap} for track 4, the listener must either listen to track 3 first, or use the track forward or backward buttons to go to track 4, then use the seek backward button to back up into track 4's @term{pre-gap}, which is really part of track 3, at least according to the TOC. Track 1 @term{pre-gap}s are especially interesting because some commercial discs have audio hidden before the beginning of the first track! The only way to hear this hidden audio with a standard player is to use the seek backward button as soon as track 1 begins playing! Audio track @term{pre-gap}s may be specified in a couple of different ways in the popular cue file format. The first way of specifying a @term{pre-gap} is to use the @command{PREGAP} command. This will place a @term{pre-gap} containing silence before a track. The second way of specifying a @term{pre-gap} is to give a track an @command{INDEX 00} as well as the more normal @command{INDEX 01}. @command{INDEX 01} will be used to specify the start of the track in the disc's TOC, while @command{INDEX 00} will be used to specify the start of the track's @term{pre-gap} as recorded in the @term{Q sub-channel}. @command{INDEX 00} is ordinarily used for specifying track @term{pre-gap}s that contain audio rather than silence. Thus, the cue file format may be used to specify track @term{pre-gap}s with silence or audio, depending on whether the @command{PREGAP} or @command{INDEX 00} commands are specified. If neither type of @term{pre-gap} is specified for a track, no @term{pre-gap} is created for that track, which merely means the absence of @term{pre-gap} information in the @term{Q sub-channel}, and the lack of a short count down to the next track. Various @acronym{CD-DA} ripping programs take various approaches to track @term{pre-gap}s. Some ripping programs ignore track @term{pre-gap}s altogether, relying solely on the disc's TOC to determine where tracks begin and end. If a disc is ripped with such a program, then re-burned later, the resulting disc will lack track @term{pre-gap}s, and thereby lack the playback behavior of counting down to the next track. Other ripping programs detect track @term{pre-gap}s and record them in the popular cue file format among others. Such ripping programs sometimes allow the user to determine whether track @term{pre-gap}s will be appended to the prior track or pre-pended to the track to which they "belong". Note that if a ripping program is ignorant of track @term{pre-gap}s, the track @term{pre-gap}s will be appended to the prior track, because that is where the disc's TOC puts them. Thus, there are many different ways an application may chose to deal with track @term{pre-gap}s. Consequently, @kbd{libcdio} does not dictate the policy a ripping program should use in dealing with track @term{pre-gap}s. Hence, @kbd{libcdio} provides the @code{cdio_get_track_pregap_[lba|lsn]()} interfaces to allow the application to deal with track @term{pre-gap}s as it sees fit. Note that the @code{cdio_get_track_pregap_[lba|lsn]()} interfaces currently only provide information for CDRDAO TOC, CDRWIN BIN/CUE, and NRG images. Getting the track @term{pre-gap}s from a CD drive is a more complicated problem because not all CD drives support reading the @term{Q sub-channel} @emph{directly} at @emph{high} speed, and there is no interface to determine whether or not a drive supports this optional feature, aside from trying to read the @term{Q sub-channel}, and possibly incurring IO errors. However, all drives @emph{do} support reading the @term{Q sub-channel} @emph{indirectly} while playing an audio disc by asking the drive for the current position. Unfortunately, this occurs at normal playback speed, and requires a certain settling time after the disc starts playing. Thus, using this @emph{slow} interface requires a more sophisticated algorithm, such as binary search or some heuristic, like backing up progressively from the end of the prior track to look for the next track's @term{pre-gap}. Note that CD drives seek @emph{slow}ly, so it is better to simply use a drive that can read the @term{Q sub-channel} directly at @emph{high} speed, and avoid complicated software solutions. (Not to mention that if the user has an older system with an analog audio cable hooked up between their soundboard and their drive, and a ripping program uses the @emph{slow} interface, the user will hear bits of the audio on the disc!) Consequently, because there is no good universal solution to the problem of reading the @term{Q sub-channel} from a drive, @kbd{libcdio} currently leaves this problem up to the application, a problem which is readily approachable through either @kbd{libcdio}'s MMC interface or @kbd{libcdio}'s cdda interface. For an example of one such application, see @url{https://gna.org/projects/cued/}. The preceding section on track @term{pre-gaps} and @acronym{CD-DA} was contributed by Robert William Fuller (@email{hydrologiccycle@@gmail.com}). @node How to use @chapter How to use The @value{libcdio} package comes with several small example programs in the directory @file{example} which demonstrate different aspects of the library and show how to use the library. The source code for all of the examples here is contained in the package. Other sources for example would be the larger utility programs @command{cd-drive}, @command{cd-info}, @command{cd-read}, @command{iso-info}, and @command{iso-read} which are all in the @file{src} directory of the @value{libcdio} package. See also @xref{Utility Programs}. @menu * Include problem:: A note about including * Example 1:: list out tracks and LSNs * Example 2:: list drivers available and default CD device * Example 3:: figure out what kind of CD (image) we've got * Example 4:: use libiso9660 to extract a file from an ISO-9660 image * Example 5:: list CD-Text and CD disc mode info * Example 6:: run a MMC INQUIRY command * Example 7:: using the CD Paranoia library for CD-DA reading * Example 8:: Setting output verbosity * All sample programs:: list of all programs in the example directory @end menu @node Include problem @section A note about including @code{} libcdio installs @code{}. This file contains all of the C Preprocessor values from @code{config.h} (created by configure). This header can be used to consult exactly how libcdio was built. Initially I had selected ``interesting'' values, but this became too hard to maintain. One set of values that libdio needs internally is the whether the CPU that was used to compile libcdio is BigEndian or not; it can get this from libcdio's @code{config.h} which is not installed and preferred or @code{cdio/cdio_config.h}. Some of the libcdio programs like the demo programs include @code{config.h} for the generic reasons that the configuration-created @code{config.h} file is used: to figure out what headers are available. For example, do we have @code{}? The file @code{config.h} is generated by an autotools-generated @code{configure} script. It doesn't check to see if it has been included previously. Later, the demo programs include @code{} to get libcdio headers. But because libcdio needs some of the same information like the BigEndian value, this creates a duplicate include. The way I get around this in the demo programs is by defining @code{__CDIO_CONFIG_H__} after including @code{config.h} as follows: @smallexample #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif @end smallexample Applications using libcdio may find it handy to do something like this as well. Defining @code{__CDIO_CONFIG_H__} will make sure @code{config_cdio.h} which is internally used, doesn't try to redefine preprocessor symbols. Ok. But now what about the problem that there are common preprocessor symbols in @code{config_cdio.h} that an application may want to define in a different manner, like @code{PACKAGE_NAME}? For this, there is yet another header, @code{}. This file undefines any symbol that @code{config.h} defines. And now we bounce to the problem that there may be symbols that are normally defined (@code{HAVE_UNISTD_H}) and you want to keep that way, but others that you don't. So here is what I suggest: @smallexample // for cdio: #include #include # remove *all* symbols libcdio defines // Add back in the ones you want your program #include @end smallexample The solution isn't the most simple or natural, but programming sometimes can be difficult. If someone has a better solution, let me know. Between header files @code{cdio_config.h} and @code{cdio_unconfig.h} and all the fact that almost all headers@footnote{@code{} is one of the few headers that doesn't set a preprocessor symbol: it does its thing every time it is @code{#included}} define a symbol to indicate they have been included, I think there is enough mechanism to cover most situations that may arise. @node Example 1 @section Example 1: list out tracks and LSNs Here we will give an annotated example which can be found in the distribution as @file{example/tracks.c}. @smallexample 1: #include 2: #include 3: #include 4: int 5: main(int argc, const char *argv[]) 6: @{ 7: CdIo_t *p_cdio = cdio_open ("/dev/cdrom", DRIVER_DEVICE); 8: track_t first_track_num = cdio_get_first_track_num(p_cdio); 9: track_t i_tracks = cdio_get_num_tracks(p_cdio); 10: int j, i=first_track_num; 11: 12: printf("CD-ROM Track List (%i - %i)\n", first_track_num, i_first_track+i_tracks-1); 13 14: printf(" #: LSN\n"); 15: 16: for (j = 0; j < i_tracks; i++, j++) @{ 17: lsn_t lsn = cdio_get_track_lsn(p_cdio, i); 18: if (CDIO_INVALID_LSN != lsn) 19: printf("%3d: %06d\n", (int) i, (long unsigned int) lsn); 20: @} 21: printf("%3X: %06d leadout\n", CDIO_CDROM_LEADOUT_TRACK, 22: (long unsigned int) cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK)); 23: cdio_destroy(p_cdio); 24: return 0; 25: @} @end smallexample Already from the beginning on line 2 we see something odd. The @code{#include } is needed because @value{libcdio} assumes type definitions exist for @code{uint32_t}, @code{uint16_t} and so on. Alternatively you change line 2 to: @smallexample #define HAVE_SYS_TYPES_H @end smallexample and @code{} will insert line 2. If you use GNU autoconf to configure your program, add @code{sys/types.h} to @code{AC_HAVE_HEADERS} and @emph{it} will arrange for @code{HAVE_SYS_TYPES_H} to get defined. If you don't have @code{} but have some other include that defines these types, put that instead of line 2. Or you could roll your own typedefs. (Note: In the future, this will probably get ``fixed'' by requiring glib.h.) Okay after getting over the hurdle of line 2, the next line pretty straightforward: you need to include this to get cdio definitions. One of the types that is defined via line 3 is @code{CdIo_t} and a pointer that is used pretty much in all operations. Line 6 initializes the variable @code{cdio} which we will be using in all of the subsequent libcdio calls. It does this via a call to @code{cdio_open()}. The second parameter of @code{cdio_open} is DRIVER_UNKNOWN. For any given installation a number of Compact Disc device drivers may be available. In particular it's not uncommon to have several drivers that can read CD disk-image formats as well as a driver that handles some CD-ROM piece of hardware. Using DRIVER_UNKNOWN as that second parameter we let the library select a driver amongst those that are available; generally the first hardware driver that is available is the one selected. If there is no CD in any of the CD-ROM drives or one does not have access to the CD-ROM, it is possible that @value{libcdio} will find a CD image in the directory you run this program and will pick a suitable CD-image driver. If this is not what you want, but always want some sort of CD-ROM driver (or failure if none), then use DRIVER_DEVICE instead of DRIVER_UNKNOWN. Note that in contrast to what is typically done using ioctls to read a CD, you don't issue any sort of CD-ROM read TOC command---that is all done by the driver. Of course, the information that you get from reading the TOC is often desired: many tracks are on the CD, or what number the first one is called. This is done through calls on lines 8 and 9. For each track, we call a cdio routine to get the logical sector number, @code{cdio_get_track_lsn()} on line 17 and print the track number and LSN value. Finally, we print out the ``lead-out track'' information and we finally call @code{cdio_destroy()} in line 23 to indicate we're done with the CD. @node Example 2 @section Example 2: list drivers available and default CD device One thing that's a bit hockey in Example 1 is hard-coding the name of the device used: @code{/dev/cdrom}. Although often this is the name of a CD-ROM device on GNU/Linux and possibly some other Unix derivatives, there are many OSs for which use a different device name. In the next example, we'll let the driver give us the name of the CD-ROM device that is right for it. @smallexample 1: #include 2: #include 3: #include 4: int 5: main(int argc, const char *argv[]) 6: @{ 7: CdIo_t *p_cdio = cdio_open (NULL, DRIVER_DEVICE); 8: const driver_id_t *driver_id_p; 9: 10: if (NULL != p_cdio) @{ 11: printf("The driver selected is %s\n", cdio_get_driver_name(p_cdio)); 12: printf("The default device for this driver is %s\n\n", 13: cdio_get_default_device(p_cdio)); 14: cdio_destroy(p_cdio); 15: @} else @{ 16: printf("Problem in trying to find a driver.\n\n"); 17: @} 18: 19: for (driver_id_p=cdio_drivers; *driver_id_p!=DRIVER_UNKNOWN; driver_id_p++) 20: if (cdio_have_driver(*driver_id_p)) 21: printf("We have: %s\n", cdio_driver_describe(*driver_id_p)); 22: else 23: printf("We don't have: %s\n", cdio_driver_describe(*driver_id_p)); 24: return 0; 25: @} @end smallexample @node Example 3 @section Example 3: figure out what kind of CD (image) we've got In this example is a somewhat simplified program to show the use of @command{cdio_guess_cd_type()} to figure out the kind of CD image we've got. This can be found in the distribution as @file{example/sample3.c}. @smallexample #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include static void print_analysis(cdio_iso_analysis_t cdio_iso_analysis, cdio_fs_anal_t fs, int first_data, unsigned int num_audio, track_t i_tracks, track_t first_track_num, CdIo_t *cdio) @{ switch(CDIO_FSTYPE(fs)) @{ case CDIO_FS_AUDIO: break; case CDIO_FS_ISO_9660: printf("CD-ROM with ISO 9660 filesystem"); if (fs & CDIO_FS_ANAL_JOLIET) @{ printf(" and joliet extension level %d", cdio_iso_analysis.joliet_level); @} if (fs & CDIO_FS_ANAL_ROCKRIDGE) printf(" and rockridge extensions"); printf("\n"); break; case CDIO_FS_ISO_9660_INTERACTIVE: printf("CD-ROM with CD-RTOS and ISO 9660 filesystem\n"); break; case CDIO_FS_HIGH_SIERRA: printf("CD-ROM with High Sierra filesystem\n"); break; case CDIO_FS_INTERACTIVE: printf("CD-Interactive%s\n", num_audio > 0 ? "/Ready" : ""); break; case CDIO_FS_HFS: printf("CD-ROM with Macintosh HFS\n"); break; case CDIO_FS_ISO_HFS: printf("CD-ROM with both Macintosh HFS and ISO 9660 filesystem\n"); break; case CDIO_FS_UFS: printf("CD-ROM with Unix UFS\n"); break; case CDIO_FS_EXT2: printf("CD-ROM with Linux second extended filesystem\n"); break; case CDIO_FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); break; case CDIO_FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; @} switch(CDIO_FSTYPE(fs)) @{ case CDIO_FS_ISO_9660: case CDIO_FS_ISO_9660_INTERACTIVE: case CDIO_FS_ISO_HFS: printf("ISO 9660: %i blocks, label `%.32s'\n", cdio_iso_analysis.isofs_size, cdio_iso_analysis.iso_label); break; @} if (first_data == 1 && num_audio > 0) printf("mixed mode CD "); if (fs & CDIO_FS_ANAL_XA) printf("XA sectors "); if (fs & CDIO_FS_ANAL_MULTISESSION) printf("Multisession"); if (fs & CDIO_FS_ANAL_HIDDEN_TRACK) printf("Hidden Track "); if (fs & CDIO_FS_ANAL_PHOTO_CD) printf("%sPhoto CD ", num_audio > 0 ? " Portfolio " : ""); if (fs & CDIO_FS_ANAL_CDTV) printf("Commodore CDTV "); if (first_data > 1) printf("CD-Plus/Extra "); if (fs & CDIO_FS_ANAL_BOOTABLE) printf("bootable CD "); if (fs & CDIO_FS_ANAL_VIDEOCD && num_audio == 0) @{ printf("Video CD "); @} if (fs & CDIO_FS_ANAL_SVCD) printf("Super Video CD (SVCD) or Chaoji Video CD (CVD)"); if (fs & CDIO_FS_ANAL_CVD) printf("Chaoji Video CD (CVD)"); printf("\n"); @} int main(int argc, const char *argv[]) @{ CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); cdio_fs_anal_t fs=0; track_t i_tracks; track_t first_track_num; lsn_t start_track; /* first sector of track */ lsn_t data_start =0; /* start of data area */ int first_data = -1; /* # of first data track */ int first_audio = -1; /* # of first audio track */ unsigned int num_data = 0; /* # of data tracks */ unsigned int num_audio = 0; /* # of audio tracks */ unsigned int i; if (NULL == p_cdio) @{ printf("Problem in trying to find a driver.\n\n"); return 1; @} first_track_num = cdio_get_first_track_num(p_cdio); i_tracks = cdio_get_num_tracks(p_cdio); /* Count the number of data and audio tracks. */ for (i = first_track_num; i <= i_tracks; i++) @{ if (TRACK_FORMAT_AUDIO == cdio_get_track_format(p_cdio, i)) @{ num_audio++; if (-1 == first_audio) first_audio = i; @} else @{ num_data++; if (-1 == first_data) first_data = i; @} @} /* try to find out what sort of CD we have */ if (0 == num_data) @{ printf("Audio CD\n"); @} else @{ /* we have data track(s) */ int j; cdio_iso_analysis_t cdio_iso_analysis; memset(&cdio_iso_analysis, 0, sizeof(cdio_iso_analysis)); for (j = 2, i = first_data; i <= i_tracks; i++) @{ lsn_t lsn; track_format_t track_format = cdio_get_track_format(p_cdio, i); lsn = cdio_get_track_lsn(p_cdio, i); switch ( track_format ) @{ case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: case TRACK_FORMAT_DATA: case TRACK_FORMAT_PSX: ; @} start_track = (i == 1) ? 0 : lsn; /* save the start of the data area */ if (i == first_data) data_start = start_track; /* skip tracks which belong to the current walked session */ if (start_track < data_start + cdio_iso_analysis.isofs_size) continue; fs = cdio_guess_cd_type(p_cdio, start_track, i, &cdio_iso_analysis); print_analysis(cdio_iso_analysis, fs, first_data, num_audio, i_tracks, first_track_num, p_cdio); if ( !(CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660 || CDIO_FSTYPE(fs) == CDIO_FS_ISO_HFS || CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660_INTERACTIVE) ) /* no method for non-ISO9660 multisessions */ break; @} @} cdio_destroy(p_cdio); return 0; @} @end smallexample @node Example 4 @section Example 4: use libiso9660 to extract a file from an ISO-9660 image Next a program to show using @command{libiso9660} to extract a file from an ISO-9660 image. This can be found in the distribution as @file{example/isofile.c}. A more complete and expanded version of this is @command{iso-read}, part of this distribution. @smallexample /* This is the ISO 9660 image. */ #define ISO9660_IMAGE_PATH "../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/copying.iso" #define LOCAL_FILENAME "copying" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #define my_exit(rc) \ fclose (p_outfd); \ free(p_statbuf); \ iso9660_close(p_iso); \ return rc; \ int main(int argc, const char *argv[]) @{ iso9660_stat_t *p_statbuf; FILE *p_outfd; int i; iso9660_t *p_iso = iso9660_open (ISO9660_IMAGE); if (NULL == p_iso) @{ fprintf(stderr, "Sorry, couldn't open ISO 9660 image %s\n", ISO9660_IMAGE); return 1; @} p_statbuf = iso9660_ifs_stat_translate (p_iso, LOCAL_FILENAME); if (NULL == p_statbuf) @{ fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", LOCAL_FILENAME); iso9660_close(p_iso); return 2; @} if (!(p_outfd = fopen (LOCAL_FILENAME, "wb"))) @{ perror ("fopen()"); free(p_statbuf); iso9660_close(p_iso); return 3; @} /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ for (i = 0; i < p_statbuf->size; i += ISO_BLOCKSIZE) @{ char buf[ISO_BLOCKSIZE]; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, p_statbuf->lsn + (i / ISO_BLOCKSIZE), 1) ) @{ fprintf(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) p_statbuf->lsn + (i / ISO_BLOCKSIZE)); my_exit(4); @} fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) @{ perror ("fwrite()"); my_exit(5); @} @} fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_statbuf->size)) perror ("ftruncate()"); my_exit(0); @} @end smallexample @node Example 5 @section Example 5: list CD-Text and disc mode info Next a program to show using @command{libcdio} to list CD-TEXT data. This can be found in the distribution as @file{example/cdtext.c}. @smallexample /* Simple program to list CD-Text info of a Compact Disc using libcdio. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include static void print_cdtext_track_info(CdIo_t *p_cdio, track_t i_track, const char *message) @{ const cdtext_t *cdtext = cdio_get_cdtext(p_cdio, 0); if (NULL != cdtext) @{ cdtext_field_t i; printf("%s\n", message); for (i=0; i < MAX_CDTEXT_FIELDS; i++) @{ if (cdtext->field[i]) @{ printf("\t%s: %s\n", cdtext_field2str(i), cdtext->field[i]); @} @} @} @} static void print_disc_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) @{ track_t i_last_track = i_first_track+i_tracks; discmode_t cd_discmode = cdio_get_discmode(p_cdio); printf("%s\n", discmode2str[cd_discmode]); print_cdtext_track_info(p_cdio, 0, "\nCD-Text for Disc:"); for ( ; i_first_track < i_last_track; i_first_track++ ) @{ char psz_msg[50]; sprintf(msg, "CD-Text for Track %d:", i_first_track); print_cdtext_track_info(p_cdio, i_first_track, psz_msg); @} @} int main(int argc, const char *argv[]) @{ track_t i_first_track; track_t i_tracks; CdIo_t *p_cdio; cdio = cdio_open (NULL, DRIVER_UNKNOWN); i_first_track = cdio_get_first_track_num(p_cdio); i_tracks = cdio_get_num_tracks(p_cdio); if (NULL == p_cdio) @{ printf("Couldn't find CD\n"); return 1; @} else @{ print_disc_info(p_cdio, i_tracks, i_first_track); @} cdio_destroy(p_cdio); return 0; @} @end smallexample @node Example 6 @section Example 6: Using MMC to run an @code{INQURY} command Now a program to show issuing a simple MMC command (@code{INQUIRY}). This MMC command retrieves the vendor, model and firmware revision number of a CD drive. For this command to work, usually a CD to be loaded into the drive; odd since the CD itself is not used. This can be found in the distribution as @file{example/mmc1.c}. @smallexample #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 /* assumes config.h is libcdio's config.h / #endif #include #include #include #include #include /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) @{ CdIo_t *p_cdio; p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); if (NULL == p_cdio) @{ printf("Couldn't find CD\n"); return 1; @} else @{ int i_status; /* Result of MMC command */ char buf[36] = @{ 0, @}; /* Place to hold returned data */ scsi_mmc_cdb_t cdb = @{@{0, @}@}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); i_status = scsi_mmc_run_cmd(p_cdio, DEFAULT_TIMEOUT_MS, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) @{ char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]; char psz_model[CDIO_MMC_HW_MODEL_LEN+1]; char psz_rev[CDIO_MMC_HW_REVISION_LEN+1]; memcpy(psz_vendor, buf + 8, sizeof(psz_vendor)-1); psz_vendor[sizeof(psz_vendor)-1] = '\0'; memcpy(psz_model, buf + 8 + CDIO_MMC_HW_VENDOR_LEN, sizeof(psz_model)-1); psz_model[sizeof(psz_model)-1] = '\0'; memcpy(psz_rev, buf + 8 + CDIO_MMC_HW_VENDOR_LEN +CDIO_MMC_HW_MODEL_LEN, sizeof(psz_rev)-1); psz_rev[sizeof(psz_rev)-1] = '\0'; printf("Vendor: %s\nModel: %s\nRevision: %s\n", psz_vendor, psz_model, psz_rev); @} else @{ printf("Couldn't get INQUIRY data (vendor, model, and revision\n"); @} @} cdio_destroy(p_cdio); return 0; @} @end smallexample Note the include of @code{#define} of @code{__CDIO_CONFIG_H__} towards the beginning. This is useful if the prior @code{#include} of @code{config.h} refers to libcdio's configuration header. It indicates that libcdio's configuration settings have been used. Without it, you may get messages about C Preprocessor symbols getting redefined in the @code{#include} of @code{}. @node Example 7 @section Example 7: Using the CD Paranoia library for CD-DA reading The below program reads CD-DA data. For a more complete program to add a WAV header so that the CD can be played from a copy on a hard disk, see the corresponding distribution program. This can be found in the distribution as @file{example/paranoia.c}. @smallexample #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 /* assumes config.h is libcdio's config.h / #endif #include #include #include #ifdef HAVE_STDLIB_H #include #endif int main(int argc, const char *argv[]) @{ cdrom_drive_t *d = NULL; /* Place to store handle given by cd-paranoia. */ char **ppsz_cd_drives; /* List of all drives with a loaded CDDA in it. */ /* See if we can find a device with a loaded CD-DA in it. */ ppsz_cd_drives = cdio_get_devices_with_cap(NULL, CDIO_FS_AUDIO, false); if (ppsz_cd_drives) @{ /* Found such a CD-ROM with a CD-DA loaded. Use the first drive in the list. */ d=cdio_cddap_identify(*ppsz_cd_drives, 1, NULL); @} else @{ printf("Unable find or access a CD-ROM drive with an audio CD in it.\n"); exit(1); @} /* Don't need a list of CD's with CD-DA's any more. */ cdio_free_device_list(ppsz_cd_drives); /* We'll set for verbose paranoia messages. */ cdio_cddap_verbose_set(d, CDDA_MESSAGE_PRINTIT, CDDA_MESSAGE_PRINTIT); if ( 0 != cdio_cddap_open(d) ) @{ printf("Unable to open disc.\n"); exit(1); @} /* Okay now set up to read up to the first 300 frames of the first audio track of the Audio CD. */ @{ cdrom_paranoia_t *p = cdio_paranoia_init(d); lsn_t i_first_lsn = cdio_cddap_disc_firstsector(d); if ( -1 == i_first_lsn ) @{ printf("Trouble getting starting LSN\n"); @} else @{ lsn_t i_cursor; track_t i_track = cdio_cddap_sector_gettrack(d, i_first_lsn); lsn_t i_last_lsn = cdio_cddap_track_lastsector(d, i_track); /* For demo purposes we'll read only 300 frames (about 4 seconds). We don't want this to take too long. On the other hand, I suppose it should be something close to a real test. */ if ( i_last_lsn - i_first_lsn > 300) i_last_lsn = i_first_lsn + 299; printf("Reading track %d from LSN %ld to LSN %ld\n", i_track, (long int) i_first_lsn, (long int) i_last_lsn); /* Set reading mode for full paranoia, but allow skipping sectors. */ paranoia_modeset(p, PARANOIA_MODE_FULL^PARANOIA_MODE_NEVERSKIP); paranoia_seek(p, i_first_lsn, SEEK_SET); for ( i_cursor = i_first_lsn; i_cursor <= i_last_lsn; i_cursor ++) @{ /* read a sector */ int16_t *p_readbuf=cdio_paranoia_read(p, NULL); char *psz_err=cdio_cddap_errors(d); char *psz_mes=cdio_cddap_messages(d); if (psz_mes || psz_err) printf("%s%s\n", psz_mes ? psz_mes: "", psz_err ? psz_err: ""); if (psz_err) cdio_cddap_free_messages(psz_err); if (psz_mes) cdio_cddap_free_messages(psz_mes); if( !p_readbuf ) @{ printf("paranoia read error. Stopping.\n"); break; @} @} @} cdio_paranoia_free(p); @} cdio_cdda_close(d); exit(0); @} @end smallexample Those who are die-hard cdparanoia programmers will notice that the @value{libcdio} paranoia names are similar but a little bit different. In particular instead of @code{paranoia_read} we have above @code{cdio_paranoia_read} and instead of @code{cdda_open} we have @code{cdio_cddap_open}. This was done intentionally so that it is possible for the original paranoia program can co-exist both in source code and linked libraries and not conflict with @value{libcdio}'s paranoia source and libraries. In general in place of any paranoia routine that begins @code{paranoia_}, use @code{cdio_paranoia_} and in place of any paranoia routine that begins @code{cdda_}, use @code{cdio_cddap_}. But for a limited time @value{libcdio} will accept the old paranoia names which may be useful for legacy paranoia code. The way this magic works is by defining the old paranoia name to be the @value{libcdio} name. In the unusual case where you do want to use both the original paranoia and @value{libcdio} routines in a single source, the C preprocessor symbol @code{DO_NOT_WANT_PARANOIA_COMPATIBILITY} can be @code{define}'d and this disables the @code{#define} substitution done automatically. The may still be a problem with conflicting structure definitions like @code{cdrom_drive_t}. @node Example 8 @section Example 8: Setting output verbosity Sometimes in tracking down a problem in your code or libcdio's you may want more information about what is going on inside the @command{libcdio} library. The setting global variable @code{cdio_loglevel_default} defined in header file @code{} controls the verbosity level. By default, only warnings, errors, and fatal errors are printed. However by setting this variable you can get either debug or informational messages, or cause the normal messages that appear to be suppressed. The verbosity levels defined in the library are from lowest number to highest are: @table @code @item @code{CDIO_LOG_DEBUG} (value 1) These are of a debugging nature and are give the most verbose output. @item @code{CDIO_LOG_INFO} (value 2) These are informational message. @item @code{CDIO_LOG_WARN} (value 3) These are warning message. Not an error, per se, but something that might be of concern. @item @code{CDIO_LOG_ERROR} (value 4) These are error messages that force program termination. @item @code{CDIO_LOG_ASSERT} (value 5) These are error messages that represent an internal inconsistency in the @command{libcdio} library. In the absence of @command{libcdio} bugs, these should never appear. @end table Setting a lower or more verbose log level will cause higher-level messages to appear, but not those that are less than the set verbosity level. The ``debug'' level is the lowest. So setting @code{cdio_loglevel_default} to level causes all other levels of messages to be displayed. However setting the verbosity level to ``warn'' will cause debug and informational messages (lower level messages) to be ignored while still showing warning, error, and fatal error messages. Another thing that can be done is to write a custom log handler that will be used instead of @command{libcdio}'s default handlers. Using this, you have complete control of how you want logging to be handled. Here is an example adapted from example program @command{logging.c}. @smallexample #include #include #include #include #include #include #include #include #include /* Here is an example of a custom log handler. */ static void custom_log_handler (cdio_log_level_t level, const char *message) @{ switch(level) @{ case CDIO_LOG_DEBUG: printf("-- custom debug message: %s\n", message); return; case CDIO_LOG_INFO: printf("-- custom info message: %s\n", message); return; case CDIO_LOG_WARN: printf("-- custom warning message: %s\n", message); return; case CDIO_LOG_ERROR: printf("-- custom error message: %s\n", message); return; case CDIO_LOG_ASSERT: printf("-- custom fatal error message: %s\n", message); return; default: printf("custom level %d message: %s\n", level, message); @} @} static void print_drives() @{ char **ppsz_cd_drives=NULL, **c; /* Print out a list of CD-drives with the above set log level. */ ppsz_cd_drives = cdio_get_devices(DRIVER_DEVICE); if (NULL != ppsz_cd_drives) for( c = ppsz_cd_drives; *c != NULL; c++ ) @{ printf("-- Drive %s\n", *c); @} cdio_free_device_list(ppsz_cd_drives); @} int main(int argc, const char *argv[]) @{ /* Set the log level to the warning verbosity. */ cdio_loglevel_default = CDIO_LOG_WARN; print_drives(); /* Do the same thing again but with a custom log handler. */ cdio_log_set_handler (custom_log_handler); print_drives(); return 0; @} @end smallexample @node All sample programs @section A list of all sample programs in the @code{example} directory The @code{example} directory contains some simple examples of the use of the @value{libcdio} library. A larger more-complicated example are the @command{cd-drive}, @command{cd-info}, @command{cd-read}, @command{iso-info} and @command{iso-info} programs in the @command{src} directory. Descriptions of the sample are as follows... @table @code @item @code{audio.c} A program to show audio controls. @item @code{cdchange.c} A program to test if a CD has been changed since the last change test. @item @code{cd-eject.c} A a stripped-down "eject" command to open or close a CD-ROM tray. @item @code{cdtext.c} A program to show CD-Text and CD disc mode info. @item @code{drives.c} A program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. @item @code{eject.c} A program eject a CD from a CD-ROM drive and then close the door again. @item @code{isofile.c} A program to show using libiso9660 to extract a file from an ISO-9660 image. @item @code{isofile2.c} A program to show using libiso9660 to extract a file from a CDRWIN cue/bin CD image. @item @code{C++/isofile2.cpp} The same program as @code{isofile2.c} written in C++. @item @code{isofuzzy.c} A program showing fuzzy ISO-9660 detection/reading. @item @code{isolist.c} A program to show using @code{libiso9660} to list files in a directory of an ISO-9660 image. @item @code{C++/isolist.cpp} The same program as @code{isolist.c} written in C++. @item @code{isofuzzy.c} A program showing fuzzy ISO-9660 detection/reading. @item @code{logging.c} A program to show to to set log verbosity levels and how to write a custom log handler. @item @code{mmc1.c} A program to show issuing a simple MMC command (@code{INQUIRY}). @item @code{C++/mmc1.cpp} The same program as @code{mmc1.c} written in C++. @item @code{mmc2.c} A more involved MMC command to list CD and drive features from a SCSI-MMC @code{GET_CONFIGURATION} command. @item @code{mmc2a.c} Prints MMC @command{MODE_SENSE} page 2A parameters. Page 2a are the CD/DVD Capabilities and Mechanical Status. @item @code{C++/mmc2.cpp} The same program as @code{mmc2.c} written in C++. @item @code{paranoia.c} A program to show using libcdio's version of the CD-DA paranoia. @item @code{paranoia2.c} A program to show using libcdio's version of the CD-DA paranoia library. But in this version, we'll open a cdio object before calling paranoia's open. I imagine in many cases such as media players this may be what will be done since, one may want to get CDDB/CD-Text info beforehand. @item @code{tracks.c} A simple program to list track numbers and logical sector numbers of a Compact Disc using @value{libcdio}. @item @code{sample2.c} A simple program to show drivers installed and what the default CD-ROM drive is. @item @code{sample3.c} A simple program to show the use of @code{cdio_guess_cd_type()}. Figures out the kind of CD image we've got. @item @code{sample4.c} A slightly improved sample3 program: we handle cdio logging and take an optional CD-location. @item @code{udf1.c} A program to show using libudf to list files in a directory of an UDF image. @item @code{udf2.c} A program to show using libudf to extract a file from an UDF image. @end table @node Utility Programs @chapter Diagnostic programs: @command{cd-drive}, @command{cd-info}, @command{cd-read}, @command{iso-info}, @command{iso-read} @menu * cd-drive:: list out CD-ROM drive information * cd-info:: list out CD or CD-image information * cd-read:: read blocks of a CD or CD image * iso-info:: list out ISO-9600 image information * iso-read:: extract a file from an ISO 9660 image @end menu @node cd-drive @section @samp{cd-drive} @samp{cd-drive} lists out drive information, what features drive supports, and information about what hardware drivers are available. @node cd-info @section @samp{cd-info} @samp{cd-info} will print out the structure of a CD medium which could either be a Compact Disc in a CD ROM or an CD image. It can try to analyze the medium to give characteristics of the medium, such as how many tracks are in the CD and the format of each track, whether a CD contains a Video CD, CD-DA, PhotoCD, whether a track has an ISO-9660 filesystem. @node cd-read @section @samp{cd-read} @samp{cd-info} can be used to read blocks a CD medium which could either be a Compact Disc in a CD ROM or an CD image. You specify the beginning and ending LSN and what mode format to use in the reading. @node iso-info @section @samp{iso-info} @samp{iso-info} can be used to print out the structure of an ISO 9660 image. @node iso-read @section @samp{iso-read} @samp{iso-read} can be used to extract a file in an ISO-9660 image. @node CD-ROM Access and Drivers @chapter CD-ROM Access and Drivers @menu * SCSI mess:: SCSI, SCSI commands, and MMC commands * Access Modes:: Access Modes * Accessing Driver Parameters:: Accessing Driver Parameters * GNU/Linux:: GNU/Linux ioctl * Microsoft:: Microsoft Windows ioctl and ASPI * Solaris:: Solaris ATAPI and SCSI * FreeBSD:: FreeBSD ioctl and CAM * OS X:: OSX (non-exclussive access) @end menu @node SCSI mess @section SCSI, SCSI commands, and MMC commands Historically, SCSI referred to a class of hardware devices and device controllers, bus technology and the data cables and protocols which attached to such devices. This is now called ``Parallel SCSI''. A specification standard grew out of the @emph{commands} that controlled such SCSI devices, but now covers a wider variety of bus technologies including Parallel SCSI, ATA/ATAPI, Serial ATA, Universal Serial Bus (USB versions 1.1 and 2.0), and High Performance Serial Bus (IEEE 1394, 1394A, and 1394B). Another similar class of hardware devices and controllers is called ATA and a command interface to that is called ATAPI (ATA Packetized Interface). ATAPI provides a mechanism for transferring and executing SCSI commands. MMC (Multimedia commands) is a specification which adds special SCSI commands for CD, DVD, Blu-Ray devices. If your optical drive understands MMC commands as most do nowadays, this probably gives the most flexibility in control. SCSI and ATAPI CD-ROM devices generally support a fairly large set of MMC commands. Unfortunately, on most Operating Systems one may need to do some additional setup, such as install drivers or modules, to allow access in this manner. The name ``SCSI MMC'' is often found in the literature in specifications and on the Internet. The ``SCSI'' part is probably a little bit misleading because a drive can understand ``SCSI MMC'' commands but not use a SCSI bus protocol---ATAPI CD-ROMs are one such broad class of examples. In fact there are drivers to ``encapsulate'' non-SCSI drives to make them act like more like SCSI drives, such as by adding SCSI address naming. For clarity and precision we will use the term ``MMC'' rather than ``SCSI MMC''. One of the problems with MMC is that there are so many different ``standards''. In particular: @itemize @item MMC --- @url{ftp://ftp.t10.org/t10/drafts/mmc/}, @item MMC 2 --- @url{ftp://ftp.t10.org/t10/drafts/mmc2/} @item MMC 3 --- @url{ftp://ftp.t10.org/t10/drafts/mmc3/} @item MMC 4 --- @url{ftp://ftp.t10.org/t10/drafts/mmc4/} @item MMC 5 --- @url{ftp://ftp.t10.org/t10/drafts/mmc5/} @item MMC 6 --- @url{ftp://ftp.t10.org/t10/drafts/mmc6/} @end itemize along with the several ``drafts'' of these. Another problem with the MMC commands related to the variations in standards is the variation in the commands themselves and there are perhaps two or three ways to do many of the basic commands like read a CD frame. There seems to be a fascination with the number of bytes a command takes in the MMC-specification world. (Size matters?) So often the name of an operation will have a suffix with the number of bytes of the command (actually in MMC jargon this is called a ``CDB'' @cindex CDB (Command Descriptor Block) or command descriptor block). So for example there is a 6-byte ``MODE SELECT'' often called ``MODE SELECT 6'' and a 10-byte ``MODE SELECT'' often called ``MODE SELECT 10''. Presumably the 6-byte command came first and it was discovered that there was some deficiency causing the longer command. In @value{libcdio} where there are two formats we add the suffix in the name, e.g. @code{CDIO_MMC_GPCMD_MODE_SELECT_6} or @code{CDIO_MMC_GPCMD_MODE_SELECT_10}. If the fascination and emphasis in the MMC specifications of CDB size is a bit odd, equally so is the fact that this too often has bled through at the OS programming API. However in @value{libcdio}, you just give the opcode in @code{scsi_mmc_run_cmd()} and we'll do the work to figure out how many bytes of the CDB are used. Down the line it is hoped that @value{libcdio} will have a way to remove a distinction between the various alternative and alternative-size MMC commands. In @code{cdio/scsi-mmc.h} you will find a little bit of this for example via the routine @code{scsi_mmc_get_drive_cap()}. However much more work is needed. Finally, in @code{libcdio} there is a driver access mode (not a driver) called ``MMC''. It tells the specific drivers to use MMC commands instead of other OS-specific mechanisms. @node Access Modes @section Access Modes There are several ways that you can open a CD-ROM drive for subsequent use. Each way is called an @emph{access mode}. Historically libcdio only supported a reading kind of access. Adding the ability to writing to a drive for ``burning'' is being added by Thomas Schmitt, and this is accomplished by opening the drive in a read-write mode. Currently writing modes are only supported via the MMC command interface. Under this, one can get exclusive read-write access or non-exclusive read-write access. The names of these two modes are @code{MMC_RDWR_EXCL} and @code{MMC_RDWR} respectively. On various OS's often there are two kinds of read modes that are supported, one which uses MMC commands and one which uses some sort of OS-specific native command interface. For example on Unix, there is often a access mode associated with issuing an device-specific @code{ioctl}'s that the OS supports. To specify a particular kind of access mode, use @code{cdio_open_am} which is like @code{cdio_open} but it requires one to specify an access mode. @node Accessing Driver Parameters @section Accessing Driver Parameters --- @code{cdio_get_arg} Once a driver is opened, you can use call @code{cdio_get_arg} to get information about the driver. Each driver can have specific features that can be queried, but there are features that are common to all drivers. These are listed below: @table @code @item @code{access-mode} This returns a string which is the name of the access mode in use. @item @code{mmc-supported?} This returns a string ``true'' or ``false'' depending whether the driver with this access mode support MMC commands. @item @code{scsi-tuple} On drivers that support MMC commands, this returns the SCSI name or a faked-up SCSI name that ripping front ends typically use. @end table @node GNU/Linux @section GNU/Linux The GNU/Linux uses a hybrid of methods. Somethings are done via ioctl and some things via MMC. GNU/Linux has a rather nice and complete ioctl mechanism. On the other hand, the MMC mechanism is more universal. There are other ``access modes'' listed which are not really access modes and should probably be redone/rethought. They are just different ways to run the read command. But for completeness, These are ``READ_CD'' and ``READ_10''. Writing/burning to a drive is supported via access modes @code{MMC_RDWR_EXCL} or @code{MMC_RDWR}. @node Microsoft @section Microsoft Windows ioctl and ASPI There are two CD drive access methods on Microsoft Windows platforms: ioctl and ASPI. The ASPI interface specification was developed by Adaptec for sending commands to a SCSI host adapter (such as those controlling CD and DVD drives) and used on Window 9x/NT and later. Emulation for ATAPI drives was added so that the same sets of commands worked, even though the drives might not be SCSI nor might there even be a SCSI controller attached. The DLL is not part of Microsoft Windows and has to be downloaded and installed separately. However, in Windows NT/2K/XP, Microsoft provides their Win32 ioctl interface, and has taken steps to make using ASPI more inaccessible (e.g. requiring administrative access to use ASPI). @node Solaris @section Solaris ATAPI and SCSI There is currently only one CD drive access methods in Solaris: SCSI (called ``USCSI'' or ``user SCSI'' in Solaris). There used to be an ATAPI method and it could be resurrected if needed. USCSI was preferred since on newer releases of Solaris and Solaris environments one need to have root access for ATAPI. @node FreeBSD @section FreeBSD ioctl and CAM There are two classes of access methods on FreeBSD: ioctl and CAM (common access method). CAM is preferred when possible, especially on newer releases. However CAM is right now sort of a hybrid and includes some ioctl code. Writing/burning to a drive is supported via access modes @code{MMC_RDWR_EXCL} or @code{MMC_RDWR} which underneath use CAM access. @node OS X @section OS X (non-exclusive access) A problem with libcdio on OS/X is that if the OS thinks it understands the drive, it will get exclusive access to the drive and thus prevents a library like this from obtaining non-exclusive access. Currently @value{libcdio} access the CD-ROM non-exclusively. However in order to be able to issue MMC, the current belief is that exclusive access is needed. Probably in a future @value{libcdio}, there will be some way to specify which kind of access is desired (with the inherent consequences of each). More work on this driver is needed. Volunteers? @node Internal Program Organization @chapter Internal Program Organization @menu * File Organization:: * Library Organization:: * Programming Conventions:: @end menu @node File Organization @section File Organization Here is a list of @value{libcdio} directories. @itemize @item @code{include/cdio} This contains the headers that are public. One that will probably be used quite a bit is @code{}. @item @code{lib} Code for installed libraries. See below for further breakout @item @code{lib/driver} Code for various OS-specific CD-ROM drivers, image drivers, and common MMC routines. This code comprises @code{libcdio.a} (or the shared version of it). @item @code{lib/iso9660} Code for to extract or query ISO-9660 images. This code comprises @code{libiso9660.a} (or the shared version of it). @item @code{lib/paranoia} This is from cdparanoia. It is the OS- and hardware- dependent code to detect and correct jitter for CD-DA CDs. @item @code{lib/cdda_interface} This is also from cdparanoia. It is the OS- and hardware- independent code to detect and correct jitter for CD-DA CDs. @item @code{doc} A home for fine documentation such as this masterpiece. @item @code{example} Here you will find various small example programs using @value{libcdio} which are largely for pedagogical purposes. You might be able to find one that is similar to what you want to do that could be extended. In fact some these are contain the kernel ideas behind of some of the larger programs in @file{src}. @item @code{src} Various stand-alone utility programs. See below. @item @code{src/paranoia} @value{libcdio}'s version of @code{cdparanoia}. Except for the fact that the back-end CD-reading code has been replaced by @value{libcdio}'s routines the code is pretty much identical. @item @code{test} Regression tests @item @code{test/data} Disk images and image meta-data used in tests @item @code{test/driver} Unit tests centered around the libcdio library (@code{libcdio}, source location @code{lib/driver} @end itemize @node Library Organization @section Library Organization @menu * libcdio:: * libcdio_cdda:: Access to CD-DA via the CD Paranoia library * libcdio_paranoia:: Access to the CD Paranoia library * libiso9660:: Access to ISO 9660 file systems and structures * libudf:: Access to UDF file systems and structures @end menu @node libcdio @subsection @samp{libcdio} @value{libcdio} exports one opaque type @code{CdIo_t}. Internally this a structure containing an enumeration for the driver, a structure containing function pointers and a generic ``environment'' pointer which is passed as a parameter on a function call. See @file{lib/driver/cdio_private.h}. The initialization routine for each driver sets up the function pointers and allocates memory for the environment. When a particular user-level cdio routine is called (e.g @code{cdio_get_first_track_num} for lib/driver/track.c), the environment pointer is passed to a device-specific routine which will then cast this pointer into something of the appropriate type. Because function pointers are used, there can be and is quite a bit of sharing of common routines. Some of the common routines are found in the file @file{lib/driver/_cdio_generic.c}. Another set of routines that one is likely to find shared amongst drivers are the MMC commands. These are located in @file{lib/driver/scsi_mmc.c}. There is not only an attempt to share functions but we've tried to create a generic CD structure @code{generic_img_private_t} of file @file{lib/driver/generic.h}. By putting information into a common structure, we increase the likelihood of being able to have a common routine to perform some sort of function. The generic CD structure would also be useful in a utility to convert one CD-image format to another. Basically the first image format is ``parsed'' into the common internal format and then from this structure it is not parsed. @node libcdio_cdda @subsection @samp{libcdio_cdda} This library is intended to give access CD-DA disks using Monty's cd-paranoia library underneath. To be completed.... @node libcdio_paranoia @subsection @samp{libcdio_paranoia} This library is intended to give access Monty's cd-paranoia library. It is the gap detection and jitter correction part without the part dealing with CD-DA reading. To be completed.... @node libiso9660 @subsection @samp{libiso9660} This library is intended to give access and manipulate a ISO-9600 file image. One part of it is concerned with the the entire ISO-9660 file system image, and the other part access routines for manipulating data structures and fields that go into such an image. To be completed.... @node libudf @subsection @samp{libudf} This library is intended to give access and manipulate a UDF file image. To be completed.... @node Programming Conventions @section Programming Conventions @menu * Coding Conventions:: * Namespace Conventions:: @end menu @node Coding Conventions @subsection Coding Conventions In @value{libcdio} there are a number of conventions used. If you understand some of these conventions it may facilitate understanding the code a little. @node Namespace Conventions @subsection Namespace Conventions For the most part, the visible external @value{libcdio} names follow conventions so as not to be confused with other applications or libraries. If you understand these conventions, there will be little or no chance that the names you use will conflict with @value{libcdio} and @code{libiso9660} and vice versa. All of the external @value{libcdio} C routines start out with @code{cdio_}, e.g. @code{cdio_open}; as a corollary, the @value{libcdio} CD-Paranoia routines start @code{cdio_cddap_}, e.g. @code{cdio_cddap_open}. @code{libiso9660} routines start @code{iso9660_}, e.g. @code{iso9660_open}. @value{libcdio} C-Preprocessor names generally start @code{CDIO_}, for example @code{CDIO_CD_FRAMESIZE_RAW}; @code{libiso9660} C-preprocessor names start @code{ISO9660_}, e.g. @code{ISO9660_FRAMESIZE}. @subsubsection suffixes (type and structure names) A few suffixes are used in type and structure names: @itemize @item @code{_e} An enumeration tag. Generally though the same name will appear with the @code{_t} suffix and probably that should be used instead. @item @code{_s} A structure tag. Generally though the same name will appear with the @code{_t} suffix and probably that should be used instead. @item @code{_t} A type suffix. @end itemize @subsubsection prefixes (variable names) A number of prefixes are used in variable names here's what they mean @itemize @item @code{i_} An integer type of some sort. A variable of this ilk one might find being iterated over in @code{for} loops or used as the index of an array for example. @item @code{b_} A Boolean type of some sort. A variable of this ilk one might find being in an @code{if} condition for example. @item @code{p_} A pointer of some sort. A variable of this ilk, say @code{p_foo} one is like likely to see @code{*p_foo} or @code{p_foo->...}. @item @code{pp_} A pointer to a pointer of some sort. A variable of this ilk, say @code{pp_foo} one is like likely to see @code{**p_foo} or @code{p_foo[x][y]} for example @item @code{psz_} A @code{char *} pointer of some sort. A variable of this ilk, say @code{psz_foo} may be used in a string operation. For example @code{printf(%s\n", psz_foo)} or @code{strdup(psz_foo)}. @item @code{ppsz_} A pointer to a @code{char *} pointer of some sort. A variable of this ilk, say @code{ppsz_foo} is used for example to return a list of CD-ROM device names @end itemize There are a some other naming conventions. Generally if a routine name starts @code{cdio_}, e.g. @code{cdio_open}, then it is an externally visible routine in @code{libcdio}. If a name starts @code{iso9660_}, e.g. @code{iso9660_is_dchar} then it is an externally visible routine in @code{libiso9660}. If a name starts @code{scsi_mmc_}, e.g. @code{scsi_mmc_get_discmode}, then it is an externally visible MMC routine. (We don't have a separate library for this yet. Names using entirely capital letters and that start @code{CDIO_} are externally visible @code{#defines}. @node ISO-9660 Character Sets @appendix ISO-9660 Character Sets For a description of where are used see @xref{ISO 9660 Level 1}. @menu * ISO646 d-Characters:: * ISO646 a-Characters:: @end menu @node ISO646 d-Characters @appendixsec ISO646 d-Characters @example | 0 1 2 3 4 5 6 7 --+----------------- 0 | 0 P 1 | 1 A Q 2 | 2 B R 3 | 3 C S 4 | 4 D T 5 | 5 E U 6 | 6 F V 7 | 7 G W 8 | 8 H X 9 | 9 I Y a | J Z b | K c | L d | M e | N f | O _ @end example @node ISO646 a-Characters @appendixsec ISO646 a-Characters @example | 0 1 2 3 4 5 6 7 --+----------------- 0 | 0 P 1 | ! 1 A Q 2 | " 2 B R 3 | 3 C S 4 | 4 D T 5 | % 5 E U 6 | & 6 F V 7 | ' 7 G W 8 | ( 8 H X 9 | ) 9 I Y a | * : J Z b | + ; K c | , < L d | - = M e | . > N f | / ? O _ @end example @node Glossary @appendix Glossary @include glossary.texi @node GNU Free Documentation License @appendix GNU Free Documentation License @cindex FDL, GNU Free Documentation License @include fdl.texi @node General Index @unnumbered General Index @printindex cp @bye libcdio-2.2.0/example/000077500000000000000000000000001474051130400145525ustar00rootroot00000000000000libcdio-2.2.0/example/.gitignore000066400000000000000000000005041474051130400165410ustar00rootroot00000000000000/*.dSYM /*.exe /*.exe.stackdump /*.o /*~ /.deps /.libs /Makefile /Makefile.in /audio /cdchange /cdio-eject /cdtext /cdtext-raw /copying /device /discid /drives /eject /extract /isofile /isofile2 /isofuzzy /isolist /isolsn /isorr /logging /mmc1 /mmc2 /mmc2a /mmc3 /sample3 /sample4 /track-01.wav /tracks /udf1 /udf2 /udffile libcdio-2.2.0/example/C++/000077500000000000000000000000001474051130400150625ustar00rootroot00000000000000libcdio-2.2.0/example/C++/.gitignore000066400000000000000000000001731474051130400170530ustar00rootroot00000000000000/*.o /*.exe /*~ /.deps /.libs /Makefile /Makefile.in /copying /device /eject /isofile /isofile2 /isolist /main /mmc1 /mmc2 libcdio-2.2.0/example/C++/Makefile.am000066400000000000000000000040571474051130400171240ustar00rootroot00000000000000# Copyright (C) 2005-2006, 2008-2009, 2017 Rocky Bernstein # # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ########################################################## # Sample C++ programs using libcdio (without OO wrapper) ######################################################### # SUBDIRS = OO if BUILD_EXAMPLES noinst_PROGRAMS = device eject isofile isofile2 isolist \ mmc1 mmc2 endif AM_CPPFLAGS = -I$(top_srcdir) $(LIBCDIO_CFLAGS) device_DEPENDENCIES = $(LIBCDIO_DEPS) device_SOURCES = device.cpp device_LDADD = $(LIBCDIO_LIBS) eject_DEPENDENCIES = $(LIBCDIO_DEPS) eject_SOURCES = eject.cpp eject_LDADD = $(LIBCDIO_LIBS) isofile_SOURCES = isofile.cpp isofile_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isofile2_SOURCES = isofile2.cpp isofile2_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isolist_SOURCES = isolist.cpp isolist_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) mmc1_SOURCES = mmc1.cpp mmc1_DEPENDENCIES = $(LIBCDIO_DEPS) mmc1_LDADD = $(LIBCDIO_LIBS) mmc2_SOURCES = mmc2.cpp mmc2_DEPENDENCIES = $(LIBCDIO_DEPS) mmc2_LDADD = $(LIBCDIO_LIBS) check_PROGRAMS = $(noinst_PROGRAMS) TESTS = $(check_PROGRAMS) # iso programs create file "copying" MOSTLYCLEANFILES = copying *.wav #: run valgrind on C++ programs check-leaks: $(check_PROGRAMS) for p in $(check_PROGRAMS); do \ valgrind ./$$p; \ done libcdio-2.2.0/example/C++/OO/000077500000000000000000000000001474051130400153775ustar00rootroot00000000000000libcdio-2.2.0/example/C++/OO/.gitignore000066400000000000000000000002101474051130400173600ustar00rootroot00000000000000/*.o /.deps /.libs /Makefile /Makefile.in /cdtext /copying /device /drives /eject /iso4 /isofile /isofile2 /isolist /mmc1 /mmc2 /tracks libcdio-2.2.0/example/C++/OO/Makefile.am000066400000000000000000000052531474051130400174400ustar00rootroot00000000000000# Copyright (C) 2005-2006, 2008-2009, 2017 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ############################################################ # Sample C++ programs using libcdio++ (with C++ OO wrapper) ############################################################ # noinst_PROGRAMS = cdtext device drives eject \ isofile isofile2 isolist iso4 mmc1 mmc2 tracks AM_CPPFLAGS = -I$(top_srcdir)/include $(LIBCDIO_CFLAGS) cdtext_SOURCES = cdtext.cpp cdtext_DEPENDENCIES = $(LIBCDIO_DEPS) cdtext_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) device_SOURCES = device.cpp device_DEPENDENCIES = $(LIBCDIO_DEPS) device_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) drives_SOURCES = drives.cpp drives_DEPENDENCIES = $(LIBCDIO_DEPS) drives_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) eject_SOURCES = eject.cpp eject_DEPENDENCIES = $(LIBCDIO_DEPS) eject_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) isofile_SOURCES = isofile.cpp isofile_LDADD = $(LIBISO9660PP_LIBS) $(LIBISO9660_LIBS) \ $(LIBCDIOPP_LIBS) $(LTLIBICONV) isofile2_SOURCES = isofile2.cpp isofile2_LDADD = $(LIBISO9660PP_LIBS) $(LIBISO9660_LIBS) \ $(LIBCDIOPP_LIBS) $(LTLIBICONV) isolist_SOURCES = isolist.cpp isolist_LDADD = $(LIBISO9660PP_LIBS) $(LIBISO9660_LIBS) \ $(LIBCDIOPP_LIBS) $(LTLIBICONV) iso4_SOURCES = iso4.cpp iso4_LDADD = $(LIBISO9660PP_LIBS) $(LIBISO9660_LIBS) \ $(LIBCDIOPP_LIBS) $(LTLIBICONV) mmc1_SOURCES = mmc1.cpp mmc1_DEPENDENCIES = $(LIBCDIO_DEPS) mmc1_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) mmc2_SOURCES = mmc2.cpp mmc2_DEPENDENCIES = $(LIBCDIO_DEPS) mmc2_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) tracks_SOURCES = tracks.cpp tracks_LDADD = $(LIBCDIOPP_LIBS) $(LIBCDIO_LIBS) check_PROGRAMS = $(noinst_PROGRAMS) TESTS = $(check_PROGRAMS) #: run valgrind on C++ programs check-leaks: $(check_PROGRAMS) for p in $(check_PROGRAMS); do \ valgrind ./$$p; \ done libcdio-2.2.0/example/C++/OO/cdtext.cpp000066400000000000000000000057551474051130400174120ustar00rootroot00000000000000/* Copyright (C) 2005, 2008-2009, 2012, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to list CD-Text info of a Compact Disc using libcdio. An optional drive name can be supplied as an argument. See also corresponding C program of a similar name. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #include /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define CDDA_IMAGE "../../../test/data/cdtext.cue" static void print_cdtext_track_info(CdioCDText *cdtext, track_t i_track) { cdtext_field_t i; for (i=(cdtext_field_t) 0; i < MAX_CDTEXT_FIELDS; i++) { if (cdtext->getConst(i, i_track)) { printf("\t%s: %s\n", cdtext->field2str(i), cdtext->getConst(i, i_track)); } } } static void print_disc_info(CdioDevice *device) { track_t i_first_track = device->getFirstTrackNum(); track_t i_tracks = device->getNumTracks(); track_t i_last_track = i_first_track+i_tracks; discmode_t cd_discmode = device->getDiscmode(); CdioCDText *cdtext = device->getCdtext(); int i; printf("Discmode: %s\n\n", discmode2str[cd_discmode]); if (NULL == cdtext) { printf("No CD-Text found on Disc.\n"); return; } /* print available languages */ { cdtext_lang_t *languages; printf("CD-Text available in: "); languages = cdtext->listLanguagesV2(); /* The API promises that non-NULL p_cdtext yields non-NULL languages */ for(i=0; i<8; i++) if ( CDTEXT_LANGUAGE_BLOCK_UNUSED != languages[i]) printf("%s ", cdtext->lang2str(languages[i])); printf("\n"); } printf("CD-Text for Disc:\n"); print_cdtext_track_info(cdtext, 0); for (i = i_first_track ; i < i_last_track; i++ ) { printf("CD-Text for Track %d:\n", i); print_cdtext_track_info(cdtext, i); } delete cdtext; } int main(int argc, const char *argv[]) { CdioDevice *device = new CdioDevice; const char *psz_drive = (const char *) NULL; if (!device->open(CDDA_IMAGE, DRIVER_BINCUE)) { printf("Couldn't open " CDDA_IMAGE " with BIN/CUE driver.\n"); } else { print_disc_info(device); } if (argc > 1) psz_drive = argv[1]; if (!device->open(psz_drive, DRIVER_DEVICE)) { printf("Couldn't find CD\n"); return 1; } else { print_disc_info(device); } delete device; return 0; } libcdio-2.2.0/example/C++/OO/device.cpp000066400000000000000000000112071474051130400173430ustar00rootroot00000000000000/* $Id: device.cpp,v 1.4 2008/03/24 15:30:57 karl Exp $ Copyright (C) 2005, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show drivers installed and what the default CD-ROM drive is. See also corresponding C program of a similar name. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define _(x) x /* Prints out drive capabilities */ static void print_drive_capabilities(cdio_drive_read_cap_t i_read_cap, cdio_drive_write_cap_t i_write_cap, cdio_drive_misc_cap_t i_misc_cap) { if (CDIO_DRIVE_CAP_ERROR == i_misc_cap) { printf("Error in getting drive hardware properties\n"); } else { printf(_("Hardware : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_FILE ? "Disk Image" : "CD-ROM or DVD"); printf(_("Can eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_EJECT ? "Yes" : "No"); printf(_("Can close tray : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_CLOSE_TRAY ? "Yes" : "No"); printf(_("Can disable manual eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_LOCK ? "Yes" : "No"); printf(_("Can select juke-box disc : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_DISC ? "Yes" : "No"); printf(_("Can set drive speed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_SPEED ? "Yes" : "No"); printf(_("Can detect if CD changed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED ? "Yes" : "No"); printf(_("Can read multiple sessions : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MULTI_SESSION ? "Yes" : "No"); printf(_("Can hard reset device : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_RESET ? "Yes" : "No"); } if (CDIO_DRIVE_CAP_ERROR == i_read_cap) { printf("Error in getting drive reading properties\n"); } else { printf("Reading....\n"); printf(_(" Can play audio : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_AUDIO ? "Yes" : "No"); printf(_(" Can read CD-R : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_R ? "Yes" : "No"); printf(_(" Can read CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No"); printf(_(" Can read DVD-ROM : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_DVD_ROM ? "Yes" : "No"); } if (CDIO_DRIVE_CAP_ERROR == i_write_cap) { printf("Error in getting drive writing properties\n"); } else { printf("\nWriting....\n"); printf(_(" Can write CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No"); printf(_(" Can write DVD-R : %s\n"), i_write_cap & CDIO_DRIVE_CAP_READ_DVD_R ? "Yes" : "No"); printf(_(" Can write DVD-RAM : %s\n"), i_write_cap & CDIO_DRIVE_CAP_READ_DVD_RAM ? "Yes" : "No"); } } int main(int argc, const char *argv[]) { CdioDevice device; if (device.open(NULL)) { char *default_device = device.getDevice(); cdio_drive_read_cap_t i_read_cap; cdio_drive_write_cap_t i_write_cap; cdio_drive_misc_cap_t i_misc_cap; printf("The driver selected is %s\n", device.getDriverName()); if (default_device) printf("The default device for this driver is %s\n", default_device); device.getDriveCap(i_read_cap, i_write_cap, i_misc_cap); print_drive_capabilities(i_read_cap, i_write_cap, i_misc_cap); free(default_device); printf("\n"); } else { printf("Problem in trying to find a driver.\n\n"); } { const driver_id_t *driver_id_p; for (driver_id_p=cdio_drivers; *driver_id_p!=DRIVER_UNKNOWN; driver_id_p++) if (cdio_have_driver(*driver_id_p)) printf("We have: %s\n", cdio_driver_describe(*driver_id_p)); else printf("We don't have: %s\n", cdio_driver_describe(*driver_id_p)); } return 0; } libcdio-2.2.0/example/C++/OO/drives.cpp000066400000000000000000000047021474051130400174020ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2006, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include static void log_handler (cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } static void print_drive_class(const char *psz_msg, cdio_fs_anal_t bitmask, bool b_any=false) { char **ppsz_cd_drives=NULL, **c; printf("%s...\n", psz_msg); ppsz_cd_drives = getDevices(NULL, bitmask, b_any); if (NULL != ppsz_cd_drives) for( c = ppsz_cd_drives; *c != NULL; c++ ) { printf("Drive %s\n", *c); } freeDeviceList(ppsz_cd_drives); printf("-----\n"); } int main(int argc, const char *argv[]) { char **ppsz_cd_drives=NULL, **c; cdio_log_set_handler (log_handler); /* Print out a list of CD-drives */ printf("All CD-ROM/DVD drives...\n"); ppsz_cd_drives = getDevices(); if (NULL != ppsz_cd_drives) for( c = ppsz_cd_drives; *c != NULL; c++ ) { printf("Drive %s\n", *c); } freeDeviceList(ppsz_cd_drives); print_drive_class("All CD-ROM drives (again)", CDIO_FS_MATCH_ALL); print_drive_class("CD-ROM drives with a CD-DA loaded...", CDIO_FS_AUDIO); print_drive_class("CD-ROM drives with some sort of ISO 9660 filesystem...", CDIO_FS_ANAL_ISO9660_ANY, true); print_drive_class("(S)VCD drives...", CDIO_FS_ANAL_VCD_ANY, true); return 0; } libcdio-2.2.0/example/C++/OO/eject.cpp000066400000000000000000000043021474051130400171740ustar00rootroot00000000000000/* $Id: eject.cpp,v 1.7 2008/03/24 15:30:57 karl Exp $ Copyright (C) 2005, 2006, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to eject a CD-ROM drive door and then close it again. If a single argument is given, it is used as the CD-ROM device to eject/close. Otherwise a CD-ROM drive will be scanned for. See also corresponding C program of a similar name. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include int main(int argc, const char *argv[]) { driver_id_t driver_id = DRIVER_DEVICE; char *psz_drive = NULL; CdioDevice device; if (argc > 1) psz_drive = strdup(argv[1]); if (!psz_drive) { psz_drive = getDefaultDevice(driver_id); if (!psz_drive) { printf("Can't find a CD-ROM to perform eject operation\n"); exit(1); } } try { ejectMedia(psz_drive); printf("CD in CD-ROM drive %s ejected.\n", psz_drive); } catch ( DriverOpUninit e ) { printf("Can't Eject CD %s from CD-ROM drive: driver is not initialized.\n", psz_drive); } catch ( DriverOpException e ) { printf("Ejecting CD from CD-ROM drive %s operation error:\n\t%s.\n", psz_drive, e.get_msg()); } try { closeTray(psz_drive); printf("Closed CD-ROM %s tray.\n", psz_drive); } catch ( DriverOpException e ) { printf("Closing CD-ROM %s tray operation error error:\n\t%s.\n", psz_drive, e.get_msg()); } free(psz_drive); return 0; } libcdio-2.2.0/example/C++/OO/iso4.cpp000066400000000000000000000064341474051130400167700ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2009, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to list files in a directory of an ISO-9660 image and give some iso9660 information. See the code to iso-info for a more complete example. If a single argument is given, it is used as the ISO 9660 image to use in the listing. Otherwise a compiled-in default ISO 9660 image name (that comes with the libcdio distribution) will be used. This program can be compiled with either a C or C++ compiler. In the distributuion we perfer C++ just to make sure we haven't broken things on the C++ side. */ /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH "../../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/isofs-m1.cue" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define print_vd_info(title, fn) \ psz_str = p_pvd->fn(); \ if (psz_str) { \ printf(title ": %s\n", psz_str); \ free(psz_str); \ psz_str = NULL; \ } int main(int argc, const char *argv[]) { stat_vector_t stat_vector; ISO9660::FS *p_iso = new ISO9660::FS; char const *psz_fname; const char *psz_path="/"; ISO9660::PVD *p_pvd; if (argc > 1) psz_fname = argv[1]; else psz_fname = ISO9660_IMAGE; if (!p_iso->open(psz_fname, DRIVER_UNKNOWN)) { fprintf(stderr, "Sorry, couldn't open %s as a CD or CD image.\n", psz_fname); return 1; } p_pvd = p_iso->read_pvd(); if (p_pvd) { char *psz_str = NULL; print_vd_info("Application", get_application_id); print_vd_info("Preparer ", get_preparer_id); print_vd_info("Publisher ", get_publisher_id); print_vd_info("System ", get_system_id); print_vd_info("Volume ", get_volume_id); print_vd_info("Volume Set ", get_volumeset_id); free(psz_str); delete(p_pvd); } if (p_iso->readdir (psz_path, stat_vector)) { /* Iterate over the list of files. */ stat_vector_iterator_t i; for(i=stat_vector.begin(); i != stat_vector.end(); ++i) { char filename[4096]; ISO9660::Stat *p_s = *i; iso9660_name_translate(p_s->p_stat->filename, filename); printf ("%s [LSN %6d] %8u %s%s\n", 2 == p_s->p_stat->type ? "d" : "-", p_s->p_stat->lsn, p_s->p_stat->size, psz_path, filename); delete(p_s); } stat_vector.clear(); } delete(p_iso); return 0; } libcdio-2.2.0/example/C++/OO/isofile.cpp000066400000000000000000000071461474051130400175450ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2009, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to extract a file from an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the extraction. Otherwise a compiled in default ISO 9660 image name (that comes with the libcdio distribution) will be used. */ /* This is the ISO 9660 image. */ #define ISO9660_IMAGE_PATH "../../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/copying.iso" #define LOCAL_FILENAME "copying" #include "portable.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ fclose (p_outfd); \ delete (p_stat); \ delete (p_iso); \ return rc; \ int main(int argc, const char *argv[]) { ISO9660::Stat *p_stat; FILE *p_outfd; unsigned int i; char const *psz_image; char const *psz_fname; ISO9660::IFS *p_iso = new ISO9660::IFS; if (argc > 3) { printf("usage %s [ISO9660-image.ISO [filename]]\n", argv[0]); printf("Extracts filename from ISO-9660-image.ISO.\n"); return 1; } if (argc > 1) psz_image = argv[1]; else psz_image = ISO9660_IMAGE; if (argc > 2) psz_fname = argv[2]; else psz_fname = LOCAL_FILENAME; if (!p_iso->open(psz_image)) { fprintf(stderr, "Sorry, couldn't open ISO 9660 image %s\n", psz_image); return 1; } p_stat = p_iso->stat(psz_fname, true); if (!p_stat) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", psz_fname); delete(p_iso); return 2; } if (!(p_outfd = fopen (psz_fname, "wb"))) { perror ("fopen()"); delete (p_stat); delete (p_iso); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ { const unsigned int i_blocks = CEILING(p_stat->p_stat->size, ISO_BLOCKSIZE); for (i = 0; i < i_blocks ; i++) { char buf[ISO_BLOCKSIZE]; const lsn_t lsn = p_stat->p_stat->lsn + i; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != p_iso->seek_read (buf, lsn, 1) ) { fprintf(stderr, "Error reading ISO 9660 file %s at LSN %lu\n", psz_fname, (long unsigned int) lsn); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) { perror ("fwrite()"); my_exit(5); } } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_stat->p_stat->size)) perror ("ftruncate()"); printf("Extraction of file '%s' from %s successful.\n", psz_fname, psz_image); my_exit(0); } libcdio-2.2.0/example/C++/OO/isofile2.cpp000066400000000000000000000100741474051130400176210ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2009, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to extract a file from a CUE/BIN CD image. If a single argument is given, it is used as the CUE file of a CD image to use. Otherwise a compiled-in default image name (that comes with the libcdio distribution) will be used. This program can be compiled with either a C or C++ compiler. In the distribution we prefer C++ just to make sure we haven't broken things on the C++ side. */ /* This is the CD-image with an ISO-9660 filesystem */ #define ISO9660_IMAGE_PATH "../../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/isofs-m1.cue" #define ISO9660_PATH "/" #define ISO9660_FILENAME "COPYING" #define LOCAL_FILENAME "copying" #include "portable.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ fclose (p_outfd); \ delete (p_stat); \ delete (p_iso); \ return rc; \ int main(int argc, const char *argv[]) { ISO9660::Stat *p_stat; FILE *p_outfd; unsigned int i; char const *psz_image; char const *psz_fname; char translated_name[256]; char untranslated_name[256] = ISO9660_PATH; ISO9660::FS *p_iso = new ISO9660::FS; if (argc > 3) { printf("usage %s [CD-ROM-or-image [filename]]\n", argv[0]); printf("Extracts filename from CD-ROM-or-image.\n"); return 1; } if (argc > 1) psz_image = argv[1]; else psz_image = ISO9660_IMAGE; if (argc > 2) psz_fname = argv[2]; else psz_fname = ISO9660_FILENAME; strcat(untranslated_name, psz_fname); if (!p_iso->open(psz_image, DRIVER_UNKNOWN)) { fprintf(stderr, "Sorry, couldn't open %s\n", psz_image); return 1; } p_stat = p_iso->stat(psz_fname); if (!p_stat) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", untranslated_name); delete(p_iso); return 2; } iso9660_name_translate(psz_fname, translated_name); if (!(p_outfd = fopen (translated_name, "wb"))) { perror ("fopen()"); delete (p_stat); delete (p_iso); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ { const unsigned int i_blocks = CEILING(p_stat->p_stat->size, ISO_BLOCKSIZE); for (i = 0; i < i_blocks; i ++) { char buf[ISO_BLOCKSIZE]; const lsn_t lsn = p_stat->p_stat->lsn + i; memset (buf, 0, ISO_BLOCKSIZE); try { p_iso->readDataBlocks(buf, lsn, ISO_BLOCKSIZE); } catch ( DriverOpException e ) { fprintf(stderr, "Error reading ISO 9660 file at lsn %lu:\n\t%s.\n", (long unsigned int) lsn, e.get_msg()); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) { perror ("fwrite()"); my_exit(5); } } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_stat->p_stat->size)) perror ("ftruncate()"); printf("Extraction of file '%s' from '%s' successful.\n", translated_name, untranslated_name); my_exit(0); } libcdio-2.2.0/example/C++/OO/isolist.cpp000066400000000000000000000064171474051130400176010ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to list files in a directory of an ISO-9660 image and give some iso9660 information. See the code to iso-info for a more complete example. If a single argument is given, it is used as the ISO 9660 image to use in the listing. Otherwise a compiled-in default ISO 9660 image name (that comes with the libcdio distribution) will be used. This program can be compiled with either a C or C++ compiler. In the distributuion we perfer C++ just to make sure we haven't broken things on the C++ side. */ /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH "../../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/copying.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define print_vd_info(title, fn) \ if (p_iso->fn(psz_str)) { \ printf(title ": %s\n", psz_str); \ } \ free(psz_str); \ psz_str = NULL; int main(int argc, const char *argv[]) { stat_vector_t stat_vector; ISO9660::IFS *p_iso = new ISO9660::IFS; char const *psz_fname; const char *psz_path="/"; if (argc > 1) psz_fname = argv[1]; else psz_fname = ISO9660_IMAGE; if (!p_iso->open(psz_fname)) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 1; } /* Show basic CD info from the Primary Volume Descriptor. */ { char *psz_str = NULL; print_vd_info("Application", get_application_id); print_vd_info("Preparer ", get_preparer_id); print_vd_info("Publisher ", get_publisher_id); print_vd_info("System ", get_system_id); print_vd_info("Volume ", get_volume_id); print_vd_info("Volume Set ", get_volumeset_id); } if (p_iso->readdir (psz_path, stat_vector)) { /* Iterate over the list of files. */ stat_vector_iterator_t i; for(i=stat_vector.begin(); i != stat_vector.end(); ++i) { char filename[4096]; ISO9660::Stat *p_s = *i; iso9660_name_translate(p_s->p_stat->filename, filename); printf ("%s [LSN %6d] %8u %s%s\n", 2 == p_s->p_stat->type ? "d" : "-", p_s->p_stat->lsn, p_s->p_stat->size, psz_path, filename); /* stat_vector.clear() currently does not dispose the objects */ delete(p_s); } stat_vector.clear(); } delete(p_iso); return 0; } libcdio-2.2.0/example/C++/OO/mmc1.cpp000066400000000000000000000051431474051130400167430ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Sample program to show use of the MMC interface. An optional drive name can be supplied as an argument. This basically the libdio mmc_get_hwinfo() routine. See also corresponding C and non OO C++ program. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #include /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdioDevice device; const char *psz_drive = NULL; if (argc > 1) psz_drive = argv[1]; if (!device.open(psz_drive)) { printf("Couldn't find CD\n"); return 1; } else { int i_status; /* Result of MMC command */ char buf[36] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); i_status = device.mmcRunCmd(DEFAULT_TIMEOUT_MS, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]; char psz_model[CDIO_MMC_HW_MODEL_LEN+1]; char psz_rev[CDIO_MMC_HW_REVISION_LEN+1]; memcpy(psz_vendor, buf + 8, sizeof(psz_vendor)-1); psz_vendor[sizeof(psz_vendor)-1] = '\0'; memcpy(psz_model, buf + 8 + CDIO_MMC_HW_VENDOR_LEN, sizeof(psz_model)-1); psz_model[sizeof(psz_model)-1] = '\0'; memcpy(psz_rev, buf + 8 + CDIO_MMC_HW_VENDOR_LEN +CDIO_MMC_HW_MODEL_LEN, sizeof(psz_rev)-1); psz_rev[sizeof(psz_rev)-1] = '\0'; printf("Vendor: %s\nModel: %s\nRevision: %s\n", psz_vendor, psz_model, psz_rev); } else { printf("Couldn't get INQUIRY data (vendor, model, and revision).\n"); } } return 0; } libcdio-2.2.0/example/C++/OO/mmc2.cpp000066400000000000000000000123011474051130400167360ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* 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 #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPE_H #include #endif #ifdef HAVE_STRING_H #include #endif #include /* Set how long do wto wait for SCSI-MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdioDevice device; const char *psz_drive = NULL; if (argc > 1) psz_drive = argv[1]; if (!device.open(psz_drive)) { printf("Couldn't find CD\n"); return 1; } else { int i_status; /* Result of MMC command */ uint8_t buf[500] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); cdb.field[1] = CDIO_MMC_GET_CONF_ALL_FEATURES; cdb.field[3] = 0x0; i_status = device.mmcRunCmd(0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { uint8_t *p; uint32_t i_data; uint8_t *p_max = buf + 65530; i_data = (unsigned int) CDIO_MMC_GET_LEN32(buf); /* set to first sense feature code, and then walk through the masks */ p = buf + 8; while( (p < &(buf[i_data])) && (p < p_max) ) { uint16_t i_feature; uint8_t i_feature_additional = p[3]; i_feature = CDIO_MMC_GET_LEN16(p); { uint8_t *q; const char *feature_str = mmc_feature2str(i_feature); printf("%s Feature\n", feature_str); switch( i_feature ) { case CDIO_MMC_FEATURE_PROFILE_LIST: for ( q = p+4 ; q < p + i_feature_additional ; q += 4 ) { int i_profile=CDIO_MMC_GET_LEN16(q); const char *feature_profile_str = mmc_feature_profile2str(i_profile); printf( "\t%s", feature_profile_str ); if (q[2] & 1) { printf(" - on"); } printf("\n"); } printf("\n"); break; case CDIO_MMC_FEATURE_CORE: { uint8_t *q = p+4; uint32_t i_interface_standard = CDIO_MMC_GET_LEN32(q); switch(i_interface_standard) { case 0: printf("\tunspecified interface\n"); break; case 1: printf("\tSCSI interface\n"); break; case 2: printf("\tATAPI interface\n"); break; case 3: printf("\tIEEE 1394 interface\n"); break; case 4: printf("\tIEEE 1394A interface\n"); break; case 5: printf("\tFibre Channel interface\n"); } printf("\n"); break; } case CDIO_MMC_FEATURE_REMOVABLE_MEDIUM: switch(p[4] >> 5) { case 0: printf("\tCaddy/Slot type loading mechanism\n"); break; case 1: printf("\tTray type loading mechanism\n"); break; case 2: printf("\tPop-up type loading mechanism\n"); break; case 4: printf("\tEmbedded changer with individually changeable discs\n"); break; case 5: printf("\tEmbedded changer using a magazine mechanism\n"); break; default: printf("\tUnknown changer mechanism\n"); } printf("\tcan%s eject the medium or magazine via the normal " "START/STOP command\n", (p[4] & 8) ? "": "not"); printf("\tcan%s be locked into the Logical Unit\n", (p[4] & 1) ? "": "not"); printf("\n"); break; case CDIO_MMC_FEATURE_CD_READ: printf("CD Read Feature\n"); printf("\tC2 Error pointers are %ssupported\n", (p[4] & 2) ? "": "not "); printf("\tCD-Text is %ssupported\n", (p[4] & 1) ? "": "not "); printf("\n"); break; case CDIO_MMC_FEATURE_CDDA_EXT_PLAY: printf("\tSCAN command is %ssupported\n", (p[4] & 4) ? "": "not "); printf("\taudio channels can %sbe muted separately\n", (p[4] & 2) ? "": "not "); printf("\taudio channels can %shave separate volume levels\n", (p[4] & 1) ? "": "not "); { uint8_t *q = p+6; uint16_t i_vol_levels = CDIO_MMC_GET_LEN16(q); printf("\t%d volume levels can be set\n", i_vol_levels); } printf("\n"); break; case CDIO_MMC_FEATURE_LU_SN: { uint8_t i_serial = *(p+3); char serial[257] = { '\0', }; memcpy(serial, p+4, i_serial); printf("\t%s\n\n", serial); break; } default: printf("\n"); break; } p += i_feature_additional + 4; } } } else { printf("Didn't get all feature codes\n"); } } return 0; } libcdio-2.2.0/example/C++/OO/tracks.cpp000066400000000000000000000035141474051130400173750ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to list track numbers and logical sector numbers of a Compact Disc using libcdio. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include int main(int argc, const char *argv[]) { CdioDevice device; track_t i_first_track; track_t i_tracks; int j, i; CdioTrack *track; if (!device.open (NULL)) { printf("Couldn't find a driver.. leaving.\n"); return 1; } i_tracks = device.getNumTracks(); i_first_track = i = device.getFirstTrackNum(); printf("CD-ROM Track List (%i - %i)\n", i_first_track, i_tracks); printf(" #: LSN\n"); for (j = 0; j < i_tracks; i++, j++) { track = device.getTrackFromNum(i); lsn_t lsn = track->getLsn(); if (CDIO_INVALID_LSN != lsn) printf("%3d: %06lu\n", (int) i, (long unsigned int) lsn); delete(track); } track = device.getTrackFromNum(CDIO_CDROM_LEADOUT_TRACK); printf("%3X: %06lu leadout\n", CDIO_CDROM_LEADOUT_TRACK, (long unsigned int) track->getLsn()); delete(track); return 0; } libcdio-2.2.0/example/C++/README000066400000000000000000000030201474051130400157350ustar00rootroot00000000000000$Id: README,v 1.4 2006/04/15 16:22:49 rocky Exp $ This directory contains some simple C++ examples of the use of the libcdio library. Descriptions of the programs in this example directory are as follows... device.cpp: A program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. eject.cpp: A program eject a CD from a CD-ROM drive and then close the door again. isofile.cpp: A program to show using libiso9660 to extract a file from an ISO-9660 image. isofile2.cpp: A program to show using libiso9660 to extract a file from a CDRWIN cue/bin CD image. isolist.cpp: A program to show using libiso9660 to list files in a directory of an ISO-9660 image and give basic iso9660 information. mmc1.cpp: A program to show issuing a simple MMC command (INQUIRY). mmc2.cpp: A more involved MMC command to list features from a MMC GET_CONFIGURATION command. paranoia.cpp: A program to show using CD-DA paranoia (a library for jitter detection and audio-read error correction). This program uses an interface compatible (mostly) with cdparanoia. It looks for a CD-ROM with an audio CD in it and rips up to the first 300 sectors of track 1 to file track1s.wav. paranoia2.cpp: Another program to show using CD-DA paranoia using a more libcdio-oriented initialization. Probably more suited to things that otherwise use libcdio such as media players (e.g. for getting CDDB or CD-Text info) libcdio-2.2.0/example/C++/device.cpp000066400000000000000000000112501474051130400170240ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show drivers installed and what the default CD-ROM drive is. See also corresponding C program of a similar name. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define _(x) x /* Prints out drive capabilities */ static void print_drive_capabilities(cdio_drive_read_cap_t i_read_cap, cdio_drive_write_cap_t i_write_cap, cdio_drive_misc_cap_t i_misc_cap) { if (CDIO_DRIVE_CAP_ERROR == i_misc_cap) { printf("Error in getting drive hardware properties\n"); } else { printf(_("Hardware : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_FILE ? "Disk Image" : "CD-ROM or DVD"); printf(_("Can eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_EJECT ? "Yes" : "No"); printf(_("Can close tray : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_CLOSE_TRAY ? "Yes" : "No"); printf(_("Can disable manual eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_LOCK ? "Yes" : "No"); printf(_("Can select juke-box disc : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_DISC ? "Yes" : "No"); printf(_("Can set drive speed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_SPEED ? "Yes" : "No"); printf(_("Can detect if CD changed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED ? "Yes" : "No"); printf(_("Can read multiple sessions : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MULTI_SESSION ? "Yes" : "No"); printf(_("Can hard reset device : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_RESET ? "Yes" : "No"); } if (CDIO_DRIVE_CAP_ERROR == i_read_cap) { printf("Error in getting drive reading properties\n"); } else { printf("Reading....\n"); printf(_(" Can play audio : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_AUDIO ? "Yes" : "No"); printf(_(" Can read CD-R : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_R ? "Yes" : "No"); printf(_(" Can read CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No"); printf(_(" Can read DVD-ROM : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_DVD_ROM ? "Yes" : "No"); } if (CDIO_DRIVE_CAP_ERROR == i_write_cap) { printf("Error in getting drive writing properties\n"); } else { printf("\nWriting....\n"); printf(_(" Can write CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No"); printf(_(" Can write DVD-R : %s\n"), i_write_cap & CDIO_DRIVE_CAP_READ_DVD_R ? "Yes" : "No"); printf(_(" Can write DVD-RAM : %s\n"), i_write_cap & CDIO_DRIVE_CAP_READ_DVD_RAM ? "Yes" : "No"); } } int main(int argc, const char *argv[]) { CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); const driver_id_t *driver_id_p; if (NULL != p_cdio) { char *default_device = cdio_get_default_device(p_cdio); cdio_drive_read_cap_t i_read_cap; cdio_drive_write_cap_t i_write_cap; cdio_drive_misc_cap_t i_misc_cap; printf("The driver selected is %s\n", cdio_get_driver_name(p_cdio)); if (default_device) printf("The default device for this driver is %s\n", default_device); cdio_get_drive_cap(p_cdio, &i_read_cap, &i_write_cap, &i_misc_cap); print_drive_capabilities(i_read_cap, i_write_cap, i_misc_cap); free(default_device); cdio_destroy(p_cdio); printf("\n"); } else { printf("Problem in trying to find a driver.\n\n"); } for (driver_id_p=cdio_drivers; *driver_id_p!=DRIVER_UNKNOWN; ++driver_id_p) if (cdio_have_driver(*driver_id_p)) printf("We have: %s\n", cdio_driver_describe(*driver_id_p)); else printf("We don't have: %s\n", cdio_driver_describe(*driver_id_p)); return 0; } libcdio-2.2.0/example/C++/eject.cpp000066400000000000000000000053461474051130400166700ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to eject a CD-ROM drive door and then close it again. If a single argument is given, it is used as the CD-ROM device to eject/close. Otherwise a CD-ROM drive will be scanned for. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include int main(int argc, const char *argv[]) { driver_return_code_t ret; driver_id_t driver_id = DRIVER_DEVICE; char *psz_drive = NULL; if (argc > 1) psz_drive = strdup(argv[1]); if (!psz_drive) { psz_drive = cdio_get_default_device_driver(&driver_id); if (!psz_drive) { printf("Can't find a CD-ROM to eject\n"); exit(1); } } ret = cdio_eject_media_drive(psz_drive); switch(ret) { case DRIVER_OP_UNSUPPORTED: printf("Eject not supported for %s.\n", psz_drive); break; case DRIVER_OP_SUCCESS: printf("CD-ROM drive %s ejected.\n", psz_drive); break; default: printf("Eject of CD-ROM drive %s failed.\n", psz_drive); break; } if (DRIVER_OP_SUCCESS == cdio_close_tray(psz_drive, &driver_id)) { printf("Closed tray of CD-ROM drive %s.\n", psz_drive); } else { printf("Closing tray of CD-ROM drive %s failed.\n", psz_drive); } free(psz_drive); ret = cdio_eject_media_drive(NULL); switch(ret) { case DRIVER_OP_UNSUPPORTED: printf("Eject not supported for default device.\n"); break; case DRIVER_OP_SUCCESS: printf("CD-ROM drive ejected for default device.\n"); break; default: printf("Eject of CD-ROM drive failed for default device.\n"); break; } driver_id = DRIVER_DEVICE; if (DRIVER_OP_SUCCESS == cdio_close_tray(NULL, &driver_id)) { printf("Closed tray of CD-ROM drive for default disc driver:\n\t%s\n", cdio_driver_describe(driver_id)); } else { printf("Closing tray of CD-ROM drive failed for default " "disc driver:\n\t%s\n", cdio_driver_describe(driver_id)); } return 0; } libcdio-2.2.0/example/C++/isofile.cpp000066400000000000000000000073061474051130400172260ustar00rootroot00000000000000/* Copyright (C) 2004, 2006, 2008, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to extract a file from an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the extraction. Otherwise a compiled in default ISO 9660 image name (that comes with the libcdio distribution) will be used. */ /* This is the ISO 9660 image. */ #define ISO9660_IMAGE_PATH "../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/copying.iso" #define LOCAL_FILENAME "copying" #include "portable.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ fclose (p_outfd); \ iso9660_stat_free(p_statbuf); \ iso9660_close(p_iso); \ return rc; \ int main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; unsigned int i; char const *psz_image; char const *psz_fname; iso9660_t *p_iso; if (argc > 3) { printf("usage %s [ISO9660-image.ISO [filename]]\n", argv[0]); printf("Extracts filename from ISO-9660-image.ISO.\n"); return 1; } if (argc > 1) psz_image = argv[1]; else psz_image = ISO9660_IMAGE; if (argc > 2) psz_fname = argv[2]; else psz_fname = LOCAL_FILENAME; p_iso = iso9660_open (psz_image); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open ISO 9660 image %s\n", psz_image); return 1; } p_statbuf = iso9660_ifs_stat_translate (p_iso, psz_fname); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", psz_fname); iso9660_close(p_iso); return 2; } if (!(p_outfd = fopen (psz_fname, "wb"))) { perror ("fopen()"); iso9660_stat_free(p_statbuf); iso9660_close(p_iso); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ { const unsigned int i_blocks = CEILING(p_statbuf->size, ISO_BLOCKSIZE); for (i = 0; i < i_blocks ; i++) { char buf[ISO_BLOCKSIZE]; const lsn_t lsn = p_statbuf->lsn + i; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, lsn, 1) ) { fprintf(stderr, "Error reading ISO 9660 file %s at LSN %lu\n", psz_fname, (long unsigned int) lsn); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) { perror ("fwrite()"); my_exit(5); } } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_statbuf->size)) perror ("ftruncate()"); printf("Extraction of file '%s' from %s successful.\n", psz_fname, psz_image); my_exit(0); } libcdio-2.2.0/example/C++/isofile2.cpp000066400000000000000000000073111474051130400173040ustar00rootroot00000000000000/* Copyright (C) 2004, 2006, 2008, 2009, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to extract a file from an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the extraction. Otherwise a compiled in default ISO 9660 image name (that comes with the libcdio distribution) will be used. */ /* This is the ISO 9660 image. */ #define ISO9660_IMAGE_PATH "../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/copying.iso" #define LOCAL_FILENAME "copying" #include "portable.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ fclose (p_outfd); \ iso9660_stat_free(p_statbuf); \ iso9660_close(p_iso); \ return rc; \ int main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; unsigned int i; char const *psz_image; char const *psz_fname; iso9660_t *p_iso; if (argc > 3) { printf("usage %s [ISO9660-image.ISO [filename]]\n", argv[0]); printf("Extracts filename from ISO-9660-image.ISO.\n"); return 1; } if (argc > 1) psz_image = argv[1]; else psz_image = ISO9660_IMAGE; if (argc > 2) psz_fname = argv[2]; else psz_fname = LOCAL_FILENAME; p_iso = iso9660_open (psz_image); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open ISO 9660 image %s\n", psz_image); return 1; } p_statbuf = iso9660_ifs_stat_translate (p_iso, psz_fname); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", psz_fname); iso9660_close(p_iso); return 2; } if (!(p_outfd = fopen (psz_fname, "wb"))) { perror ("fopen()"); iso9660_stat_free(p_statbuf); iso9660_close(p_iso); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ { const unsigned int i_blocks = CEILING(p_statbuf->size, ISO_BLOCKSIZE); for (i = 0; i < i_blocks ; i++) { char buf[ISO_BLOCKSIZE]; const lsn_t lsn = p_statbuf->lsn + i; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, lsn, 1) ) { fprintf(stderr, "Error reading ISO 9660 file %s at LSN %lu\n", psz_fname, (long unsigned int) lsn); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) { perror ("fwrite()"); my_exit(5); } } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_statbuf->size)) perror ("ftruncate()"); printf("Extraction of file '%s' from %s successful.\n", psz_fname, psz_image); my_exit(0); } libcdio-2.2.0/example/C++/isolist.cpp000066400000000000000000000066431474051130400172650ustar00rootroot00000000000000/* Copyright (C) 2004, 2006, 2008, 2009 2017, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to list files in a directory of an ISO-9660 image and give some iso9660 information. See the code to iso-info for a more complete example. If a single argument is given, it is used as the ISO 9660 image to use in the listing. Otherwise a compiled-in default ISO 9660 image name (that comes with the libcdio distribution) will be used. This program can be compiled with either a C or C++ compiler. In the distributuion we perfer C++ just to make sure we haven't broken things on the C++ side. */ /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH "../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/copying.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define print_vd_info(title, fn) \ if (fn(p_iso, &psz_str)) { \ printf(title ": %s\n", psz_str); \ } \ free(psz_str); \ psz_str = NULL; int main(int argc, const char *argv[]) { CdioISO9660FileList_t *p_entlist; CdioListNode_t *p_entnode; char const *psz_fname; iso9660_t *p_iso; const char *psz_path="/"; if (argc > 1) psz_fname = argv[1]; else psz_fname = ISO9660_IMAGE; p_iso = iso9660_open (psz_fname); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 1; } /* Show basic CD info from the Primary Volume Descriptor. */ { char *psz_str = NULL; print_vd_info("Application", iso9660_ifs_get_application_id); print_vd_info("Preparer ", iso9660_ifs_get_preparer_id); print_vd_info("Publisher ", iso9660_ifs_get_publisher_id); print_vd_info("System ", iso9660_ifs_get_system_id); print_vd_info("Volume ", iso9660_ifs_get_volume_id); print_vd_info("Volume Set ", iso9660_ifs_get_volumeset_id); } p_entlist = iso9660_ifs_readdir (p_iso, psz_path); /* Iterate over the list of nodes that iso9660_ifs_readdir gives */ if (p_entlist) { _CDIO_LIST_FOREACH (p_entnode, p_entlist) { char filename[4096]; iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (p_entnode); iso9660_name_translate(p_statbuf->filename, filename); printf ("%s [LSN %6d] %8u %s%s\n", 2 == p_statbuf->type ? "d" : "-", p_statbuf->lsn, p_statbuf->size, psz_path, filename); } iso9660_filelist_free(p_entlist); } iso9660_close(p_iso); return 0; } libcdio-2.2.0/example/C++/mmc1.cpp000066400000000000000000000053561474051130400164340ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Sample program to show use of the MMC interface. An optional drive name can be supplied as an argument. This basically the libdio mmc_get_hwinfo() routine. See also corresponding C and OO C++ program. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdIo_t *p_cdio; const char *psz_drive = NULL; if (argc > 1) psz_drive = argv[1]; p_cdio = cdio_open (psz_drive, DRIVER_UNKNOWN); if (NULL == p_cdio) { printf("Couldn't find CD\n"); return 1; } else { int i_status; /* Result of MMC command */ char buf[36] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); i_status = mmc_run_cmd(p_cdio, DEFAULT_TIMEOUT_MS, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]; char psz_model[CDIO_MMC_HW_MODEL_LEN+1]; char psz_rev[CDIO_MMC_HW_REVISION_LEN+1]; memcpy(psz_vendor, buf + 8, sizeof(psz_vendor)-1); psz_vendor[sizeof(psz_vendor)-1] = '\0'; memcpy(psz_model, buf + 8 + CDIO_MMC_HW_VENDOR_LEN, sizeof(psz_model)-1); psz_model[sizeof(psz_model)-1] = '\0'; memcpy(psz_rev, buf + 8 + CDIO_MMC_HW_VENDOR_LEN +CDIO_MMC_HW_MODEL_LEN, sizeof(psz_rev)-1); psz_rev[sizeof(psz_rev)-1] = '\0'; printf("Vendor: %s\nModel: %s\nRevision: %s\n", psz_vendor, psz_model, psz_rev); } else { printf("Couldn't get INQUIRY data (vendor, model, and revision).\n"); } } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/C++/mmc2.cpp000066400000000000000000000123261474051130400164300ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* 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 #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include /* Set how long do wto wait for SCSI-MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdIo_t *p_cdio; p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); if (NULL == p_cdio) { printf("Couldn't find CD\n"); return 1; } else { int i_status; /* Result of MMC command */ uint8_t buf[500] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); cdb.field[1] = CDIO_MMC_GET_CONF_ALL_FEATURES; cdb.field[3] = 0x0; i_status = mmc_run_cmd(p_cdio, 0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { uint8_t *p; uint32_t i_data; uint8_t *p_max = buf + 65530; i_data = (unsigned int) CDIO_MMC_GET_LEN32(buf); /* set to first sense feature code, and then walk through the masks */ p = buf + 8; while( (p < &(buf[i_data])) && (p < p_max) ) { uint16_t i_feature; uint8_t i_feature_additional = p[3]; i_feature = CDIO_MMC_GET_LEN16(p); { uint8_t *q; const char *feature_str = mmc_feature2str(i_feature); printf("%s Feature\n", feature_str); switch( i_feature ) { case CDIO_MMC_FEATURE_PROFILE_LIST: for ( q = p+4 ; q < p + i_feature_additional ; q += 4 ) { int i_profile=CDIO_MMC_GET_LEN16(q); const char *feature_profile_str = mmc_feature_profile2str(i_profile); printf( "\t%s", feature_profile_str ); if (q[2] & 1) { printf(" - on"); } printf("\n"); } printf("\n"); break; case CDIO_MMC_FEATURE_CORE: { uint8_t *q = p+4; uint32_t i_interface_standard = CDIO_MMC_GET_LEN32(q); switch(i_interface_standard) { case 0: printf("\tunspecified interface\n"); break; case 1: printf("\tSCSI interface\n"); break; case 2: printf("\tATAPI interface\n"); break; case 3: printf("\tIEEE 1394 interface\n"); break; case 4: printf("\tIEEE 1394A interface\n"); break; case 5: printf("\tFibre Channel interface\n"); } printf("\n"); break; } case CDIO_MMC_FEATURE_REMOVABLE_MEDIUM: switch(p[4] >> 5) { case 0: printf("\tCaddy/Slot type loading mechanism\n"); break; case 1: printf("\tTray type loading mechanism\n"); break; case 2: printf("\tPop-up type loading mechanism\n"); break; case 4: printf("\tEmbedded changer with individually changeable discs\n"); break; case 5: printf("\tEmbedded changer using a magazine mechanism\n"); break; default: printf("\tUnknown changer mechanism\n"); } printf("\tcan%s eject the medium or magazine via the normal " "START/STOP command\n", (p[4] & 8) ? "": "not"); printf("\tcan%s be locked into the Logical Unit\n", (p[4] & 1) ? "": "not"); printf("\n"); break; case CDIO_MMC_FEATURE_CD_READ: printf("CD Read Feature\n"); printf("\tC2 Error pointers are %ssupported\n", (p[4] & 2) ? "": "not "); printf("\tCD-Text is %ssupported\n", (p[4] & 1) ? "": "not "); printf("\n"); break; case CDIO_MMC_FEATURE_CDDA_EXT_PLAY: printf("\tSCAN command is %ssupported\n", (p[4] & 4) ? "": "not "); printf("\taudio channels can %sbe muted separately\n", (p[4] & 2) ? "": "not "); printf("\taudio channels can %shave separate volume levels\n", (p[4] & 1) ? "": "not "); { uint8_t *q = p+6; uint16_t i_vol_levels = CDIO_MMC_GET_LEN16(q); printf("\t%d volume levels can be set\n", i_vol_levels); } printf("\n"); break; case CDIO_MMC_FEATURE_LU_SN: { uint8_t i_serial = *(p+3); char serial[257] = { '\0', }; memcpy(serial, p+4, i_serial); printf("\t%s\n\n", serial); break; } default: printf("\n"); break; } p += i_feature_additional + 4; } } } else { printf("Didn't get all feature codes\n"); } } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/Makefile.am000066400000000000000000000106451474051130400166140ustar00rootroot00000000000000# Copyright (C) 2003-2006, 2008-2009, 2012-2013, 2017 # Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #################################################### # Sample programs #################################################### # if ENABLE_CPP SUBDIRS = C++ endif noinst_PROGRAMS = \ audio \ cdchange \ cdio-eject \ cdtext \ cdtext-raw \ device \ discid \ drives \ eject \ extract \ isofile \ isorr \ isofile2 \ isofuzzy \ isolist \ isolsn \ logging \ mmc1 \ mmc2 \ mmc2a \ mmc3 \ sample3 \ sample4 \ tracks \ udf1 \ udf2 \ udffile check_PROGRAMS = device drives isofile2 \ mmc1 mmc2 mmc2a mmc3 sample4 #: run regression tests. "test" is the same thing as "check" test: check-am #: Run all tests without bloated output check-short: $(MAKE) check 2>&1 | ruby @abs_top_srcdir@/make-check-filter.rb #: run valgrind on C programs check-leaks: $(check_PROGRAMS) for p in $(check_PROGRAMS); do \ valgrind ./$$p; \ done AM_CPPFLAGS = $(LIBCDIO_CFLAGS) audio_DEPENDENCIES = $(LIBCDIO_DEPS) audio_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdchange_DEPENDENCIES = $(LIBCDIO_DEPS) cdchange_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdio_eject_DEPENDENCIES = $(LIBCDIO_DEPS) cdio_eject_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdtext_DEPENDENCIES = $(LIBCDIO_DEPS) cdtext_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdtext_raw_DEPENDENCIES = $(LIBCDIO_DEPS) cdtext_raw_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) device_DEPENDENCIES = $(LIBCDIO_DEPS) device_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) discid_DEPENDENCIES = $(LIBCDIO_DEPS) discid_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) drives_DEPENDENCIES = $(LIBCDIO_DEPS) drives_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) eject_DEPENDENCIES = $(LIBCDIO_DEPS) eject_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) extract_DEPENDENCIES = $(LIBISO9660_LIBS) $(LIBUDF_LIBS) $(LIBCDIO_DEPS) extract_LDADD = $(LIBISO9660_LIBS) $(LIBUDF_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isorr_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isofile_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isofile2_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isofuzzy_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isolist_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) isolsn_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) logging_DEPENDENCIES = $(LIBCDIO_DEPS) logging_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) mmc1_DEPENDENCIES = $(LIBCDIO_DEPS) mmc1_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) mmc2_DEPENDENCIES = $(LIBCDIO_DEPS) mmc2_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) mmc2a_DEPENDENCIES = $(LIBCDIO_DEPS) mmc2a_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) mmc3_DEPENDENCIES = $(LIBCDIO_DEPS) mmc3_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) sample3_DEPENDENCIES = $(LIBCDIO_DEPS) sample3_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) sample4_DEPENDENCIES = $(LIBCDIO_DEPS) sample4_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) tracks_DEPENDENCIES = $(LIBCDIO_DEPS) tracks_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) udf1_DEPENDENCIES = $(LIBUDF_LIBS) $(LIBCDIO_DEPS) udf1_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) udf2_DEPENDENCIES = $(LIBUDF_LIBS) $(LIBCDIO_DEPS) udf2_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) udffile_DEPENDENCIES = $(LIBUDF_LIBS) $(LIBCDIO_DEPS) udffile_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) TESTS = $(check_PROGRAMS) MOSTLYCLEANFILES = copying *.wav *.log *.trs *.orig *.rej *.dSYM mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -fr $(MOSTLYCLEANFILES) -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) libcdio-2.2.0/example/README000066400000000000000000000104361474051130400154360ustar00rootroot00000000000000This directory contains some simple examples of the use of the libcdio library. One might also possibly find useful C code among the regression tests (directory test), e.g. testbincue.c, testdefault.c, testiso9660.c, testparanoia.c, or testtoc.c Larger more-complicated examples are the cd-drive, cd-info, cd-read, cdda-player, iso-info and iso-read programs in the src directory. And going further there's the cd-paranoia program (in src/cd-paranoia), and "real-world' code in the xine VCD plugin, or the vlc CD-DA plugin which are part of those distributions. In some cases you may have to make small changes to compile these programs. For example, compiling using Solaris's C compiler with largefile support on a 64-bit system, may require changing C headers. Descriptions of the programs in this example directory are as follows... audio.c: Sample program to show audio controls. cdchange.c: A program to test if a CD has been changed since the last change test. cdio-eject.c: a stripped-down "eject" command to open or close a CDROM tray cdtext.c: A program to show CD-Text and CD disc mode info. cdtext-raw.c: A program to show CD-Text parsing from binary files. device.c: A program to show drivers installed and what the default CD-ROM drive is. See also corresponding C++ programs of similar names. discid.c: http://sourceforge.net/projects/discid/ using libcdio: a small program to calculate the disc-ID for audio compact discs. The disc-ID can be used to query info (tracks, title, interpret) about compact audio discs from a CDDB-Server. drives.c: A program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. eject.c: A program eject a CD from a CD-ROM drive and then close the door again. extract.c: Extract the full contents of either an UDF or ISO9660 image file. isofile.c: A program to show using libiso9660 to extract a file from an ISO-9660 image. isofile2.c: A program to show using libiso9660 to extract a file from a CDRWIN cue/bin CD image. isofuzzy.c : A program showing fuzzy ISO-9660 detection/reading. isolist.c: A program to show using libiso9660 to list files in a directory of an ISO-9660 image and give basic iso9660 information. isolsn.c: A program to show using libiso9660 to get the file path for a given LSN. mmc1.c: A program to show issuing a simple MMC command (INQUIRY). mmc2.c: A more involved MMC command to list features from a MMC GET_CONFIGURATION command. mmc2a.c: Show MODE_SENSE page 2A paramaters: CD/DVD Capabilities and Mechanical Status Page mmc3.c Another simple program to show use of SCSI MMC interface. Is basically the the libdio scsi_mmc_get_hwinfo() routine. paranoia: A program to show using CD-DA paranoia (a library for jitter detection and audio-read error correction). This program uses an interface compatible (mostly) with cdparanoia. It looks for a CD-ROM with an audio CD in it and rips up to the first 300 sectors of track 1 to file track01s.wav. paranoia2: Another program to show using CD-DA paranoia using a more libcdio-oriented initialization. Probably more suited to things that otherwise use libcdio such as media players (e.g. for getting CDDB or CD-Text info) sample3.c: A simple program to show the use of cdio_guess_cd_type(). Figure out the kind of CD image we've got. sample4.c: A slightly improved sample3 program: we handle cdio logging and take an optional CD-location. tracks.c: A program to list track numbers and logical sector numbers of a Compact Disc using libcdio. udf1.c: A program to show using libudf to list files in a directory of an UDF image. udf2.c: A program to show using libudf to extract a file from an UDF image. udffile.c A program to show using libudf to extract a file. Many of the above programs can be compiled in C++. See that directory for C++ examples which include some of the above. Some of these programs are also used in testing. When this occurs, output is prepended with -- so it can be filtered out by Ruby program make-check-filter.rb when running "make check-short". libcdio-2.2.0/example/audio.c000066400000000000000000000276571474051130400160400ustar00rootroot00000000000000/* Copyright (C) 2005, 2008-2009, 2012, 2014, 2017 Rocky Bernstein Adapted from Gerd Knorr's player.c program Copyright (C) 1997, 1998 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* A program to show use of audio controls. For a more expanded CDDA player program using curses display see cdda-player in this distribution. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_GETOPT_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include #include #include #include #include static bool play_track(track_t t1, track_t t2); static CdIo_t *p_cdio_global = NULL; /* libcdio handle */ static driver_id_t driver_id = DRIVER_DEVICE; /* cdrom data */ static track_t i_first_track; static track_t i_last_track; static track_t i_first_audio_track; static track_t i_last_audio_track; static track_t i_tracks; static msf_t toc[CDIO_CDROM_LEADOUT_TRACK+1]; static cdio_subchannel_t sub; /* subchannel last time read */ static int i_data; /* # of data tracks present ? */ static int start_track = 0; static int stop_track = 0; static int one_track = 0; static bool b_cd = false; static bool auto_mode = false; static bool b_verbose = false; static bool debug = false; static bool b_record = false; /* we have a record for the inserted CD */ static char *psz_device_global=NULL; static char *psz_program; inline static void xperror(const char *psz_msg) { if (b_verbose) { fprintf(stderr, "error: "); perror(psz_msg); } return; } static void oops(const char *psz_msg, int rc) { cdio_destroy (p_cdio_global); free (psz_device_global); exit (rc); } /* ---------------------------------------------------------------------- */ /*! Stop playing audio CD */ static bool cd_stop(CdIo_t *p_cdio) { bool b_ok = true; if (b_cd && p_cdio) { i_last_audio_track = CDIO_INVALID_TRACK; b_ok = DRIVER_OP_SUCCESS == cdio_audio_stop(p_cdio); if ( !b_ok ) xperror("stop"); } return b_ok; } /*! Eject CD */ static bool cd_eject(void) { bool b_ok = true; if (p_cdio_global) { cd_stop(p_cdio_global); b_ok = DRIVER_OP_SUCCESS == cdio_eject_media(&p_cdio_global); if (!b_ok) xperror("eject"); b_cd = false; p_cdio_global = NULL; } return b_ok; } /*! Close CD tray */ static bool cd_close(const char *psz_device) { bool b_ok = true; if (!b_cd) { b_ok = DRIVER_OP_SUCCESS == cdio_close_tray(psz_device, &driver_id); if (!b_ok) xperror("close"); } return b_ok; } /*! Pause playing audio CD */ static bool cd_pause(CdIo_t *p_cdio) { bool b_ok = true; if (sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) { b_ok = DRIVER_OP_SUCCESS == cdio_audio_pause(p_cdio); if (!b_ok) xperror("pause"); } return b_ok; } /*! Get status/track/position info of an audio CD */ static bool read_subchannel(CdIo_t *p_cdio) { bool b_ok = true; if (!b_cd) return false; b_ok = DRIVER_OP_SUCCESS == cdio_audio_read_subchannel(p_cdio, &sub); if (!b_ok) { xperror("read subchannel"); b_cd = 0; } if (auto_mode && sub.audio_status == CDIO_MMC_READ_SUB_ST_COMPLETED) cd_eject(); return b_ok; } /*! Read CD TOC and set CD information. */ static void read_toc(CdIo_t *p_cdio) { track_t i; i_first_track = cdio_get_first_track_num(p_cdio); i_last_track = cdio_get_last_track_num(p_cdio); i_tracks = cdio_get_num_tracks(p_cdio); i_first_audio_track = i_first_track; i_last_audio_track = i_last_track; if ( CDIO_INVALID_TRACK == i_first_track || CDIO_INVALID_TRACK == i_last_track ) { xperror("read toc header"); b_cd = false; b_record = false; } else { b_cd = true; i_data = 0; for (i = i_first_track; i <= i_last_track+1; i++) { if ( !cdio_get_track_msf(p_cdio, i, &(toc[i])) ) { xperror("read toc entry"); b_cd = false; return; } if ( TRACK_FORMAT_AUDIO != cdio_get_track_format(p_cdio, i) ) { if ((i != i_last_track+1) ) { i_data++; if (i == i_first_track) { if (i == i_last_track) i_first_audio_track = CDIO_CDROM_LEADOUT_TRACK; else i_first_audio_track++; } } } } b_record = true; read_subchannel(p_cdio); if (auto_mode && sub.audio_status != CDIO_MMC_READ_SUB_ST_PLAY) play_track(1, CDIO_CDROM_LEADOUT_TRACK); } } /*! Play an audio track. */ static bool play_track(track_t i_start_track, track_t i_end_track) { bool b_ok = true; if (!b_cd) { cd_close(psz_device_global); read_toc(p_cdio_global); } read_subchannel(p_cdio_global); if (!b_cd || i_first_track == CDIO_CDROM_LEADOUT_TRACK) return false; if (debug) fprintf(stderr,"play tracks: %d-%d => ", i_start_track, i_end_track); if (i_start_track < i_first_track) i_start_track = i_first_track; if (i_start_track > i_last_audio_track) i_start_track = i_last_audio_track; if (i_end_track < i_first_track) i_end_track = i_first_track; if (i_end_track > i_last_audio_track) i_end_track = i_last_audio_track; if (debug) fprintf(stderr,"%d-%d\n",i_start_track, i_end_track); cd_pause(p_cdio_global); b_ok = (DRIVER_OP_SUCCESS == cdio_audio_play_msf(p_cdio_global, &(toc[i_start_track]), &(toc[i_end_track])) ); if (!b_ok) xperror("play"); return b_ok; } static void usage(char *prog) { fprintf(stderr, "%s is a simple interface to issuing CD audio comamnds\n" "\n" "usage: %s [options] [device]\n" "\n" "default for to search for a CD-ROM device with a CD-DA loaded\n" "\n" "These command line options available:\n" " -h print this help\n" " -a start up in auto-mode\n" " -v verbose\n" "\n" " Use only one of these:\n" " -C close CD-ROM tray. If you use this option,\n" " a CD-ROM device name must be specified.\n" " -p play the whole CD\n" " -t n play track >n<\n" " -t a-b play all tracks between a and b (inclusive)\n" " -L set volume level\n" " -s stop playing\n" " -S list audio subchannel information\n" " -e eject cdrom\n" "\n" "That's all. Oh, maybe a few words more about the auto-mode. This\n" "is the 'dont-touch-any-key' feature. You load a CD, player starts\n" "to play it, and when it is done it ejects the CD. Start it that\n" "way on a spare console and forget about it...\n" "\n" "(c) 1997,98 Gerd Knorr \n" "(c) 2005 Rocky Bernstein \n" , prog, prog); } typedef enum { NO_OP=0, PLAY_CD=1, PLAY_TRACK=2, STOP_PLAYING=3, EJECT_CD=4, CLOSE_CD=5, SET_VOLUME=6, LIST_SUBCHANNEL=7, } cd_operation_t; int main(int argc, char *argv[]) { int c; char *h; int i_rc = 0; int i_volume_level = -1; cd_operation_t todo = NO_OP; /* operation to do in non-interactive mode */ psz_program = strrchr(argv[0],'/'); psz_program = psz_program ? psz_program+1 : argv[0]; /* parse options */ while ( 1 ) { if (-1 == (c = getopt(argc, argv, "aCdehkpL:sSt:vx"))) break; switch (c) { case 'v': b_verbose = true; break; case 'd': debug = 1; break; case 'a': auto_mode = 1; break; case 'L': if (NULL != strchr(optarg,'-')) { i_volume_level = atoi(optarg); todo = SET_VOLUME; } break; case 't': if (NULL != (h = strchr(optarg,'-'))) { *h = 0; start_track = atoi(optarg); stop_track = atoi(h+1)+1; if (0 == start_track) start_track = 1; if (1 == stop_track) stop_track = CDIO_CDROM_LEADOUT_TRACK; } else { start_track = atoi(optarg); stop_track = start_track+1; one_track = 1; } todo = PLAY_TRACK; break; case 'p': todo = PLAY_CD; break; case 'C': todo = CLOSE_CD; break; break; case 's': todo = STOP_PLAYING; break; case 'S': todo = LIST_SUBCHANNEL; break; case 'e': todo = EJECT_CD; break; case 'h': usage(psz_program); exit(1); default: usage(psz_program); exit(1); } } if (argc > optind) { psz_device_global = strdup(argv[optind]); } else { char **ppsz_cdda_drives=NULL; char **ppsz_all_cd_drives = cdio_get_devices_ret(&driver_id); if (!ppsz_all_cd_drives) { fprintf(stderr, "Can't find a CD-ROM drive\n"); exit(2); } ppsz_cdda_drives = cdio_get_devices_with_cap(ppsz_all_cd_drives, CDIO_FS_AUDIO, false); if (!ppsz_cdda_drives || !ppsz_cdda_drives[0]) { fprintf(stderr, "Can't find a CD-ROM drive with a CD-DA in it\n"); exit(3); } psz_device_global = strdup(ppsz_cdda_drives[0]); cdio_free_device_list(ppsz_all_cd_drives); cdio_free_device_list(ppsz_cdda_drives); } if (!b_cd && todo != EJECT_CD) { cd_close(psz_device_global); } /* open device */ if (b_verbose) fprintf(stderr,"open %s... ", psz_device_global); p_cdio_global = cdio_open (psz_device_global, driver_id); if (!p_cdio_global) { if (b_verbose) fprintf(stderr, "error: %s\n", strerror(errno)); else fprintf(stderr, "open %s: %s\n", psz_device_global, strerror(errno)); exit(1); } else if (b_verbose) fprintf(stderr,"ok\n"); if (EJECT_CD == todo) { i_rc = cd_eject() ? 0 : 1; } else { read_toc(p_cdio_global); if (!b_cd) { cd_close(psz_device_global); read_toc(p_cdio_global); } if (b_cd) switch (todo) { case NO_OP: break; case STOP_PLAYING: i_rc = cd_stop(p_cdio_global) ? 0 : 1; break; case EJECT_CD: /* Should have been handled above before case statement. gcc warns if we don't include this. And with this Coverty complains when we do - we can't win, so go with gcc. */ cd_eject(); break; case PLAY_TRACK: /* play just this one track */ play_track(start_track, stop_track); break; case PLAY_CD: play_track(1,CDIO_CDROM_LEADOUT_TRACK); break; case CLOSE_CD: i_rc = cdio_close_tray(psz_device_global, NULL) ? 0 : 1; break; case SET_VOLUME: { cdio_audio_volume_t volume; volume.level[0] = i_volume_level; i_rc = (DRIVER_OP_SUCCESS == cdio_audio_set_volume(p_cdio_global, &volume)) ? 0 : 1; break; } case LIST_SUBCHANNEL: if (read_subchannel(p_cdio_global)) { if (sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED || sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) { { printf("track %2d - %02x:%02x (%02x:%02x abs) ", sub.track, sub.rel_addr.m, sub.rel_addr.s, sub.abs_addr.m, sub.abs_addr.s); } } printf("drive state: %s\n", mmc_audio_state2str(sub.audio_status)); } else { i_rc = 1; } break; } else { fprintf(stderr,"no CD in drive (%s)\n", psz_device_global); } } oops("bye", i_rc); return 0; /* keep compiler happy */ } libcdio-2.2.0/example/cdchange.c000066400000000000000000000047671474051130400164700ustar00rootroot00000000000000/* Copyright (C) 2005-2013, 2022 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Test media changed */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_WINDOWS_H #include #endif #ifdef _WIN32 #include #undef sleep #define sleep(s) Sleep(1000*s) #endif #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio; long int i_sleep = 30; int media_changed_ret; if (argc > 1) { p_cdio = cdio_open (argv[1], DRIVER_DEVICE); if (argc > 2) { errno = 0; i_sleep = strtol(argv[2], (char **)NULL, 10); if ( (LONG_MIN == i_sleep || LONG_MAX == i_sleep) && errno != 0 ) { printf("Invalid sleep parameter %s\n", argv[2]); printf("Error reported back from strtol: %s\n", strerror(errno)); return 2; } } } else { p_cdio = cdio_open (NULL, DRIVER_DEVICE); } if (NULL == p_cdio) { printf("Couldn't find a driver.. leaving.\n"); return 1; } if ((media_changed_ret = cdio_get_media_changed(p_cdio)) == 1) printf("Initial media status: changed\n"); else if (media_changed_ret == 0) printf("Initial media status: not changed\n"); else printf("Error while invoking media changed request!\n"); printf("Giving you %ld seconds to change CD if you want to do so.\n", i_sleep); sleep(i_sleep); if ((media_changed_ret = cdio_get_media_changed(p_cdio)) == 1) printf("Media status: changed\n"); else if (media_changed_ret == 0) printf("Media status: not changed\n"); else printf("Error while invoking media changed request!\n"); cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/cdio-eject.c000066400000000000000000000035131474051130400167260ustar00rootroot00000000000000/* Copyright (C) 2007, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #include static void usage(char * progname) { fprintf(stderr, "Usage: %s [-t] \n", progname); } int main(int argc, char ** argv) { driver_return_code_t err; int close_tray = 0; const char * device = NULL; if(argc < 2 || argc > 3) { usage(argv[0]); return -1; } if((argc == 3) && strcmp(argv[1], "-t")) { usage(argv[0]); return -1; } if(argc == 2) device = argv[1]; else if(argc == 3) { close_tray = 1; device = argv[2]; } if(close_tray) { err = cdio_close_tray(device, NULL); if(err) { fprintf(stderr, "Closing tray failed for device %s: %s\n", device, cdio_driver_errmsg(err)); return -1; } } else { err = cdio_eject_media_drive(device); if(err) { fprintf(stderr, "Ejecting failed for device %s: %s\n", device, cdio_driver_errmsg(err)); return -1; } } return 0; } libcdio-2.2.0/example/cdtext-raw.c000066400000000000000000000105401474051130400170000ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2004, 2006, 2008, 2010-2012, 2017, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Example demonstrating the parsing of raw CD-Text files Output adapted from cd-info. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include /* Maximum CD-TEXT payload: 8 text blocks with 256 packs of 18 bytes each */ #define CDTEXT_LEN_BINARY_MAX (8 * 256 * 18) static void print_cdtext_track_info(cdtext_t *p_cdtext, track_t i_track, const char *psz_msg) { if (NULL != p_cdtext) { cdtext_field_t i; printf("%s\n", psz_msg); for (i=0; i < MAX_CDTEXT_FIELDS; i++) { if (cdtext_get_const(p_cdtext, i, i_track)) { printf("\t%s: %s\n", cdtext_field2str(i), cdtext_get_const(p_cdtext, i, i_track)); } } } } static void print_cdtext_info(cdtext_t *p_cdtext) { track_t i_first_track = 0; track_t i_last_track = 0; cdtext_lang_t *languages; cdtext_genre_t genre; int i, j; languages = cdtext_list_languages_v2(p_cdtext); if (NULL == languages) return; for(i=0; i<8; i++) if ( CDTEXT_LANGUAGE_BLOCK_UNUSED != languages[i] && cdtext_set_language_index(p_cdtext, i)) { printf("\nLanguage %d '%s':\n", i, cdtext_lang2str(languages[i])); print_cdtext_track_info(p_cdtext, 0, "CD-TEXT for Disc:"); genre = cdtext_get_genre(p_cdtext); if ( CDTEXT_GENRE_UNUSED != genre) printf("\tGENRE_CODE: %d (%s)\n", genre, cdtext_genre2str(genre)); i_first_track = cdtext_get_first_track(p_cdtext); i_last_track = cdtext_get_last_track(p_cdtext); for ( j = i_first_track ; j <= i_last_track; j++ ) { char msg[50]; sprintf(msg, "CD-TEXT for Track %2d:", j); print_cdtext_track_info(p_cdtext, j, msg); } } } static cdtext_t * read_cdtext(const char *path) { FILE *fp; size_t size; uint8_t *cdt_data = NULL, *cdt_packs; cdtext_t *cdt; int mmc_len; cdt_data = calloc(CDTEXT_LEN_BINARY_MAX + 4, 1); if (NULL == cdt_data) { fprintf(stderr, "could not allocate memory for cdt_data buffer\n"); exit(4); } fp = fopen(path, "rb"); if (NULL == fp) { fprintf(stderr, "could not open file `%s'\n", path); exit(3); } size = fread(cdt_data, 1, CDTEXT_LEN_BINARY_MAX + 4, fp); fclose(fp); if (size < 5) { fprintf(stderr, "file `%s' is too small to contain CD-TEXT\n", path); exit(1); } /* Check whether obviously a MMC header is prepended and if so, skip it. cdtext_data_init() wants to see only the text pack bytes. */ cdt_packs = cdt_data; if (cdt_data[0] < 0x80) { /* This cannot be a text pack start */ mmc_len = CDIO_MMC_GET_LEN16(cdt_data) + 2; if ((size == mmc_len || size == mmc_len + 1) && mmc_len % 18 == 4 && cdt_data[4] >= 0x80 && cdt_data[4] <= 0x8f) { /* It looks much like a MMC header followed by a text pack start */ size -= 4; cdt_packs = cdt_data + 4; fprintf(stderr, "NOTE: Skipped 4 bytes of apparent MMC header.\n"); } } /* ignore trailing 0 */ if (1 == size % 18) size -= 1; /* init cdtext */ cdt = cdtext_init (); if(0 != cdtext_data_init(cdt, cdt_packs, size)) { fprintf(stderr, "failed to parse CD-Text file `%s'\n", path); free(cdt); exit(2); } free(cdt_data); return cdt; } int main(int argc, const char *argv[]) { cdtext_t *cdt; char *cdt_path = NULL; if (argc > 1) { cdt_path = (char *) argv[1]; }else{ fprintf(stderr, "no CD-Text file given\n"); exit(77); } cdt = read_cdtext(cdt_path); print_cdtext_info(cdt); free(cdt); return 0; } libcdio-2.2.0/example/cdtext.c000066400000000000000000000072111474051130400162120ustar00rootroot00000000000000/* Copyright (C) 2018-2019 Thomas Schmitt Copyright (C) 2004-2009, 2011-2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to list CD-Text info of a Compact Disc using libcdio. See also corresponding C++ programs of similar names. */ #define EXAMPLE_CUE_FILE "../test/data/cdtext.cue" #define EXAMPLE_PREF_LANG CDTEXT_LANGUAGE_GERMAN #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #include static void print_cdtext_track_info(cdtext_t *cdtext, track_t i_track) { cdtext_field_t i; for (i=0; i < MAX_CDTEXT_FIELDS; i++) { if (cdtext_get_const(cdtext, i, i_track)) { printf("-- \t%s: %s\n", cdtext_field2str(i), cdtext_get_const(cdtext, i, i_track)); } } } static void print_disc_info(CdIo_t *p_cdio) { track_t i_first_track = cdio_get_first_track_num (p_cdio); track_t i_tracks = cdio_get_num_tracks (p_cdio); track_t i_last_track = i_first_track + i_tracks; discmode_t cd_discmode = cdio_get_discmode (p_cdio); cdtext_t *cdtext = cdio_get_cdtext (p_cdio); int i; printf("-- Discmode: %s\n\n", discmode2str[cd_discmode]); if (NULL == cdtext) { printf("-- No CD-Text found on Disc.\n"); return; } /* print available languages */ { cdtext_lang_t *languages; printf("-- CD-Text available in: "); languages = cdtext_list_languages_v2(cdtext); /* Since cdtext is not NULL, cdtext_list_languages_v2() returns a list of up to 8 language blocks which we process below. */ for(i=0; i<8; i++) if ( CDTEXT_LANGUAGE_BLOCK_UNUSED != languages[i]) printf("%s ", cdtext_lang2str(languages[i])); printf("\n"); } /* select language */ if(cdtext_select_language(cdtext, EXAMPLE_PREF_LANG)) { printf("-- %s selected.\n", cdtext_lang2str (EXAMPLE_PREF_LANG)); } else { printf("-- '%s' is not available. Using '%s'\n", cdtext_lang2str (EXAMPLE_PREF_LANG), cdtext_lang2str (cdtext_get_language (cdtext))); } /* print cd-text */ printf("-- CD-Text for Disc:\n"); print_cdtext_track_info(cdtext, 0); for (i=i_first_track ; i < i_last_track; i++ ) { printf("-- CD-Text for Track %d:\n", i); print_cdtext_track_info(cdtext, i); } } int main(int argc, const char *argv[]) { CdIo_t *p_cdio; /* read CD-Text from a bin/cue (CDRWIN) image */ p_cdio = cdio_open(EXAMPLE_CUE_FILE, DRIVER_BINCUE); if (NULL == p_cdio) { printf("Couldn't open %s with BIN/CUE driver.\n", EXAMPLE_CUE_FILE); } else { print_disc_info(p_cdio); cdio_destroy(p_cdio); } /* read CD-Text from default device */ p_cdio = cdio_open (NULL, DRIVER_DEVICE); if (NULL == p_cdio) { printf("Couldn't find CD\n"); return 77; } else { print_disc_info(p_cdio); cdio_destroy(p_cdio); } return 0; } libcdio-2.2.0/example/device.c000066400000000000000000000113601474051130400161560ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2009, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show drivers installed and what the default CD-ROM drive is. See also corresponding C++ programs of similar names .*/ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define _(x) x /* Prints out drive capabilities */ static void print_drive_capabilities(cdio_drive_read_cap_t i_read_cap, cdio_drive_write_cap_t i_write_cap, cdio_drive_misc_cap_t i_misc_cap) { if (CDIO_DRIVE_CAP_ERROR == i_misc_cap) { printf("Error in getting drive hardware properties\n"); } else { printf(_("-- Hardware : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_FILE ? "Disk Image" : "CD-ROM or DVD"); printf(_("-- Can eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_EJECT ? "Yes" : "No"); printf(_("-- Can close tray : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_CLOSE_TRAY ? "Yes" : "No"); printf(_("-- Can disable manual eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_LOCK ? "Yes" : "No"); printf(_("-- Can select juke-box disc : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_DISC ? "Yes" : "No"); printf(_("-- Can set drive speed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_SPEED ? "Yes" : "No"); printf(_("-- Can detect if CD changed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED ? "Yes" : "No"); printf(_("-- Can read multiple sessions : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MULTI_SESSION ? "Yes" : "No"); printf(_("-- Can hard reset device : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_RESET ? "Yes" : "No"); } if (CDIO_DRIVE_CAP_ERROR == i_read_cap) { printf("Error in getting drive reading properties\n"); } else { printf("-- Reading....\n"); printf(_("-- Can play audio : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_AUDIO ? "Yes" : "No"); printf(_("-- Can read CD-R : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_R ? "Yes" : "No"); printf(_("-- Can read CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No"); printf(_("-- Can read DVD-ROM : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_DVD_ROM ? "Yes" : "No"); } if (CDIO_DRIVE_CAP_ERROR == i_write_cap) { printf("Error in getting drive writing properties\n"); } else { printf("\n-- Writing....\n"); printf(_("-- Can write CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No"); printf(_("-- Can write DVD-R : %s\n"), i_write_cap & CDIO_DRIVE_CAP_READ_DVD_R ? "Yes" : "No"); printf(_("-- Can write DVD-RAM : %s\n"), i_write_cap & CDIO_DRIVE_CAP_READ_DVD_RAM ? "Yes" : "No"); } } int main(int argc, const char *argv[]) { CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); if (NULL != p_cdio) { char *default_device = cdio_get_default_device(p_cdio); cdio_drive_read_cap_t i_read_cap; cdio_drive_write_cap_t i_write_cap; cdio_drive_misc_cap_t i_misc_cap; printf("-- The driver selected is %s\n", cdio_get_driver_name(p_cdio)); if (default_device) printf("-- The default device for this driver is %s\n", default_device); cdio_get_drive_cap(p_cdio, &i_read_cap, &i_write_cap, &i_misc_cap); print_drive_capabilities(i_read_cap, i_write_cap, i_misc_cap); free(default_device); cdio_destroy(p_cdio); printf("\n"); } else { printf("-- Problem in trying to find a driver.\n\n"); } { const driver_id_t *driver_id_p; for (driver_id_p=cdio_drivers; *driver_id_p!=DRIVER_UNKNOWN; driver_id_p++) if (cdio_have_driver(*driver_id_p)) printf("-- We have: %s\n", cdio_driver_describe(*driver_id_p)); else printf("-- We don't have: %s\n", cdio_driver_describe(*driver_id_p)); } return 0; } libcdio-2.2.0/example/discid.c000066400000000000000000000045451474051130400161650ustar00rootroot00000000000000/* Copyright (C) 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* http://sourceforge.net/projects/discid/ using libcdio: a small program to calculate the disc-ID for audio compact discs. The disc-ID can be used to query info (tracks, title, interpret) about compact audio discs from a CDDB-Server. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include static int cddb_sum(int n) { int result = 0; while (n > 0) { result += n % 10; n /= 10; } return result; } int main(int argc, const char *argv[]) { CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); track_t i_track; track_t i_tracks; unsigned n = 0; if (NULL == p_cdio) { printf("Couldn't find a driver.. leaving.\n"); return 1; } i_tracks = cdio_get_num_tracks(p_cdio); for (i_track = 1; i_track <= i_tracks; ++i_track) { lba_t lba = cdio_get_track_lba(p_cdio, i_track); n += cddb_sum(lba / CDIO_CD_FRAMES_PER_SEC); } { unsigned start_sec = cdio_get_track_lba(p_cdio, 1) / CDIO_CD_FRAMES_PER_SEC; unsigned leadout_sec = cdio_get_track_lba(p_cdio, CDIO_CDROM_LEADOUT_TRACK) / CDIO_CD_FRAMES_PER_SEC; unsigned total = leadout_sec - start_sec; unsigned id = ((n % 0xff) << 24 | total << 8 | i_tracks); printf("%08X %d", id, i_tracks); for (i_track = 1; i_track <= i_tracks; ++i_track) { lba_t lba = cdio_get_track_lba(p_cdio, i_track); printf(" %ld", (long) lba); } printf(" %ld\n", (long) cdio_get_track_lba(p_cdio, CDIO_CDROM_LEADOUT_TRACK) / CDIO_CD_FRAMES_PER_SEC); } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/drives.c000066400000000000000000000051221474051130400162120ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2006, 2008, 2009, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include static void log_handler (cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } static void print_drive_class(const char *psz_msg, cdio_fs_anal_t bitmask, bool b_any) { char **ppsz_cd_drives=NULL, **c; printf("-- %s...\n", psz_msg); ppsz_cd_drives = cdio_get_devices_with_cap(NULL, bitmask, b_any); if (NULL != ppsz_cd_drives) for( c = ppsz_cd_drives; *c != NULL; c++ ) { printf("-- Drive %s\n", *c); } cdio_free_device_list(ppsz_cd_drives); printf("-----\n"); } int main(int argc, const char *argv[]) { char **ppsz_cd_drives=NULL, **c; cdio_log_set_handler (log_handler); /* Print out a list of CD-drives */ ppsz_cd_drives = cdio_get_devices(DRIVER_DEVICE); if (NULL != ppsz_cd_drives) for( c = ppsz_cd_drives; *c != NULL; c++ ) { printf("-- Drive %s\n", *c); } cdio_free_device_list(ppsz_cd_drives); ppsz_cd_drives = NULL; printf("-----\n"); /* Print out a list of CD-drives the harder way. */ print_drive_class("-- All CD-ROM drives (again)", CDIO_FS_MATCH_ALL, false); print_drive_class("-- CD-ROM drives with a CD-DA loaded...", CDIO_FS_AUDIO, false); print_drive_class("-- CD-ROM drives with some sort of ISO 9660 filesystem...", CDIO_FS_ANAL_ISO9660_ANY, true); print_drive_class("-- (S)VCD drives...", CDIO_FS_ANAL_VCD_ANY, true); return 0; } libcdio-2.2.0/example/eject.c000066400000000000000000000054321474051130400160140ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to eject a CD-ROM drive door and then close it again. If a single argument is given, it is used as the CD-ROM device to eject/close. Otherwise a CD-ROM drive will be scanned for. See also corresponding C++ program of a similar name. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include int main(int argc, const char *argv[]) { driver_return_code_t ret; driver_id_t driver_id = DRIVER_DEVICE; char *psz_drive = NULL; if (argc > 1) psz_drive = strdup(argv[1]); if (!psz_drive) { psz_drive = cdio_get_default_device_driver(&driver_id); if (!psz_drive) { printf("Can't find a CD-ROM to eject\n"); exit(1); } } ret = cdio_eject_media_drive(psz_drive); switch(ret) { case DRIVER_OP_UNSUPPORTED: printf("Eject not supported for %s.\n", psz_drive); break; case DRIVER_OP_SUCCESS: printf("CD-ROM drive %s ejected.\n", psz_drive); break; default: printf("Eject of CD-ROM drive %s failed.\n", psz_drive); break; } if (DRIVER_OP_SUCCESS == cdio_close_tray(psz_drive, &driver_id)) { printf("Closed tray of CD-ROM drive %s.\n", psz_drive); } else { printf("Closing tray of CD-ROM drive %s failed.\n", psz_drive); } free(psz_drive); ret = cdio_eject_media_drive(NULL); switch(ret) { case DRIVER_OP_UNSUPPORTED: printf("Eject not supported for default device.\n"); break; case DRIVER_OP_SUCCESS: printf("CD-ROM drive ejected for default device.\n"); break; default: printf("Eject of CD-ROM drive failed for default device.\n"); break; } driver_id = DRIVER_DEVICE; if (DRIVER_OP_SUCCESS == cdio_close_tray(NULL, &driver_id)) { printf("Closed tray of CD-ROM drive for default disc driver:\n\t%s\n", cdio_driver_describe(driver_id)); } else { printf("Closing tray of CD-ROM drive failed for default " "disc driver:\n\t%s\n", cdio_driver_describe(driver_id)); } return 0; } libcdio-2.2.0/example/extract.c000066400000000000000000000221531474051130400163730ustar00rootroot00000000000000/* Copyright (C) 2012 Pete Batard Based on samples copyright (c) 2003-2011, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Extract the full contents of either an UDF or ISO9660 image file. TODO: timestamp preservation, file permissions, Unicode */ /* To handle files > 2 GB, we may need the Large File Support settings defined in config.h. Comes first, as stdio.h depends on it. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #if defined(_WIN32) #include #else #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #define _mkdir(a) mkdir(a, S_IRWXU) #endif #if !defined(HAVE_SNPRINTF) /* Fallback to unsafe 'sprintf' */ #define snprintf(str, size, format, ...) sprintf(str, format, __VA_ARGS__) #endif #include #include #include #include #ifndef MIN #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif #define print_vd_info(title, fn) \ if (fn(p_iso, &psz_str)) { \ printf(title ": %s\n", psz_str); \ } \ free(psz_str); \ psz_str = NULL; static const char *psz_extract_dir; static uint8_t i_joliet_level = 0; static void log_handler (cdio_log_level_t level, const char *message) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const char *psz_path) { FILE *fd = NULL; int i_length; char* psz_fullpath; const char* psz_basename; udf_dirent_t *p_udf_dirent2; uint8_t buf[UDF_BLOCKSIZE]; int64_t i_read, i_file_length; if ((p_udf_dirent == NULL) || (psz_path == NULL)) return 1; while (udf_readdir(p_udf_dirent)) { psz_basename = udf_get_filename(p_udf_dirent); i_length = 3 + strlen(psz_path) + strlen(psz_basename) + strlen(psz_extract_dir); psz_fullpath = (char*)calloc(sizeof(char), i_length); if (psz_fullpath == NULL) { fprintf(stderr, "Error allocating file name\n"); goto out; } i_length = snprintf(psz_fullpath, i_length, "%s%s/%s", psz_extract_dir, psz_path, psz_basename); if (i_length < 0) { goto out; } printf("-- Extracting: %s\n", psz_fullpath); if (udf_is_dir(p_udf_dirent)) { int rc = _mkdir(psz_fullpath); if (0 == rc) { p_udf_dirent2 = udf_opendir(p_udf_dirent); if (p_udf_dirent2 != NULL) { if (udf_extract_files(p_udf, p_udf_dirent2, &psz_fullpath[strlen(psz_extract_dir)])) goto out; } } else if (-1 == rc) { fprintf(stderr, " Unable to create make directory %s:\n%s\n", psz_fullpath, strerror(errno)); } else { fprintf(stderr, " Unable to create make directory %s;(rc=%d)\n", psz_fullpath, rc); } } else { fd = fopen(psz_fullpath, "wb"); if (fd == NULL) { fprintf(stderr, " Unable to create file %s\n", psz_fullpath); goto out; } i_file_length = udf_get_file_length(p_udf_dirent); while (i_file_length > 0) { memset(buf, 0, UDF_BLOCKSIZE); i_read = udf_read_block(p_udf_dirent, buf, 1); if (i_read < 0) { fprintf(stderr, " Error reading UDF file %s\n", &psz_fullpath[strlen(psz_extract_dir)]); goto out; } fwrite(buf, (size_t)MIN(i_file_length, i_read), 1, fd); if (ferror(fd)) { fprintf(stderr, " Error writing file %s: %s\n", psz_fullpath, strerror(errno)); goto out; } i_file_length -= i_read; } fclose(fd); fd = NULL; } free(psz_fullpath); } return 0; out: if (fd != NULL) fclose(fd); free(psz_fullpath); return 1; } static int iso_extract_files(iso9660_t* p_iso, const char *psz_path) { FILE *fd = NULL; int i_length, r = 1; char psz_fullpath[4096], *psz_basename; const char *psz_iso_name = &psz_fullpath[strlen(psz_extract_dir)]; unsigned char buf[ISO_BLOCKSIZE]; CdioListNode_t *p_entnode; iso9660_stat_t *p_statbuf; CdioISO9660FileList_t* p_entlist; size_t i; lsn_t lsn; int64_t i_file_length; if ((p_iso == NULL) || (psz_path == NULL)) return 1; i_length = snprintf(psz_fullpath, sizeof(psz_fullpath), "%s%s/", psz_extract_dir, psz_path); if (i_length < 0) return 1; psz_basename = &psz_fullpath[i_length]; p_entlist = iso9660_ifs_readdir(p_iso, psz_path); if (!p_entlist) { printf("Could not access %s\n", psz_path); return 1; } _CDIO_LIST_FOREACH (p_entnode, p_entlist) { p_statbuf = (iso9660_stat_t*) _cdio_list_node_data(p_entnode); /* Eliminate . and .. entries */ if ( (strcmp(p_statbuf->filename, ".") == 0) || (strcmp(p_statbuf->filename, "..") == 0) ) continue; iso9660_name_translate_ext(p_statbuf->filename, psz_basename, i_joliet_level); if (p_statbuf->type == _STAT_DIR) { _mkdir(psz_fullpath); if (iso_extract_files(p_iso, psz_iso_name)) goto out; } else { printf("Extracting: %s\n", psz_fullpath); fd = fopen(psz_fullpath, "wb"); if (fd == NULL) { fprintf(stderr, " Unable to create file\n"); goto out; } i_file_length = p_statbuf->total_size; for (i = 0; i_file_length > 0; i++) { memset(buf, 0, ISO_BLOCKSIZE); lsn = p_statbuf->lsn + i; if (iso9660_iso_seek_read(p_iso, buf, lsn, 1) != ISO_BLOCKSIZE) { fprintf(stderr, " Error reading ISO9660 file %s at LSN %lu\n", psz_iso_name, (long unsigned int)lsn); goto out; } fwrite(buf, (size_t)MIN(i_file_length, ISO_BLOCKSIZE), 1, fd); if (ferror(fd)) { fprintf(stderr, " Error writing file %s: %s\n", psz_iso_name, strerror(errno)); goto out; } i_file_length -= ISO_BLOCKSIZE; } fclose(fd); fd = NULL; } } r = 0; out: if (fd != NULL) fclose(fd); iso9660_filelist_free(p_entlist); return r; } int main(int argc, char** argv) { iso9660_t* p_iso = NULL; udf_t* p_udf = NULL; udf_dirent_t* p_udf_root; char *psz_str = NULL; char vol_id[UDF_VOLID_SIZE] = ""; char volset_id[UDF_VOLSET_ID_SIZE+1] = ""; int r = 0; cdio_log_set_handler (log_handler); if (argc < 3) { fprintf(stderr, "Usage: extract \n"); return 1; } /* Warn if LFS doesn't appear to be enabled */ if (sizeof(off_t) < 8) { fprintf(stderr, "INFO: Large File Support not detected (required for files >2GB)\n"); } psz_extract_dir = argv[2]; if (_mkdir(psz_extract_dir) == 0) { printf("-- Creating directory: %s\n", psz_extract_dir); } else if (errno != EEXIST) { fprintf(stderr, "Unable to create extraction directory %s\n", psz_extract_dir); return 1; } /* First try to open as UDF - fallback to ISO if it failed */ p_udf = udf_open(argv[1]); if (p_udf == NULL) goto try_iso; p_udf_root = udf_get_root(p_udf, true, 0); if (p_udf_root == NULL) { fprintf(stderr, "Couldn't locate UDF root directory\n"); goto out; } vol_id[0] = 0; volset_id[0] = 0; /* Show basic UDF Volume info */ if (udf_get_volume_id(p_udf, vol_id, sizeof(vol_id)) > 0) printf("-- Volume id: %s\n", vol_id); if (udf_get_volume_id(p_udf, volset_id, sizeof(volset_id)) >0 ) { volset_id[UDF_VOLSET_ID_SIZE]='\0'; printf("-- Volume set id: %s\n", volset_id); } printf("-- Partition number: %d\n", udf_get_part_number(p_udf)); /* Recursively extract files */ r = udf_extract_files(p_udf, p_udf_root, ""); goto out; try_iso: p_iso = iso9660_open_ext(argv[1], ISO_EXTENSION_ALL); if (p_iso == NULL) { fprintf(stderr, "Unable to open image '%s'.\n", argv[1]); r = 1; goto out; } i_joliet_level = iso9660_ifs_get_joliet_level(p_iso); /* Show basic ISO9660 info from the Primary Volume Descriptor. */ print_vd_info("Application", iso9660_ifs_get_application_id); print_vd_info("Preparer ", iso9660_ifs_get_preparer_id); print_vd_info("Publisher ", iso9660_ifs_get_publisher_id); print_vd_info("System ", iso9660_ifs_get_system_id); print_vd_info("Volume ", iso9660_ifs_get_volume_id); print_vd_info("Volume Set ", iso9660_ifs_get_volumeset_id); r = iso_extract_files(p_iso, ""); out: if (p_iso != NULL) iso9660_close(p_iso); if (p_udf != NULL) udf_close(p_udf); return r; } libcdio-2.2.0/example/isofile.c000066400000000000000000000074341474051130400163600ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2006, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to extract a file from an ISO-9660 image. If a single argument is given, it is used as the ISO 9660 image to use in the extraction. Otherwise a compiled in default ISO 9660 image name (that comes with the libcdio distribution) will be used. */ /* This is the ISO 9660 image. */ #define ISO9660_IMAGE_PATH "../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/copying.iso" #define LOCAL_FILENAME "copying" /* portable.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. */ #include "portable.h" #include #include #include #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ fclose (p_outfd); \ iso9660_stat_free(p_statbuf); \ iso9660_close(p_iso); \ return rc; \ int main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; int i; char const *psz_image; char const *psz_fname; iso9660_t *p_iso; if (argc > 3) { printf("usage %s [ISO9660-image.ISO [filename]]\n", argv[0]); printf("Extracts filename from ISO-9660-image.ISO\n"); return 1; } if (argc > 1) psz_image = argv[1]; else psz_image = ISO9660_IMAGE; if (argc > 2) psz_fname = argv[2]; else psz_fname = LOCAL_FILENAME; p_iso = iso9660_open (psz_image); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open ISO 9660 image %s\n", psz_image); return 1; } p_statbuf = iso9660_ifs_stat_translate (p_iso, psz_fname); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", psz_fname); iso9660_close(p_iso); return 2; } if (!(p_outfd = fopen (psz_fname, "wb"))) { perror ("fopen()"); iso9660_stat_free(p_statbuf); iso9660_close(p_iso); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ { const unsigned int i_blocks = CEILING(p_statbuf->total_size, ISO_BLOCKSIZE); for (i = 0; i < i_blocks ; i++) { char buf[ISO_BLOCKSIZE]; const lsn_t lsn = p_statbuf->lsn + i; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, lsn, 1) ) { fprintf(stderr, "Error reading ISO 9660 file %s at LSN %lu\n", psz_fname, (long unsigned int) lsn); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) { perror("fwrite()"); my_exit(5); } } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_statbuf->total_size)) perror ("ftruncate()"); printf("Extraction of file '%s' from %s successful.\n", psz_fname, psz_image); my_exit(0); } libcdio-2.2.0/example/isofile2.c000066400000000000000000000105741474051130400164410ustar00rootroot00000000000000/* Copyright (C) 2003-2006, 2009, 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to extract a file from a CUE/BIN CD image. If a single argument is given, it is used as the CUE file of a CD image to use. Otherwise a compiled-in default image name (that comes with the libcdio distribution) will be used. This program can be compiled with either a C or C++ compiler. In the distribution we prefer C++ just to make sure we haven't broken things on the C++ side. */ /* This is the CD-image with an ISO-9660 filesystem */ #define ISO9660_IMAGE_PATH "../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/isofs-m1.cue" #define ISO9660_PATH "/" #define ISO9660_FILENAME "COPYING" #define LOCAL_FILENAME "copying" /* portable.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. */ #include "portable.h" #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ fclose (p_outfd); \ iso9660_stat_free(p_statbuf); \ cdio_destroy(p_cdio); \ return rc; \ int main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; int i; char const *psz_image; char const *psz_fname; char translated_name[256]; char untranslated_name[256] = ISO9660_PATH; CdIo_t *p_cdio; unsigned int i_fname=sizeof(ISO9660_FILENAME); if (argc > 3) { printf("usage %s [CD-ROM-or-image [filename]]\n", argv[0]); printf("Extracts filename from CD-ROM-or-image.\n"); return 1; } if (argc > 1) psz_image = argv[1]; else psz_image = ISO9660_IMAGE; if (argc > 2) { psz_fname = argv[2]; i_fname = strlen(psz_fname)+1; } else psz_fname = ISO9660_FILENAME; strncat(untranslated_name, psz_fname, i_fname); // cdio_loglevel_default = CDIO_LOG_DEBUG; p_cdio = cdio_open (psz_image, DRIVER_UNKNOWN); if (!p_cdio) { fprintf(stderr, "Sorry, couldn't open %s\n", psz_image); return 1; } p_statbuf = iso9660_fs_stat (p_cdio, untranslated_name); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", untranslated_name); cdio_destroy(p_cdio); return 2; } iso9660_name_translate(psz_fname, translated_name); if (!(p_outfd = fopen (translated_name, "wb"))) { perror ("fopen()"); cdio_destroy(p_cdio); iso9660_stat_free(p_statbuf); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ { const unsigned int i_blocks = CEILING(p_statbuf->total_size, ISO_BLOCKSIZE); for (i = 0; i < i_blocks; i ++) { char buf[ISO_BLOCKSIZE]; const lsn_t lsn = p_statbuf->lsn + i; memset (buf, 0, ISO_BLOCKSIZE); if ( 0 != cdio_read_data_sectors (p_cdio, buf, lsn, ISO_BLOCKSIZE, 1) ) { fprintf(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) p_statbuf->lsn); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror(p_outfd)) { perror ("fwrite()"); my_exit(5); } } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_statbuf->total_size)) perror ("ftruncate()"); printf("-- Extraction of file '%s' from '%s' successful.\n", translated_name, untranslated_name); my_exit(0); } libcdio-2.2.0/example/isofuzzy.c000066400000000000000000000046121474051130400166230ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2009, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Program to show using libiso9660 with fuzzy search to get file info. If a single argument is given, it is used as the ISO 9660 image. Otherwise we use a compiled-in default ISO 9660 image name. */ /* This is the BIN we think there is an ISO 9660 image inside of. */ #define ISO9660_IMAGE_PATH "/tmp/" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "vcd_demo.bin" /* portable.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. */ #include "portable.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include int main(int argc, const char *argv[]) { CdioISO9660FileList_t *p_entlist; CdioListNode_t *entnode; char const *psz_fname; iso9660_t *p_iso; if (argc > 1) psz_fname = argv[1]; else psz_fname = ISO9660_IMAGE; p_iso = iso9660_open_fuzzy (psz_fname, 5); if (NULL == p_iso) { fprintf(stderr, "-- Sorry, could not find an ISO 9660 image from %s\n", psz_fname); return 1; } p_entlist = iso9660_ifs_readdir (p_iso, "/"); /* Iterate over the list of nodes that iso9660_ifs_readdir gives */ if (p_entlist) { _CDIO_LIST_FOREACH (entnode, p_entlist) { char filename[4096]; iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (entnode); iso9660_name_translate(p_statbuf->filename, filename); printf ("-- /%s\n", filename); } iso9660_filelist_free(p_entlist); } iso9660_close(p_iso); exit(0); } libcdio-2.2.0/example/isolist.c000066400000000000000000000065221474051130400164110ustar00rootroot00000000000000/* Copyright (C) 2004-2008, 2011, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to list files in a directory of an ISO-9660 image and give some iso9660 information. See the code to iso-info for a more complete example. If a single argument is given, it is used as the ISO 9660 image to use in the listing. Otherwise a compiled-in default ISO 9660 image name (that comes with the libcdio distribution) will be used. */ /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH "../test/" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "copying.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define print_vd_info(title, fn) \ if (fn(p_iso, &psz_str)) { \ printf(title ": %s\n", psz_str); \ } \ free(psz_str); \ psz_str = NULL; int main(int argc, const char *argv[]) { CdioISO9660FileList_t *p_entlist; CdioListNode_t *p_entnode; char const *psz_fname; iso9660_t *p_iso; const char *psz_path = "/"; if (argc > 1) psz_fname = argv[1]; else psz_fname = ISO9660_IMAGE; p_iso = iso9660_open (psz_fname); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 1; } /* Show basic CD info from the Primary Volume Descriptor. */ { char *psz_str = NULL; print_vd_info("Application", iso9660_ifs_get_application_id); print_vd_info("Preparer ", iso9660_ifs_get_preparer_id); print_vd_info("Publisher ", iso9660_ifs_get_publisher_id); print_vd_info("System ", iso9660_ifs_get_system_id); print_vd_info("Volume ", iso9660_ifs_get_volume_id); print_vd_info("Volume Set ", iso9660_ifs_get_volumeset_id); } p_entlist = iso9660_ifs_readdir (p_iso, psz_path); /* Iterate over the list of nodes that iso9660_ifs_readdir gives */ if (p_entlist) { _CDIO_LIST_FOREACH (p_entnode, p_entlist) { char filename[4096]; double total_size; iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (p_entnode); iso9660_name_translate(p_statbuf->filename, filename); total_size = (double) p_statbuf->total_size; printf("%s [LSN %8d] %12.f %s%s\n", _STAT_DIR == p_statbuf->type ? "d" : "-", p_statbuf->lsn, total_size, psz_path, filename); } iso9660_filelist_free(p_entlist); } iso9660_close(p_iso); return 0; } libcdio-2.2.0/example/isolsn.c000066400000000000000000000050241474051130400162260ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011, 2014 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 to get a file path for a given LSN of an ISO-9660 image. If a single argument is given, it is used as the LSN to search for. Otherwise we use a built-in default value. If a second argument is given, it is ISO 9660 image to use in the listing. Otherwise a compiled-in default ISO 9660 image name (that comes with the libcdio distribution) will be used. */ /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH "../test/" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "copying.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define print_vd_info(title, fn) \ if (fn(p_iso, &psz_str)) { \ printf(title ": %s\n", psz_str); \ } \ free(psz_str); \ psz_str = NULL; int main(int argc, const char *argv[]) { char const *psz_fname; iso9660_t *p_iso; iso9660_stat_t *p_stat; lsn_t lsn = 24; char *psz_path = NULL; if (argc > 1) lsn = strtol(argv[1], (char **)NULL, 10); if (argc > 2) psz_fname = argv[2]; else psz_fname = ISO9660_IMAGE; p_iso = iso9660_open (psz_fname); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 1; } p_stat = iso9660_ifs_find_lsn_with_path (p_iso, lsn, &psz_path); if (psz_path != NULL) { printf("File at LSN %u is %s\n", lsn, psz_path); free(psz_path); } iso9660_stat_free(p_stat); iso9660_close(p_iso); return 0; } libcdio-2.2.0/example/isorr.c000066400000000000000000000037051474051130400160610ustar00rootroot00000000000000/* Copyright (C) 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libiso9660 how to see if a file has Rock-Ridge Extensions */ /* Set up an ISO-9660 image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH "../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/data/copying-rr.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include int main(int argc, const char *argv[]) { char const *psz_fname; iso9660_t *p_iso; if (argc > 1) psz_fname = argv[1]; else psz_fname = ISO9660_IMAGE; p_iso = iso9660_open (psz_fname); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 1; } switch (iso9660_have_rr(p_iso, 100)) { case yep: printf("-- Have Rock Ridge\n"); break; case nope: printf("-- Don't have Rock Ridge\n"); break; case dunno: printf("-- Possibly don't have Rock Ridge\n"); break; } iso9660_close(p_iso); return 0; } libcdio-2.2.0/example/logging.c000066400000000000000000000101611474051130400163430ustar00rootroot00000000000000/* Copyright (C) 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show how to set log verbosity and how to write a custom log handler. Invoke with an argument level, e.g. logging debug or with a number like: logging 1 # same as debug */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include /* Here is an example of a custom log handler. */ static void custom_log_handler (cdio_log_level_t level, const char *message) { switch(level) { case CDIO_LOG_DEBUG: printf("-- custom debug message: %s\n", message); return; case CDIO_LOG_INFO: printf("-- custom info message: %s\n", message); return; case CDIO_LOG_WARN: printf("-- custom warning message: %s\n", message); return; case CDIO_LOG_ERROR: printf("-- custom error message: %s\n", message); return; case CDIO_LOG_ASSERT: printf("-- custom assertion message: %s\n", message); return; default: printf("custom level %d message: %s\n", level, message); } } static long parse_loglevel_arg(const char *ps_loglevel) { long loglevel; if (strncmp(ps_loglevel, "debug", strlen("debug")) == 0) { loglevel = CDIO_LOG_DEBUG; } else if (strncmp(ps_loglevel, "info", strlen("info")) == 0) { loglevel = CDIO_LOG_INFO; } else if (strncmp(ps_loglevel, "warn", strlen("warn")) == 0) { loglevel = CDIO_LOG_WARN; } else if (strncmp(ps_loglevel, "error", strlen("error")) == 0) { loglevel = CDIO_LOG_ERROR; } else if (strncmp(ps_loglevel, "assert", strlen("assert")) == 0) { loglevel = CDIO_LOG_ASSERT; } else { char *endptr; errno = 0; /* To distinguish success/failure after call */ loglevel = strtol(ps_loglevel, &endptr, 10); /* Check for various possible errors, in parsing the verbosity * level. */ if ((errno == ERANGE && (loglevel == LONG_MAX || loglevel == LONG_MIN)) || (errno != 0 && loglevel == 0)) { perror("strtol conversion error of loglevel"); exit(EXIT_FAILURE); } if (endptr == ps_loglevel) { fprintf(stderr, "No digits were found\n"); exit(EXIT_FAILURE); } } return loglevel; } static void print_drives(void) { char **ppsz_cd_drives=NULL, **c; /* Print out a list of CD-drives with the above set log level. */ ppsz_cd_drives = cdio_get_devices(DRIVER_DEVICE); if (NULL != ppsz_cd_drives) for( c = ppsz_cd_drives; *c != NULL; c++ ) { printf("-- Drive %s\n", *c); } cdio_free_device_list(ppsz_cd_drives); } int main(int argc, const char *argv[]) { /* Set the log level to the warning verbosity. */ cdio_loglevel_default = CDIO_LOG_WARN; /* Parse command arguemnts */ if (argc > 2) { printf("Usage:\n%s \n" "Shows drives.\n" "A verbosity level is a name like 'debug', 'info', 'warn,'\n" "or a number greater than 0.\n", argv[0]); exit(EXIT_FAILURE); } if (argc == 2) { /* Set cdio's verbosity level. */ cdio_loglevel_default = parse_loglevel_arg(argv[1]); } print_drives(); /* Do the same thing again but with a custom log handler. */ cdio_log_set_handler (custom_log_handler); print_drives(); return 0; } libcdio-2.2.0/example/mmc1.c000066400000000000000000000062321474051130400155560ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008-2012, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Sample program to show use of the MMC interface. An optional drive name can be supplied as an argument. This basically the libdio mmc_get_hwinfo() routine. See also corresponding C++ programs. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdIo_t *p_cdio; const char *psz_drive = NULL; if (argc > 1) psz_drive = argv[1]; p_cdio = cdio_open (psz_drive, DRIVER_UNKNOWN); if (!p_cdio) { printf("-- Couldn't find CD\n"); return 77; } else { int i_status; /* Result of MMC command */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ char buf[36] = { 0, }; /* Place to hold returned data */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); i_status = mmc_run_cmd(p_cdio, DEFAULT_TIMEOUT_MS, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]; char psz_model[CDIO_MMC_HW_MODEL_LEN+1]; char psz_rev[CDIO_MMC_HW_REVISION_LEN+1]; memcpy(psz_vendor, buf + 8, sizeof(psz_vendor)-1); psz_vendor[sizeof(psz_vendor)-1] = '\0'; memcpy(psz_model, buf + 8 + CDIO_MMC_HW_VENDOR_LEN, sizeof(psz_model)-1); psz_model[sizeof(psz_model)-1] = '\0'; memcpy(psz_rev, buf + 8 + CDIO_MMC_HW_VENDOR_LEN +CDIO_MMC_HW_MODEL_LEN, sizeof(psz_rev)-1); psz_rev[sizeof(psz_rev)-1] = '\0'; printf("-- Vendor: %s\n-- Model: %s\n-- Revision: %s\n", psz_vendor, psz_model, psz_rev); } else { printf("-- Couldn't get INQUIRY data (vendor, model, and revision).\n"); } { bool b_erasable; cdio_mmc_feature_profile_t disctype; i_status = mmc_get_disc_erasable(p_cdio, &b_erasable); if (DRIVER_OP_SUCCESS == i_status) printf("-- Disc is %serasable.\n", b_erasable ? "" : "not "); else printf("-- Can't determine if disc is erasable.\n"); i_status = mmc_get_disctype(p_cdio, 0, &disctype); if (DRIVER_OP_SUCCESS == i_status) { printf("-- disc type: profile is %s (0x%X)\n", mmc_feature_profile2str(disctype), disctype); } } } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/mmc2.c000066400000000000000000000127121474051130400155570ustar00rootroot00000000000000/* Copyright (C) 2004-2005, 2008-2009, 2012, 2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* 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 #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio; const char *psz_drive = NULL; if (argc > 1) psz_drive = argv[1]; p_cdio = cdio_open (psz_drive, DRIVER_DEVICE); if (NULL == p_cdio) { printf("-- Couldn't find CD\n"); return 77; } else { int i_status; /* Result of MMC command */ uint8_t buf[65530] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); cdb.field[1] = CDIO_MMC_GET_CONF_ALL_FEATURES; cdb.field[3] = 0x0; i_status = mmc_run_cmd(p_cdio, 0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { uint8_t *p; uint32_t i_data; uint8_t *p_max = buf + sizeof(buf); i_data = (unsigned int) CDIO_MMC_GET_LEN32(buf); /* set to first sense feature code, and then walk through the masks */ p = buf + 8; while( (p < &(buf[i_data])) && (p < p_max) ) { uint16_t i_feature; uint8_t i_feature_additional = p[3]; i_feature = CDIO_MMC_GET_LEN16(p); { const char *feature_str = mmc_feature2str(i_feature); printf("-- %s Feature\n", feature_str); switch( i_feature ) { case CDIO_MMC_FEATURE_PROFILE_LIST: { uint8_t *q; for ( q = p+4 ; q < p + i_feature_additional ; q += 4 ) { int i_profile=CDIO_MMC_GET_LEN16(q); const char *feature_profile_str = mmc_feature_profile2str(i_profile); printf( "-- \t%s", feature_profile_str ); if (q[2] & 1) { printf(" - on"); } printf("\n"); } printf("\n"); break; } case CDIO_MMC_FEATURE_CORE: { uint8_t *q = p+4; uint32_t i_interface_standard = CDIO_MMC_GET_LEN32(q); switch(i_interface_standard) { case 0: printf("-- \tunspecified interface.\n"); break; case 1: printf("-- \tSCSI interface.\n"); break; case 2: printf("-- \tATAPI interface.\n"); break; case 3: printf("-- \tIEEE 1394 interface.\n"); break; case 4: printf("-- \tIEEE 1394A interface.\n"); break; case 5: printf("-- \tFibre Channel interface.\n"); } printf("\n"); break; } case CDIO_MMC_FEATURE_REMOVABLE_MEDIUM: switch(p[4] >> 5) { case 0: printf("-- \tCaddy/Slot type loading mechanism,\n"); break; case 1: printf("-- \tTray type loading mechanism,\n"); break; case 2: printf("-- \tPop-up type loading mechanism,\n"); break; case 4: printf("-- \tEmbedded changer with individually changeable discs,\n"); break; case 5: printf("-- \tEmbedded changer using a magazine mechanism,\n"); break; default: printf("-- \tUnknown changer mechanism,\n"); } printf("-- \tcan%s eject the medium or magazine via the normal " "START/STOP command,\n", (p[4] & 8) ? "": "not"); printf("-- \tcan%s be locked into the Logical Unit.\n", (p[4] & 1) ? "": "not"); printf("\n"); break; case CDIO_MMC_FEATURE_CD_READ: printf("-- CD Read Feature\n"); printf("-- \tC2 Error pointers are %ssupported,\n", (p[4] & 2) ? "": "not "); printf("-- \tCD-Text is %ssupported.\n", (p[4] & 1) ? "": "not "); printf("\n"); break; case CDIO_MMC_FEATURE_CDDA_EXT_PLAY: printf("\tSCAN command is %ssupported,\n", (p[4] & 4) ? "": "not "); printf("\taudio channels can %sbe muted separately,\n", (p[4] & 2) ? "": "not "); printf("\taudio channels can %shave separate volume levels.\n", (p[4] & 1) ? "": "not "); { uint8_t *q = p+6; uint16_t i_vol_levels = CDIO_MMC_GET_LEN16(q); printf("\t%d volume levels can be set\n", i_vol_levels); } printf("\n"); break; case CDIO_MMC_FEATURE_LU_SN: { uint8_t i_serial = *(p+3); char serial[257] = { '\0', }; memcpy(serial, p+4, i_serial); printf("\t%s\n\n", serial); break; } default: printf("\n"); break; } p += i_feature_additional + 4; } } } else { printf("-- Didn't get all feature codes.\n"); } } if (mmc_have_interface(p_cdio, CDIO_MMC_FEATURE_INTERFACE_ATAPI)) printf("-- CD-ROM is an ATAPI interface.\n"); else printf("-- CD-ROM is not an ATAPI interface.\n"); cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/mmc2a.c000066400000000000000000000151211474051130400157150ustar00rootroot00000000000000/* Copyright (C) 2006, 2008-2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Sample program to show use of the MMC interface. An optional drive name can be supplied as an argument. This basically calls to the libdio mmc_mode_sense_10() and mmc_mode_sense_6 routines. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include #include static void print_mode_sense (const char *psz_drive, const char *six_or_ten, const uint8_t buf[30]) { printf("-- Mode sense %s information for %s:\n", six_or_ten, psz_drive); if (buf[2] & 0x01) { printf("-- \tReads CD-R media.\n"); } if (buf[2] & 0x02) { printf("-- \tReads CD-RW media.\n"); } if (buf[2] & 0x04) { printf("-- \tReads fixed-packet tracks when Addressing type is method 2.\n"); } if (buf[2] & 0x08) { printf("-- \tReads DVD ROM media.\n"); } if (buf[2] & 0x10) { printf("-- \tReads DVD-R media.\n"); } if (buf[2] & 0x20) { printf("-- \tReads DVD-RAM media.\n"); } if (buf[2] & 0x40) { printf("-- \tReads DVD-RAM media.\n"); } if (buf[3] & 0x01) { printf("-- \tWrites CD-R media.\n"); } if (buf[3] & 0x02) { printf("-- \tWrites CD-RW media.\n"); } if (buf[3] & 0x04) { printf("-- \tSupports emulation write.\n"); } if (buf[3] & 0x10) { printf("-- \tWrites DVD-R media.\n"); } if (buf[3] & 0x20) { printf("-- \tWrites DVD-RAM media.\n"); } if (buf[4] & 0x01) { printf("-- \tCan play audio.\n"); } if (buf[4] & 0x02) { printf("-- \tDelivers composition A/V stream.\n"); } if (buf[4] & 0x04) { printf("-- \tSupports digital output on port 2.\n"); } if (buf[4] & 0x08) { printf("-- \tSupports digital output on port 1.\n"); } if (buf[4] & 0x10) { printf("-- \tReads Mode-2 form 1 (e.g. XA) media.\n"); } if (buf[4] & 0x20) { printf("-- \tReads Mode-2 form 2 media.\n"); } if (buf[4] & 0x40) { printf("-- \tReads multi-session CD media.\n"); } if (buf[4] & 0x80) { printf("-- \tSupports Buffer under-run free recording on CD-R/RW media.\n"); } if (buf[4] & 0x01) { printf("-- \tCan read audio data with READ CD.\n"); } if (buf[4] & 0x02) { printf("-- \tREAD CD data stream is accurate.\n"); } if (buf[5] & 0x04) { printf("-- \tReads R-W subchannel information.\n"); } if (buf[5] & 0x08) { printf("-- \tReads de-interleaved R-W subchannel.\n"); } if (buf[5] & 0x10) { printf("-- \tSupports C2 error pointers.\n"); } if (buf[5] & 0x20) { printf("-- \tReads ISRC information.\n"); } if (buf[5] & 0x40) { printf("-- \tReads ISRC informaton.\n"); } if (buf[5] & 0x40) { printf("-- \tReads media catalog number (MCN also known as UPC).\n"); } if (buf[5] & 0x80) { printf("-- \tReads bar codes.\n"); } if (buf[6] & 0x01) { printf("-- \tPREVENT/ALLOW may lock media.\n"); } printf("-- \tLock state is %slocked.\n", (buf[6] & 0x02) ? "" : "un"); printf("-- \tPREVENT/ALLOW jumper is %spresent.\n", (buf[6] & 0x04) ? "": "not "); if (buf[6] & 0x08) { printf("-- \tEjects media with START STOP UNIT.\n"); } { const unsigned int i_load_type = (buf[6]>>5 & 0x07); printf("-- \tLoading mechanism type is %d: ", i_load_type); switch (buf[6]>>5 & 0x07) { case 0: printf("caddy type loading mechanism.\n"); break; case 1: printf("tray type loading mechanism.\n"); break; case 2: printf("popup type loading mechanism.\n"); break; case 3: printf("reserved\n"); break; case 4: printf("changer with individually changeable discs.\n"); break; case 5: printf("changer using Magazine mechanism.\n"); break; case 6: printf("changer using Magazine mechanism.\n"); break; default: printf("Invalid.\n"); break; } } if (buf[7] & 0x01) { printf("-- \tVolume controls each channel separately.\n"); } if (buf[7] & 0x02) { printf("-- \tHas a changer that supports disc present reporting.\n"); } if (buf[7] & 0x04) { printf("-- \tCan load empty slot in changer.\n"); } if (buf[7] & 0x08) { printf("-- \tSide change capable.\n"); } if (buf[7] & 0x10) { printf("-- \tReads raw R-W subchannel information from lead in.\n"); } { const unsigned int i_speed_Kbs = CDIO_MMC_GETPOS_LEN16(buf, 8); printf("-- \tMaximum read speed is %d K bytes/sec (about %dX)\n", i_speed_Kbs, i_speed_Kbs / 176) ; } printf("-- \tNumber of Volume levels is %d\n", CDIO_MMC_GETPOS_LEN16(buf, 10)); printf("-- \tBuffers size for data is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 12)); printf("-- \tCurrent read speed is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 14)); printf("-- \tMaximum write speed is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 18)); printf("-- \tCurrent write speed is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 28)); } int main(int argc, const char *argv[]) { CdIo_t *p_cdio; const char *psz_drive = NULL; if (argc > 1) psz_drive = argv[1]; p_cdio = cdio_open (psz_drive, DRIVER_UNKNOWN); if (!p_cdio) { printf("-- Couldn't find CD\n"); return 77; } else { uint8_t buf[30] = { 0, }; /* Place to hold returned data */ char *psz_cd = cdio_get_default_device(p_cdio); if (DRIVER_OP_SUCCESS == mmc_mode_sense_6(p_cdio, buf, sizeof(buf), CDIO_MMC_CAPABILITIES_PAGE) ) { print_mode_sense(psz_cd, "6", buf); } else { printf("-- Couldn't get MODE_SENSE 6 data.\n"); } if (DRIVER_OP_SUCCESS == mmc_mode_sense_10(p_cdio, buf, sizeof(buf), CDIO_MMC_CAPABILITIES_PAGE) ) { print_mode_sense(psz_cd, "10", buf); } else { printf("-- Couldn't get MODE_SENSE 10 data.\n"); } free(psz_cd); } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/mmc3.c000066400000000000000000000070411474051130400155570ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2009, 2011, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Another simple program to show use of SCSI MMC interface. Is basically the the libdio scsi_mmc_get_hwinfo() routine. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdIo_t *p_cdio; driver_return_code_t ret; driver_id_t driver_id = DRIVER_DEVICE; char *psz_drive = NULL; bool do_eject = false; bool do_close = false; if (argc > 1) psz_drive = strdup(argv[1]); if (!psz_drive) { psz_drive = cdio_get_default_device_driver(&driver_id); if (!psz_drive) { printf("-- Can't find a CD-ROM\n"); exit(77); } } p_cdio = cdio_open (psz_drive, driver_id); if (!p_cdio) { printf("-- Can't open %s\n", psz_drive); exit(77); } ret = mmc_get_tray_status(p_cdio); switch((int) ret) { case 0: printf("-- CD-ROM drive %s is closed.\n", psz_drive); do_eject = true; do_close = true; break; case 1: printf("-- CD-ROM drive %s is open.\n", psz_drive); break; default: printf("-- Error status for drive %s: %s.\n", psz_drive, cdio_driver_errmsg(ret)); free(psz_drive); return 77; } ret = mmc_get_media_changed(p_cdio); switch((int) ret) { case 0: printf("-- CD-ROM drive %s media not changed since last test.\n", psz_drive); break; case 1: printf("-- CD-ROM drive %s media changed since last test.\n", psz_drive); break; default: printf("-- Error status for drive %s: %s.\n", psz_drive, cdio_driver_errmsg(ret)); free(psz_drive); return 77; } if (do_eject && argc > 2) cdio_eject_media_drive(psz_drive); else cdio_close_tray(psz_drive, &driver_id); ret = mmc_get_tray_status(p_cdio); switch((int) ret) { case 0: printf("-- CD-ROM drive %s is closed.\n", psz_drive); break; case 1: printf("-- CD-ROM drive %s is open.\n", psz_drive); break; default: printf("Error status for drive %s: %s.\n", psz_drive, cdio_driver_errmsg(ret)); free(psz_drive); return 77; } ret = mmc_get_media_changed(p_cdio); switch((int) ret) { case 0: printf("-- CD-ROM drive %s media not changed since last test.\n", psz_drive); break; case 1: printf("-- CD-ROM drive %s media changed since last test.\n", psz_drive); break; default: printf("-- Error status for drive %s: %s.\n", psz_drive, cdio_driver_errmsg(ret)); free(psz_drive); return 77; } if (do_close) cdio_close_tray(psz_drive, &driver_id); free(psz_drive); cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/read-disc-struct.c000066400000000000000000000045571474051130400201060ustar00rootroot00000000000000/* Copyright (C) 2019 Thomas Schmitt 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* READ DVD STRUCTURE */ #include #include #include #include #include #include #include #include static void hexdump (FILE *stream, uint8_t * buffer, unsigned int len) { unsigned int i; for (i = 0; i < len; i++, buffer++) { if (i % 16 == 0) fprintf (stream, "0x%04x: ", i); fprintf (stream, "%02x", *buffer); if (i % 2 == 1) fprintf (stream, " "); if (i % 16 == 15) { uint8_t *p; fprintf (stream, " "); for (p=buffer-15; p <= buffer; p++) { fprintf(stream, "%c", isprint(*p) ? *p : '.'); } fprintf (stream, "\n"); } } fprintf (stream, "\n"); fflush (stream); } int main(int argc, const char *argv[]) { CdIo_t *p_cdio; const char *psz_drive = NULL; /* Put in "/dev/sr0" here. */ if (argc > 1) psz_drive = argv[1]; p_cdio = cdio_open (psz_drive, DRIVER_DEVICE); if (NULL == p_cdio) { printf("Couldn't find DVD\n"); return 77; } else { int i_status; /* Result of MMC command */ uint8_t buf[200] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ int i; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_DVD_STRUCTURE); CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(buf)); for (i=0; i<=16; i++) { cdb.field[7] = i; /* The format field */ i_status = mmc_run_cmd(p_cdio, 0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { hexdump(stdout, buf, 200); printf("============================================\n"); } else { printf("Didn't get DVD Structure.\n"); } } } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/read-disc-struct.sh000077500000000000000000000005411474051130400202660ustar00rootroot00000000000000#!/bin/bash gcc -I../include/ -g3 -Wall -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith -Wwrite-strings -Wnested-externs -Wno-sign-compare -o read-disc-struct.o -c read-disc-struct.c /bin/sh ../libtool --silent --tag=CC --mode=link gcc -g3 -o read-disc-struct read-disc-struct.o ../lib/driver/libcdio.la -lm libcdio-2.2.0/example/sample3.c000066400000000000000000000135001474051130400162610ustar00rootroot00000000000000/* Copyright (C) 2003, 2005, 2008, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* A somewhat simplified program to show the use of cdio_guess_cd_type(). Figure out the kind of CD image we've got. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include static void print_analysis(cdio_iso_analysis_t cdio_iso_analysis, cdio_fs_anal_t fs, int first_data, unsigned int num_audio) { switch(CDIO_FSTYPE(fs)) { case CDIO_FS_AUDIO: break; case CDIO_FS_ISO_9660: printf("CD-ROM with ISO 9660 filesystem"); if (fs & CDIO_FS_ANAL_JOLIET) { printf(" and joliet extension level %d", cdio_iso_analysis.joliet_level); } if (fs & CDIO_FS_ANAL_ROCKRIDGE) printf(" and rockridge extensions"); printf("\n"); break; case CDIO_FS_ISO_9660_INTERACTIVE: printf("CD-ROM with CD-RTOS and ISO 9660 filesystem\n"); break; case CDIO_FS_HIGH_SIERRA: printf("CD-ROM with High Sierra filesystem\n"); break; case CDIO_FS_INTERACTIVE: printf("CD-Interactive%s\n", num_audio > 0 ? "/Ready" : ""); break; case CDIO_FS_HFS: printf("CD-ROM with Macintosh HFS\n"); break; case CDIO_FS_ISO_HFS: printf("CD-ROM with both Macintosh HFS and ISO 9660 filesystem\n"); break; case CDIO_FS_UFS: printf("CD-ROM with Unix UFS\n"); break; case CDIO_FS_EXT2: printf("CD-ROM with Linux second extended filesystem\n"); break; case CDIO_FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); break; case CDIO_FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; } switch(CDIO_FSTYPE(fs)) { case CDIO_FS_ISO_9660: case CDIO_FS_ISO_9660_INTERACTIVE: case CDIO_FS_ISO_HFS: printf("ISO 9660: %i blocks, label `%.32s'\n", cdio_iso_analysis.isofs_size, cdio_iso_analysis.iso_label); break; } if (first_data == 1 && num_audio > 0) printf("mixed mode CD "); if (fs & CDIO_FS_ANAL_XA) printf("XA sectors "); if (fs & CDIO_FS_ANAL_MULTISESSION) printf("Multisession"); if (fs & CDIO_FS_ANAL_HIDDEN_TRACK) printf("Hidden Track "); if (fs & CDIO_FS_ANAL_PHOTO_CD) printf("%sPhoto CD ", num_audio > 0 ? " Portfolio " : ""); if (fs & CDIO_FS_ANAL_CDTV) printf("Commodore CDTV "); if (first_data > 1) printf("CD-Plus/Extra "); if (fs & CDIO_FS_ANAL_BOOTABLE) printf("bootable CD "); if (fs & CDIO_FS_ANAL_VIDEOCD && num_audio == 0) { printf("Video CD "); } if (fs & CDIO_FS_ANAL_SVCD) printf("Super Video CD (SVCD) or Chaoji Video CD (CVD)"); if (fs & CDIO_FS_ANAL_CVD) printf("Chaoji Video CD (CVD)"); printf("\n"); } int main(int argc, const char *argv[]) { CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); cdio_fs_anal_t fs=0; track_t num_tracks; track_t first_track_num; lsn_t start_track; /* first sector of track */ lsn_t data_start =0; /* start of data area */ int first_data = -1; /* # of first data track */ int first_audio = -1; /* # of first audio track */ unsigned int num_data = 0; /* # of data tracks */ unsigned int num_audio = 0; /* # of audio tracks */ unsigned int i; if (NULL == p_cdio) { printf("Problem in trying to find a driver.\n\n"); return 1; } first_track_num = cdio_get_first_track_num(p_cdio); num_tracks = cdio_get_num_tracks(p_cdio); /* Count the number of data and audio tracks. */ for (i = first_track_num; i <= num_tracks; i++) { if (TRACK_FORMAT_AUDIO == cdio_get_track_format(p_cdio, i)) { num_audio++; if (-1 == first_audio) first_audio = i; } else { num_data++; if (-1 == first_data) first_data = i; } } /* try to find out what sort of CD we have */ if (0 == num_data) { printf("Audio CD\n"); } else { /* we have data track(s) */ cdio_iso_analysis_t cdio_iso_analysis; memset(&cdio_iso_analysis, 0, sizeof(cdio_iso_analysis)); for (i = first_data; i <= num_tracks; i++) { lsn_t lsn; track_format_t track_format = cdio_get_track_format(p_cdio, i); lsn = cdio_get_track_lsn(p_cdio, i); switch ( track_format ) { case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: case TRACK_FORMAT_DATA: case TRACK_FORMAT_PSX: ; } start_track = (i == 1) ? 0 : lsn; /* save the start of the data area */ if (i == first_data) data_start = start_track; /* skip tracks which belong to the current walked session */ if (start_track < data_start + cdio_iso_analysis.isofs_size) continue; fs = cdio_guess_cd_type(p_cdio, start_track, i, &cdio_iso_analysis); print_analysis(cdio_iso_analysis, fs, first_data, num_audio); if ( !(CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660 || CDIO_FSTYPE(fs) == CDIO_FS_ISO_HFS || CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660_INTERACTIVE) ) /* no method for non-ISO9660 multisessions */ break; } } cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/sample4.c000066400000000000000000000143331474051130400162670ustar00rootroot00000000000000/* Copyright (C) 2003-2004, 2008-2009, 2012, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* A slightly improved sample3 program: we handle cdio logging and take an optional CD-location. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include static void log_handler (cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } static void print_analysis(cdio_iso_analysis_t cdio_iso_analysis, cdio_fs_anal_t fs, int first_data, unsigned int num_audio) { switch(CDIO_FSTYPE(fs)) { case CDIO_FS_AUDIO: break; case CDIO_FS_ISO_9660: printf("CD-ROM with ISO 9660 filesystem"); if (fs & CDIO_FS_ANAL_JOLIET) { printf(" and joliet extension level %d", cdio_iso_analysis.joliet_level); } if (fs & CDIO_FS_ANAL_ROCKRIDGE) printf(" and rockridge extensions"); printf("\n"); break; case CDIO_FS_ISO_9660_INTERACTIVE: printf("CD-ROM with CD-RTOS and ISO 9660 filesystem\n"); break; case CDIO_FS_HIGH_SIERRA: printf("CD-ROM with High Sierra filesystem\n"); break; case CDIO_FS_INTERACTIVE: printf("CD-Interactive%s\n", num_audio > 0 ? "/Ready" : ""); break; case CDIO_FS_HFS: printf("CD-ROM with Macintosh HFS\n"); break; case CDIO_FS_ISO_HFS: printf("CD-ROM with both Macintosh HFS and ISO 9660 filesystem\n"); break; case CDIO_FS_UFS: printf("CD-ROM with Unix UFS\n"); break; case CDIO_FS_EXT2: printf("CD-ROM with Linux second extended filesystem\n"); break; case CDIO_FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); break; case CDIO_FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; } switch(CDIO_FSTYPE(fs)) { case CDIO_FS_ISO_9660: case CDIO_FS_ISO_9660_INTERACTIVE: case CDIO_FS_ISO_HFS: printf("ISO 9660: %i blocks, label `%.32s'\n", cdio_iso_analysis.isofs_size, cdio_iso_analysis.iso_label); break; } if (first_data == 1 && num_audio > 0) printf("mixed mode CD "); if (fs & CDIO_FS_ANAL_XA) printf("XA sectors "); if (fs & CDIO_FS_ANAL_MULTISESSION) printf("Multisession"); if (fs & CDIO_FS_ANAL_HIDDEN_TRACK) printf("Hidden Track "); if (fs & CDIO_FS_ANAL_PHOTO_CD) printf("%sPhoto CD ", num_audio > 0 ? " Portfolio " : ""); if (fs & CDIO_FS_ANAL_CDTV) printf("Commodore CDTV "); if (first_data > 1) printf("CD-Plus/Extra "); if (fs & CDIO_FS_ANAL_BOOTABLE) printf("bootable CD "); if (fs & CDIO_FS_ANAL_VIDEOCD && num_audio == 0) { printf("Video CD "); } if (fs & CDIO_FS_ANAL_SVCD) printf("Super Video CD (SVCD) or Chaoji Video CD (CVD)"); if (fs & CDIO_FS_ANAL_CVD) printf("Chaoji Video CD (CVD)"); printf("\n"); } int main(int argc, const char *argv[]) { CdIo_t *p_cdio; cdio_fs_anal_t fs=0; track_t num_tracks; track_t first_track_num; lsn_t start_track; /* first sector of track */ lsn_t data_start =0; /* start of data area */ int first_data = -1; /* # of first data track */ int first_audio = -1; /* # of first audio track */ unsigned int num_data = 0; /* # of data tracks */ unsigned int num_audio = 0; /* # of audio tracks */ unsigned int i; char *cd_image_name = NULL; if (argc > 1) cd_image_name = strdup(argv[1]); cdio_log_set_handler (log_handler); p_cdio = cdio_open (cd_image_name, DRIVER_UNKNOWN); if (NULL == p_cdio) { printf("-- Problem in trying to find a driver.\n\n"); free(cd_image_name); return 77; } first_track_num = cdio_get_first_track_num(p_cdio); num_tracks = cdio_get_num_tracks(p_cdio); /* Count the number of data and audio tracks. */ for (i = first_track_num; i <= num_tracks; i++) { if (TRACK_FORMAT_AUDIO == cdio_get_track_format(p_cdio, i)) { num_audio++; if (-1 == first_audio) first_audio = i; } else { num_data++; if (-1 == first_data) first_data = i; } } /* try to find out what sort of CD we have */ if (0 == num_data) { printf("-- Audio CD\n"); } else { /* we have data track(s) */ cdio_iso_analysis_t cdio_iso_analysis; memset(&cdio_iso_analysis, 0, sizeof(cdio_iso_analysis)); for (i = first_data; i <= num_tracks; i++) { lsn_t lsn; track_format_t track_format = cdio_get_track_format(p_cdio, i); lsn = cdio_get_track_lsn(p_cdio, i); switch ( track_format ) { case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: case TRACK_FORMAT_DATA: case TRACK_FORMAT_PSX: ; } start_track = (i == 1) ? 0 : lsn; /* save the start of the data area */ if (i == first_data) data_start = start_track; /* skip tracks which belong to the current walked session */ if (start_track < data_start + cdio_iso_analysis.isofs_size) continue; fs = cdio_guess_cd_type(p_cdio, start_track, i, &cdio_iso_analysis); print_analysis(cdio_iso_analysis, fs, first_data, num_audio); if ( !(CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660 || CDIO_FSTYPE(fs) == CDIO_FS_ISO_HFS || CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660_INTERACTIVE) ) /* no method for non-ISO9660 multisessions */ break; } } free(cd_image_name); cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/tracks.c000066400000000000000000000036331474051130400162120ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to list track numbers and logical sector numbers of a Compact Disc using libcdio. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); track_t i_first_track; track_t i_tracks; int j, i; if (NULL == p_cdio) { printf("Couldn't find a driver.. leaving.\n"); return 1; } printf("Disc last LSN: %d\n", cdio_get_disc_last_lsn(p_cdio)); i_tracks = cdio_get_num_tracks(p_cdio); i_first_track = i = cdio_get_first_track_num(p_cdio); printf("CD-ROM Track List (%i - %i)\n", i_first_track, i_first_track+i_tracks-1); printf(" #: LSN\n"); for (j = 0; j < i_tracks; i++, j++) { lsn_t lsn = cdio_get_track_lsn(p_cdio, i); if (CDIO_INVALID_LSN != lsn) printf("%3d: %06lu\n", (int) i, (long unsigned int) lsn); } printf("%3X: %06lu leadout\n", CDIO_CDROM_LEADOUT_TRACK, (long unsigned int) cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK)); cdio_destroy(p_cdio); return 0; } libcdio-2.2.0/example/udf1.c000066400000000000000000000071341474051130400155620ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2014 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libudf to list files in a directory of an UDF image. */ /* This is the UDF image. */ #define UDF_IMAGE_PATH "../" #define UDF_IMAGE "../test/data/udf102.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define udf_PATH_DELIMITERS "/\\" static void print_file_info(const udf_dirent_t *p_udf_dirent, const char* psz_dirname) { time_t mod_time = udf_get_modification_time(p_udf_dirent); char psz_mode[11]="invalid"; const char *psz_fname= psz_dirname ? psz_dirname : udf_get_filename(p_udf_dirent); /* Print directory attributes*/ printf("%s ", udf_mode_string(udf_get_posix_filemode(p_udf_dirent), psz_mode)); printf("%4d ", udf_get_link_count(p_udf_dirent)); printf("%lu ", (long unsigned int) udf_get_file_length(p_udf_dirent)); printf("%s %s", *psz_fname ? psz_fname : "/", ctime(&mod_time)); } static void list_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const char *psz_path) { if (!p_udf_dirent) return; print_file_info(p_udf_dirent, psz_path); while (udf_readdir(p_udf_dirent)) { if (udf_is_dir(p_udf_dirent)) { udf_dirent_t *p_udf_dirent2 = udf_opendir(p_udf_dirent); if (p_udf_dirent2) { const char *psz_dirname = udf_get_filename(p_udf_dirent); const unsigned int i_newlen=2 + strlen(psz_path) + strlen(psz_dirname); char *psz_newpath = calloc(1, sizeof(char)*i_newlen); snprintf(psz_newpath, i_newlen, "%s%s/", psz_path, psz_dirname); list_files(p_udf, p_udf_dirent2, psz_newpath); free(psz_newpath); } } else { print_file_info(p_udf_dirent, NULL); } } } int main(int argc, const char *argv[]) { udf_t *p_udf; char const *psz_udf_image; if (argc > 1) psz_udf_image = argv[1]; else psz_udf_image = UDF_IMAGE; p_udf = udf_open (psz_udf_image); if (NULL == p_udf) { fprintf(stderr, "Sorry, couldn't open %s as something using UDF\n", psz_udf_image); return 1; } else { udf_dirent_t *p_udf_root = udf_get_root(p_udf, true, 0); if (NULL == p_udf_root) { fprintf(stderr, "Sorry, couldn't find / in %s\n", psz_udf_image); return 1; } { char vol_id[UDF_VOLID_SIZE] = ""; char volset_id[UDF_VOLSET_ID_SIZE+1] = ""; if (0 < udf_get_volume_id(p_udf, vol_id, sizeof(vol_id)) ) printf("volume id: %s\n", vol_id); if (0 < udf_get_volume_id(p_udf, volset_id, sizeof(volset_id)) ) { volset_id[UDF_VOLSET_ID_SIZE]='\0'; printf("volume set id: %s\n", volset_id); } printf("partition number: %d\n", udf_get_part_number(p_udf)); } list_files(p_udf, p_udf_root, ""); } udf_close(p_udf); return 0; } libcdio-2.2.0/example/udf2.c000066400000000000000000000071171474051130400155640ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libudf to extract a file. This program can be compiled with either a C or C++ compiler. In the distribution we prefer C++ just to make sure we haven't broken things on the C++ side. */ /* This is the UDF image. */ #define UDF_IMAGE_PATH "../" #define UDF_IMAGE "/src2/cd-images/udf/test2.iso" #define UDF_FILENAME "/parse/cue.L" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define CEILING(x, y) ((x+(y-1))/y) #define udf_PATH_DELIMITERS "/\\" static void print_file_info(const udf_dirent_t *p_udf_dirent, const char* psz_dirname) { time_t mod_time = udf_get_modification_time(p_udf_dirent); char psz_mode[11]="invalid"; const char *psz_fname= psz_dirname ? psz_dirname : udf_get_filename(p_udf_dirent); /* Print directory attributes*/ printf("%s ", udf_mode_string(udf_get_posix_filemode(p_udf_dirent), psz_mode)); printf("%4d ", udf_get_link_count(p_udf_dirent)); printf("%ld ", (long unsigned int) udf_get_file_length(p_udf_dirent)); printf("%s %s\n", *psz_fname ? psz_fname : "/", ctime(&mod_time)); } int main(int argc, const char *argv[]) { udf_t *p_udf; char const *psz_udf_image; char const *psz_udf_fname; if (argc > 1) psz_udf_image = argv[1]; else psz_udf_image = UDF_IMAGE; if (argc > 2) psz_udf_fname = argv[2]; else psz_udf_fname = UDF_FILENAME; p_udf = udf_open (psz_udf_image); if (NULL == p_udf) { fprintf(stderr, "Sorry, couldn't open %s as something using UDF\n", psz_udf_image); return 1; } else { udf_dirent_t *p_udf_root = udf_get_root(p_udf, true, 0); udf_dirent_t *p_udf_file = NULL; if (NULL == p_udf_root) { fprintf(stderr, "Sorry, couldn't find / in %s\n", psz_udf_image); return 1; } p_udf_file = udf_fopen(p_udf_root, psz_udf_fname); if (!p_udf_file) { fprintf(stderr, "Sorry, couldn't find %s in %s\n", psz_udf_fname, psz_udf_image); return 2; } print_file_info(p_udf_file, udf_get_filename(p_udf_file)); { long unsigned int i_file_length = udf_get_file_length(p_udf_file); char *p_buf; unsigned int i_blocks = CEILING(i_file_length, UDF_BLOCKSIZE); char fmt_string[100] = {'\0'}; snprintf(fmt_string, sizeof(fmt_string), "%%%lus", i_file_length); p_buf = (char *) calloc(sizeof(char), UDF_BLOCKSIZE*i_blocks); udf_read_block(p_udf_file, p_buf, i_blocks); printf(fmt_string, p_buf); free(p_buf); } udf_dirent_free(p_udf_file); udf_dirent_free(p_udf_root); } udf_close(p_udf); return 0; } libcdio-2.2.0/example/udffile.c000066400000000000000000000077311474051130400163440ustar00rootroot00000000000000/* Copyright (C) 2005-2006, 2008-2011, 2017, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Simple program to show using libudf to extract a file. This program can be compiled with either a C or C++ compiler. In the distribution we prefer C++ just to make sure we haven't broken things on the C++ side. */ /* config.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif /* This is the UDF image. */ #define UDF_IMAGE_PATH "../" #define UDF_IMAGE "../test/data/udf102.iso" #define UDF_FILENAME "/COPYING" #define LOCAL_FILENAME "copying" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define CEILING(x, y) ((x+(y-1))/y) #define udf_PATH_DELIMITERS "/\\" int main(int argc, const char *argv[]) { udf_t *p_udf; FILE *p_outfd; char const *psz_udf_image; char const *psz_udf_fname; char const *psz_local_fname; if (argc > 1) psz_udf_image = argv[1]; else psz_udf_image = UDF_IMAGE; if (argc > 2) psz_udf_fname = argv[2]; else psz_udf_fname = UDF_FILENAME; if (argc > 3) psz_local_fname = argv[3]; else psz_local_fname = LOCAL_FILENAME; p_udf = udf_open (psz_udf_image); if (NULL == p_udf) { fprintf(stderr, "Sorry, couldn't open %s as something using UDF\n", psz_udf_image); return 1; } else { udf_dirent_t *p_udf_root = udf_get_root(p_udf, true, 0); udf_dirent_t *p_udf_file = NULL; if (NULL == p_udf_root) { fprintf(stderr, "Sorry, couldn't find / in %s\n", psz_udf_image); udf_dirent_free(p_udf_file); udf_close(p_udf); return 1; } p_udf_file = udf_fopen(p_udf_root, psz_udf_fname); if (!p_udf_file) { fprintf(stderr, "Sorry, couldn't find %s in %s\n", psz_udf_fname, psz_udf_image); udf_dirent_free(p_udf_root); udf_dirent_free(p_udf_file); udf_close(p_udf); return 2; } if (!(p_outfd = fopen (psz_local_fname, "wb"))) { perror ("fopen()"); udf_close(p_udf); udf_dirent_free(p_udf_file); return 3; } { uint64_t i_file_length = udf_get_file_length(p_udf_file); const unsigned int i_blocks = (unsigned int) CEILING(i_file_length, UDF_BLOCKSIZE); unsigned int i; for (i = 0; i < i_blocks ; i++) { char buf[UDF_BLOCKSIZE] = {'\0',}; ssize_t i_read = udf_read_block(p_udf_file, buf, 1); if ( i_read < 0 ) { fprintf(stderr, "Error reading UDF file %s at block %u\n", psz_local_fname, i); return 4; } fwrite (buf, i_read, 1, p_outfd); if (ferror (p_outfd)) { perror ("fwrite()"); return 5; } } fflush (p_outfd); udf_dirent_free(p_udf_file); udf_dirent_free(p_udf_root); udf_close(p_udf); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of UDF_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), i_file_length)) perror ("ftruncate()"); printf("Extraction of file '%s' from %s successful.\n", psz_local_fname, psz_udf_image); return 0; } } } libcdio-2.2.0/include/000077500000000000000000000000001474051130400145425ustar00rootroot00000000000000libcdio-2.2.0/include/.gitignore000066400000000000000000000000271474051130400165310ustar00rootroot00000000000000/Makefile /Makefile.in libcdio-2.2.0/include/Makefile.am000066400000000000000000000015421474051130400166000ustar00rootroot00000000000000# $Id: Makefile.am,v 1.4 2008/03/20 19:02:37 karl Exp $ # # Copyright (C) 2003, 2004, 2006, 2008 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . if ENABLE_CXX_BINDINGS cxxdirs = cdio++ endif SUBDIRS = cdio $(cxxdirs) libcdio-2.2.0/include/cdio++/000077500000000000000000000000001474051130400156065ustar00rootroot00000000000000libcdio-2.2.0/include/cdio++/.gitignore000066400000000000000000000000271474051130400175750ustar00rootroot00000000000000/Makefile /Makefile.in libcdio-2.2.0/include/cdio++/Makefile.am000066400000000000000000000021711474051130400176430ustar00rootroot00000000000000# $Id: Makefile.am,v 1.5 2008/03/20 19:02:38 karl Exp $ # # Copyright (C) 2005, 2008 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################## # Things to make the install (public) libcdio++ headers ######################################################## # libcdioincludedir=$(includedir)/cdio++ libcdioinclude_HEADERS = \ cdio.hpp \ cdtext.hpp \ device.hpp \ devices.hpp \ disc.hpp \ enum.hpp \ iso9660.hpp \ mmc.hpp \ read.hpp \ track.hpp libcdio-2.2.0/include/cdio++/cdio.hpp000066400000000000000000000077301474051130400172440ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file cdio.hpp * * \brief C++ class for libcdio: the CD Input and Control * library. Applications use this for anything regarding libcdio. */ #ifndef CDIO_CDIOPP_HPP_ #define CDIO_CDIOPP_HPP_ #include #include #include #include #include // Make pre- and post-increment operators for enums in libcdio where it // makes sense. #include /** Class for driver exceptions. **/ class DriverOpException { public: driver_return_code_t driver_return_code; DriverOpException( void ) { driver_return_code = DRIVER_OP_SUCCESS; }; DriverOpException( driver_return_code_t drc ) { driver_return_code = drc; }; driver_return_code_t get_code(void) { return driver_return_code; }; const char *get_msg(void) { return cdio_driver_errmsg(driver_return_code); }; }; class DriverOpError: public DriverOpException { public: DriverOpError(void) { driver_return_code = DRIVER_OP_ERROR; } }; class DriverOpUnsupported: public DriverOpException { public: DriverOpUnsupported(void) { driver_return_code = DRIVER_OP_UNSUPPORTED; } }; class DriverOpUninit: public DriverOpException { public: DriverOpUninit(void) { driver_return_code = DRIVER_OP_UNINIT; } }; class DriverOpNotPermitted: public DriverOpException { public: DriverOpNotPermitted(void) {driver_return_code = DRIVER_OP_NOT_PERMITTED;} }; class DriverOpBadParameter: public DriverOpException { public: DriverOpBadParameter(void) {driver_return_code = DRIVER_OP_BAD_PARAMETER;} }; class DriverOpBadPointer: public DriverOpException { public: DriverOpBadPointer(void) {driver_return_code = DRIVER_OP_BAD_POINTER;} }; class DriverOpNoDriver: public DriverOpException { public: DriverOpNoDriver(void) {driver_return_code = DRIVER_OP_NO_DRIVER;} }; void possible_throw_device_exception(driver_return_code_t drc); /** A class relating to CD-Text. Use invalid track number 0 to specify CD-Text for the CD (as opposed to a specific track). */ class CdioCDText { public: CdioCDText(cdtext_t *cdtext) { if (NULL == cdtext) cdtext = cdtext_init(); p_cdtext = cdtext; } ~CdioCDText() { cdtext_destroy(p_cdtext); p_cdtext = (cdtext_t *) NULL; } // Other member functions #include "cdtext.hpp" private: cdtext_t *p_cdtext; }; /** A class relating to tracks. A track object basically saves device and track number information so that in track operations these don't have be specified. */ class CdioTrack { public: CdioTrack(CdIo_t *p, track_t t) { i_track = t; p_cdio = p; } // Other member functions #include "track.hpp" private: track_t i_track; CdIo_t *p_cdio; }; /** A class relating to a CD-ROM device or pseudo CD-ROM device with has a particular CD image. A device basically saves the libcdio "object" (of type CdIo *). */ class CdioDevice { protected: CdIo_t *p_cdio; public: CdioDevice() { p_cdio = (CdIo_t *) NULL; }; ~CdioDevice() { cdio_destroy(p_cdio); p_cdio = (CdIo_t *) NULL; }; // Other member functions #include "device.hpp" #include "disc.hpp" #include "mmc.hpp" #include "read.hpp" }; /* Things related to devices. No class or object is needed. */ #include "devices.hpp" #endif /* CDIO_CDIOPP_HPP_ */ libcdio-2.2.0/include/cdio++/cdtext.hpp000066400000000000000000000060241474051130400176140ustar00rootroot00000000000000/* Copyright (C) 2018 Thomas Schmitt Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file cdtext.hpp * \brief methods relating to CD-Text information. This file * should not be #included directly. */ /*! Return string representation of the enum values above */ const char *field2str (cdtext_field_t i) { return cdtext_field2str (i); } const char *genre2str (cdtext_genre_t i) { return cdtext_genre2str (i); } const char *lang2str (cdtext_lang_t i) { return cdtext_lang2str (i); } /*! returns an allocated string associated with the given field. NULL is returned if key is CDTEXT_INVALID or the field is not set. The user needs to free the string using cdio_free() when done with it. @see getConst to retrieve a constant string that doesn't have to be freed. */ char *get (cdtext_field_t key, track_t i_track) { return cdtext_get (p_cdtext, key, i_track); } /*! returns a const string associated with the given field. NULL is returned if key is CDTEXT_INVALID or the field is not set. Don't use the string when the cdtext object (i.e. the CdIo_t object you got it from) is no longer valid. @see cdio_get to retrieve an allocated string that persists past the cdtext object. */ const char *getConst (cdtext_field_t key, track_t i_track) { return cdtext_get_const (p_cdtext, key, i_track); } /*! sets cdtext's keyword entry to field */ void set (cdtext_field_t key, track_t i_track, const uint8_t *value, const char *charset) { cdtext_set (p_cdtext, key, value, i_track, charset); } /*! returns the selected language */ cdtext_lang_t getLanguage() { return cdtext_get_language(p_cdtext); } /*! selects a language */ bool selectLanguage(cdtext_lang_t lang) { return cdtext_select_language(p_cdtext, lang); } /*! selects a language by index rather than language code */ bool setLanguageIndex(int idx) { return cdtext_set_language_index(p_cdtext, idx); } /*! @deprecated. Use listLanguagesV2(), see cdio/cdtext.h returns a list of available languages (which has various problems) */ cdtext_lang_t *listLanguages() { return cdtext_list_languages(p_cdtext); } /*! returns a pointer to an array with 8 elements which indicate available languages */ cdtext_lang_t *listLanguagesV2() { return cdtext_list_languages_v2(p_cdtext); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio++/device.hpp000066400000000000000000000136601474051130400175640ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file device.hpp * * \brief C++ header for driver- or device-related libcdio calls. * ("device" includes CD-image reading devices.) */ /*! Free resources associated with CD-ROM Device/Image. After this we must do another open before any more reading. */ bool close() { cdio_destroy(p_cdio); p_cdio = (CdIo_t *) NULL; return true; } /*! Eject media in CD drive if there is a routine to do so. If the CD is ejected, object is destroyed. */ void ejectMedia () { driver_return_code_t drc = cdio_eject_media(&p_cdio); possible_throw_device_exception(drc); } /*! Free device list returned by GetDevices @param device_list list returned by GetDevices @see GetDevices */ void freeDeviceList (char * device_list[]) { cdio_free_device_list(device_list); } /*! Get the value associatied with key. @param key the key to retrieve @return the value associatd with "key" or NULL if p_cdio is NULL or "key" does not exist. */ const char * getArg (const char key[]) { return cdio_get_arg (p_cdio, key); } /*! Return an opaque CdIo_t pointer for the given track object. */ CdIo_t *getCdIo() { return p_cdio; } /*! Get the CD device name for the object. @return a string containing the CD device for this object or NULL is if we couldn't get a device anme. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ char * getDevice () { return cdio_get_default_device(p_cdio); } /*! Get the what kind of device we've got. @param p_read_cap pointer to return read capabilities @param p_write_cap pointer to return write capabilities @param p_misc_cap pointer to return miscellaneous other capabilities In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ void getDriveCap (cdio_drive_read_cap_t &read_cap, cdio_drive_write_cap_t &write_cap, cdio_drive_misc_cap_t &misc_cap) { cdio_get_drive_cap(p_cdio, &read_cap, &write_cap, &misc_cap); } /*! Get a string containing the name of the driver in use. @return a string with driver name or NULL if CdIo_t is NULL (we haven't initialized a specific device. */ const char * getDriverName () { return cdio_get_driver_name(p_cdio); } /*! Get the driver id. if CdIo_t is NULL (we haven't initialized a specific device driver), then return DRIVER_UNKNOWN. @return the driver id.. */ driver_id_t getDriverId () { return cdio_get_driver_id(p_cdio); } /*! Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. False is returned if we had an error getting the information. */ bool getHWinfo ( /*out*/ cdio_hwinfo_t &hw_info ) { return cdio_get_hwinfo(p_cdio, &hw_info); } /*! Get the LSN of the first track of the last session of on the CD. @param i_last_session pointer to the session number to be returned. */ void getLastSession (/*out*/ lsn_t &i_last_session) { driver_return_code_t drc = cdio_get_last_session(p_cdio, &i_last_session); possible_throw_device_exception(drc); } /*! Find out if media has changed since the last call. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ int getMediaChanged() { return cdio_get_media_changed(p_cdio); } /*! True if CD-ROM understand ATAPI commands. */ bool_3way_t haveATAPI () { return cdio_have_atapi(p_cdio); } /*! Sets up to read from the device specified by psz_source. An open routine should be called before using any read routine. If device object was previously opened it is closed first. @return true if open succeeded or false if error. */ bool open(const char *psz_source) { if (p_cdio) cdio_destroy(p_cdio); p_cdio = cdio_open_cd(psz_source); return NULL != p_cdio ; } /*! Sets up to read from the device specified by psz_source and access mode. An open routine should be called before using any read routine. If device object was previously opened it is "closed". @return true if open succeeded or false if error. */ bool open (const char *psz_source, driver_id_t driver_id, const char *psz_access_mode = (const char *) NULL) { if (p_cdio) cdio_destroy(p_cdio); if (psz_access_mode) p_cdio = cdio_open_am(psz_source, driver_id, psz_access_mode); else p_cdio = cdio_open(psz_source, driver_id); return NULL != p_cdio ; } /*! Set the blocksize for subsequent reads. */ void setBlocksize ( int i_blocksize ) { driver_return_code_t drc = cdio_set_blocksize ( p_cdio, i_blocksize ); possible_throw_device_exception(drc); } /*! Set the drive speed. */ void setSpeed ( int i_speed ) { driver_return_code_t drc = cdio_set_speed ( p_cdio, i_speed ); possible_throw_device_exception(drc); } /*! Set the arg "key" with "value" in "p_cdio". @param key the key to set @param value the value to assocaiate with key */ void setArg (const char key[], const char value[]) { driver_return_code_t drc = cdio_set_arg (p_cdio, key, value); possible_throw_device_exception(drc); } libcdio-2.2.0/include/cdio++/devices.hpp000066400000000000000000000135441474051130400177500ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file devices.hpp * * \brief methods relating to devices. It is *not* part of a class. * This file should not be #included directly. */ /*! Close media tray in CD drive if there is a routine to do so. @param psz_drive the name of CD-ROM to be closed. @param driver_id is the driver to be used or that got used if it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't report back the driver used. */ void closeTray(const char *psz_drive, /*in/out*/ driver_id_t &driver_id); /*! Close media tray in CD drive if there is a routine to do so. @param psz_drive the name of CD-ROM to be closed. If omitted or NULL, we'll scan for a suitable CD-ROM. */ void closeTray(const char *psz_drive=(const char *)NULL); /*! Get a string decribing driver_id. @param driver_id the driver you want the description for @return a sring of driver description */ const char *driverDescribe(driver_id_t driver_id); /*! Eject media in CD drive if there is a routine to do so. If the CD is ejected, object is destroyed. */ void ejectMedia(const char *psz_drive); /*! Free device list returned by GetDevices @param device_list list returned by GetDevices @see GetDevices */ void freeDeviceList(char * device_list[]); /*! Return a string containing the default CD device if none is specified. if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable one set the default device for that. NULL is returned if we couldn't get a default device. */ char * getDefaultDevice(/*in/out*/ driver_id_t &driver_id); /*! Return an array of device names. If you want a specific devices for a driver, give that device. If you want hardware devices, give DRIVER_DEVICE and if you want all possible devices, image drivers and hardware drivers give DRIVER_UNKNOWN. NULL is returned if we couldn't return a list of devices. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ char ** getDevices(driver_id_t driver_id=DRIVER_DEVICE); /*! Like GetDevices above, but we may change the p_driver_id if we were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. */ char **getDevices(driver_id_t &driver_id); /*! Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If search_devices is NULL, then we'll search all possible CD drives. If "b_any" is set false then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If "any" is set true, then if any of the capabilities matches, we call that a success. To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL. @return the array of device names or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found. */ char ** getDevices(/*in*/ char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any=false); /*! Like GetDevices above but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. */ char ** getDevices(/*in*/ char* ppsz_search_devices[], cdio_fs_anal_t capabilities, /*out*/ driver_id_t &driver_id, bool b_any=false); /*! Return true if we Have driver for driver_id */ bool haveDriver(driver_id_t driver_id); /*! Determine if bin_name is the bin file part of a CDRWIN CD disk image. @param bin_name location of presumed CDRWIN bin image file. @return the corresponding CUE file if bin_name is a BIN file or NULL if not a BIN file. */ char *isBinFile(const char *psz_bin_name); /*! Determine if cue_name is the cue sheet for a CDRWIN CD disk image. @return corresponding BIN file if cue_name is a CDRWIN cue file or NULL if not a CUE file. */ char *isCueFile(const char *psz_cue_name); /*! Determine if psz_source refers to a real hardware CD-ROM. @param psz_source location name of object @param driver_id driver for reading object. Use DRIVER_UNKNOWN if you don't know what driver to use. @return true if psz_source is a device; If false is returned we could have a CD disk image. */ bool isDevice(const char *psz_source, driver_id_t driver_id); /*! Determine if psz_nrg is a Nero CD disk image. @param psz_nrg location of presumed NRG image file. @return true if psz_nrg is a Nero NRG image or false if not a NRG image. */ bool isNero(const char *psz_nrg); /*! Determine if psz_toc is a TOC file for a cdrdao CD disk image. @param psz_toc location of presumed TOC image file. @return true if toc_name is a cdrdao TOC file or false if not a TOC file. */ bool isTocFile(const char *psz_toc); libcdio-2.2.0/include/cdio++/disc.hpp000066400000000000000000000102301474051130400172350ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file disc.hpp * \brief methods relating to getting Compact Disc information. This file * should not be #included directly. */ /*! Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc. that we've got. The notion of "CD" is extended a little to include DVD's. */ discmode_t getDiscmode () { return cdio_get_discmode(p_cdio); } /*! Get the lsn of the end of the CD @return the lsn. On error 0 or CDIO_INVALD_LSN. */ lsn_t getDiscLastLsn() { return cdio_get_disc_last_lsn(p_cdio); } /*! Get the number of the first track. @return a track object or NULL; on error. */ CdioTrack *getFirstTrack() { track_t i_track = cdio_get_first_track_num(p_cdio); return (CDIO_INVALID_TRACK != i_track) ? new CdioTrack(p_cdio, i_track) : (CdioTrack *) NULL; } /*! Get the number of the first track. @return the track number or CDIO_INVALID_TRACK on error. */ track_t getFirstTrackNum() { return cdio_get_first_track_num(p_cdio); } /*! Get the number of the first track. @return a track object or NULL; on error. */ CdioTrack *getLastTrack() { track_t i_track = cdio_get_last_track_num(p_cdio); return (CDIO_INVALID_TRACK != i_track) ? new CdioTrack(p_cdio, i_track) : (CdioTrack *) NULL; } /*! Get the number of the first track. @return the track number or CDIO_INVALID_TRACK on error. */ track_t getLastTrackNum() { return cdio_get_last_track_num(p_cdio); } /*! Return the Joliet level recognized for p_cdio. */ uint8_t getJolietLevel() { return cdio_get_joliet_level(p_cdio); } /*! Get the media catalog number (MCN) from the CD. @return the media catalog number r NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * getMcn () { return cdio_get_mcn (p_cdio); } /*! Get the number of tracks on the CD. @return the number of tracks, or CDIO_INVALID_TRACK if there is an error. */ track_t getNumTracks () { return cdio_get_num_tracks(p_cdio); } /*! Find the track which contans lsn. CDIO_INVALID_TRACK is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track 0 is returned. Otherwise we return the track that spans the lsn. */ CdioTrack *getTrackFromNum(track_t i_track) { return new CdioTrack(p_cdio, i_track); } /*! Find the track which contans lsn. CDIO_INVALID_TRACK is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track 0 is returned. Otherwise we return the track that spans the lsn. */ CdioTrack *getTrackFromLsn(lsn_t lsn) { track_t i_track = cdio_get_track(p_cdio, lsn); return (CDIO_INVALID_TRACK != i_track) ? new CdioTrack(p_cdio, i_track) : (CdioTrack *) NULL; } /*! Return true if discmode is some sort of CD. */ bool isDiscmodeCdrom (discmode_t discmode) { return cdio_is_discmode_cdrom(discmode); } /*! Return true if discmode is some sort of DVD. */ bool isDiscmodeDvd (discmode_t discmode) { return cdio_is_discmode_dvd (discmode) ; } /*! Get CD-Text information for a CdIo_t object. @return the CD-Text object or NULL if obj is NULL or CD-Text information does not exist. */ CdioCDText *getCdtext () { cdtext_t *cdtext = cdio_get_cdtext (p_cdio); if (NULL == cdtext) return (CdioCDText *) NULL; else return new CdioCDText(cdtext); } libcdio-2.2.0/include/cdio++/enum.hpp000066400000000000000000000025601474051130400172660ustar00rootroot00000000000000/* Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file enum.hpp * * \brief C++ header for pre- and post-increment operators for * enumerations defined in libcdio that it makes sense to iterate over. */ #define ENUM_ITERATE_FNS(type) \ inline \ type &operator++(type &t) \ { \ return t = type(t + 1); \ } \ inline \ type &operator++(type &t, int) \ { \ return t = type(t + 1); \ } \ inline \ type &operator--(type &t) \ { \ return t = type(t - 1); \ } \ inline \ type &operator--(type &t, int) \ { \ return t = type(t - 1); \ } ENUM_ITERATE_FNS(cdtext_field_t) ENUM_ITERATE_FNS(driver_id_t) libcdio-2.2.0/include/cdio++/iso9660.hpp000066400000000000000000000275471474051130400174550ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2011-2012, 2016-2017, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file iso9660.hpp * * \brief C++ class for libcdio: the CD Input and Control * library. Applications use this for anything regarding libcdio. */ #ifndef CDIO_ISO9660_HPP_ #define CDIO_ISO9660_HPP_ #include #include #include // vector class library #include #include /** ISO 9660 class. */ class ISO9660 { public: class PVD // Primary Volume ID { public: iso9660_pvd_t pvd; // Make private? PVD() { std::memset(&pvd, 0, sizeof(pvd)); } PVD(iso9660_pvd_t *p_new_pvd) { std::memcpy(&pvd, p_new_pvd, sizeof(pvd)); }; /*! Return the PVD's application ID. NULL is returned if there is some problem in getting this. */ char * get_application_id(); int get_pvd_block_size(); /*! Return the PVD's preparer ID. NULL is returned if there is some problem in getting this. */ char * get_preparer_id(); /*! Return the PVD's publisher ID. NULL is returned if there is some problem in getting this. */ char * get_publisher_id(); const char *get_pvd_id(); int get_pvd_space_size(); uint8_t get_pvd_type(); /*! Return the primary volume id version number (of pvd). If there is an error 0 is returned. */ int get_pvd_version(); /*! Return the LSN of the root directory for pvd. If there is an error CDIO_INVALID_LSN is returned. */ lsn_t get_root_lsn(); /*! Return the PVD's system ID. NULL is returned if there is some problem in getting this. */ char * get_system_id(); /*! Return the PVD's volume ID. NULL is returned if there is some problem in getting this. */ char * get_volume_id(); /*! Return the PVD's volumeset ID. NULL is returned if there is some problem in getting this. */ char * get_volumeset_id(); }; class Stat // ISO 9660 file information { public: iso9660_stat_t *p_stat; typedef std::vector< ISO9660::Stat *> stat_vector_t; Stat(iso9660_stat_t *p_new_stat) { p_stat = p_new_stat; }; Stat(const Stat& copy_in) { iso9660_stat_free(p_stat); p_stat = (iso9660_stat_t *) calloc( 1, sizeof(iso9660_stat_t) + strlen(copy_in.p_stat->filename)+1 ); p_stat = copy_in.p_stat; } const Stat& operator= (const Stat& right) { iso9660_stat_free(p_stat); this->p_stat = right.p_stat; return right; } ~Stat() { iso9660_stat_free(p_stat); p_stat = NULL; } }; #ifdef FS #undef FS #endif class FS : public CdioDevice // ISO 9660 Filesystem on a CD or CD-image { public: typedef std::vector< ISO9660::Stat *> stat_vector_t; /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @return Stat * of entry if we found lsn, or NULL otherwise. Caller must release returned object using delete when done. */ Stat *find_lsn(lsn_t i_lsn); /*! Read the Primary Volume Descriptor for a CD. A PVD object is returned if read, and NULL if there was an error. */ PVD *read_pvd (); /*! Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ bool read_superblock (iso_extension_mask_t iso_extension_mask); /*! Read psz_path (a directory) and return a vector of iso9660_stat_t pointers for the files inside that directory. The caller must free the returned result. */ bool readdir (const char psz_path[], stat_vector_t& stat_vector); /*! Return file status for path name psz_path. NULL is returned on error. If translate is true, version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. @return file status object for psz_path. NULL is returned on error. Caller must release returned object using delete when done. */ Stat * stat (const char psz_path[], bool b_translate=false) { if (b_translate) return new Stat(iso9660_fs_stat_translate (p_cdio, psz_path)); else return new Stat(iso9660_fs_stat (p_cdio, psz_path)); } }; class IFS // ISO 9660 filesystem image { public: typedef std::vector< ISO9660::Stat *> stat_vector_t; IFS() { p_iso9660=NULL; }; ~IFS() { iso9660_close(p_iso9660); p_iso9660 = (iso9660_t *) NULL; }; /*! Close previously opened ISO 9660 image and free resources associated with the image. Call this when done using using an ISO 9660 image. @return true is unconditionally returned. If there was an error false would be returned. */ bool close(); /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. Returns Stat* of entry if we found lsn, or NULL otherwise. Caller must release returned object using delete when done. */ Stat *find_lsn(lsn_t i_lsn); /*! Get the application ID. psz_app_id is set to NULL if there is some problem in getting this and false is returned. */ bool get_application_id(/*out*/ char * &psz_app_id) { return iso9660_ifs_get_application_id(p_iso9660, &psz_app_id); } /*! Return the Joliet level recognized. */ uint8_t get_joliet_level(); /*! Get the preparer ID. psz_preparer_id is set to NULL if there is some problem in getting this and false is returned. */ bool get_preparer_id(/*out*/ char * &psz_preparer_id) { return iso9660_ifs_get_preparer_id(p_iso9660, &psz_preparer_id); } /*! Get the publisher ID. psz_publisher_id is set to NULL if there is some problem in getting this and false is returned. */ bool get_publisher_id(/*out*/ char * &psz_publisher_id) { return iso9660_ifs_get_publisher_id(p_iso9660, &psz_publisher_id); } /*! Get the system ID. psz_system_id is set to NULL if there is some problem in getting this and false is returned. */ bool get_system_id(/*out*/ char * &psz_system_id) { return iso9660_ifs_get_system_id(p_iso9660, &psz_system_id); } /*! Return the volume ID in the PVD. psz_volume_id is set to NULL if there is some problem in getting this and false is returned. */ bool get_volume_id(/*out*/ char * &psz_volume_id) { return iso9660_ifs_get_volume_id(p_iso9660, &psz_volume_id); } /*! Return the volumeset ID in the PVD. psz_volumeset_id is set to NULL if there is some problem in getting this and false is returned. */ bool get_volumeset_id(/*out*/ char * &psz_volumeset_id) { return iso9660_ifs_get_volumeset_id(p_iso9660, &psz_volumeset_id); } /*! Return true if ISO 9660 image has extended attrributes (XA). */ bool is_xa (); /*! Open an ISO 9660 image for reading. Maybe in the future we will have a mode. NULL is returned on error. An open routine should be called before using any read routine. If device object was previously opened it is closed first. @param psz_path location of ISO 9660 image @param iso_extension_mask the kinds of ISO 9660 extensions will be considered on access. @return true if open succeeded or false if error. @see open_fuzzy */ bool open(const char *psz_path, iso_extension_mask_t iso_extension_mask=ISO_EXTENSION_NONE) { if (p_iso9660) iso9660_close(p_iso9660); p_iso9660 = iso9660_open_ext(psz_path, iso_extension_mask); return NULL != (iso9660_t *) p_iso9660 ; } /*! Open an ISO 9660 image for "fuzzy" reading. This means that we will try to guess various internal offset based on internal checks. This may be useful when trying to read an ISO 9660 image contained in a file format that libiso9660 doesn't know natively (or knows imperfectly.) Maybe in the future we will have a mode. NULL is returned on error. @see open */ bool open_fuzzy (const char *psz_path, iso_extension_mask_t iso_extension_mask =ISO_EXTENSION_NONE, uint16_t i_fuzz=20); /*! Read the Primary Volume Descriptor for an ISO 9660 image. A PVD object is returned if read, and NULL if there was an error. */ PVD *read_pvd (); /*! Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. @see read_superblock */ bool read_superblock (iso_extension_mask_t iso_extension_mask =ISO_EXTENSION_NONE, uint16_t i_fuzz=20); /*! Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. @see read_superblock */ bool read_superblock_fuzzy (iso_extension_mask_t iso_extension_mask =ISO_EXTENSION_NONE, uint16_t i_fuzz=20); /*! Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. The caller must free the returned result. */ bool readdir (const char psz_path[], stat_vector_t& stat_vector) { CdioISO9660FileList_t *p_stat_list = iso9660_ifs_readdir (p_iso9660, psz_path); if (p_stat_list) { CdioListNode_t *p_entnode; _CDIO_LIST_FOREACH (p_entnode, p_stat_list) { iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (p_entnode); stat_vector.push_back(new ISO9660::Stat(p_statbuf)); } /* explicitely not iso9660_filelist_free(p_stat_list) because the p_statbuf objects live on in stat_vector. */ _cdio_list_free(p_stat_list, false, (CdioDataFree_t) NULL); return true; } else { return false; } } /*! Seek to a position and then read n bytes. Size read is returned. */ long int seek_read (void *ptr, lsn_t start, long int i_size=1) { return iso9660_iso_seek_read (p_iso9660, ptr, start, i_size); } /*! Return file status for pathname. NULL is returned on error. Caller must release returned object using delete when done. */ Stat * stat (const char psz_path[], bool b_translate=false) { if (b_translate) return new Stat(iso9660_ifs_stat_translate (p_iso9660, psz_path)); else return new Stat(iso9660_ifs_stat (p_iso9660, psz_path)); } private: iso9660_t *p_iso9660; }; }; typedef std::vector< ISO9660::Stat *> stat_vector_t; typedef std::vector ::iterator stat_vector_iterator_t; #endif /* CDIO_ISO9660_HPP_ */ libcdio-2.2.0/include/cdio++/mmc.hpp000066400000000000000000000323331474051130400170770ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2010 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** * \file mmc.hpp * \brief methods relating to MMC (Multimedia Commands). This file * should not be #included directly. */ /** Read Audio Subchannel information @param p_cdio the CD object to be acted upon. @param p_subchannel place for returned subchannel information A DriverOpException is raised on error. */ void mmcAudioReadSubchannel (/*out*/ cdio_subchannel_t *p_subchannel) { driver_return_code_t drc = mmc_audio_read_subchannel (p_cdio, p_subchannel); possible_throw_device_exception(drc); } /** Eject using MMC commands. If CD-ROM is "locked" we'll unlock it. Command is not "immediate" -- we'll wait for the command to complete. For a more general (and lower-level) routine, @see mmc_start_stop_unit. A DriverOpException is raised on error. */ void mmcEjectMedia() { driver_return_code_t drc = mmc_eject_media( p_cdio ); possible_throw_device_exception(drc); } /** Get the lsn of the end of the CD @return the lsn. On error return CDIO_INVALID_LSN. */ lsn_t mmcGetDiscLastLsn() { return mmc_get_disc_last_lsn( p_cdio ); } /** Return the discmode as reported by the MMC Read (FULL) TOC command. Information was obtained from Section 5.1.13 (Read TOC/PMA/ATIP) pages 56-62 from the MMC draft specification, revision 10a at http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf See especially tables 72, 73 and 75. */ discmode_t mmcGetDiscmode() { return mmc_get_discmode( p_cdio ); } /** Get drive capabilities for a device. @return the drive capabilities. */ void mmcGetDriveCap ( /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) { mmc_get_drive_cap ( p_cdio, p_read_cap, p_write_cap, p_misc_cap); } /** Get the MMC level supported by the device. */ cdio_mmc_level_t mmcGetDriveMmcCap() { return mmc_get_drive_mmc_cap(p_cdio); } /** Get the DVD type associated with cd object. @return the DVD discmode. */ discmode_t mmcGetDvdStructPhysical (cdio_dvd_struct_t *s) { return mmc_get_dvd_struct_physical (p_cdio, s); } /** Get the CD-ROM hardware info via an MMC INQUIRY command. @return true if we were able to get hardware info, false if we had an error. */ bool mmcGetHwinfo ( /* out*/ cdio_hwinfo_t *p_hw_info ) { return mmc_get_hwinfo ( p_cdio, p_hw_info ); } /** Find out if media has changed since the last call. @param p_cdio the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ int mmcGetMediaChanged() { return mmc_get_media_changed(p_cdio); } /** Get the media catalog number (MCN) from the CD via MMC. @return the media catalog number r NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * mmcGetMcn () { return mmc_get_mcn ( p_cdio ); } /** Get the output port volumes and port selections used on AUDIO PLAY commands via a MMC MODE SENSE command using the CD Audio Control Page. A DriverOpException is raised on error. */ void mmcAudioGetVolume (mmc_audio_volume_t *p_volume) { driver_return_code_t drc = mmc_audio_get_volume (p_cdio, p_volume); possible_throw_device_exception(drc); } /** Report if CD-ROM has a praticular kind of interface (ATAPI, SCSCI, ...) Is it possible for an interface to have serveral? If not this routine could probably return the single mmc_feature_interface_t. @return true if we have the interface and false if not. */ bool_3way_t mmcHaveInterface( cdio_mmc_feature_interface_t e_interface ) { return mmc_have_interface( p_cdio, e_interface ); } /** Run a MODE_SENSE command (6- or 10-byte version) and put the results in p_buf @return DRIVER_OP_SUCCESS if we ran the command ok. */ int mmcModeSense( /*out*/ void *p_buf, int i_size, int page) { return mmc_mode_sense( p_cdio, /*out*/ p_buf, i_size, page); } /** Run a MODE_SENSE command (10-byte version) and put the results in p_buf @return DRIVER_OP_SUCCESS if we ran the command ok. */ int mmcModeSense10( /*out*/ void *p_buf, int i_size, int page) { return mmc_mode_sense_10( p_cdio, /*out*/ p_buf, i_size, page); } /** Run a MODE_SENSE command (6-byte version) and put the results in p_buf @return DRIVER_OP_SUCCESS if we ran the command ok. */ int mmcModeSense6( /*out*/ void *p_buf, int i_size, int page) { return mmc_mode_sense_6( p_cdio, /*out*/ p_buf, i_size, page); } /** Issue a MMC READ_CD command. @param p_cdio object to read from @param p_buf Place to store data. The caller should ensure that p_buf can hold at least i_blocksize * i_blocks bytes. @param i_lsn sector to read @param expected_sector_type restricts reading to a specific CD sector type. Only 3 bits with values 1-5 are used: 0 all sector types 1 CD-DA sectors only 2 Mode 1 sectors only 3 Mode 2 formless sectors only. Note in contrast to all other values an MMC CD-ROM is not required to support this mode. 4 Mode 2 Form 1 sectors only 5 Mode 2 Form 2 sectors only @param b_digital_audio_play Control error concealment when the data being read is CD-DA. If the data being read is not CD-DA, this parameter is ignored. If the data being read is CD-DA and DAP is false zero, then the user data returned should not be modified by flaw obscuring mechanisms such as audio data mute and interpolate. If the data being read is CD-DA and DAP is true, then the user data returned should be modified by flaw obscuring mechanisms such as audio data mute and interpolate. b_sync_header return the sync header (which will probably have the same value as CDIO_SECTOR_SYNC_HEADER of size CDIO_CD_SYNC_SIZE). @param header_codes Header Codes refer to the sector header and the sub-header that is present in mode 2 formed sectors: 0 No header information is returned. 1 The 4-byte sector header of data sectors is be returned, 2 The 8-byte sector sub-header of mode 2 formed sectors is returned. 3 Both sector header and sub-header (12 bytes) is returned. The Header preceeds the rest of the bytes (e.g. user-data bytes) that might get returned. @param b_user_data Return user data if true. For CD-DA, the User Data is CDIO_CD_FRAMESIZE_RAW bytes. For Mode 1, The User Data is ISO_BLOCKSIZE bytes beginning at offset CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE. For Mode 2 formless, The User Data is M2RAW_SECTOR_SIZE bytes beginning at offset CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE. For data Mode 2, form 1, User Data is ISO_BLOCKSIZE bytes beginning at offset CDIO_CD_XA_SYNC_HEADER. For data Mode 2, form 2, User Data is 2 324 bytes beginning at offset CDIO_CD_XA_SYNC_HEADER. @param b_sync @param b_edc_ecc true if we return EDC/ECC error detection/correction bits. The presence and size of EDC redundancy or ECC parity is defined according to sector type: CD-DA sectors have neither EDC redundancy nor ECC parity. Data Mode 1 sectors have 288 bytes of EDC redundancy, Pad, and ECC parity beginning at offset 2064. Data Mode 2 formless sectors have neither EDC redundancy nor ECC parity Data Mode 2 form 1 sectors have 280 bytes of EDC redundancy and ECC parity beginning at offset 2072 Data Mode 2 form 2 sectors optionally have 4 bytes of EDC redundancy beginning at offset 2348. @param c2_error_information If true associate a bit with each sector for C2 error The resulting bit field is ordered exactly as the main channel bytes. Each 8-bit boundary defines a byte of flag bits. @param subchannel_selection subchannel-selection bits 0 No Sub-channel data shall be returned. (0 bytes) 1 RAW P-W Sub-channel data shall be returned. (96 byte) 2 Formatted Q sub-channel data shall be transferred (16 bytes) 3 Reserved 4 Corrected and de-interleaved R-W sub-channel (96 bytes) 5-7 Reserved @param i_blocksize size of the a block expected to be returned @param i_blocks number of blocks expected to be returned. A DriverOpException is raised on error. */ void mmcReadCd ( void *p_buf, lsn_t i_lsn, int expected_sector_type, bool b_digital_audio_play, bool b_sync, uint8_t header_codes, bool b_user_data, bool b_edc_ecc, uint8_t c2_error_information, uint8_t subchannel_selection, uint16_t i_blocksize, uint32_t i_blocks ) { driver_return_code_t drc = mmc_read_cd ( p_cdio, p_buf, i_lsn, expected_sector_type, b_digital_audio_play, b_sync, header_codes, b_user_data, b_edc_ecc, c2_error_information, subchannel_selection, i_blocksize, i_blocks ); possible_throw_device_exception(drc); } /** Read just the user data part of some sort of data sector (via mmc_read_cd). @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of each block @param i_blocks number of blocks to read */ void mmcReadDataSectors ( void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks=1) { driver_return_code_t drc = mmc_read_data_sectors ( p_cdio, p_buf, i_lsn, i_blocksize, i_blocks ); possible_throw_device_exception(drc); } /** Read MMC read mode2 sectors A DriverOpException is raised on error. */ void mmcReadSectors ( void *p_buf, lsn_t i_lsn, int read_sector_type, uint32_t i_blocks=1) { driver_return_code_t drc = mmc_read_sectors ( p_cdio, p_buf, i_lsn, read_sector_type, i_blocks); possible_throw_device_exception(drc); } /** Run an MMC command. @param p_cdio CD structure set by cdio_open(). @param i_timeout_ms time in milliseconds we will wait for the command to complete. @param p_cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. @param e_direction direction the transfer is to go. @param i_buf Size of buffer @param p_buf Buffer for data, both sending and receiving. @return 0 if command completed successfully. */ int mmcRunCmd( unsigned int i_timeout_ms, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { return mmc_run_cmd( p_cdio, i_timeout_ms, p_cdb, e_direction, i_buf, p_buf ); } /** Set the block size for subsequent read requests, via MMC. @param i_blocksize size to set for subsequent requests A DriverOpException is raised on error. */ void mmcSetBlocksize ( uint16_t i_blocksize) { driver_return_code_t drc = mmc_set_blocksize ( p_cdio, i_blocksize); possible_throw_device_exception(drc); } /** Set the drive speed via MMC. @param i_speed speed to set drive to. A DriverOpException is raised on error. */ void mmcSetSpeed( int i_speed ) { driver_return_code_t drc = mmc_set_speed( p_cdio, i_speed, 0); possible_throw_device_exception(drc); } /** Load or Unload media using a MMC START STOP command. @param p_cdio the CD object to be acted upon. @param b_eject eject if true and close tray if false @param b_immediate wait or don't wait for operation to complete @param power_condition Set CD-ROM to idle/standby/sleep. If nonzero eject/load is ignored, so set to 0 if you want to eject or load. @see mmc_eject_media or mmc_close_tray A DriverOpException is raised on error. */ void mmcStartStopMedia(bool b_eject, bool b_immediate, uint8_t power_condition) { driver_return_code_t drc = mmc_start_stop_unit(p_cdio, b_eject, b_immediate, power_condition, 0); possible_throw_device_exception(drc); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio++/read.hpp000066400000000000000000000074251474051130400172420ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file read.hpp * * \brief methods relating to reading blocks of Compact Discs. This file * should not be #included directly. */ /*! Reposition read offset Similar to (if not the same as) libc's lseek() @param offset amount to seek @param whence like corresponding parameter in libc's lseek, e.g. SEEK_SET or SEEK_END. @return (off_t) -1 on error. */ off_t lseek(off_t offset, int whence) { return cdio_lseek(p_cdio, offset, whence); } /*! Reads into buf the next size bytes. Similar to (if not the same as) libc's read() @param p_buf place to read data into. The caller should make sure this location can store at least i_size bytes. @param i_size number of bytes to read @return (ssize_t) -1 on error. */ ssize_t read(void *p_buf, size_t i_size) { return cdio_read(p_cdio, p_buf, i_size); } /*! Reads a number of sectors (AKA blocks). @param p_buf place to read data into. The caller should make sure this location is large enough. See below for size information. @param read_mode the kind of "mode" to use in reading. @param i_lsn sector to read @param i_blocks number of sectors to read If read_mode is CDIO_MODE_AUDIO, *p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes. If read_mode is CDIO_MODE_DATA, *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE, M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum which is M2RAW_SECTOR_SIZE. If read_mode is CDIO_MODE_M2F1, *p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes. If read_mode is CDIO_MODE_M2F2, *p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes. A DriverOpException is raised on error. */ void readSectors(void *p_buf, lsn_t i_lsn, cdio_read_mode_t read_mode, uint32_t i_blocks=1) { driver_return_code_t drc = cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, i_blocks); possible_throw_device_exception(drc); } /*! Reads a number of data sectors (AKA blocks). @param p_buf place to read data into. The caller should make sure this location is large enough. See below for size information. *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE, M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum which is M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. @param i_blocks number of sectors to read A DriverOpException is raised on error. */ void readDataBlocks(void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks=1) { driver_return_code_t drc = cdio_read_data_sectors (p_cdio, p_buf, i_lsn, i_blocksize, i_blocks); possible_throw_device_exception(drc); } libcdio-2.2.0/include/cdio++/track.hpp000066400000000000000000000061201474051130400174220ustar00rootroot00000000000000/* $Id: track.hpp,v 1.2 2008/03/25 15:59:10 karl Exp $ Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file track.hpp * \brief methods relating to getting Compact Discs. This file * should not be #included directly. */ /*! Return an opaque CdIo_t pointer for the given track object. */ CdIo_t *getCdIo() { return p_cdio; } /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int getChannels() { return cdio_get_track_channels(p_cdio, i_track); } /*! Return copy protection status on a track. Is this meaningful if not an audio track? */ track_flag_t getCopyPermit() { return cdio_get_track_copy_permit(p_cdio, i_track); } /*! Get the format (audio, mode2, mode1) of track. */ track_format_t getFormat() { return cdio_get_track_format(p_cdio, i_track); } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ bool getGreen() { return cdio_get_track_green(p_cdio, i_track); } /*! Return the ending LSN. CDIO_INVALID_LSN is returned on error. */ lsn_t getLastLsn() { return cdio_get_track_last_lsn(p_cdio, i_track); } /*! Get the starting LBA. @return the starting LBA or CDIO_INVALID_LBA on error. */ lba_t getLba() { return cdio_get_track_lba(p_cdio, i_track); } /*! @return the starting LSN or CDIO_INVALID_LSN on error. */ lsn_t getLsn() { return cdio_get_track_lsn(p_cdio, i_track); } /*! Return the starting MSF (minutes/secs/frames) for track number i_track in p_cdio. @return true if things worked or false if there is no track entry. */ bool getMsf(/*out*/ msf_t &msf) { return cdio_get_track_msf(p_cdio, i_track,/*out*/ &msf); } /*! Return the track number of the track object. */ track_t getTrackNum() { return i_track; } /*! Get linear preemphasis status on an audio track This is not meaningful if not an audio track? */ track_flag_t getPreemphasis() { return cdio_get_track_preemphasis(p_cdio, i_track); } /*! Get the number of sectors between this track an the next. This includes any pregap sectors before the start of the next track. @return the number of sectors or 0 if there is an error. */ unsigned int getSecCount() { return cdio_get_track_sec_count(p_cdio, i_track); } libcdio-2.2.0/include/cdio/000077500000000000000000000000001474051130400154605ustar00rootroot00000000000000libcdio-2.2.0/include/cdio/.gitignore000066400000000000000000000000651474051130400174510ustar00rootroot00000000000000/*~ /Makefile /Makefile.in /cdio_config.h /version.h libcdio-2.2.0/include/cdio/Makefile.am000066400000000000000000000034461474051130400175230ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2006, 2008, 2011, 2012 # Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################## # Things to make the install (public) libcdio headers ######################################################## # cdio_config.h: $(top_builddir)/config.h @echo '#ifndef __CDIO_CONFIG_H__' > cdio_config.h @echo '#define __CDIO_CONFIG_H__' >> cdio_config.h @@SED@ @SED_EXTENDED_RE_FLAG@ -e 's/^(#[ \t]*define[ \t]+)/\1CDIO_/' $(top_builddir)/config.h >>cdio_config.h @echo '#endif /* #ifndef CDIO_CONFIG_H */' >>cdio_config.h libcdioincludedir=$(includedir)/cdio dist_libcdioinclude_HEADERS = \ audio.h \ bytesex.h \ bytesex_asm.h \ cdio.h \ cd_types.h \ cdtext.h \ device.h \ disc.h \ ds.h \ dvd.h \ ecma_167.h \ iso9660.h \ logging.h \ memory.h \ mmc.h \ mmc_cmds.h \ mmc_hl_cmds.h \ mmc_ll_cmds.h \ mmc_util.h \ posix.h \ read.h \ rock.h \ sector.h \ track.h \ types.h \ udf.h \ udf_file.h \ udf_time.h \ utf8.h \ util.h \ version.h \ xa.h nodist_libcdioinclude_HEADERS = cdio_config.h EXTRA_DIST = version.h.in BUILT_SOURCES = version.h DISTCLEANFILES = cdio_config.h libcdio-2.2.0/include/cdio/audio.h000066400000000000000000000077611474051130400167450ustar00rootroot00000000000000/* -*- c -*- Copyright (C) 2005, 2007, 2008, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file audio.h * * \brief The top-level header for CD audio-related libcdio * calls. These control playing of the CD-ROM through its * line-out jack. */ #ifndef CDIO_AUDIO_H_ #define CDIO_AUDIO_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! This struct is used by the cdio_audio_read_subchannel */ typedef struct cdio_subchannel_s { uint8_t format; uint8_t audio_status; uint8_t address: 4; uint8_t control: 4; uint8_t track; uint8_t index; msf_t abs_addr; msf_t rel_addr; } cdio_subchannel_t; /*! This struct is used by cdio_audio_get_volume and cdio_audio_set_volume */ typedef struct cdio_audio_volume_s { uint8_t level[4]; } cdio_audio_volume_t; /*! This struct is used by the CDROMPLAYTRKIND ioctl */ typedef struct cdio_track_index_s { uint8_t i_start_track; /**< start track */ uint8_t i_start_index; /**< start index */ uint8_t i_end_track; /**< end track */ uint8_t i_end_index; /**< end index */ } cdio_track_index_t; /*! Get volume of an audio CD. @param p_cdio the CD object to be acted upon. @param p_volume place to put the list of volume outputs levels \p p_volume can be \p NULL in which case we return only whether the driver has the ability to get the volume or not. */ driver_return_code_t cdio_audio_get_volume (CdIo_t *p_cdio, /*out*/ cdio_audio_volume_t *p_volume); /*! Return the number of seconds (discarding frame portion) of an MSF */ uint32_t cdio_audio_get_msf_seconds(msf_t *p_msf); /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_pause (CdIo_t *p_cdio); /*! Playing CD through analog output at the given MSF. @param p_cdio the CD object to be acted upon. @param p_start_msf pointer to staring MSF @param p_end_msf pointer to ending MSF */ driver_return_code_t cdio_audio_play_msf (CdIo_t *p_cdio, /*in*/msf_t *p_start_msf, /*in*/ msf_t *p_end_msf); /*! Playing CD through analog output at the desired track and index @param p_cdio the CD object to be acted upon. @param p_track_index location to start/end. */ driver_return_code_t cdio_audio_play_track_index ( CdIo_t *p_cdio, cdio_track_index_t *p_track_index); /*! Get subchannel information. @param p_cdio the CD object to be acted upon. @param p_subchannel place for returned subchannel information */ driver_return_code_t cdio_audio_read_subchannel (CdIo_t *p_cdio, /*out*/ cdio_subchannel_t *p_subchannel); /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_resume (CdIo_t *p_cdio); /*! Set volume of an audio CD. @param p_cdio the CD object to be acted upon. @param p_volume place for returned volume-level information */ driver_return_code_t cdio_audio_set_volume (CdIo_t *p_cdio, /*out*/ cdio_audio_volume_t *p_volume); /*! Stop playing an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_stop (CdIo_t *p_cdio); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_AUDIO_H_ */ libcdio-2.2.0/include/cdio/bytesex.h000066400000000000000000000164311474051130400173210ustar00rootroot00000000000000/* Copyright (C) 2000, 2004 Herbert Valerio Riedel Copyright (C) 2005, 2008, 2012, 2015 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file bytesex.h * \brief Generic Byte-swapping routines. * * Note: this header will is slated to get removed and libcdio will * use glib.h routines instead. */ #ifndef CDIO_BYTESEX_H_ #define CDIO_BYTESEX_H_ #include #include /* also defines CDIO_INLINE */ #include /** 16-bit big-endian to little-endian */ #define UINT16_SWAP_LE_BE_C(val) ((uint16_t) ( \ (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \ (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8))) /** 32-bit big-endian to little-endian */ #define UINT32_SWAP_LE_BE_C(val) ((uint32_t) ( \ (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \ (((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \ (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \ (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24))) /** 64-bit big-endian to little-endian */ #define UINT64_SWAP_LE_BE_C(val) ((uint64_t) ( \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000000000ff)) << 56) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000000000ff00)) << 40) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000000000ff0000)) << 24) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000ff000000)) << 8) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000ff00000000)) >> 8) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000ff0000000000)) >> 24) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x00ff000000000000)) >> 40) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0xff00000000000000)) >> 56))) #ifndef UINT16_SWAP_LE_BE # define UINT16_SWAP_LE_BE UINT16_SWAP_LE_BE_C #endif #ifndef UINT32_SWAP_LE_BE # define UINT32_SWAP_LE_BE UINT32_SWAP_LE_BE_C #endif #ifndef UINT64_SWAP_LE_BE # define UINT64_SWAP_LE_BE UINT64_SWAP_LE_BE_C #endif static CDIO_INLINE uint16_t uint16_swap_le_be (const uint16_t val) { return UINT16_SWAP_LE_BE (val); } static CDIO_INLINE uint32_t uint32_swap_le_be (const uint32_t val) { return UINT32_SWAP_LE_BE (val); } static CDIO_INLINE uint64_t uint64_swap_le_be (const uint64_t val) { return UINT64_SWAP_LE_BE (val); } # define UINT8_TO_BE(val) ((uint8_t) (val)) # define UINT8_TO_LE(val) ((uint8_t) (val)) #ifdef WORDS_BIGENDIAN # define UINT16_TO_BE(val) ((uint16_t) (val)) # define UINT16_TO_LE(val) ((uint16_t) UINT16_SWAP_LE_BE(val)) # define UINT32_TO_BE(val) ((uint32_t) (val)) # define UINT32_TO_LE(val) ((uint32_t) UINT32_SWAP_LE_BE(val)) # define UINT64_TO_BE(val) ((uint64_t) (val)) # define UINT64_TO_LE(val) ((uint64_t) UINT64_SWAP_LE_BE(val)) #else # define UINT16_TO_BE(val) ((uint16_t) UINT16_SWAP_LE_BE(val)) # define UINT16_TO_LE(val) ((uint16_t) (val)) # define UINT32_TO_BE(val) ((uint32_t) UINT32_SWAP_LE_BE(val)) # define UINT32_TO_LE(val) ((uint32_t) (val)) # define UINT64_TO_BE(val) ((uint64_t) UINT64_SWAP_LE_BE(val)) # define UINT64_TO_LE(val) ((uint64_t) (val)) #endif /** symmetric conversions */ #define UINT8_FROM_BE(val) (UINT8_TO_BE (val)) #define UINT8_FROM_LE(val) (UINT8_TO_LE (val)) #define UINT16_FROM_BE(val) (UINT16_TO_BE (val)) #define UINT16_FROM_LE(val) (UINT16_TO_LE (val)) #define UINT32_FROM_BE(val) (UINT32_TO_BE (val)) #define UINT32_FROM_LE(val) (UINT32_TO_LE (val)) #define UINT64_FROM_BE(val) (UINT64_TO_BE (val)) #define UINT64_FROM_LE(val) (UINT64_TO_LE (val)) /** converter function template */ #define CVT_TO_FUNC(bits) \ static CDIO_INLINE uint ## bits ## _t \ uint ## bits ## _to_be (uint ## bits ## _t val) \ { return UINT ## bits ## _TO_BE (val); } \ static CDIO_INLINE uint ## bits ## _t \ uint ## bits ## _to_le (uint ## bits ## _t val) \ { return UINT ## bits ## _TO_LE (val); } \ CVT_TO_FUNC(8) CVT_TO_FUNC(16) CVT_TO_FUNC(32) CVT_TO_FUNC(64) #undef CVT_TO_FUNC #define uint8_from_be(val) (uint8_to_be (val)) #define uint8_from_le(val) (uint8_to_le (val)) #define uint16_from_be(val) (uint16_to_be (val)) #define uint16_from_le(val) (uint16_to_le (val)) #define uint32_from_be(val) (uint32_to_be (val)) #define uint32_from_le(val) (uint32_to_le (val)) #define uint64_from_be(val) (uint64_to_be (val)) #define uint64_from_le(val) (uint64_to_le (val)) /** ISO9660-related field conversion routines */ /** Convert from uint8_t to ISO 9660 7.1.1 format */ #define to_711(i) uint8_to_le(i) /** Convert from ISO 9660 7.1.1 format to uint8_t */ #define from_711(i) uint8_from_le(i) /** Convert from uint16_t to ISO 9669 7.2.1 format */ #define to_721(i) uint16_to_le(i) /** Convert from ISO 9660 7.2.1 format to uint16_t */ #define from_721(i) uint16_from_le(i) /** Convert from uint16_t to ISO 9669 7.2.2 format */ #define to_722(i) uint16_to_be(i) /** Convert from ISO 9660 7.2.2 format to uint16_t */ #define from_722(i) uint16_from_be(i) /** Convert from uint16_t to ISO 9669 7.2.3 format */ static CDIO_INLINE uint32_t to_723(uint16_t i) { return uint32_swap_le_be(i) | i; } /** Convert from ISO 9660 7.2.3 format to uint16_t */ static CDIO_INLINE uint16_t from_723 (uint32_t p) { uint8_t *u = (uint8_t *) &p; /* Return the little-endian part always, to handle non-specs-compliant images */ return (u[0] | (u[1] << 8)); } static CDIO_INLINE uint16_t from_723_with_err (uint32_t p, bool *err) { if (uint32_swap_le_be (p) != p) { cdio_warn ("from_723: broken byte order"); *err = true; } else { *err = false; } return (0xFFFF & p); } /** Convert from uint16_t to ISO 9669 7.3.1 format */ #define to_731(i) uint32_to_le(i) /** Convert from ISO 9660 7.3.1 format to uint32_t */ #define from_731(i) uint32_from_le(i) /** Convert from uint32_t to ISO 9669 7.3.2 format */ #define to_732(i) uint32_to_be(i) /** Convert from ISO 9660 7.3.2 format to uint32_t */ #define from_732(i) uint32_from_be(i) /** Convert from uint16_t to ISO 9669 7.3.3 format */ static CDIO_INLINE uint64_t to_733(uint32_t i) { return uint64_swap_le_be(i) | i; } /** Convert from ISO 9660 7.3.3 format to uint32_t */ static CDIO_INLINE uint32_t from_733 (uint64_t p) { uint8_t *u = (uint8_t *) &p; /* Return the little-endian part always, to handle non-specs-compliant images */ return (u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24)); } static CDIO_INLINE uint32_t from_733_with_err (uint64_t p, bool *err) { if (uint64_swap_le_be (p) != p) { cdio_warn ("from_733: broken byte order"); *err = true; } else { *err = false; } return (UINT32_C(0xFFFFFFFF) & p); } #endif /* CDIO_BYTESEX_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/bytesex_asm.h000066400000000000000000000064541474051130400201650ustar00rootroot00000000000000/* Copyright (C) 2008, 2012 Rocky Bernstein 2001, 2004, 2005 Herbert Valerio Riedel 2001 Sven Ottemann 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file bytesex_asm.h * \brief Assembly code to handle byte-swapping. Note: this header will is slated to get removed and libcdio will use glib.h routines instead. */ #ifndef CDIO_BYTESEX_ASM_H_ #define CDIO_BYTESEX_ASM_H_ #if !defined(DISABLE_ASM_OPTIMIZE) #include #if !defined CDIO_INLINE #if defined(__cplusplus) || defined(inline) #define CDIO_INLINE inline #elif defined(__GNUC__) #define CDIO_INLINE __inline__ #elif defined(_MSC_VER) #define CDIO_INLINE __inline #else #define CDIO_INLINE #endif #endif /* CDIO_INLINE */ #if defined(__powerpc__) && defined(__GNUC__) static CDIO_INLINE uint32_t uint32_swap_le_be_asm(const uint32_t a) { uint32_t b; __asm__ ("lwbrx %0,0,%1" :"=r"(b) :"r"(&a), "m"(a)); return b; } static CDIO_INLINE uint16_t uint16_swap_le_be_asm(const uint16_t a) { uint32_t b; __asm__ ("lhbrx %0,0,%1" :"=r"(b) :"r"(&a), "m"(a)); return b; } #define UINT16_SWAP_LE_BE uint16_swap_le_be_asm #define UINT32_SWAP_LE_BE uint32_swap_le_be_asm #elif defined(__mc68000__) && defined(__STORMGCC__) static CDIO_INLINE uint32_t uint32_swap_le_be_asm(uint32_t a __asm__("d0")) { /* __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); */ __asm__("move.l %1,d0;rol.w #8,d0;swap d0;rol.w #8,d0;move.l d0,%0" :"=r"(a) :"r"(a)); return(a); } static CDIO_INLINE uint16_t uint16_swap_le_be_asm(uint16_t a __asm__("d0")) { __asm__("move.l %1,d0;rol.w #8,d0;move.l d0,%0" :"=r"(a) :"r"(a)); return(a); } #define UINT16_SWAP_LE_BE uint16_swap_le_be_asm #define UINT32_SWAP_LE_BE uint32_swap_le_be_asm #elif 0 && defined(__i386__) && defined(__GNUC__) static CDIO_INLINE uint32_t uint32_swap_le_be_asm(uint32_t a) { __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ "rorl $16,%0\n\t" /* swap words */ "xchgb %b0,%h0" /* swap higher bytes */ :"=q" (a) : "0" (a)); return(a); } static CDIO_INLINE uint16_t uint16_swap_le_be_asm(uint16_t a) { __asm__("xchgb %b0,%h0" /* swap bytes */ : "=q" (a) : "0" (a)); return(a); } #define UINT16_SWAP_LE_BE uint16_swap_le_be_asm #define UINT32_SWAP_LE_BE uint32_swap_le_be_asm #endif #endif /* !defined(DISABLE_ASM_OPTIMIZE) */ #endif /* CDIO_BYTESEX_ASM_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/cd_types.h000066400000000000000000000150671474051130400174540ustar00rootroot00000000000000/* Copyright (C) 2003, 2006, 2008, 2012 Rocky Bernstein Copyright (C) 1996,1997,1998 Gerd Knorr and Heiko Eifeldt 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file cd_types.h * \brief Header for routines which automatically determine the Compact Disc * format and possibly filesystem on the CD. * */ #ifndef CDIO_CD_TYPES_H_ #define CDIO_CD_TYPES_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Filesystem types we understand. The highest-numbered fs type should * be less than CDIO_FS_MASK defined below. */ typedef enum { CDIO_FS_AUDIO = 1, /**< audio only - not really a filesystem */ CDIO_FS_HIGH_SIERRA = 2, /**< High-Sierra Filesystem */ CDIO_FS_ISO_9660 = 3, /**< ISO 9660 filesystem */ CDIO_FS_INTERACTIVE = 4, CDIO_FS_HFS = 5, /**< file system used on the Macintosh system in MacOS 6 through MacOS 9 and deprecated in OSX. */ CDIO_FS_UFS = 6, /**< Generic Unix file system derived from the Berkeley fast file system. */ /**< * EXT2 was the GNU/Linux native filesystem for early kernels. Newer * GNU/Linux OS's may use EXT3 which is EXT2 with a journal. */ CDIO_FS_EXT2 = 7, CDIO_FS_ISO_HFS = 8, /**< both HFS & ISO-9660 filesystem */ CDIO_FS_ISO_9660_INTERACTIVE = 9, /**< both CD-RTOS and ISO filesystem */ /**< * The 3DO is, technically, a set of specifications created by the 3DO * company. These specs are for making a 3DO Interactive Multiplayer * which uses a CD-player. Panasonic in the early 90's was the first * company to manufacture and market a 3DO player. */ CDIO_FS_3DO = 10, /**< Microsoft X-BOX CD. */ CDIO_FS_XISO = 11, CDIO_FS_UDFX = 12, CDIO_FS_UDF = 13, CDIO_FS_ISO_UDF = 14 } cdio_fs_t; /** * Macro to extract just the FS type portion defined above */ #define CDIO_FSTYPE(fs) (fs & CDIO_FS_MASK) /** * Bit masks for the classes of CD-images. These are generally * higher-level than the fs-type information above and may be determined * based of the fs type information. This */ typedef enum { CDIO_FS_MASK = 0x000f, /**< Note: this should be 2**n-1 and and greater than the highest CDIO_FS number above */ CDIO_FS_ANAL_XA = 0x00010, /**< eXtended Architecture format */ CDIO_FS_ANAL_MULTISESSION = 0x00020, /**< CD has multisesion */ CDIO_FS_ANAL_PHOTO_CD = 0x00040, /**< Is a Kodak Photo CD */ CDIO_FS_ANAL_HIDDEN_TRACK = 0x00080, /**< Hidden track at the beginning of the CD */ CDIO_FS_ANAL_CDTV = 0x00100, CDIO_FS_ANAL_BOOTABLE = 0x00200, /**< CD is bootable */ CDIO_FS_ANAL_VIDEOCD = 0x00400, /**< VCD 1.1 */ CDIO_FS_ANAL_ROCKRIDGE = 0x00800, /**< Has Rock Ridge Extensions to ISO 9660, */ CDIO_FS_ANAL_JOLIET = 0x01000, /**< Microsoft Joliet extensions to ISO 9660, */ CDIO_FS_ANAL_SVCD = 0x02000, /**< Super VCD or Choiji Video CD */ CDIO_FS_ANAL_CVD = 0x04000, /**< Choiji Video CD */ CDIO_FS_ANAL_XISO = 0x08000, /**< XBOX CD */ CDIO_FS_ANAL_ISO9660_ANY = 0x10000, /**< Any sort fo ISO9660 FS */ CDIO_FS_ANAL_VCD_ANY = (CDIO_FS_ANAL_VIDEOCD|CDIO_FS_ANAL_SVCD| CDIO_FS_ANAL_CVD), CDIO_FS_MATCH_ALL = ~CDIO_FS_MASK /**< bitmask which can be used by cdio_get_devices to specify matching any sort of CD. */ } cdio_fs_cap_t; #define CDIO_FS_UNKNOWN CDIO_FS_MASK /** * */ #define CDIO_FS_MATCH_ALL (cdio_fs_anal_t) (~CDIO_FS_MASK) /*! \brief The type used to return analysis information from cdio_guess_cd_type. These fields make sense only for when an ISO-9660 filesystem is used. */ typedef struct { unsigned int joliet_level; /**< If has Joliet extensions, this is the associated level number (i.e. 1, 2, or 3). */ char iso_label[33]; /**< This is 32 + 1 for null byte at the end in formatting the string */ unsigned int isofs_size; uint8_t UDFVerMinor; /**< For UDF filesystems only */ uint8_t UDFVerMajor; /**< For UDF filesystems only */ } cdio_iso_analysis_t; /** * Try to determine what kind of CD-image and/or filesystem we * have at track track_num. Return information about the CD image * is returned in iso_analysis and the return value. */ cdio_fs_anal_t cdio_guess_cd_type(const CdIo_t *cdio, int start_session, track_t track_num, /*out*/ cdio_iso_analysis_t *iso_analysis); #ifdef __cplusplus } #endif /* __cplusplus */ /** The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ extern cdio_fs_cap_t debug_cdio_fs_cap; extern cdio_fs_t debug_cdio_fs; #endif /* CDIO_CD_TYPES_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/cdio.h000066400000000000000000000037371474051130400165610ustar00rootroot00000000000000/* -*- c -*- Copyright (C) 2003, 2004, 2005, 2008, 2009, 2014 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file cdio.h * * \brief The top-level header for libcdio: the CD Input and Control * library. Applications include this for anything regarding libcdio. */ #ifndef __CDIO_H__ #define __CDIO_H__ /** Application Interface or Protocol version number. If the public * interface changes, we increase this number. */ #define CDIO_API_VERSION 6 #include #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* For compatibility. */ #define CdIo CdIo_t /** This is an opaque structure for the CD object. */ typedef struct _CdIo CdIo_t; #ifdef __cplusplus } #endif /* __cplusplus */ /* Drive(r)/Device-related functions. Perhaps we should break out Driver from device? */ #include /* CD-Text-related functions. */ #include /* Disc-related functions. */ #include /* Sector (frame, or block)-related functions. Uses driver_return_code_t from so it should come after that. */ #include /* Track-related functions. */ #include /* Memory management functions. */ #include #endif /* __CDIO_H__ */ libcdio-2.2.0/include/cdio/cdtext.h000066400000000000000000000345571474051130400171420ustar00rootroot00000000000000/* Copyright (C) 2018 Thomas Schmitt Copyright (C) 2004, 2005, 2008, 2012, 2019 Rocky Bernstein adapted from cuetools Copyright (C) 2003 Svend Sanjay Sorensen 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file cdtext.h * * \brief The top-level header for CD-Text information. Applications * include this for CD-Text access. */ #ifndef CDIO_CDTEXT_H_ #define CDIO_CDTEXT_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define MIN_CDTEXT_FIELD 0 #define MAX_CDTEXT_FIELDS 10 /*! \typedef enum cdtext_field_t \brief Enumeration of CD-TEXT text fields. */ typedef enum { CDTEXT_FIELD_TITLE = 0, /**< title of album name or track titles */ CDTEXT_FIELD_PERFORMER = 1, /**< name(s) of the performer(s) */ CDTEXT_FIELD_SONGWRITER = 2, /**< name(s) of the songwriter(s) */ CDTEXT_FIELD_COMPOSER = 3, /**< name(s) of the composer(s) */ CDTEXT_FIELD_MESSAGE = 4, /**< message(s) from content provider or artist, ISO-8859-1 encoded*/ CDTEXT_FIELD_ARRANGER = 5, /**< name(s) of the arranger(s) */ CDTEXT_FIELD_ISRC = 6, /**< ISRC code of each track */ CDTEXT_FIELD_UPC_EAN = 7, /**< upc/european article number of disc, ISO-8859-1 encoded */ CDTEXT_FIELD_GENRE = 8, /**< genre identification and genre information, ASCII encoded */ CDTEXT_FIELD_DISCID = 9, /**< disc identification, ASCII encoded (may be non-printable) */ CDTEXT_FIELD_INVALID = MAX_CDTEXT_FIELDS /**< INVALID FIELD*/ } cdtext_field_t; /*! \typedef enum cdtext_genre_t \brief Enumeration of possible genre codes. */ typedef enum { CDTEXT_GENRE_UNUSED = 0, /**< field is not used. default */ CDTEXT_GENRE_UNDEFINED = 1, /**< not defined */ CDTEXT_GENRE_ADULT_CONTEMP = 2, /**< Adult Contemporary */ CDTEXT_GENRE_ALT_ROCK = 3, /**< Alternative Rock */ CDTEXT_GENRE_CHILDRENS = 4, /**< Childrens Music */ CDTEXT_GENRE_CLASSIC = 5, /**< Classical */ CDTEXT_GENRE_CHRIST_CONTEMP = 6, /**< Contemporary Christian */ CDTEXT_GENRE_COUNTRY = 7, /**< Country */ CDTEXT_GENRE_DANCE = 8, /**< Dance */ CDTEXT_GENRE_EASY_LISTENING = 9, /**< Easy Listening */ CDTEXT_GENRE_EROTIC = 10, /**< Erotic */ CDTEXT_GENRE_FOLK = 11, /**< Folk */ CDTEXT_GENRE_GOSPEL = 12, /**< Gospel */ CDTEXT_GENRE_HIPHOP = 13, /**< Hip Hop */ CDTEXT_GENRE_JAZZ = 14, /**< Jazz */ CDTEXT_GENRE_LATIN = 15, /**< Latin */ CDTEXT_GENRE_MUSICAL = 16, /**< Musical */ CDTEXT_GENRE_NEWAGE = 17, /**< New Age */ CDTEXT_GENRE_OPERA = 18, /**< Opera */ CDTEXT_GENRE_OPERETTA = 19, /**< Operetta */ CDTEXT_GENRE_POP = 20, /**< Pop Music */ CDTEXT_GENRE_RAP = 21, /**< RAP */ CDTEXT_GENRE_REGGAE = 22, /**< Reggae */ CDTEXT_GENRE_ROCK = 23, /**< Rock Music */ CDTEXT_GENRE_RYTHMANDBLUES = 24, /**< Rhythm & Blues */ CDTEXT_GENRE_SOUNDEFFECTS = 25, /**< Sound Effects */ CDTEXT_GENRE_SOUNDTRACK = 26, /**< Soundtrack */ CDTEXT_GENRE_SPOKEN_WORD = 27, /**< Spoken Word */ CDTEXT_GENRE_WORLD_MUSIC = 28 /**< World Music */ } cdtext_genre_t; /*! \typedef typedef enum cdtext_lang_t \brief Enumeration of possible CD-TEXT languages. The language code is encoded as specified in ANNEX 1 to part 5 of EBU Tech 32 58 -E (1991). */ typedef enum { CDTEXT_LANGUAGE_UNKNOWN = 0x00, CDTEXT_LANGUAGE_ALBANIAN = 0x01, CDTEXT_LANGUAGE_BRETON = 0x02, CDTEXT_LANGUAGE_CATALAN = 0x03, CDTEXT_LANGUAGE_CROATIAN = 0x04, CDTEXT_LANGUAGE_WELSH = 0x05, CDTEXT_LANGUAGE_CZECH = 0x06, CDTEXT_LANGUAGE_DANISH = 0x07, CDTEXT_LANGUAGE_GERMAN = 0x08, CDTEXT_LANGUAGE_ENGLISH = 0x09, CDTEXT_LANGUAGE_SPANISH = 0x0A, CDTEXT_LANGUAGE_ESPERANTO = 0x0B, CDTEXT_LANGUAGE_ESTONIAN = 0x0C, CDTEXT_LANGUAGE_BASQUE = 0x0D, CDTEXT_LANGUAGE_FAROESE = 0x0E, CDTEXT_LANGUAGE_FRENCH = 0x0F, CDTEXT_LANGUAGE_FRISIAN = 0x10, CDTEXT_LANGUAGE_IRISH = 0x11, CDTEXT_LANGUAGE_GAELIC = 0x12, CDTEXT_LANGUAGE_GALICIAN = 0x13, CDTEXT_LANGUAGE_ICELANDIC = 0x14, CDTEXT_LANGUAGE_ITALIAN = 0x15, CDTEXT_LANGUAGE_LAPPISH = 0x16, CDTEXT_LANGUAGE_LATIN = 0x17, CDTEXT_LANGUAGE_LATVIAN = 0x18, CDTEXT_LANGUAGE_LUXEMBOURGIAN = 0x19, CDTEXT_LANGUAGE_LITHUANIAN = 0x1A, CDTEXT_LANGUAGE_HUNGARIAN = 0x1B, CDTEXT_LANGUAGE_MALTESE = 0x1C, CDTEXT_LANGUAGE_DUTCH = 0x1D, CDTEXT_LANGUAGE_NORWEGIAN = 0x1E, CDTEXT_LANGUAGE_OCCITAN = 0x1F, CDTEXT_LANGUAGE_POLISH = 0x20, CDTEXT_LANGUAGE_PORTUGUESE = 0x21, CDTEXT_LANGUAGE_ROMANIAN = 0x22, CDTEXT_LANGUAGE_ROMANSH = 0x23, CDTEXT_LANGUAGE_SERBIAN = 0x24, CDTEXT_LANGUAGE_SLOVAK = 0x25, CDTEXT_LANGUAGE_SLOVENIAN = 0x26, CDTEXT_LANGUAGE_FINNISH = 0x27, CDTEXT_LANGUAGE_SWEDISH = 0x28, CDTEXT_LANGUAGE_TURKISH = 0x29, CDTEXT_LANGUAGE_FLEMISH = 0x2A, CDTEXT_LANGUAGE_WALLON = 0x2B, CDTEXT_LANGUAGE_ZULU = 0x45, CDTEXT_LANGUAGE_VIETNAMESE = 0x46, CDTEXT_LANGUAGE_UZBEK = 0x47, CDTEXT_LANGUAGE_URDU = 0x48, CDTEXT_LANGUAGE_UKRAINIAN = 0x49, CDTEXT_LANGUAGE_THAI = 0x4A, CDTEXT_LANGUAGE_TELUGU = 0x4B, CDTEXT_LANGUAGE_TATAR = 0x4C, CDTEXT_LANGUAGE_TAMIL = 0x4D, CDTEXT_LANGUAGE_TADZHIK = 0x4E, CDTEXT_LANGUAGE_SWAHILI = 0x4F, CDTEXT_LANGUAGE_SRANANTONGO = 0x50, CDTEXT_LANGUAGE_SOMALI = 0x51, CDTEXT_LANGUAGE_SINHALESE = 0x52, CDTEXT_LANGUAGE_SHONA = 0x53, CDTEXT_LANGUAGE_SERBO_CROAT = 0x54, CDTEXT_LANGUAGE_RUTHENIAN = 0x55, CDTEXT_LANGUAGE_RUSSIAN = 0x56, CDTEXT_LANGUAGE_QUECHUA = 0x57, CDTEXT_LANGUAGE_PUSHTU = 0x58, CDTEXT_LANGUAGE_PUNJABI = 0x59, CDTEXT_LANGUAGE_PERSIAN = 0x5A, CDTEXT_LANGUAGE_PAPAMIENTO = 0x5B, CDTEXT_LANGUAGE_ORIYA = 0x5C, CDTEXT_LANGUAGE_NEPALI = 0x5D, CDTEXT_LANGUAGE_NDEBELE = 0x5E, CDTEXT_LANGUAGE_MARATHI = 0x5F, CDTEXT_LANGUAGE_MOLDAVIAN = 0x60, CDTEXT_LANGUAGE_MALAYSIAN = 0x61, CDTEXT_LANGUAGE_MALAGASAY = 0x62, CDTEXT_LANGUAGE_MACEDONIAN = 0x63, CDTEXT_LANGUAGE_LAOTIAN = 0x64, CDTEXT_LANGUAGE_KOREAN = 0x65, CDTEXT_LANGUAGE_KHMER = 0x66, CDTEXT_LANGUAGE_KAZAKH = 0x67, CDTEXT_LANGUAGE_KANNADA = 0x68, CDTEXT_LANGUAGE_JAPANESE = 0x69, CDTEXT_LANGUAGE_INDONESIAN = 0x6A, CDTEXT_LANGUAGE_HINDI = 0x6B, CDTEXT_LANGUAGE_HEBREW = 0x6C, CDTEXT_LANGUAGE_HAUSA = 0x6D, CDTEXT_LANGUAGE_GURANI = 0x6E, CDTEXT_LANGUAGE_GUJURATI = 0x6F, CDTEXT_LANGUAGE_GREEK = 0x70, CDTEXT_LANGUAGE_GEORGIAN = 0x71, CDTEXT_LANGUAGE_FULANI = 0x72, CDTEXT_LANGUAGE_DARI = 0x73, CDTEXT_LANGUAGE_CHURASH = 0x74, CDTEXT_LANGUAGE_CHINESE = 0x75, CDTEXT_LANGUAGE_BURMESE = 0x76, CDTEXT_LANGUAGE_BULGARIAN = 0x77, CDTEXT_LANGUAGE_BENGALI = 0x78, CDTEXT_LANGUAGE_BIELORUSSIAN = 0x79, CDTEXT_LANGUAGE_BAMBORA = 0x7A, CDTEXT_LANGUAGE_AZERBAIJANI = 0x7B, CDTEXT_LANGUAGE_ASSAMESE = 0x7C, CDTEXT_LANGUAGE_ARMENIAN = 0x7D, CDTEXT_LANGUAGE_ARABIC = 0x7E, CDTEXT_LANGUAGE_AMHARIC = 0x7F, /* libcdio-internal pseudo codes: */ CDTEXT_LANGUAGE_INVALID = 0x100, /**< Invalid language code */ CDTEXT_LANGUAGE_BLOCK_UNUSED = 0x101 /**< Language code should be ignored */ } cdtext_lang_t; /*! \typedef struct cdtext_s cdtext_t \brief Opaque type for CD-Text. */ typedef struct cdtext_s cdtext_t; /*! Return string representation of the given genre code. */ const char *cdtext_genre2str (cdtext_genre_t i); /*! Return string representation of the given language code. */ const char *cdtext_lang2str (cdtext_lang_t i); /*! Return the language code of a given language string representation. This is the inverse of cdtext_lang2str(). @param lang language to look up @return if lang is among the possible results of cdtext_lang2str(): the \p cdtext_lang_t which is associated, or \p CDTEXT_LANGUAGE_INVALID otherwise. */ cdtext_lang_t cdtext_str2lang (const char *lang); /*! Return string representation of given field type. */ const char *cdtext_field2str (cdtext_field_t i); /*! Initialize a new \p cdtext_t structure. When the structure is no longer needed, release the resources using cdtext_delete. */ cdtext_t *cdtext_init (void); /*! Fill a cdtext_t object with text pack bytes as they were handed out by the CD drive, but without the 4-byte header which the drive prepended. The text pack data can be obtained by the calls - cdio_get_cdtext_raw() - mmc_read_cdtext() - mmc_read_toc_cdtext() Each sets in the buffer passed into values that begin with a 4-byte header. This should be skipped. Here is some sample code: @code #include if (DRIVER_OP_SUCCESS == mmc_read_toc_cdtext (p_cdio, &i_length, p_buf, 0) && 4 < i_length) cdtext_data_init(p_cdtext, p_buf + 4, (size_t) i_length - 4); @endcode Instead of calling cdtext_data_init(), you can call cdio_get_cdtext() which returns a pointer to the \p cdtext_t object that is attached to the inquired \p CdIo_t object. This \p cdtext_t object gets created and filled if none is yet attached to the inquired \p CdIo_t object. @param p_cdtext the CD-TEXT object @param wdata the data @param i_data size of wdata @returns 0 on success, non-zero on failure */ int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data); /*! Free memory associated with the given \p cdtext_t object. @param p_cdtext the CD-TEXT object */ void cdtext_destroy (cdtext_t *p_cdtext); /*! Returns a copy of the return value of cdtext_get_const or NULL. Must be freed using cdio_free() when done. @see cdtext_get_const */ char *cdtext_get (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track); /*! Returns value of the given field. NULL is returned if key is CDTEXT_INVALID or the field is not set. Strings are encoded in UTF-8. @param p_cdtext the CD-TEXT object @param field type of the field to return @param track specifies the track, 0 stands for disc */ const char *cdtext_get_const (const cdtext_t *p_cdtext, cdtext_field_t field, track_t track); /*! Returns the discs genre code. @param p_cdtext the CD-TEXT object */ cdtext_genre_t cdtext_get_genre (const cdtext_t *p_cdtext); /*! Returns the currently active language. @param p_cdtext the CD-TEXT object */ cdtext_lang_t cdtext_get_language (const cdtext_t *p_cdtext); /*! Returns the first track number. @param p_cdtext the CD-TEXT object */ track_t cdtext_get_first_track(const cdtext_t *p_cdtext); /*! Returns the last track number. @param p_cdtext the CD-TEXT object */ track_t cdtext_get_last_track(const cdtext_t *p_cdtext); /*! Try to select the given language. @param p_cdtext the CD-TEXT object @param language string representation of the language @return true on success, false if language is not available */ bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language); /*! @deprecated Use cdtext_list_languages_v2() Returns a list of available languages or NULL. __WARNING__: The indices in the returned array _do not_ match the indexing as expected by cdtext_set_language_index(). Use cdtext_select_language() with the values of array elements. Internally the list is stored in a static array. @param p_cdtext the CD-TEXT object @return NULL if p_cdtext is NULL, or an array of 8 cdtext_lang_t elements: CDTEXT_LANGUAGE_UNKNOWN not only marks language code 0x00 but also invalid language codes and invalid language blocks. */ cdtext_lang_t *cdtext_list_languages (const cdtext_t *p_cdtext); /*! Returns an array of available languages or NULL. The index of an array element may be used to select the corresponding language block by call cdtext_set_language_index(). The return value is a pointer into the memory range of *p_cdtext. Do not use it after having freed that memory range. @param p_cdtext the CD-TEXT object @return NULL if p_cdtext is NULL, or an array of 8 cdtext_lang_t elements. If an enumeration is CDTEXT_LANGUAGE_INVALID, then the language block has an invalid language code. If an enumeration is CDTEXT_LANGUAGE_BLOCK_UNUSED, then the block does not exist on CD or could not be read in CD-TEXT for some reason. Otherwise, the enumeration of element will be a value in CDTEXT_LANGUAGE_UNKNOWN to CDTEXT_LANGUAGE_AMHARIC, and is a block in that language. */ cdtext_lang_t *cdtext_list_languages_v2(cdtext_t *p_cdtext); /*! Select the given language by block index. See cdtext_list_languages_v2(). If the index is bad, or no language block with that index was read: select the default language at index 0 and return false. @param p_cdtext the CD-TEXT object @param idx the desired index: 0 to 7. @return true on success, false if no language block is associated to \p idx. */ bool cdtext_set_language_index(cdtext_t *p_cdtext, int idx); /*! Sets the given field at the given track to the given value. Recodes to UTF-8 if charset is not \p NULL. @param p_cdtext the CD-TEXT object @param key field to set @param value value to set @param track track to work on @param charset charset to convert from */ void cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_CDTEXT_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/device.h000066400000000000000000001063771474051130400171060ustar00rootroot00000000000000/* -*- c -*- Copyright (C) 2005-2006, 2008-2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** * \file device.h * * \brief C header for driver- or device-related libcdio * calls. ("device" includes CD-image reading devices). */ #ifndef CDIO_DEVICE_H_ #define CDIO_DEVICE_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include #include /** The type of an drive capability bit mask. See below for values*/ typedef uint32_t cdio_drive_read_cap_t; typedef uint32_t cdio_drive_write_cap_t; typedef uint32_t cdio_drive_misc_cap_t; /** \brief Drive capability bits returned by cdio_get_drive_cap() NOTE: Setting a bit here means the presence of a capability. */ /** Miscellaneous capabilities. */ typedef enum { CDIO_DRIVE_CAP_ERROR = 0x40000, /**< Error */ CDIO_DRIVE_CAP_UNKNOWN = 0x80000, /**< Dunno. It can be on if we have only partial information or are not completely certain */ CDIO_DRIVE_CAP_MISC_CLOSE_TRAY = 0x00001, /**< caddy systems can't close... */ CDIO_DRIVE_CAP_MISC_EJECT = 0x00002, /**< but can eject. */ CDIO_DRIVE_CAP_MISC_LOCK = 0x00004, /**< disable manual eject */ CDIO_DRIVE_CAP_MISC_SELECT_SPEED = 0x00008, /**< programmable speed */ CDIO_DRIVE_CAP_MISC_SELECT_DISC = 0x00010, /**< select disc from juke-box */ CDIO_DRIVE_CAP_MISC_MULTI_SESSION= 0x00020, /**< read sessions>1 */ CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED= 0x00080, /**< media changed */ CDIO_DRIVE_CAP_MISC_RESET = 0x00100, /**< hard reset device */ CDIO_DRIVE_CAP_MISC_FILE = 0x20000 /**< drive is really a file, i.e a CD file image */ } cdio_drive_cap_misc_t; /** Reading masks.. */ typedef enum { CDIO_DRIVE_CAP_READ_AUDIO = 0x00001, /**< drive can play CD audio */ CDIO_DRIVE_CAP_READ_CD_DA = 0x00002, /**< drive can read CD-DA */ CDIO_DRIVE_CAP_READ_CD_G = 0x00004, /**< drive can read CD+G */ CDIO_DRIVE_CAP_READ_CD_R = 0x00008, /**< drive can read CD-R */ CDIO_DRIVE_CAP_READ_CD_RW = 0x00010, /**< drive can read CD-RW */ CDIO_DRIVE_CAP_READ_DVD_R = 0x00020, /**< drive can read DVD-R */ CDIO_DRIVE_CAP_READ_DVD_PR = 0x00040, /**< drive can read DVD+R */ CDIO_DRIVE_CAP_READ_DVD_RAM = 0x00080, /**< drive can read DVD-RAM */ CDIO_DRIVE_CAP_READ_DVD_ROM = 0x00100, /**< drive can read DVD-ROM */ CDIO_DRIVE_CAP_READ_DVD_RW = 0x00200, /**< drive can read DVD-RW */ CDIO_DRIVE_CAP_READ_DVD_RPW = 0x00400, /**< drive can read DVD+RW */ CDIO_DRIVE_CAP_READ_C2_ERRS = 0x00800, /**< has C2 error correction */ CDIO_DRIVE_CAP_READ_MODE2_FORM1 = 0x01000, /**< can read mode 2 form 1 */ CDIO_DRIVE_CAP_READ_MODE2_FORM2 = 0x02000, /**< can read mode 2 form 2 */ CDIO_DRIVE_CAP_READ_MCN = 0x04000, /**< can read MCN */ CDIO_DRIVE_CAP_READ_ISRC = 0x08000 /**< can read ISRC */ } cdio_drive_cap_read_t; /** Writing masks.. */ typedef enum { CDIO_DRIVE_CAP_WRITE_CD_R = 0x00001, /**< drive can write CD-R */ CDIO_DRIVE_CAP_WRITE_CD_RW = 0x00002, /**< drive can write CD-RW */ CDIO_DRIVE_CAP_WRITE_DVD_R = 0x00004, /**< drive can write DVD-R */ CDIO_DRIVE_CAP_WRITE_DVD_PR = 0x00008, /**< drive can write DVD+R */ CDIO_DRIVE_CAP_WRITE_DVD_RAM = 0x00010, /**< drive can write DVD-RAM */ CDIO_DRIVE_CAP_WRITE_DVD_RW = 0x00020, /**< drive can write DVD-RW */ CDIO_DRIVE_CAP_WRITE_DVD_RPW = 0x00040, /**< drive can write DVD+RW */ CDIO_DRIVE_CAP_WRITE_MT_RAINIER = 0x00080, /**< Mount Rainier */ CDIO_DRIVE_CAP_WRITE_BURN_PROOF = 0x00100, /**< burn proof */ CDIO_DRIVE_CAP_WRITE_CD = (CDIO_DRIVE_CAP_WRITE_CD_R | CDIO_DRIVE_CAP_WRITE_CD_RW), /**< Has some sort of CD writer ability */ CDIO_DRIVE_CAP_WRITE_DVD = (CDIO_DRIVE_CAP_WRITE_DVD_R | CDIO_DRIVE_CAP_WRITE_DVD_PR | CDIO_DRIVE_CAP_WRITE_DVD_RAM | CDIO_DRIVE_CAP_WRITE_DVD_RW | CDIO_DRIVE_CAP_WRITE_DVD_RPW ), /**< Has some sort of DVD writer ability */ CDIO_DRIVE_CAP_WRITE = (CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD) /**< Has some sort of DVD or CD writing ability */ } cdio_drive_cap_write_t; /** Size of fields returned by an \p INQUIRY command */ typedef enum { CDIO_MMC_HW_VENDOR_LEN = 8, /**< length of vendor field */ CDIO_MMC_HW_MODEL_LEN = 16, /**< length of model field */ CDIO_MMC_HW_REVISION_LEN = 4 /**< length of revision field */ } cdio_mmc_hw_len_t; /** \brief Structure to return CD vendor, model, and revision-level strings obtained via the \p INQUIRY command */ typedef struct cdio_hwinfo { char psz_vendor [CDIO_MMC_HW_VENDOR_LEN+1]; char psz_model [CDIO_MMC_HW_MODEL_LEN+1]; char psz_revision[CDIO_MMC_HW_REVISION_LEN+1]; } cdio_hwinfo_t; /** Flags specifying the category of device to open or is opened. */ typedef enum { CDIO_SRC_IS_DISK_IMAGE_MASK = 0x0001, /**< Read source is a CD image. */ CDIO_SRC_IS_DEVICE_MASK = 0x0002, /**< Read source is a CD device. */ CDIO_SRC_IS_SCSI_MASK = 0x0004, /**< Read source SCSI device. */ CDIO_SRC_IS_NATIVE_MASK = 0x0008 } cdio_src_category_mask_t; /** * The driver_id_t enumerations may be used to tag a specific driver * that is opened or is desired to be opened. Note that this is * different than what is available on a given host. * * Order should not be changed lightly because it breaks the ABI. * One is not supposed to iterate over the values, but iterate over the * cdio_drivers and cdio_device_drivers arrays. * * NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES. * */ typedef enum { DRIVER_UNKNOWN, /**< Used as input when we don't care what kind of driver to use. */ DRIVER_AIX, /**< AIX driver */ DRIVER_FREEBSD, /**< FreeBSD driver - includes CAM and ioctl access */ DRIVER_NETBSD, /**< NetBSD Driver. */ DRIVER_LINUX, /**< GNU/Linux Driver */ DRIVER_SOLARIS, /**< Sun Solaris Driver */ DRIVER_OSX, /**< Apple OSX (or MacOS) Driver */ DRIVER_WIN32, /**< Microsoft Windows Driver. Includes ASPI and ioctl access. */ DRIVER_CDRDAO, /**< cdrdao format CD image. This is listed before BIN/CUE, to make the code prefer cdrdao over BIN/CUE when both exist. */ DRIVER_BINCUE, /**< CDRWIN BIN/CUE format CD image. This is listed before NRG, to make the code prefer BIN/CUE over NRG when both exist. */ DRIVER_NRG, /**< Nero NRG format CD image. */ DRIVER_DEVICE /**< Is really a set of the above; should come last */ } driver_id_t; /** A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in order of preference) array of drivers. */ extern const driver_id_t cdio_drivers[]; /** A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in order of preference) array of device drivers. */ extern const driver_id_t cdio_device_drivers[]; /** There will generally be only one hardware for a given build/platform from the list above. You can use the variable below to determine which you've got. If the build doesn't make an hardware driver, then the value will be DRIVER_UNKNOWN. */ extern const driver_id_t cdio_os_driver; /** The following are status codes for completion of a given cdio operation. By design 0 is successful completion and -1 is error completion. This is compatable with ioctl so those routines that call ioctl can just pass the value the get back (cast as this enum). Also, by using negative numbers for errors, the enumeration values below can be used in places where a positive value is expected when things complete successfully. For example, get_blocksize returns the blocksize, but on error uses the error codes below. So note that this enumeration is often cast to an integer. C seems to tolerate this. */ typedef enum { DRIVER_OP_SUCCESS = 0, /**< in cases where an int is returned, like cdio_set_speed, more the negative return codes are for errors and the positive ones for success. */ DRIVER_OP_ERROR = -1, /**< operation returned an error */ DRIVER_OP_UNSUPPORTED = -2, /**< returned when a particular driver doesn't support a particular operation. For example an image driver which doesn't really "eject" a CD. */ DRIVER_OP_UNINIT = -3, /**< returned when a particular driver hasn't been initialized or a null pointer has been passed. */ DRIVER_OP_NOT_PERMITTED = -4, /**< Operation not permitted. For example might be a permission problem. */ DRIVER_OP_BAD_PARAMETER = -5, /**< Bad parameter passed */ DRIVER_OP_BAD_POINTER = -6, /**< Bad pointer to memory area */ DRIVER_OP_NO_DRIVER = -7, /**< Operation called on a driver not available on this OS */ DRIVER_OP_MMC_SENSE_DATA = -8, /**< MMC operation returned sense data, but no other error above recorded. */ } driver_return_code_t; /** Close media tray in CD drive if there is a routine to do so. @param psz_drive the name of CD-ROM to be closed. If NULL, we will use the default device. @param p_driver_id is the driver to be used or that got used if it was \p DRIVER_UNKNOWN or \p DRIVER_DEVICE; If this is \p NULL, we won't report back the driver used. */ driver_return_code_t cdio_close_tray (const char *psz_drive, /*in/out*/ driver_id_t *p_driver_id); /** @param drc the return code you want interpreted. @return the string information about \p drc */ const char *cdio_driver_errmsg(driver_return_code_t drc); /** Eject media in CD drive if there is a routine to do so. @param p_cdio the CD object to be acted upon. If the CD is ejected \p *p_cdio is free'd and p_cdio set to \p NULL. */ driver_return_code_t cdio_eject_media (CdIo_t **p_cdio); /** Eject media in CD drive if there is a routine to do so. @param psz_drive the name of the device to be acted upon. If NULL is given as the drive, we'll use the default driver device. */ driver_return_code_t cdio_eject_media_drive (const char *psz_drive); /** Free device list returned by cdio_get_devices or cdio_get_devices_with_cap(). @param device_list list returned by cdio_get_devices or cdio_get_devices_with_cap(). @see cdio_get_devices(), and cdio_get_devices_with_cap(). */ void cdio_free_device_list (char * device_list[]); /** Get the default CD device. if \p p_cdio is \p NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that. @param p_cdio the CD object queried @return a string containing the default CD device or \p NULL if we couldn't get a default device. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ char * cdio_get_default_device (const CdIo_t *p_cdio); /** Return a string containing the default CD device if none is specified. if \p p_driver_id is \p DRIVER_UNKNOWN or \p DRIVER_DEVICE then find a suitable one set the default device for that. \p NULL is returned if we couldn't get a default device. */ char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id); /** Return an array of device names. If you want a specific devices for a driver, give that device. If you want hardware devices, give \p DRIVER_DEVICE and if you want all possible devices, image drivers and hardware drivers give \p DRIVER_UNKNOWN. NULL is returned if we couldn't return a list of devices. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return \p NULL even though there may be a hardware CD-ROM. */ char ** cdio_get_devices (driver_id_t driver_id); /** Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If search_devices is \p NULL, then we'll search all possible CD drives. Capabilities have two parts to them, a "filesystem" part and an "analysis" part. The filesystem part is mutually exclusive. For example either the filesystem is at most one of the High-Sierra, UFS, or HFS, ISO9660, fileystems. Valid combinations of say HFS and ISO9660 are specified as a separate "filesystem". Capabilities on the other hand are not mutually exclusive. For example a filesystem may have none, either, or both of the XA or Rock-Ridge extension properties. If "b_any" is set false then every capability listed in the analysis portion of capabilities (i.e. not the basic filesystem) must be satisified. If no analysis capabilities are specified, that's a match. If "b_any" is set true, then if any of the analysis capabilities matches, we call that a success. In either case, in the filesystem portion different filesystem either specify 0 to match any filesystem or the specific filesystem type. To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL. @return the array of device names or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found. */ char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any); /** Like cdio_get_devices_with_cap() but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. */ char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any, /*out*/ driver_id_t *p_driver_id); /** Like cdio_get_devices(), but we may change the p_driver_id if we were given \p DRIVER_DEVICE or \p DRIVER_UNKNOWN. This is because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. */ char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id); /** Get the what kind of device we've got. @param p_cdio the CD object queried @param p_read_cap pointer to return read capabilities @param p_write_cap pointer to return write capabilities @param p_misc_cap pointer to return miscellaneous other capabilities In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as \p NULL even though there isa hardware CD-ROM. */ void cdio_get_drive_cap (const CdIo_t *p_cdio, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); /** Get the drive capabilities for a specified device. Return a list of device capabilities. In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as \p NULL even though there isa hardware CD-ROM. */ void cdio_get_drive_cap_dev (const char *device, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); /** Get a string containing the name of the driver in use. @param p_cdio the CD object to be acted upon. @return a string with driver name or NULL if CdIo_t is NULL (we haven't initialized a specific device. */ const char * cdio_get_driver_name (const CdIo_t *p_cdio); /** Return a string name for the \p driver_id. */ const char * cdio_get_driver_name_from_id (driver_id_t driver_id); /** Get the driver id. if \p p_cdio is \p NULL (we haven't initialized a specific device driver), then return \p DRIVER_UNKNOWN. @param p_cdio the CD object to be acted upon. @return the driver id.. */ driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio); /** Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. False is returned if we had an error getting the information. */ bool cdio_get_hwinfo ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *p_hw_info ); /** Get the LSN of the first track of the last session of on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, /*out*/ lsn_t *i_last_session); /** Find out if media has changed since the last call. @param p_cdio the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as \p driver_return_code_t */ int cdio_get_media_changed(CdIo_t *p_cdio); /** True if CD-ROM understand ATAPI commands. */ bool_3way_t cdio_have_atapi (CdIo_t *p_cdio); /** Like cdio_have_xxx but uses an enumeration instead. */ bool cdio_have_driver (driver_id_t driver_id); /** Free any resources associated with \p p_cdio. Call this when done using p_cdio and using CD reading/control operations. @param p_cdio the CD object to eliminated. */ void cdio_destroy (CdIo_t *p_cdio); /** Get a string decribing driver_id. @param driver_id the driver you want the description for @return a string of driver description */ const char *cdio_driver_describe (driver_id_t driver_id); /** Sets up to read from place specified by \p psz_source and \p driver_id. This or cdio_open_* should be called before using any other routine, except cdio_init or any routine that accesses the CD-ROM drive by name. cdio_open will call cdio_init, if that hasn't been done previously. @return the cdio object or NULL on error or no device. If NULL is given as the source, we'll use the default driver device. */ CdIo_t * cdio_open (const char *psz_source, driver_id_t driver_id); /** Sets up to read from place specified by psz_source, driver_id and access mode. This or cdio_open* should be called before using any other routine, except cdio_init or any routine that accesses the CD-ROM drive by name. This will call cdio_init, if that hasn't been done previously. If \p NULL is given as the source, we'll use the default driver device. @return the cdio object or \p NULL on error or no device. */ CdIo_t * cdio_open_am (const char *psz_source, driver_id_t driver_id, const char *psz_access_mode); /** Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file @return the cdio object or \p NULL on error or no device. */ CdIo_t * cdio_open_bincue (const char *psz_cue_name); /** Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file @return the cdio object or \p NULL on error or no device.. */ CdIo_t * cdio_open_am_bincue (const char *psz_cue_name, const char *psz_access_mode); /** Set up cdrdao CD disk-image for reading. Source is the .toc file @return the cdio object or \p NULL on error or no device. */ CdIo_t * cdio_open_cdrdao (const char *psz_toc_name); /** Set up cdrdao CD disk-image for reading. Source is the .toc file @return the cdio object or NULL on error or no device.. */ CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name, const char *psz_access_mode); /** Return a string containing the default CUE file that would be used when none is specified. @return the cdio object or \p NULL on error or no device. */ char * cdio_get_default_device_bincue(void); char **cdio_get_devices_bincue(void); /** @return string containing the default CUE file that would be used when none is specified. \p NULL is returned on error or there is no device. */ char * cdio_get_default_device_cdrdao(void); char **cdio_get_devices_cdrdao(void); /** Set up CD-ROM for reading. The device_name is the some sort of device name. @return the cdio object for subsequent operations. \p NULL on error or there is no driver for a some sort of hardware CD-ROM. */ CdIo_t * cdio_open_cd (const char *device_name); /** Set up CD-ROM for reading. The device_name is the some sort of device name. @return the cdio object for subsequent operations. \p NULL on error or there is no driver for a some sort of hardware CD-ROM. */ CdIo_t * cdio_open_am_cd (const char *psz_device, const char *psz_access_mode); /** CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file @return the cdio object for subsequent operations. \p NULL on error. */ CdIo_t * cdio_open_cue (const char *cue_name); /** Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name. @return the cdio object for subsequent operations. \p NULL on error or there is no AIX driver. @see cdio_open() */ CdIo_t * cdio_open_am_aix (const char *psz_source, const char *psz_access_mode); /** Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name. @return the cdio object for subsequent operations. \p NULL on error or there is no AIX driver. @see cdio_open() */ CdIo_t * cdio_open_aix (const char *psz_source); /** Return a string containing the default device name that the AIX driver would use when none is specified. @return the cdio object for subsequent operations. \p NULL on error or there is no AIX driver. @see cdio_open_cd(), cdio_open() */ char * cdio_get_default_device_aix(void); /** Return a list of all of the CD-ROM devices that the AIX driver can find. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return \p NULL even though there may be a hardware CD-ROM. */ char **cdio_get_devices_aix(void); /** Set up CD-ROM for reading using the FreeBSD driver. The device_name is the some sort of device name. NULL is returned on error or there is no FreeBSD driver. @see cdio_open_cd(), cdio_open() */ CdIo_t * cdio_open_freebsd (const char *paz_psz_source); /** Set up CD-ROM for reading using the FreeBSD driver. The device_name is the some sort of device name. NULL is returned on error or there is no FreeBSD driver. @see cdio_open_cd(), cdio_open() */ CdIo_t * cdio_open_am_freebsd (const char *psz_source, const char *psz_access_mode); /** Return a string containing the default device name that the FreeBSD driver would use when none is specified. NULL is returned on error or there is no CD-ROM device. */ char * cdio_get_default_device_freebsd(void); /** Return a list of all of the CD-ROM devices that the FreeBSD driver can find. */ char **cdio_get_devices_freebsd(void); /** Set up CD-ROM for reading using the GNU/Linux driver. The device_name is the some sort of device name. @return the cdio object for subsequent operations. NULL on error or there is no GNU/Linux driver. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ CdIo_t * cdio_open_linux (const char *psz_source); /** Set up CD-ROM for reading using the GNU/Linux driver. The device_name is the some sort of device name. @return the cdio object for subsequent operations. NULL on error or there is no GNU/Linux driver. */ CdIo_t * cdio_open_am_linux (const char *psz_source, const char *access_mode); /** Return a string containing the default device name that the GNU/Linux driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them. NULL is returned on error or there is no CD-ROM device. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. @see cdio_open_cd, cdio_open */ char * cdio_get_default_device_linux(void); /** Return a list of all of the CD-ROM devices that the GNU/Linux driver can find. */ char **cdio_get_devices_linux(void); /** Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name. @return the cdio object for subsequent operations. \p NULL on error or there is no Solaris driver. */ CdIo_t * cdio_open_solaris (const char *psz_source); /** Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name. @return the cdio object for subsequent operations. \p NULL on error or there is no Solaris driver. */ CdIo_t * cdio_open_am_solaris (const char *psz_source, const char *psz_access_mode); /** Return a string containing the default device name that the Solaris driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them. \p NULL is returned on error or there is no CD-ROM device. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return \p NULL even though there may be a hardware CD-ROM. @see cdio_open_cd(), cdio_open() */ char * cdio_get_default_device_solaris(void); /** Return a list of all of the CD-ROM devices that the Solaris driver can find. */ char **cdio_get_devices_solaris(void); /** Set up CD-ROM for reading using the Apple OSX driver. The device_name is the some sort of device name. \p NULL is returned on error or there is no OSX driver. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. @see cdio_open_cd(), cdio_open() */ CdIo_t * cdio_open_osx (const char *psz_source); /** Set up CD-ROM for reading using the Apple OSX driver. The device_name is the some sort of device name. NULL is returned on error or there is no OSX driver. @see cdio_open_cd(), cdio_open() */ CdIo_t * cdio_open_am_osx (const char *psz_source, const char *psz_access_mode); /** Return a string containing the default device name that the OSX driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ char * cdio_get_default_device_osx(void); /** Return a list of all of the CD-ROM devices that the OSX driver can find. */ char **cdio_get_devices_osx(void); /** Set up CD-ROM for reading using the Microsoft Windows driver. The device_name is the some sort of device name. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ CdIo_t * cdio_open_win32 (const char *psz_source); /** Set up CD-ROM for reading using the Microsoft Windows driver. The device_name is the some sort of device name. NULL is returned on error or there is no Microsof Windows driver. */ CdIo_t * cdio_open_am_win32 (const char *psz_source, const char *psz_access_mode); /** Return a string containing the default device name that the Win32 driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. @see cdio_open_cd(), cdio_open() */ char * cdio_get_default_device_win32(void); char **cdio_get_devices_win32(void); /** Set up CD-ROM for reading using the Nero driver. The device_name is the some sort of device name. @return true on success; NULL on error or there is no Nero driver. */ CdIo_t * cdio_open_nrg (const char *psz_source); /** Set up CD-ROM for reading using the Nero driver. The device_name is the some sort of device name. @return true on success; NULL on error or there is no Nero driver. */ CdIo_t * cdio_open_am_nrg (const char *psz_source, const char *psz_access_mode); /** Get a string containing the default device name that the NRG driver would use when none is specified. A scan is made for NRG disk images in the current directory. @return string containing the default device. NULL on error or there is no CD-ROM device. */ char * cdio_get_default_device_nrg(void); char **cdio_get_devices_nrg(void); /** Determine if bin_name is the bin file part of a CDRWIN CD disk image. @param bin_name location of presumed CDRWIN bin image file. @return the corresponding CUE file if bin_name is a BIN file or \p NULL if not a BIN file. */ char *cdio_is_binfile(const char *bin_name); /** Determine if cue_name is the cue sheet for a CDRWIN CD disk image. @return corresponding BIN file if cue_name is a CDRWIN cue file or \p NULL if not a CUE file. */ char *cdio_is_cuefile(const char *cue_name); /** Determine if psg_nrg is a Nero CD disc image. @param psz_nrg location of presumed NRG image file. @return true if psz_nrg is a Nero NRG image or false if not a NRG image. */ bool cdio_is_nrg(const char *psz_nrg); /** Determine if psz_toc is a TOC file for a cdrdao CD disc image. @param psz_toc location of presumed TOC image file. @return true if toc_name is a cdrdao TOC file or false if not a TOC file. */ bool cdio_is_tocfile(const char *psz_toc); /** Determine if psz_source refers to a real hardware CD-ROM. @param psz_source location name of object @param driver_id driver for reading object. Use DRIVER_UNKNOWN if you don't know what driver to use. @return true if psz_source is a device; If false is returned we could have a CD disk image. */ bool cdio_is_device(const char *psz_source, driver_id_t driver_id); /** Set the blocksize for subsequent reads. */ driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio, int i_blocksize ); /** Set the drive speed. @param p_cdio CD structure set by cdio_open(). @param i_drive_speed speed in CD-ROM speed units. Note this not Kbs as would be used in the MMC spec or in mmc_set_speed(). To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). On many CD-ROM drives, specifying a value too large will result in using the fastest speed. @see mmc_set_speed() and mmc_set_drive_speed() */ driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio, int i_drive_speed ); /** Get the value associatied with key. @param p_cdio the CD object queried @param key the key to retrieve @return the value associated with "key", \p NULL if \p p_cdio is \p NULL, or "key" does not exist. */ const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[]); /** Set the arg "key" with "value" in "p_cdio". @param p_cdio the CD object to set @param key the key to set @param value the value to assocaiate with key */ driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[], const char value[]); /** Initialize CD Reading and control routines. Should be called first. */ bool cdio_init(void); #ifdef __cplusplus } #endif /* __cplusplus */ /** The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ extern cdio_drive_cap_misc_t debug_cdio_drive_cap_misc; extern cdio_drive_cap_read_t debug_cdio_drive_cap_read_t; extern cdio_drive_cap_write_t debug_drive_cap_write_t; extern cdio_mmc_hw_len_t debug_cdio_mmc_hw_len; extern cdio_src_category_mask_t debug_cdio_src_category_mask; #endif /* CDIO_DEVICE_H_ */ libcdio-2.2.0/include/cdio/disc.h000066400000000000000000000112331474051130400165530ustar00rootroot00000000000000/* -*- c -*- Copyright (C) 2018 Thomas Schmitt Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file disc.h \brief The top-level header for disc-related libcdio calls. */ #ifndef CDIO_DISC_H_ #define CDIO_DISC_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** disc modes. The first combined from MMC-5 6.33.3.13 (Send CUESHEET), "DVD Book" from MMC-5 Table 400, page 419. and GNU/Linux /usr/include/linux/cdrom.h and we've added DVD. */ typedef enum { CDIO_DISC_MODE_CD_DA, /**< CD-DA */ CDIO_DISC_MODE_CD_DATA, /**< CD-ROM form 1 */ CDIO_DISC_MODE_CD_XA, /**< CD-ROM XA form2 */ CDIO_DISC_MODE_CD_MIXED, /**< Some combo of above. */ CDIO_DISC_MODE_DVD_ROM, /**< DVD ROM (e.g. movies) */ CDIO_DISC_MODE_DVD_RAM, /**< DVD-RAM */ CDIO_DISC_MODE_DVD_R, /**< DVD-R */ CDIO_DISC_MODE_DVD_RW, /**< DVD-RW */ CDIO_DISC_MODE_HD_DVD_ROM, /**< HD DVD-ROM */ CDIO_DISC_MODE_HD_DVD_RAM, /**< HD DVD-RAM */ CDIO_DISC_MODE_HD_DVD_R, /**< HD DVD-R */ CDIO_DISC_MODE_DVD_PR, /**< DVD+R */ CDIO_DISC_MODE_DVD_PRW, /**< DVD+RW */ CDIO_DISC_MODE_DVD_PRW_DL, /**< DVD+RW DL */ CDIO_DISC_MODE_DVD_PR_DL, /**< DVD+R DL */ CDIO_DISC_MODE_DVD_OTHER, /**< Unknown/unclassified DVD type */ CDIO_DISC_MODE_NO_INFO, CDIO_DISC_MODE_ERROR, CDIO_DISC_MODE_CD_I /**< CD-i. */ } discmode_t; extern const char *discmode2str[]; /** Read cdtext information for a cdtext_t object. About format and usage of these data see the documentation of call mmc_read_cdtext() in include file . @param p_cdio the CD object that may contain CD-Text information. @return malloc'd pointer to raw CD-Text data as replied by the drive or NULL if problems occur or CD-Text information does not exist. A non-NULL return value must be freed with cdio_free() when done. */ uint8_t * cdio_get_cdtext_raw (CdIo_t *p_cdio); /** Return a pointer to the cdtext_t object which is attached to a CdIo_t object. If no such cdtext_t is attached yet, then try to read CD-TEXT information and use it to create and initialise the cdtext_t object. For usage of cdtext_t see include file . @param p_cdio the CD object that may contain CD-Text information. @return a pointer to the attached cdtext_t object or NULL if problems occur or if CD-Text information does not exist. */ cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio); /** Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc. that we've got. The notion of "CD" is extended a little to include DVD's. */ discmode_t cdio_get_discmode (CdIo_t *p_cdio); /** Get the lsn of the end of the CD @return the lsn. On error 0 or CDIO_INVALD_LSN. */ lsn_t cdio_get_disc_last_lsn(const CdIo_t *p_cdio); /** Return the Joliet level recognized for p_cdio. */ uint8_t cdio_get_joliet_level(const CdIo_t *p_cdio); /** Get the media catalog number (MCN) from the CD. @return the media catalog number or NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * cdio_get_mcn (const CdIo_t *p_cdio); /** Get the number of tracks on the CD. @return the number of tracks, or CDIO_INVALID_TRACK if there is an error. */ track_t cdio_get_num_tracks (const CdIo_t *p_cdio); /** Return true if discmode is some sort of CD. */ bool cdio_is_discmode_cdrom (discmode_t discmode); /** Return true if discmode is some sort of DVD. */ bool cdio_is_discmode_dvd (discmode_t discmode); /** cdio_stat_size is deprecated. @see cdio_get_disc_last_lsn */ #define cdio_stat_size cdio_get_disc_last_lsn #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_DISC_H_ */ libcdio-2.2.0/include/cdio/ds.h000066400000000000000000000051121474051130400162360ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2017 Rocky Bernstein Copyright (C) 2000, 2004 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file ds.h * \brief The top-level header for list-related data structures. Note: this header will is slated to get removed and libcdio will use glib.h routines instead. */ #ifndef CDIO_DS_H_ #define CDIO_DS_H_ #include /** opaque types... */ typedef struct _CdioList CdioList_t; typedef struct _CdioListNode CdioListNode_t; typedef int (*_cdio_list_cmp_func_t) (void *p_data1, void *p_data2); typedef int (*_cdio_list_iterfunc_t) (void *p_data, void *p_user_data); #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** methods */ CdioList_t *_cdio_list_new (void); void _cdio_list_free (CdioList_t *p_list, int free_data, CdioDataFree_t free_fn); unsigned _cdio_list_length (const CdioList_t *list); void _cdio_list_prepend (CdioList_t *p_list, void *p_data); void _cdio_list_append (CdioList_t *p_list, void *p_data); void _cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func, void *p_user_data); CdioListNode_t *_cdio_list_find (CdioList_t *p_list, _cdio_list_iterfunc_t cmp_func, void *p_user_data); #define _CDIO_LIST_FOREACH(node, list) \ for (node = _cdio_list_begin (list); node; node = _cdio_list_node_next (node)) /** node operations */ CdioListNode_t *_cdio_list_begin (const CdioList_t *p_list); CdioListNode_t *_cdio_list_end (CdioList_t *p_list); CdioListNode_t *_cdio_list_node_next (CdioListNode_t *p_node); void _cdio_list_node_free (CdioListNode_t *p_node, int i_free_data, CdioDataFree_t free_fn); void *_cdio_list_node_data (CdioListNode_t *p_node); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_DS_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/dvd.h000066400000000000000000000066341474051130400164170ustar00rootroot00000000000000/* Copyright (C) 2004, 2010 Rocky Bernstein Modeled after GNU/Linux definitions in linux/cdrom.h 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file dvd.h \brief Definitions for DVD access. The documents we make use of are described Multi-Media Commands (MMC). This document generally has a numeric level number appended. For example MMC-5 refers to ``Multi-Media Commands - 5' which is the current version in 2010. */ #ifndef CDIO_DVD_H_ #define CDIO_DVD_H_ #include /** Values used in a READ DVD STRUCTURE */ typedef enum cdio_dvd_structure { CDIO_DVD_STRUCT_PHYSICAL = 0x00, CDIO_DVD_STRUCT_COPYRIGHT = 0x01, CDIO_DVD_STRUCT_DISCKEY = 0x02, CDIO_DVD_STRUCT_BCA = 0x03, CDIO_DVD_STRUCT_MANUFACT = 0x04 } cdio_dvd_structure; /** Media definitions for "DVD Book" from MMC-5 Table 400, page 419. */ typedef enum cdio_dvd_book { CDIO_DVD_BOOK_DVD_ROM = 0x0, /**< DVD-ROM */ CDIO_DVD_BOOK_DVD_RAM = 0x1, /**< DVD-RAM */ CDIO_DVD_BOOK_DVD_R = 0x2, /**< DVD-R */ CDIO_DVD_BOOK_DVD_RW = 0x3, /**< DVD-RW */ CDIO_DVD_BOOK_HD_DVD_ROM = 0x4, /**< HD DVD-ROM */ CDIO_DVD_BOOK_HD_DVD_RAM = 0x5, /**< HD DVD-RAM */ CDIO_DVD_BOOK_HD_DVD_R = 0x6, /**< HD DVD-R */ CDIO_DVD_BOOK_DVD_PRW = 0x9, /**< DVD+RW */ CDIO_DVD_BOOK_DVD_PR = 0xa, /**< DVD+R */ CDIO_DVD_BOOK_DVD_PRW_DL = 0xd, /**< DVD+RW DL */ CDIO_DVD_BOOK_DVD_PR_DL = 0xe /**< DVD+R DL */ } cdio_dvd_book; typedef struct cdio_dvd_layer { unsigned int book_version : 4; unsigned int book_type : 4; unsigned int min_rate : 4; unsigned int disc_size : 4; unsigned int layer_type : 4; unsigned int track_path : 1; unsigned int nlayers : 2; unsigned int track_density : 4; unsigned int linear_density : 4; unsigned int bca : 1; uint32_t start_sector; uint32_t end_sector; uint32_t end_sector_l0; } cdio_dvd_layer_t; /** Maximum number of layers in a DVD. */ #define CDIO_DVD_MAX_LAYERS 4 typedef struct cdio_dvd_physical { uint8_t type; uint8_t layer_num; cdio_dvd_layer_t layer[CDIO_DVD_MAX_LAYERS]; } cdio_dvd_physical_t; typedef struct cdio_dvd_copyright { uint8_t type; uint8_t layer_num; uint8_t cpst; uint8_t rmi; } cdio_dvd_copyright_t; typedef struct cdio_dvd_disckey { uint8_t type; unsigned agid : 2; uint8_t value[2048]; } cdio_dvd_disckey_t; typedef struct cdio_dvd_bca { uint8_t type; int len; uint8_t value[188]; } cdio_dvd_bca_t; typedef struct cdio_dvd_manufact { uint8_t type; uint8_t layer_num; int len; uint8_t value[2048]; } cdio_dvd_manufact_t; typedef union { uint8_t type; cdio_dvd_physical_t physical; cdio_dvd_copyright_t copyright; cdio_dvd_disckey_t disckey; cdio_dvd_bca_t bca; cdio_dvd_manufact_t manufact; } cdio_dvd_struct_t; #endif /* CDIO_DVD_H_ */ libcdio-2.2.0/include/cdio/ecma_167.h000066400000000000000000001025301474051130400171340ustar00rootroot00000000000000/* Copyright (c) 2005, 2006, 2008, 2012, 2024 Rocky Bernstein Copyright (c) 2001-2002 Ben Fennema 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* * Some portions taken from FreeBSD ecma167-udf.h which states: * Copyright (c) 2001, 2002 Scott Long * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /*! * \file ecma_167.h * * \brief Definitions based on ECMA-167 3rd edition (June 1997) * See http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-167.pdf */ #ifndef CDIO_ECMA_167_H #define CDIO_ECMA_167_H 1 #include /** Imagine the below enum values as \#define'd values rather than distinct values of an enum. */ typedef enum { VSD_STD_ID_SIZE = 5, /** Volume Structure Descriptor (ECMA 167r3 2/9.1) */ UDF_REGID_ID_SIZE = 23, /**< See identifier (ECMA 167r3 1/7.4) */ UDF_VOLID_SIZE = 32, UDF_FID_SIZE = 38, UDF_VOLSET_ID_SIZE = 128 } ecma_167_enum1_t ; /** Tag Identifier (ECMA 167r3 3/7.2.1) */ typedef enum { TAGID_PRI_VOL = 0x0001, TAGID_ANCHOR = 0x0002, TAGID_VOL = 0x0003, TAGID_IMP_VOL = 0x0004, TAGID_PARTITION = 0x0005, TAGID_LOGVOL = 0x0006, TAGID_UNALLOC_SPACE = 0x0007, TAGID_TERM = 0x0008, TAGID_LOGVOL_INTEGRITY = 0x0009, TAGID_FSD = 0x0100, TAGID_FID = 0x0101, TAGID_AED = 0x0102, TAGID_IE = 0x0103, TAGID_TE = 0x0104, TAGID_FILE_ENTRY = 0x0105, TAGID_EAHD = 0x0106, TAGID_USE = 0x0107, TAGID_SBD = 0x0108, TAGID_PIE = 0x0109, TAGID_EFE = 0x010A, } tag_id_t ; /** Character Set Type (ECMA 167r3 1/7.2.1.1) */ typedef enum { CHARSPEC_TYPE_CS0 = 0x00, /**< Section 1/7.2.2 */ CHARSPEC_TYPE_CS1 = 0x01, /**< Section 1/7.2.3 */ CHARSPEC_TYPE_CS2 = 0x02, /**< Section 1/7.2.4 */ CHARSPEC_TYPE_CS3 = 0x03, /**< Section 1/7.2.5 */ CHARSPEC_TYPE_CS4 = 0x04, /**< Section 1/7.2.6 */ CHARSPEC_TYPE_CS5 = 0x05, /**< Section 1/7.2.7 */ CHARSPEC_TYPE_CS6 = 0x06, /**< Section 1/7.2.8 */ CHARSPEC_TYPE_CS7 = 0x07, /**< Section 1/7.2.9 */ CHARSPEC_TYPE_CS8 = 0x08, /**< Section 1/7.2.10 */ } udf_charspec_enum_t; typedef uint8_t udf_Uint8_t; /*! Section 1/7/1.1 */ typedef uint16_t udf_Uint16_t; /*! Section 1/7.1.3 */ typedef uint32_t udf_Uint32_t; /*! Section 1/7.1.5 */ typedef uint64_t udf_Uint64_t; /*! Section 1/7.1.7 */ typedef char udf_dstring; /*! Section 1/7.1.12 */ #define UDF_LENGTH_MASK 0x3fffffff PRAGMA_BEGIN_PACKED /** Character set specification (ECMA 167r3 1/7.2.1) */ struct udf_charspec_s { udf_Uint8_t charset_type; udf_Uint8_t charset_info[63]; } GNUC_PACKED; typedef struct udf_charspec_s udf_charspec_t; /** Timestamp (ECMA 167r3 1/7.3) */ struct udf_timestamp_s { udf_Uint16_t type_tz; udf_Uint16_t year; udf_Uint8_t month; udf_Uint8_t day; udf_Uint8_t hour; udf_Uint8_t minute; udf_Uint8_t second; udf_Uint8_t centiseconds; udf_Uint8_t hundreds_of_microseconds; udf_Uint8_t microseconds; } GNUC_PACKED; typedef struct udf_timestamp_s udf_timestamp_t; /** Type and Time Zone (ECMA 167r3 1/7.3.1) Imagine the below enum values as \#define'd values rather than distinct values of an enum. */ typedef enum { TIMESTAMP_TYPE_CUT = 0x0000, TIMESTAMP_TYPE_LOCAL = 0x1000, TIMESTAMP_TYPE_AGREEMENT = 0x2000, TIMESTAMP_TYPE_MASK = 0xF000, TIMESTAMP_TIMEZONE_MASK = 0x0FFF, } ecma_167_timezone_enum_t ; #define TIMESTAMP_TYPE_MASK 0xF000 #define TIMESTAMP_TYPE_CUT 0x0000 #define TIMESTAMP_TYPE_LOCAL 0x1000 #define TIMESTAMP_TYPE_AGREEMENT 0x2000 #define TIMESTAMP_TIMEZONE_MASK 0x0FFF struct udf_id_suffix_s { udf_Uint16_t udf_revision; udf_Uint8_t os_class; udf_Uint8_t os_identifier; udf_Uint8_t reserved[4]; } GNUC_PACKED; typedef struct udf_id_suffix_s udf_id_suffix_t; /** Entity identifier (ECMA 167r3 1/7.4) */ struct udf_regid_s { udf_Uint8_t flags; udf_Uint8_t id[UDF_REGID_ID_SIZE]; udf_id_suffix_t id_suffix; } GNUC_PACKED; typedef struct udf_regid_s udf_regid_t; /** Flags (ECMA 167r3 1/7.4.1) */ #define ENTITYID_FLAGS_DIRTY 0x00 #define ENTITYID_FLAGS_PROTECTED 0x01 /** Volume Structure Descriptor (ECMA 167r3 2/9.1) */ struct vol_struct_desc_s { udf_Uint8_t struct_type; udf_Uint8_t std_id[VSD_STD_ID_SIZE]; udf_Uint8_t struct_version; udf_Uint8_t struct_data[2041]; } GNUC_PACKED; /** Standard Identifier (EMCA 167r2 2/9.1.2) */ #define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */ /** Standard Identifier (ECMA 167r3 2/9.1.2) */ /* The below const definitions are to faciltate debugging of the values #define'd below. */ extern const char VSD_STD_ID_BEA01[sizeof("BEA01")-1]; extern const char VSD_STD_ID_BOOT2[sizeof("BOOT2")-1]; extern const char VSD_STD_ID_CD001[sizeof("CD001")-1]; extern const char VSD_STD_ID_CDW01[sizeof("CDW02")-1]; extern const char VSD_STD_ID_NSR03[sizeof("NSR03")-1]; extern const char VSD_STD_ID_TEA01[sizeof("TEA01")-1]; #define VSD_STD_ID_BEA01 "BEA01" /**< ECMA-167 2/9.2 */ #define VSD_STD_ID_BOOT2 "BOOT2" /**< ECMA-167 2/9.4 */ #define VSD_STD_ID_CD001 "CD001" /**< ECMA-119 */ #define VSD_STD_ID_CDW02 "CDW02" /**< ECMA-168 */ #define VSD_STD_ID_NSR02 "NSR02" /**< ECMA-167, 3/9.1 NOTE: ECMA-167, 2nd edition */ #define VSD_STD_ID_NSR03 "NSR03" /**< ECMA-167 3/9.1 */ #define VSD_STD_ID_TEA01 "TEA01" /**< ECMA-168 2/9.3 */ /** Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */ struct beginning_extended_area_desc_s { udf_Uint8_t struct_type; udf_Uint8_t std_id[VSD_STD_ID_SIZE]; udf_Uint8_t struct_version; udf_Uint8_t struct_data[2041]; } GNUC_PACKED; /** Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */ struct terminating_extended_area_desc_s { udf_Uint8_t struct_type; udf_Uint8_t std_id[VSD_STD_ID_SIZE]; udf_Uint8_t struct_version; udf_Uint8_t struct_data[2041]; } GNUC_PACKED; /** Boot Descriptor (ECMA 167r3 2/9.4) */ struct boot_desc_s { udf_Uint8_t struct_type; udf_Uint8_t std_ident[VSD_STD_ID_SIZE]; udf_Uint8_t struct_version; udf_Uint8_t reserved1; udf_regid_t arch_type; udf_regid_t boot_ident; udf_Uint32_t bool_ext_location; udf_Uint32_t bool_ext_length; udf_Uint64_t load_address; udf_Uint64_t start_address; udf_timestamp_t desc_creation_time; udf_Uint16_t flags; udf_Uint8_t reserved2[32]; udf_Uint8_t boot_use[1906]; } GNUC_PACKED; /** Flags (ECMA 167r3 2/9.4.12) */ #define BOOT_FLAGS_ERASE 0x01 /** Extent Descriptor (ECMA 167r3 3/7.1) */ struct udf_extent_ad_s { udf_Uint32_t len; udf_Uint32_t loc; } GNUC_PACKED; typedef struct udf_extent_ad_s udf_extent_ad_t; /** Descriptor Tag (ECMA 167r3 3/7.2) */ struct udf_tag_s { udf_Uint16_t id; udf_Uint16_t desc_version; udf_Uint8_t cksum; udf_Uint8_t reserved; udf_Uint16_t i_serial; udf_Uint16_t desc_CRC; udf_Uint16_t desc_CRC_len; udf_Uint32_t loc; } GNUC_PACKED; typedef struct udf_tag_s udf_tag_t; /** NSR Descriptor (ECMA 167r3 3/9.1) */ struct NSR_desc_s { udf_Uint8_t struct_type; udf_Uint8_t std_id[VSD_STD_ID_SIZE]; udf_Uint8_t struct_version; udf_Uint8_t reserved; udf_Uint8_t struct_data[2040]; } GNUC_PACKED; /** Primary Volume Descriptor (ECMA 167r3 3/10.1) */ struct udf_pvd_s { udf_tag_t tag; udf_Uint32_t vol_desc_seq_num; udf_Uint32_t primary_vol_desc_num; udf_dstring vol_ident[UDF_VOLID_SIZE]; udf_Uint16_t vol_seq_num; udf_Uint16_t max_vol_seqnum; udf_Uint16_t interchange_lvl; udf_Uint16_t max_interchange_lvl; udf_Uint32_t charset_list; udf_Uint32_t max_charset_list; udf_dstring volset_id[UDF_VOLSET_ID_SIZE]; udf_charspec_t desc_charset; udf_charspec_t explanatory_charset; udf_extent_ad_t vol_abstract; udf_extent_ad_t vol_copyright; udf_regid_t app_ident; udf_timestamp_t recording_time; udf_regid_t imp_ident; udf_Uint8_t imp_use[64]; udf_Uint32_t predecessor_vol_desc_seq_location; udf_Uint16_t flags; udf_Uint8_t reserved[22]; } GNUC_PACKED; typedef struct udf_pvd_s udf_pvd_t; /** Flags (ECMA 167r3 3/10.1.21) */ #define PVD_FLAGS_VSID_COMMON 0x0001 /** Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */ struct anchor_vol_desc_ptr_s { udf_tag_t tag; udf_extent_ad_t main_vol_desc_seq_ext; udf_extent_ad_t reserve_vol_desc_seq_ext; udf_Uint8_t reserved[480]; } GNUC_PACKED; typedef struct anchor_vol_desc_ptr_s anchor_vol_desc_ptr_t; /** Volume Descriptor Pointer (ECMA 167r3 3/10.3) */ struct vol_desc_ptr_s { udf_tag_t tag; udf_Uint32_t vol_desc_seq_num; udf_extent_ad_t next_vol_desc_set_ext; udf_Uint8_t reserved[484]; } GNUC_PACKED; /** Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */ struct imp_use_vol_desc_s { udf_tag_t tag; udf_Uint32_t vol_desc_seq_num; udf_regid_t imp_id; udf_Uint8_t imp_use[460]; } GNUC_PACKED; /** Partition Descriptor (ECMA 167r3 3/10.5) */ struct partition_desc_s { udf_tag_t tag; udf_Uint32_t vol_desc_seq_num; udf_Uint16_t flags; udf_Uint16_t number; /**< Partition number */ udf_regid_t contents; udf_Uint8_t contents_use[128]; udf_Uint32_t access_type; udf_Uint32_t start_loc; udf_Uint32_t part_len; udf_regid_t imp_id; udf_Uint8_t imp_use[128]; udf_Uint8_t reserved[156]; } GNUC_PACKED; typedef struct partition_desc_s partition_desc_t; /** Partition Flags (ECMA 167r3 3/10.5.3) */ #define PD_PARTITION_FLAGS_ALLOC 0x0001 /** Partition Contents (ECMA 167r2 3/10.5.3) */ #define PD_PARTITION_CONTENTS_NSR02 "+NSR02" /** Partition Contents (ECMA 167r3 3/10.5.5) */ #define PD_PARTITION_CONTENTS_FDC01 "+FDC01" #define PD_PARTITION_CONTENTS_CD001 "+CD001" #define PD_PARTITION_CONTENTS_CDW02 "+CDW02" #define PD_PARTITION_CONTENTS_NSR03 "+NSR03" /** Access Type (ECMA 167r3 3/10.5.7) */ #define PD_ACCESS_TYPE_NONE 0x00000000 #define PD_ACCESS_TYPE_READ_ONLY 0x00000001 #define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002 #define PD_ACCESS_TYPE_REWRITABLE 0x00000003 #define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004 /** Recorded Address (ECMA 167r3 4/7.1) */ struct udf_lb_addr_s { udf_Uint32_t lba; udf_Uint16_t partitionReferenceNum; } GNUC_PACKED; typedef struct udf_lb_addr_s udf_lb_addr_t; /** Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ struct udf_short_ad_s { udf_Uint32_t len; udf_Uint32_t pos; } GNUC_PACKED; typedef struct udf_short_ad_s udf_short_ad_t; /** Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ struct udf_long_ad_s { udf_Uint32_t len; udf_lb_addr_t loc; udf_Uint8_t imp_use[6]; } GNUC_PACKED; typedef struct udf_long_ad_s udf_long_ad_t; /** Logical Volume Descriptor (ECMA 167r3 3/10.6) */ struct logical_vol_desc_s { udf_tag_t tag; udf_Uint32_t seq_num; udf_charspec_t desc_charset; udf_dstring logvol_id[128]; udf_Uint32_t logical_blocksize; udf_regid_t domain_id; union { udf_long_ad_t fsd_loc; udf_Uint8_t logvol_content_use[16]; } lvd_use; udf_Uint8_t logvol_contents_use[16]; udf_Uint32_t maptable_len; udf_Uint32_t i_partition_maps; udf_regid_t imp_id; udf_Uint8_t imp_use[128]; udf_extent_ad_t integrity_seq_ext; udf_Uint8_t partition_maps[0]; } GNUC_PACKED; typedef struct logical_vol_desc_s logical_vol_desc_t; /** Generic Partition Map (ECMA 167r3 3/10.7.1) */ struct generic_partition_map { udf_Uint8_t partition_map_type; udf_Uint8_t partition_map_length; udf_Uint8_t partition_mapping[0]; } GNUC_PACKED; /** Partition Map Type (ECMA 167r3 3/10.7.1.1) */ #define GP_PARTITION_MAP_TYPE_UNDEF 0x00 #define GP_PARTIITON_MAP_TYPE_1 0x01 #define GP_PARTITION_MAP_TYPE_2 0x02 /** Type 1 Partition Map (ECMA 167r3 3/10.7.2) */ struct generic_partition_map1 { udf_Uint8_t partition_map_type; udf_Uint8_t partition_map_length; udf_Uint16_t vol_seq_num; udf_Uint16_t i_partition; } GNUC_PACKED; /** Type 2 Partition Map (ECMA 167r3 3/10.7.3) */ struct generic_partition_map2 { udf_Uint8_t partition_map_type; udf_Uint8_t partition_map_length; udf_Uint8_t partition_id[62]; } GNUC_PACKED; /** Unallocated Space Descriptor (ECMA 167r3 3/10.8) */ struct unalloc_space_desc_s { udf_tag_t tag; udf_Uint32_t vol_desc_seq_num; udf_Uint32_t u_alloc_descs; udf_extent_ad_t allocDescs[0]; } GNUC_PACKED; /** Terminating Descriptor (ECMA 167r3 3/10.9) */ struct terminating_desc_s { udf_tag_t tag; udf_Uint8_t reserved[496]; } GNUC_PACKED; /** Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */ struct logvol_integrity_desc_s { udf_tag_t tag; udf_timestamp_t recording_time; udf_Uint32_t integrity_type; udf_extent_ad_t next_integrity_ext; udf_Uint8_t logvol_contents_use[32]; udf_Uint32_t i_partitions; union { /* Same MSVC workaround as with struct udf_fileid_desc_s */ udf_Uint32_t imp_use_len; struct { udf_Uint32_t unused; udf_Uint32_t data[0]; } freespace_table; struct { udf_Uint32_t unused; udf_Uint32_t data[0]; } size_table; struct { udf_Uint32_t unused; udf_Uint32_t data[0]; } imp_use; } u; } GNUC_PACKED; /** Integrity Type (ECMA 167r3 3/10.10.3) */ #define LVID_INTEGRITY_TYPE_OPEN 0x00000000 #define LVID_INTEGRITY_TYPE_CLOSE 0x00000001 /** Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */ struct udf_ext_ad_s { udf_Uint32_t len; udf_Uint32_t recorded_len; udf_Uint32_t information_len; udf_lb_addr_t ext_loc; } GNUC_PACKED; typedef struct udf_ext_ad_s udf_ext_ad_t; /** Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */ /** Tag Identifier (ECMA 167r3 4/7.2.1) */ /** File Set Descriptor (ECMA 167r3 4/14.1) */ struct udf_fsd_s { udf_tag_t tag; udf_timestamp_t recording_time; udf_Uint16_t interchange_lvl; udf_Uint16_t maxInterchange_lvl; udf_Uint32_t charset_list; udf_Uint32_t max_charset_list; udf_Uint32_t fileset_num; udf_Uint32_t udf_fsd_num; udf_charspec_t logical_vol_id_charset; udf_dstring logical_vol_id[128]; udf_charspec_t fileset_charset; udf_dstring fileSet_id[32]; udf_dstring copyright_file_id[32]; udf_dstring abstract_file_id[32]; udf_long_ad_t root_icb; udf_regid_t domain_id; udf_long_ad_t next_ext; udf_long_ad_t stream_directory_ICB; udf_Uint8_t reserved[32]; } GNUC_PACKED; typedef struct udf_fsd_s udf_fsd_t; /** Partition Header Descriptor (ECMA 167r3 4/14.3) */ struct partition_header_desc_s { udf_short_ad_t unalloc_space_table; udf_short_ad_t unalloc_space_bitmap; udf_short_ad_t partition_integrity_table; udf_short_ad_t freed_space_table; udf_short_ad_t freed_space_bitmap; udf_Uint8_t reserved[88]; } GNUC_PACKED; typedef struct partition_header_desc_s partition_header_desc_t; /** File Identifier Descriptor (ECMA 167r3 4/14.4) */ struct udf_fileid_desc_s { udf_tag_t tag; udf_Uint16_t file_version_num; udf_Uint8_t file_characteristics; udf_Uint8_t i_file_id; udf_long_ad_t icb; /* MSVC workaround for multiple zero sized arrays Unlike what is the case with GNU, and against logic, an union of zero sized arrays in the Microsoft world is not zero bytes but one byte! Thus, for sizeof() to be consistent across platforms, we must use an ugly workaround that attaches the union to the last non-zero member. */ union { udf_Uint16_t i_imp_use; struct { udf_Uint16_t unused; udf_Uint8_t data[0]; } imp_use; struct { udf_Uint16_t unused; udf_Uint8_t data[0]; } file_id; struct { udf_Uint16_t unused; udf_Uint8_t data[0]; } padding; } u; } GNUC_PACKED; typedef struct udf_fileid_desc_s udf_fileid_desc_t; /** File Characteristics (ECMA 167r3 4/14.4.3) Imagine the below enumeration values are \#defines to be used in a bitmask rather than distinct values of an enum. */ typedef enum { UDF_FILE_HIDDEN = (1 << 0), UDF_FILE_DIRECTORY = (1 << 1), UDF_FILE_DELETED = (1 << 2), UDF_FILE_PARENT = (1 << 3), UDF_FILE_METADATA = (1 << 4) } file_characteristics_t; /** Allocation Ext Descriptor (ECMA 167r3 4/14.5) */ struct allocExtDesc { udf_tag_t tag; udf_Uint32_t previous_alloc_ext_loc; udf_Uint32_t u_alloc_descs; } GNUC_PACKED; /** ICB Tag (ECMA 167r3 4/14.6) */ struct udf_icbtag_s { udf_Uint32_t prev_num_dirs; udf_Uint16_t strat_type; udf_Uint16_t strat_param; udf_Uint16_t max_num_entries; udf_Uint8_t reserved; udf_Uint8_t file_type; udf_lb_addr_t parent_ICB; udf_Uint16_t flags; } GNUC_PACKED; typedef struct udf_icbtag_s udf_icbtag_t; #define UDF_ICB_TAG_FLAGS_SETUID 0x40 #define UDF_ICB_TAG_FLAGS_SETGID 0x80 #define UDF_ICB_TAG_FLAGS_STICKY 0x100 /** Strategy Type (ECMA 167r3 4/14.6.2) which helpfully points largely to 4/A.x */ #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000 #define ICBTAG_STRATEGY_TYPE_1 0x0001 /**< 4/A.2 Direct entries Uint16 */ #define ICBTAG_STRATEGY_TYPE_2 0x0002 /**< 4/A.3 List of ICB direct entries */ #define ICBTAG_STRATEGY_TYPE_3 0x0003 /**< 4/A.4 */ #define ICBTAG_STRATEGY_TYPE_4 0x0004 /**< 4/A.5 Hierarchy having one single ICB with one direct entry. This is what's most often used. */ /** File Type (ECMA 167r3 4/14.6.6) Imagine the below enum values as \#define'd values rather than distinct values of an enum. */ typedef enum { ICBTAG_FILE_TYPE_UNDEF = 0x00, ICBTAG_FILE_TYPE_USE = 0x01, ICBTAG_FILE_TYPE_PIE = 0x02, ICBTAG_FILE_TYPE_IE = 0x03, ICBTAG_FILE_TYPE_DIRECTORY = 0x04, ICBTAG_FILE_TYPE_REGULAR = 0x05, ICBTAG_FILE_TYPE_BLOCK = 0x06, ICBTAG_FILE_TYPE_CHAR = 0x07, ICBTAG_FILE_TYPE_EA = 0x08, ICBTAG_FILE_TYPE_FIFO = 0x09, ICBTAG_FILE_TYPE_SOCKET = 0x0A, ICBTAG_FILE_TYPE_TE = 0x0B, ICBTAG_FILE_TYPE_SYMLINK = 0x0C, ICBTAG_FILE_TYPE_STREAMDIR = 0x0D } icbtag_file_type_enum_t; /** Flags (ECMA 167r3 4/14.6.8) */ typedef enum { ICBTAG_FLAG_AD_MASK = 0x0007, /**< "&" this to get below address flags */ ICBTAG_FLAG_AD_SHORT = 0x0000, /**< The allocation descriptor field is filled with short_ad's. If the offset is beyond the current extent, look for the next extent. */ ICBTAG_FLAG_AD_LONG = 0x0001, /**< The allocation descriptor field is filled with long_ad's If the offset is beyond the current extent, look for the next extent. */ ICBTAG_FLAG_AD_EXTENDED = 0x0002, ICBTAG_FLAG_AD_IN_ICB = 0x0003, /**< This type means that the file *data* is stored in the allocation descriptor field of the file entry. */ ICBTAG_FLAG_SORTED = 0x0008, ICBTAG_FLAG_NONRELOCATABLE = 0x0010, ICBTAG_FLAG_ARCHIVE = 0x0020, ICBTAG_FLAG_SETUID = 0x0040, ICBTAG_FLAG_SETGID = 0x0080, ICBTAG_FLAG_STICKY = 0x0100, ICBTAG_FLAG_CONTIGUOUS = 0x0200, ICBTAG_FLAG_SYSTEM = 0x0400, ICBTAG_FLAG_TRANSFORMED = 0x0800, ICBTAG_FLAG_MULTIVERSIONS = 0x1000, ICBTAG_FLAG_STREAM = 0x2000 } icbtag_flag_enum_t; /** Indirect Entry (ECMA 167r3 4/14.7) */ struct indirect_entry_s { udf_tag_t tag; udf_icbtag_t icb_tag; udf_long_ad_t indirect_ICB; } GNUC_PACKED; /** Terminal Entry (ECMA 167r3 4/14.8) */ struct terminal_entry_s { udf_tag_t tag; udf_icbtag_t icb_tag; } GNUC_PACKED; /** File Entry (ECMA 167r3 4/14.9) */ struct udf_file_entry_s { udf_tag_t tag; udf_icbtag_t icb_tag; /**< 4/14.9.2 */ udf_Uint32_t uid; /**< 4/14.9.3 */ udf_Uint32_t gid; /**< 4/14.9.4 */ udf_Uint32_t permissions; /**< 4/14.9.5 */ udf_Uint16_t link_count; /**< 4/14.9.6 */ udf_Uint8_t rec_format; /**< 4/14.9.7 */ udf_Uint8_t rec_disp_attr; /**< 4/14.9.8 */ udf_Uint32_t rec_len; /**< 4/14.9.9 */ udf_Uint64_t info_len; /**< 4/14.9.10 */ udf_Uint64_t logblks_recorded; /**< 4/14.9.11 */ udf_timestamp_t access_time; /**< 4/14.9.12 - last access to any stream of file prior to recording file entry */ udf_timestamp_t modification_time; /**< 4/14.9.13 - last access to modification to any stream of file */ udf_timestamp_t attribute_time; udf_Uint32_t checkpoint; udf_long_ad_t ext_attr_ICB; udf_regid_t imp_id; udf_Uint64_t unique_ID; udf_Uint32_t u_extended_attr; udf_Uint32_t u_alloc_descs; /* The following union allows file entry reuse without worrying about overflows, by ensuring the struct is always the maximum possible size allowed by the specs: one UDF block. */ union { udf_Uint8_t ext_attr[0]; udf_Uint8_t alloc_descs[0]; udf_Uint8_t pad_to_one_block[2048-176]; } u; } GNUC_PACKED; typedef struct udf_file_entry_s udf_file_entry_t; #define UDF_FENTRY_SIZE 176 #define UDF_FENTRY_PERM_USER_MASK 0x07 #define UDF_FENTRY_PERM_GRP_MASK 0xE0 #define UDF_FENTRY_PERM_OWNER_MASK 0x1C00 /** Permissions (ECMA 167r3 4/14.9.5) */ #define FE_PERM_O_EXEC 0x00000001U #define FE_PERM_O_WRITE 0x00000002U #define FE_PERM_O_READ 0x00000004U #define FE_PERM_O_CHATTR 0x00000008U #define FE_PERM_O_DELETE 0x00000010U #define FE_PERM_G_EXEC 0x00000020U #define FE_PERM_G_WRITE 0x00000040U #define FE_PERM_G_READ 0x00000080U #define FE_PERM_G_CHATTR 0x00000100U #define FE_PERM_G_DELETE 0x00000200U #define FE_PERM_U_EXEC 0x00000400U #define FE_PERM_U_WRITE 0x00000800U #define FE_PERM_U_READ 0x00001000U #define FE_PERM_U_CHATTR 0x00002000U #define FE_PERM_U_DELETE 0x00004000U /** Record Format (ECMA 167r3 4/14.9.7) */ #define FE_RECORD_FMT_UNDEF 0x00 #define FE_RECORD_FMT_FIXED_PAD 0x01 #define FE_RECORD_FMT_FIXED 0x02 #define FE_RECORD_FMT_VARIABLE8 0x03 #define FE_RECORD_FMT_VARIABLE16 0x04 #define FE_RECORD_FMT_VARIABLE16_MSB 0x05 #define FE_RECORD_FMT_VARIABLE32 0x06 #define FE_RECORD_FMT_PRINT 0x07 #define FE_RECORD_FMT_LF 0x08 #define FE_RECORD_FMT_CR 0x09 #define FE_RECORD_FMT_CRLF 0x0A #define FE_RECORD_FMT_LFCR 0x0B /** Record Display Attributes (ECMA 167r3 4/14.9.8) */ #define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00 #define FE_RECORD_DISPLAY_ATTR_1 0x01 #define FE_RECORD_DISPLAY_ATTR_2 0x02 #define FE_RECORD_DISPLAY_ATTR_3 0x03 /** Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */ struct extended_attr_header_desc_s { udf_tag_t tag; udf_Uint32_t imp_attr_location; udf_Uint32_t app_attr_location; } GNUC_PACKED; /** Generic Format (ECMA 167r3 4/14.10.2) */ struct generic_format_s { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint8_t attrData[0]; } GNUC_PACKED; /** Character Set Information (ECMA 167r3 4/14.10.3) */ struct charSet_info_s { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint32_t escapeSeqLength; udf_Uint8_t charSetType; udf_Uint8_t escapeSeq[0]; } GNUC_PACKED; /* Alternate Permissions (ECMA 167r3 4/14.10.4) */ struct alt_perms_s { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint16_t owner_id; udf_Uint16_t group_id; udf_Uint16_t permission; } GNUC_PACKED; /** File Times Extended Attribute (ECMA 167r3 4/14.10.5) */ struct filetimes_ext_attr_s { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint32_t dataLength; udf_Uint32_t fileTimeExistence; udf_Uint8_t fileTimes; } GNUC_PACKED; /** FileTimeExistence (ECMA 167r3 4/14.10.5.6) */ #define FTE_CREATION 0x00000001 #define FTE_DELETION 0x00000004 #define FTE_EFFECTIVE 0x00000008 #define FTE_BACKUP 0x00000002 /** Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */ struct infoTimesExtAttr { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint32_t dataLength; udf_Uint32_t infoTimeExistence; udf_Uint8_t infoTimes[0]; } GNUC_PACKED; /** Device Specification (ECMA 167r3 4/14.10.7) */ struct deviceSpec { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint32_t imp_useLength; udf_Uint32_t majorDevice_id; udf_Uint32_t minorDevice_id; udf_Uint8_t imp_use[0]; } GNUC_PACKED; /** Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */ struct impUseExtAttr { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint32_t imp_useLength; udf_regid_t imp_id; udf_Uint8_t imp_use[0]; } GNUC_PACKED; /** Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */ struct appUseExtAttr { udf_Uint32_t attr_type; udf_Uint8_t attr_subtype; udf_Uint8_t reserved[3]; udf_Uint32_t attrLength; udf_Uint32_t appUseLength; udf_regid_t app_id; udf_Uint8_t appUse[0]; } GNUC_PACKED; #define EXTATTR_CHAR_SET 1 #define EXTATTR_ALT_PERMS 3 #define EXTATTR_FILE_TIMES 5 #define EXTATTR_INFO_TIMES 6 #define EXTATTR_DEV_SPEC 12 #define EXTATTR_IMP_USE 2048 #define EXTATTR_APP_USE 65536 /** Unallocated Space Entry (ECMA 167r3 4/14.11) */ struct unallocSpaceEntry { udf_tag_t tag; udf_icbtag_t icb_tag; udf_Uint32_t lengthAllocDescs; udf_Uint8_t allocDescs[0]; } GNUC_PACKED; /** Space Bitmap Descriptor (ECMA 167r3 4/14.12) */ struct spaceBitmapDesc { udf_tag_t tag; udf_Uint32_t i_bits; udf_Uint32_t i_bytes; udf_Uint8_t bitmap[0]; } GNUC_PACKED; /** Partition Integrity Entry (ECMA 167r3 4/14.13) */ struct partitionIntegrityEntry { udf_tag_t tag; udf_icbtag_t icb_tag; udf_timestamp_t recording_time; udf_Uint8_t integrityType; udf_Uint8_t reserved[175]; udf_regid_t imp_id; udf_Uint8_t imp_use[256]; } GNUC_PACKED; /** Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ /** Extent Length (ECMA 167r3 4/14.14.1.1) */ #define EXT_RECORDED_ALLOCATED 0x00000000 #define EXT_NOT_RECORDED_ALLOCATED 0x40000000 #define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000 #define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000 /** Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ /** Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */ /** Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */ struct logical_vol_header_desc_s { udf_Uint64_t uniqueID; udf_Uint8_t reserved[24]; } GNUC_PACKED; typedef struct logical_vol_header_desc_s logical_vol_header_desc_t; /** Path Component (ECMA 167r3 4/14.16.1) */ struct pathComponent { udf_Uint8_t component_type; udf_Uint8_t lengthComponent_id; udf_Uint16_t componentFileVersionNum; udf_dstring component_id[0]; } GNUC_PACKED; /** File Entry (ECMA 167r3 4/14.17) */ struct extended_file_entry { udf_tag_t tag; /**< 4/14.17.1 - id = 266 */ udf_icbtag_t icb_tag; /**< 4/14.17.2 & 4/14.9.2 */ udf_Uint32_t uid; /**< 4/14.17.3 & 4/14.9.3 */ udf_Uint32_t gid; /**< 4/14.17.4 & 4/14.9.4 */ udf_Uint32_t permissions; /**< 4/14.17.5 & 4/14.9.5 */ udf_Uint16_t link_count; /**< 4/14.17.6 & 4/14.9.6 */ udf_Uint8_t rec_format; /**< 4/14.17.7 & 4/14.9.7 */ udf_Uint8_t rec_display_attr; /**< 4/14.17.8 & 4/14.9.8 */ udf_Uint32_t record_len; /**< 4/14.17.9 & 4/14.9.9 */ udf_Uint64_t info_len; /**< 4/14.17.10 & 4/14.9.10 */ udf_Uint64_t object_size; /**< 4/14.17.11 */ udf_Uint64_t logblks_recorded; /**< 4/14.17.12 & 4/14.9.11 */ udf_timestamp_t access_time; /**< 4/14.17.13 & 4/14.9.12 - last access to any stream of file */ udf_timestamp_t modification_time; /**< 4/14.17.14 & 4/14.9.13 - last modification to any stream of file*/ udf_timestamp_t create_time; /**< 4/14.17.15 */ udf_timestamp_t attribute_time; /**< 4/14.17.16 & 4/14.9.14 - most recent create or modify time */ udf_Uint32_t checkpoint; udf_Uint32_t reserved; /**< #00 bytes */ udf_long_ad_t ext_attr_ICB; udf_long_ad_t stream_directory_ICB; udf_regid_t imp_id; udf_Uint64_t unique_ID; udf_Uint32_t length_extended_attr; udf_Uint32_t length_alloc_descs; union { /* MSVC workaround for multiple zero sized arrays */ udf_Uint8_t ext_attr[0]; udf_Uint8_t alloc_descs[0]; udf_Uint8_t pad_to_one_block[2048-216]; } u; } GNUC_PACKED; PRAGMA_END_PACKED /** The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one refer to the enumeration value names in the typedefs above in a debugger and in debugger expressions. */ extern tag_id_t debug_tagid; extern file_characteristics_t debug_file_characteristics; extern icbtag_file_type_enum_t debug_icbtag_file_type_enum; extern icbtag_flag_enum_t debug_flag_enum; extern ecma_167_enum1_t debug_ecma_167_enum1; extern ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; #endif /* CDIO_ECMA_167_H */ libcdio-2.2.0/include/cdio/iso9660.h000066400000000000000000001507111474051130400167550ustar00rootroot00000000000000/* Copyright (C) 2003-2008, 2012-2013, 2017, 2023-2024 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel See also iso9660.h by Eric Youngdale (1993). Copyright 1993 Yggdrasil Computing, Incorporated 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file iso9660.h * * \brief The top-level interface header for libiso9660: the ISO-9660 * filesystem library; applications include this. * * See also the ISO-9660 specification. The freely available European * equivalent standard is called ECMA-119. */ #ifndef CDIO_ISO9660_H_ #define CDIO_ISO9660_H_ #include #include #include #include /** \brief ISO 9660 Integer and Character types These are described in the section 7 of the ISO 9660 (or ECMA 119) specification. */ typedef uint8_t iso711_t; /*! See section 7.1.1 */ typedef int8_t iso712_t; /*! See section 7.1.2 */ typedef uint16_t iso721_t; /*! See section 7.2.1 */ typedef uint16_t iso722_t; /*! See section 7.2.2 */ typedef uint32_t iso723_t; /*! See section 7.2.3 */ typedef uint32_t iso731_t; /*! See section 7.3.1 */ typedef uint32_t iso732_t; /*! See section 7.3.2 */ typedef uint64_t iso733_t; /*! See section 7.3.3 */ typedef char achar_t; /*! See section 7.4.1 */ typedef char dchar_t; /*! See section 7.4.1 */ #ifndef EMPTY_ARRAY_SIZE #define EMPTY_ARRAY_SIZE 0 #endif #include #include #ifdef ISODCL #undef ISODCL #endif /* This part borrowed from the bsd386 isofs */ #define ISODCL(from, to) ((to) - (from) + 1) #define MIN_TRACK_SIZE 4*75 #define MIN_ISO_SIZE MIN_TRACK_SIZE /*! The below isn't really an enumeration one would really use in a program; things are done this way so that in a debugger one can to refer to the enumeration value names such as in a debugger expression and get something. With the more common a \#define mechanism, the name/value association is lost at run time. */ extern enum iso_enum1_s { ISO_PVD_SECTOR = 16, /**< Sector of Primary Volume Descriptor. */ ISO_EVD_SECTOR = 17, /**< Sector of End Volume Descriptor. */ LEN_ISONAME = 31, /**< Size in bytes of the filename portion + null byte. */ ISO_MAX_SYSTEM_ID = 32, /**< Maximum number of characters in a system id. */ MAX_ISONAME = 37, /**< Size in bytes of the filename portion + null byte. */ ISO_MAX_PREPARER_ID = 128, /**< Maximum number of characters in a preparer id. */ MAX_ISOPATHNAME = 255, /**< Maximum number of characters in the entire ISO 9660 filename. */ ISO_BLOCKSIZE = 2048 /**< Number of bytes in an ISO 9660 block. */ } iso_enums1; /*! An enumeration for some of the ISO_* \#defines below. This isn't really an enumeration one would really use in a program it is here to be helpful in debuggers where wants just to refer to the ISO_*_ names and get something. */ /*! ISO 9660 directory flags. */ extern enum iso_flag_enum_s { ISO_FILE = 0, /**< Not really a flag... */ ISO_EXISTENCE = 1, /**< Do not make existence known (hidden) */ ISO_DIRECTORY = 2, /**< This file is a directory */ ISO_ASSOCIATED = 4, /**< This file is an associated file */ ISO_RECORD = 8, /**< Record format in extended attr. != 0 */ ISO_PROTECTION = 16, /**< No read/execute perm. in ext. attr. */ ISO_DRESERVED1 = 32, /**<, Reserved bit 5 */ ISO_DRESERVED2 = 64, /**<, Reserved bit 6 */ ISO_MULTIEXTENT = 128, /**< Not final entry of a mult. ext. file */ } iso_flag_enums; /*! Volume descriptor types */ extern enum iso_vd_enum_s { ISO_VD_BOOT_RECORD = 0, /**< CD is bootable */ ISO_VD_PRIMARY = 1, /**< Is in any ISO-9660 */ ISO_VD_SUPPLEMENTARY = 2, /**< Used by Joliet, for example */ ISO_VD_PARITION = 3, /**< Indicates a partition of a CD */ ISO_VD_END = 255 } iso_vd_enums; /*! An ISO filename is: abcd.eee -> filename.ext;version# For ISO-9660 Level 1, the maximum needed string length is: @code 30 chars (filename + ext) + 2 chars ('.' + ';') + 5 chars (strlen("32767")) + 1 null byte ================================ = 38 chars @endcode */ /*! \brief Maximum number of characters in a publisher id. */ #define ISO_MAX_PUBLISHER_ID 128 /*! \brief Maximum number of characters in an application id. */ #define ISO_MAX_APPLICATION_ID 128 /*! \brief Maximum number of characters in a volume id. */ #define ISO_MAX_VOLUME_ID 32 /*! \brief Maximum number of characters in a volume-set id. */ #define ISO_MAX_VOLUMESET_ID 128 /*! String inside frame which identifies an ISO 9660 filesystem. This string is the "id" field of an iso9660_pvd_t or an iso9660_svd_t. */ extern const char ISO_STANDARD_ID[sizeof("CD001")-1]; #define ISO_STANDARD_ID "CD001" #define CDIO_EXTENT_BLOCKS(size) ((size + (ISO_BLOCKSIZE - 1)) / ISO_BLOCKSIZE) #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef enum strncpy_pad_check { ISO9660_NOCHECK = 0, ISO9660_7BIT, ISO9660_ACHARS, ISO9660_DCHARS } strncpy_pad_check_t; PRAGMA_BEGIN_PACKED /*! \brief ISO-9660 shorter-format time structure. See ECMA 9.1.5. @see iso9660_dtime */ struct iso9660_dtime_s { iso711_t dt_year; /**< Number of years since 1900 */ iso711_t dt_month; /**< Has value in range 1..12. Note starts at 1, not 0 like a tm struct. */ iso711_t dt_day; /**< Day of the month from 1 to 31 */ iso711_t dt_hour; /**< Hour of the day from 0 to 23 */ iso711_t dt_minute; /**< Minute of the hour from 0 to 59 */ iso711_t dt_second; /**< Second of the minute from 0 to 59 */ iso712_t dt_gmtoff; /**< GMT values -48 .. + 52 in 15 minute intervals */ } GNUC_PACKED; typedef struct iso9660_dtime_s iso9660_dtime_t; /*! \brief ISO-9660 longer-format time structure. Section 8.4.26.1 of ECMA 119. All values are encoded as character arrays, eg. '1', '9', '5', '5' for the year 1955 (no null terminated byte). @see iso9660_ltime */ struct iso9660_ltime_s { char lt_year [ISODCL( 1, 4)]; /**< Add 1900 to value for the Julian year */ char lt_month [ISODCL( 5, 6)]; /**< Has value in range 1..12. Note starts at 1, not 0 like a tm struct. */ char lt_day [ISODCL( 7, 8)]; /**< Day of month: 1..31 */ char lt_hour [ISODCL( 9, 10)]; /**< hour: 0..23 */ char lt_minute [ISODCL( 11, 12)]; /**< minute: 0..59 */ char lt_second [ISODCL( 13, 14)]; /**< second: 0..59 */ char lt_hsecond [ISODCL( 15, 16)]; /**< The value is in units of 1/100's of a second */ iso712_t lt_gmtoff; /**< Offset from Greenwich Mean Time in number of 15 min intervals from -48 (West) to +52 (East) recorded according to 7.1.2 numerical value */ } GNUC_PACKED; typedef struct iso9660_ltime_s iso9660_ltime_t; typedef struct iso9660_dir_s iso9660_dir_t; typedef struct iso9660_stat_s iso9660_stat_t; #include /*! \brief Format of an ISO-9660 directory record Section 9.1 of ECMA 119. This structure may have an odd length depending on how many characters there are in the filename! Some compilers (e.g. on Sun3/mc68020) pad the structures to an even length. For this reason, we cannot use sizeof (struct iso_path_table) or sizeof (struct iso_directory_record) to compute on disk sizes. Instead, we use offsetof(..., name) and add the name size. See mkisofs.h of the cdrtools package. @see iso9660_stat */ struct iso9660_dir_s { iso711_t length; /*! Length of Directory record (9.1.1) */ iso711_t xa_length; /*! XA length if XA is used. Otherwise zero. (9.1.2) */ iso733_t extent; /*! LBA of first local block allocated to the extent */ iso733_t size; /*! data length of File Section. This does not include the length of any XA Records. (9.1.2) */ iso9660_dtime_t recording_time; /*! Recording date and time (9.1.3) */ uint8_t file_flags; /*! If no XA then zero. If a directory, then bits 2,3 and 7 are zero. (9.1.6) */ iso711_t file_unit_size; /*! File Unit size for the File Section if the File Section is recorded in interleaved mode. Otherwise zero. (9.1.7) */ iso711_t interleave_gap; /*! Interleave Gap size for the File Section if the File Section is interleaved. Otherwise zero. (9.1.8) */ iso723_t volume_sequence_number; /*! Ordinal number of the volume in the Volume Set on which the Extent described by this Directory Record is recorded. (9.1.9) */ /*! MSVC compilers cannot handle a zero sized array in the middle of a struct, and iso9660_dir_s is reused within iso9660_pvd_s. Therefore, instead of defining: iso711_t filename_len; char filename[]; we leverage the fact that iso711_t and char are the same size and use an union. The only gotcha is that the actual string payload of filename.str[] starts at 1, not 0. */ union { iso711_t len; char str[1]; } filename; } GNUC_PACKED; /*! \brief ISO-9660 Primary Volume Descriptor. */ struct iso9660_pvd_s { iso711_t type; /**< ISO_VD_PRIMARY - 1 */ char id[5]; /**< ISO_STANDARD_ID "CD001" */ iso711_t version; /**< value 1 for ECMA 119 */ char unused1[1]; /**< unused - value 0 */ achar_t system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */ dchar_t volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */ uint8_t unused2[8]; /**< unused - value 0 */ iso733_t volume_space_size; /**< total number of sectors */ uint8_t unused3[32]; /**< unused - value 0 */ iso723_t volume_set_size; /**< often 1 */ iso723_t volume_sequence_number; /**< often 1 */ iso723_t logical_block_size; /**< sector size, e.g. 2048 */ iso733_t path_table_size; /**< bytes in path table */ iso731_t type_l_path_table; /**< first sector of L Path Table */ iso731_t opt_type_l_path_table; /**< first sector of optional L Path Table */ iso732_t type_m_path_table; /**< first sector of M Path table */ iso732_t opt_type_m_path_table; /**< first sector of optional M Path table */ iso9660_dir_t root_directory_record; /**< See 8.4.18 and section 9.1 of ISO 9660 spec. */ char root_directory_filename; /**< Is '\\0' or root directory. Also pads previous field to 34 bytes */ dchar_t volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< Volume Set of which the volume is a member. See section 8.4.19 */ achar_t publisher_id[ISO_MAX_PUBLISHER_ID]; /**< Publisher of volume. If the first character is '_' 0x5F, the remaining bytes specify a file containing the user. If all bytes are " " (0x20) no publisher is specified. See section 8.4.20 of ECMA 119 */ achar_t preparer_id[ISO_MAX_PREPARER_ID]; /**< preparer of volume. If the first character is '_' 0x5F, the remaining bytes specify a file containing the user. If all bytes are " " (0x20) no preparer is specified. See section 8.4.21 of ECMA 119 */ achar_t application_id[ISO_MAX_APPLICATION_ID]; /**< application use to create the volume. If the first character is '_' 0x5F, the remaining bytes specify a file containing the user. If all bytes are " " (0x20) no application is specified. See section of 8.4.22 of ECMA 119 */ dchar_t copyright_file_id[37]; /**< Name of file for copyright info. If all bytes are " " (0x20), then no file is identified. See section 8.4.23 of ECMA 119 9660 spec. */ dchar_t abstract_file_id[37]; /**< See section 8.4.24 of ECMA 119. */ dchar_t bibliographic_file_id[37]; /**< See section 7.5 of ISO 9660 spec. */ iso9660_ltime_t creation_date; /**< date and time of volume creation. See section 8.4.26.1 of the ISO 9660 spec. */ iso9660_ltime_t modification_date; /**< date and time of the most recent modification. See section 8.4.27 of the ISO 9660 spec. */ iso9660_ltime_t expiration_date; /**< date and time when volume expires. See section 8.4.28 of the ISO 9660 spec. */ iso9660_ltime_t effective_date; /**< date and time when volume is effective. See section 8.4.29 of the ISO 9660 spec. */ iso711_t file_structure_version; /**< value 1 for ECMA 119 */ uint8_t unused4[1]; /**< unused - value 0 */ char application_data[512]; /**< Application can put whatever it wants here. */ uint8_t unused5[653]; /**< Unused - value 0 */ } GNUC_PACKED; typedef struct iso9660_pvd_s iso9660_pvd_t; /*! \brief ISO-9660 Supplementary Volume Descriptor. This is used for Joliet Extensions and is almost the same as the the primary descriptor but two unused fields, "unused1" and "unused3 become "flags and "escape_sequences" respectively. */ struct iso9660_svd_s { iso711_t type; /**< ISO_VD_SUPPLEMENTARY - 2 */ char id[5]; /**< ISO_STANDARD_ID "CD001" */ iso711_t version; /**< value 1 */ char flags; /**< Section 8.5.3 */ achar_t system_id[ISO_MAX_SYSTEM_ID]; /**< Section 8.5.4; each char is an achar */ dchar_t volume_id[ISO_MAX_VOLUME_ID]; /**< Section 8.5.5; each char is a dchar */ char unused2[8]; iso733_t volume_space_size; /**< total number of sectors */ char escape_sequences[32]; /**< Section 8.5.6 */ iso723_t volume_set_size; /**< often 1 */ iso723_t volume_sequence_number; /**< often 1 */ iso723_t logical_block_size; /**< sector size, e.g. 2048 */ iso733_t path_table_size; /**< 8.5.7; bytes in path table */ iso731_t type_l_path_table; /**< 8.5.8; first sector of little-endian path table */ iso731_t opt_type_l_path_table; /**< 8.5.9; first sector of optional little-endian path table */ iso732_t type_m_path_table; /**< 8.5.10; first sector of big-endian path table */ iso732_t opt_type_m_path_table; /**< 8.5.11; first sector of optional big-endian path table */ iso9660_dir_t root_directory_record; /**< See section 8.5.12 and 9.1 of ISO 9660 spec. */ char root_directory_filename; /**< Is '\\0' or root directory. Also pads previous field to 34 bytes */ dchar_t volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< 8.5.13; dchars */ achar_t publisher_id[ISO_MAX_PUBLISHER_ID]; /**< Publisher of volume. If the first char- aracter is '_' 0x5F, the remaining bytes specify a file containing the user. If all bytes are " " (0x20) no publisher is specified. See section 8.5.14 of ECMA 119 */ achar_t preparer_id[ISO_MAX_PREPARER_ID]; /**< Data preparer of volume. If the first character is '_' 0x5F, the remaining bytes specify a file containing the user. If all bytes are " " (0x20) no preparer is specified. See section 8.5.15 of ECMA 119 */ achar_t application_id[ISO_MAX_APPLICATION_ID]; /**< application use to create the volume. If the first character is '_' 0x5F, the remaining bytes specify a file containing the user. If all bytes are " " (0x20) no application is specified. See section of 8.5.16 of ECMA 119 */ dchar_t copyright_file_id[37]; /**< Name of file for copyright info. If all bytes are " " (0x20), then no file is identified. See section 8.5.17 of ECMA 119 9660 spec. */ dchar_t abstract_file_id[37]; /**< See section 8.5.18 of ECMA 119. */ dchar_t bibliographic_file_id[37]; /**< See section 8.5.19 of ECMA 119. */ iso9660_ltime_t creation_date; /**< date and time of volume creation. See section 8.4.26.1 of the ECMA 119 spec. */ iso9660_ltime_t modification_date; /**< date and time of the most recent modification. See section 8.4.27 of the ECMA 119 spec. */ iso9660_ltime_t expiration_date; /**< date and time when volume expires. See section 8.4.28 of the ECMA 119 spec. */ iso9660_ltime_t effective_date; /**< date and time when volume is effective. See section 8.4.29 of the ECMA 119 spec. */ iso711_t file_structure_version; /**< value 1 for ECMA 119 */ uint8_t unused4[1]; /**< unused - value 0 */ char application_data[512]; /**< 8.5.20 Application can put whatever it wants here. */ uint8_t unused5[653]; /**< Unused - value 0 */ } GNUC_PACKED; typedef struct iso9660_svd_s iso9660_svd_t; PRAGMA_END_PACKED /*! \brief A data type for a list of ISO9660 statbuf file pointers returned from the various Cdio iso9660 readdir routines. */ typedef CdioList_t CdioISO9660FileList_t; /*! \brief A data type for a list of ISO9660 statbuf drectory pointer returned from the variious Cdio iso9660 readdir routines. */ typedef CdioList_t CdioISO9660DirList_t; /*! \brief Unix stat-like version of iso9660_dir The iso9660_stat structure is not part of the ISO-9660 specification. We use it for our to communicate information in a C-library friendly way, e.g struct tm time structures and a C-style filename string. @see iso9660_dir */ struct iso9660_stat_s { /* big endian!! */ iso_rock_statbuf_t rr; /**< Rock Ridge-specific fields */ struct tm tm; /**< time on entry - FIXME merge with one of entries above, like ctime? */ lsn_t lsn; /**< start logical sector number */ #ifndef DO_NOT_WANT_COMPATIBILITY /* *** Deprecated Legacy API *** Use .total_size and CDIO_EXTENT_BLOCKS. */ uint32_t size; /**< size of the first extent, in bytes */ uint32_t secsize; /**< size of the first extent, in sectors */ #endif /* DO_NOT_WANT_COMPATIBILITY */ /* Multi-extent aware size, in bytes. It is guaranteed that the bytes are stored as gapless string in a contiguous sequence of blocks. I.e. they can be read sequentially starting at iso9660_stat_s.lsn. Data files which do not fulfil this promise cause a warning message and are not represented by this type of struct. (Directories are not allowed to have more than one extent and thus cannot legally break the promise.) */ uint64_t total_size; /* NB: If you need to access the 'secsize' equivalent for an extent, * you should use CDIO_EXTENT_BLOCKS(iso9660_stat_s.total_size) */ iso9660_xa_t xa; /**< XA attributes */ enum { _STAT_FILE = 1, _STAT_DIR = 2 } type; bool b_xa; char filename[EMPTY_ARRAY_SIZE]; /**< filename */ }; /** A mask used in iso9660_ifs_read_vd which allows what kinds of extensions we allow, eg. Joliet, Rock Ridge, etc. */ typedef uint8_t iso_extension_mask_t; /*! An enumeration for some of the ISO_EXTENSION_* \#defines below. This isn't really an enumeration one would really use in a program it is here to be helpful in debuggers where wants just to refer to the ISO_EXTENSION_*_ names and get something. */ extern enum iso_extension_enum_s { ISO_EXTENSION_JOLIET_LEVEL1 = 0x01, ISO_EXTENSION_JOLIET_LEVEL2 = 0x02, ISO_EXTENSION_JOLIET_LEVEL3 = 0x04, ISO_EXTENSION_ROCK_RIDGE = 0x08, ISO_EXTENSION_HIGH_SIERRA = 0x10 } iso_extension_enums; #define ISO_EXTENSION_ALL 0xFF #define ISO_EXTENSION_NONE 0x00 #define ISO_EXTENSION_JOLIET \ (ISO_EXTENSION_JOLIET_LEVEL1 | \ ISO_EXTENSION_JOLIET_LEVEL2 | \ ISO_EXTENSION_JOLIET_LEVEL3 ) /** This is an opaque structure. */ typedef struct _iso9660_s iso9660_t; /*! Close previously opened ISO 9660 image and free resources associated with the image. Call this when done using using an ISO 9660 image. @param p_iso the ISO-9660 file image to get data from @return true is unconditionally returned. If there was an error false would be returned. Resources associated with p_iso are freed. */ bool iso9660_close (iso9660_t * p_iso); /*! Open an ISO 9660 image for reading. Maybe in the future we will have a mode. NULL is returned on error. @param psz_path full path of ISO9660 file. @return a IS9660 structure is unconditionally returned. The caller should call iso9660_close() when done. */ iso9660_t *iso9660_open (const char *psz_path /*flags, mode */); /*! Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. NULL is returned on error. @see iso9660_open_fuzzy */ iso9660_t *iso9660_open_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask); /*! Open an ISO 9660 image for "fuzzy" reading. This means that we will try to guess various internal offset based on internal checks. This may be useful when trying to read an ISO 9660 image contained in a file format that libiso9660 doesn't know natively (or knows imperfectly.) Some tolerance allowed for positioning the ISO 9660 image. We scan for STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. NULL is returned on error. @see iso9660_open, @see iso9660_fuzzy_ext */ iso9660_t *iso9660_open_fuzzy (const char *psz_path /*flags, mode */, uint16_t i_fuzz); /*! Open an ISO 9660 image for reading with some tolerance for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. NULL is returned on error. @see iso9660_open_ext @see iso9660_open_fuzzy */ iso9660_t *iso9660_open_fuzzy_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz /*flags, mode */); /*! Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. */ bool iso9660_ifs_fuzzy_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz); /*! Seek to a position and then read i_size blocks. @param p_iso the ISO-9660 file image to get data from @param ptr place to put returned data. It should be able to store a least i_size bytes @param start location to start reading from @param i_size number of blocks to read. Each block is ISO_BLOCKSIZE bytes long. @return number of bytes (not blocks) read */ long int iso9660_iso_seek_read (const iso9660_t *p_iso, /*out*/ void *ptr, lsn_t start, long int i_size); /*! Read the Primary Volume Descriptor for a CD. True is returned if read, and false if there was an error. */ bool iso9660_fs_read_pvd ( const CdIo_t *p_cdio, /*out*/ iso9660_pvd_t *p_pvd ); /*! Read the Primary Volume Descriptor for an ISO 9660 image. True is returned if read, and false if there was an error. */ bool iso9660_ifs_read_pvd (const iso9660_t *p_iso, /*out*/ iso9660_pvd_t *p_pvd); /*! Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ bool iso9660_fs_read_superblock (CdIo_t *p_cdio, iso_extension_mask_t iso_extension_mask); /*! Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ bool iso9660_ifs_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask); /*==================================================== Time conversion ====================================================*/ /*! Set time in format used in ISO 9660 directory index record from a Unix time structure. */ void iso9660_set_dtime (const struct tm *tm, /*out*/ iso9660_dtime_t *idr_date); /*! Set time in format used in ISO 9660 directory index record from a Unix time structure. timezone is given as an offset correction in minutes. */ void iso9660_set_dtime_with_timezone (const struct tm *p_tm, int timezone, /*out*/ iso9660_dtime_t *p_idr_date); /*! Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. */ void iso9660_set_ltime (const struct tm *_tm, /*out*/ iso9660_ltime_t *p_pvd_date); /*! Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. */ void iso9660_set_ltime_with_timezone (const struct tm *_tm, int timezone, /*out*/ iso9660_ltime_t *p_pvd_date); /*! Get Unix time structure from format use in an ISO 9660 directory index record. Even though tm_wday and tm_yday fields are not explicitly in idr_date, they are calculated from the other fields. If tm is to reflect the localtime, set "b_localtime" true, otherwise tm will reported in GMT. */ bool iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime, /*out*/ struct tm *p_tm); /*! Get "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. */ bool iso9660_get_ltime (const iso9660_ltime_t *p_ldate, /*out*/ struct tm *p_tm); /*==================================================== Character Classification and String Manipulation ====================================================*/ /*! Return true if c is a DCHAR - a character that can appear in an an ISO-9600 level 1 directory name. These are the ASCII capital letters A-Z, the digits 0-9 and an underscore. */ bool iso9660_is_dchar (int c); /*! Return true if c is an ACHAR - These are the DCHAR's plus some ASCII symbols including the space symbol. */ bool iso9660_is_achar (int c); /*! Convert an ISO-9660 file name which is in the format usually stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @return length of the translated string is returned. */ int iso9660_name_translate(const char *psz_oldname, /*out*/ char *psz_newname); /*! Convert an ISO-9660 file name which is in the format usually stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @param i_joliet_level 0 if not using Joliet Extension. Otherwise the Joliet level. @return length of the translated string is returned. It will be no greater than the length of psz_oldname. */ int iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname, uint8_t i_joliet_level); /*! Pad string src with spaces to size len and copy this to dst. If len is less than the length of src, dst will be truncated to the first len characters of src. src can also be scanned to see if it contains only ACHARs, DCHARs, 7-bit ASCII chars depending on the enumeration _check. In addition to getting changed, dst is the return value. Note: this string might not be NULL terminated. */ char *iso9660_strncpy_pad(char dst[], const char src[], size_t len, enum strncpy_pad_check _check); /*===================================================================== File and Directory Names ======================================================================*/ /*! Check that psz_path is a valid ISO-9660 directory name. A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs. True is returned if psz_path is valid. */ bool iso9660_dirname_valid_p (const char psz_path[]); /*! Take psz_path and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followed by ";" and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version 1. The resulting ISO-9660 pathname is returned. */ char *iso9660_pathname_isofy (const char psz_path[], uint16_t i_version); /*! Check that psz_path is a valid ISO-9660 pathname. A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs. True is returned if psz_path is valid. */ bool iso9660_pathname_valid_p (const char psz_path[]); /*===================================================================== directory tree ======================================================================*/ void iso9660_dir_init_new (void *dir, uint32_t self, uint32_t ssize, uint32_t parent, uint32_t psize, const time_t *dir_time); void iso9660_dir_init_new_su (void *dir, uint32_t self, uint32_t ssize, const void *ssu_data, unsigned int ssu_size, uint32_t parent, uint32_t psize, const void *psu_data, unsigned int psu_size, const time_t *dir_time); void iso9660_dir_add_entry_su (void *dir, const char filename[], uint32_t extent, uint32_t size, uint8_t file_flags, const void *su_data, unsigned int su_size, const time_t *entry_time); unsigned int iso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len); /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @param p_cdio the CD object to read from @param i_lsn an lsn to find @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn); iso9660_stat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn); /*! Given a directory pointer, find the filesystem entry that contains LSN and return information about it. @param p_cdio the ISO-9660 file image to get data from. @param i_lsn the LSN to find @param ppsz_full_filename the place to store the name of the path that has LSN. On entry this should point to NULL. If not, the value will be freed. On exit a value is malloc'd and the caller is responsible for freeing the result. @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t *iso9660_fs_find_lsn_with_path(CdIo_t *p_cdio, lsn_t i_lsn, /*out*/ char **ppsz_full_filename); /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @param p_iso the ISO-9660 file image to get data from. @param i_lsn the LSN to find @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t *iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn); /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @param p_iso pointer to iso_t @param i_lsn LSN to find @param ppsz_path full path of lsn filename. On entry *ppsz_path should be NULL. On return it will be allocated an point to the full path of the file at lsn or NULL if the lsn is not found. You should deallocate *ppsz_path when you are done using it. @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t *iso9660_ifs_find_lsn_with_path(iso9660_t *p_iso, lsn_t i_lsn, /*out*/ char **ppsz_path); /*! Free the passed iso9660_stat_t structure. @param p_stat iso9660 stat buffer to free. */ void iso9660_stat_free(iso9660_stat_t *p_stat); /*! Return file status for psz_path. NULL is returned on error. @param p_cdio the CD object to read from @param psz_path filename path to look up and get information about @return ISO 9660 file information. The caller must free the returned result using iso9660_stat_free(). Important note: You make get different results looking up "/" versus "/." and the latter may give more complete information. "/" will take information from the PVD only, whereas "/." will force a directory read of "/" and find "." and in that Rock-Ridge information might be found which fills in more stat information. Ideally iso9660_fs_stat should be fixed. Patches anyone? */ iso9660_stat_t *iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[]); /*! Return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. @param p_cdio the CD object to read from @param psz_path filename path to look up and get information about @return ISO 9660 file information. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t *iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[]); /*! @param p_iso the ISO-9660 file image to get data from @param psz_path path the look up @return file status for pathname. NULL is returned on error. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t *iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[]); /*! @param p_iso the ISO-9660 file image to get data from @param psz_path filename path translate @return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[]); /*! Create a new data structure to hold a list of ISO9660 statbuf-entry pointers for the files inside a directory. @return allocated list. Free with iso9660_filelist_free() */ CdioISO9660FileList_t * iso9660_filelist_new(void); /*! Create a new data structure to hold a list of ISO9660 statbuf entries for directory pointers for the files inside a directory. @return allocated list. Free with iso9660_dirlist_free() */ CdioISO9660DirList_t * iso9660_dirlist_new(void); /*! Free the passed CdioISOC9660FileList_t structure. */ void iso9660_filelist_free(CdioISO9660FileList_t *p_filelist); /*! Free the passed CdioISOC9660Dirlist_t structure. */ void iso9660_dirlist_free(CdioISO9660DirList_t *p_filelist); /*! Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. @param p_cdio the CD object to read from @param psz_path path the read the directory from. @return file status for psz_path. The caller must free the The caller must free the returned result using iso9660_stat_free(). */ CdioList_t * iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]); /*! Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. @param p_iso the ISO-9660 file image to get data from @param psz_path path the read the directory from. @return file status for psz_path. The caller must free the The caller must free the returned result using iso9660_stat_free(). */ CdioList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]); /*! Return the PVD's application ID. @param p_pvd the PVD to get data from @return the application id. NULL is returned if there is some problem in getting this. The caller must free the resturned result using free() if not null. */ char * iso9660_get_application_id(iso9660_pvd_t *p_pvd); /*! Return the PVD's application ID. @param p_iso the ISO-9660 file image to get data from @param p_psz_app_id the application id set on success. NULL is returned if there is some problem in getting this. The caller must free the resturned result using free() if not null. */ bool iso9660_ifs_get_application_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_app_id); /*! Return the Joliet level recognized for p_iso. */ uint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso); uint8_t iso9660_get_dir_len(const iso9660_dir_t *p_idr); #ifdef FIXME uint8_t iso9660_get_dir_size(const iso9660_dir_t *p_idr); lsn_t iso9660_get_dir_extent(const iso9660_dir_t *p_idr); #endif /*! Return the directory name stored in the iso9660_dir_t A string is allocated: the caller must deallocate. This routine can return NULL if memory allocation fails. */ char * iso9660_dir_to_name (const iso9660_dir_t *p_iso9660_dir); /*! Returns a POSIX mode for a given p_iso_dirent. */ mode_t iso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent); /*! Return a string containing the preparer id with trailing blanks removed. */ char *iso9660_get_preparer_id(const iso9660_pvd_t *p_pvd); /*! Get the preparer ID. psz_preparer_id is set to NULL if there is some problem in getting this and false is returned. */ bool iso9660_ifs_get_preparer_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_preparer_id); /*! Return a string containing the PVD's publisher id with trailing blanks removed. */ char *iso9660_get_publisher_id(const iso9660_pvd_t *p_pvd); /*! Get the publisher ID. psz_publisher_id is set to NULL if there is some problem in getting this and false is returned. */ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_publisher_id); uint8_t iso9660_get_pvd_type(const iso9660_pvd_t *p_pvd); const char * iso9660_get_pvd_id(const iso9660_pvd_t *p_pvd); int iso9660_get_pvd_space_size(const iso9660_pvd_t *p_pvd); int iso9660_get_pvd_block_size(const iso9660_pvd_t *p_pvd) ; /*! Return the primary volume id version number (of pvd). If there is an error 0 is returned. */ int iso9660_get_pvd_version(const iso9660_pvd_t *pvd) ; /*! Return a string containing the PVD's system id with trailing blanks removed. */ char *iso9660_get_system_id(const iso9660_pvd_t *p_pvd); /*! Return "yup" if any file has Rock-Ridge extensions. Warning: this can be time consuming. On an ISO 9600 image with lots of files but no Rock-Ridge extensions, the entire directory structure will be scanned up to u_file_limit. @param p_iso the ISO-9660 file image to get data from @param u_file_limit the maximum number of (non-rock-ridge) files to consider before giving up and returning "dunno". "dunno" can also be returned if there was some error encountered such as not being able to allocate memory in processing. */ bool_3way_t iso9660_have_rr(iso9660_t *p_iso, uint64_t u_file_limit); /*! Get the system ID. psz_system_id is set to NULL if there is some problem in getting this and false is returned. */ bool iso9660_ifs_get_system_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_system_id); /*! Return the LSN of the root directory for pvd. If there is an error CDIO_INVALID_LSN is returned. */ lsn_t iso9660_get_root_lsn(const iso9660_pvd_t *p_pvd); /*! Get the volume ID in the PVD. psz_volume_id is set to NULL if there is some problem in getting this and false is returned. */ char *iso9660_get_volume_id(const iso9660_pvd_t *p_pvd); /*! Get the volume ID in the PVD. psz_volume_id is set to NULL if there is some problem in getting this and false is returned. */ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_volume_id); /*! Return the volumeset ID in the PVD. NULL is returned if there is some problem in getting this. */ char *iso9660_get_volumeset_id(const iso9660_pvd_t *p_pvd); /*! Get the volumeset ID. psz_systemset_id is set to NULL if there is some problem in getting this and false is returned. */ bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_volumeset_id); /* pathtable */ /*! Zero's out pathable. Do this first. */ void iso9660_pathtable_init (void *pt); unsigned int iso9660_pathtable_get_size (const void *pt); uint16_t iso9660_pathtable_l_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent); uint16_t iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent); /**===================================================================== Volume Descriptors ======================================================================*/ void iso9660_set_pvd (void *pd, const char volume_id[], const char application_id[], const char publisher_id[], const char preparer_id[], uint32_t iso_size, const void *root_dir, uint32_t path_table_l_extent, uint32_t path_table_m_extent, uint32_t path_table_size, const time_t *pvd_time); void iso9660_set_evd (void *pd); /*! Return true if ISO 9660 image has extended attributes (XA). */ bool iso9660_ifs_is_xa (const iso9660_t * p_iso); #ifndef DO_NOT_WANT_COMPATIBILITY /** For compatibility with < 0.77 */ #define iso9660_isdchar iso9660_is_dchar #define iso9660_isachar iso9660_is_achar #endif /*DO_NOT_WANT_COMPATIBILITY*/ #ifdef __cplusplus } #endif /* __cplusplus */ #undef ISODCL #endif /* CDIO_ISO9660_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/logging.h000066400000000000000000000075241474051130400172670ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file logging.h * \brief Header to control logging and level of detail of output. * */ #ifndef CDIO_LOGGING_H_ #define CDIO_LOGGING_H_ #include #ifdef __cplusplus extern "C" { #endif /** * The different log levels supported. */ typedef enum { CDIO_LOG_DEBUG = 1, /**< Debug-level messages - helps debug what's up. */ CDIO_LOG_INFO, /**< Informational - indicates perhaps something of interest. */ CDIO_LOG_WARN, /**< Warning conditions - something that looks funny. */ CDIO_LOG_ERROR, /**< Error conditions - may terminate program. */ CDIO_LOG_ASSERT /**< Critical conditions - may abort program. */ } cdio_log_level_t; /** * The place to save the preference concerning how much verbosity * is desired. This is used by the internal default log handler, but * it could be use by applications which provide their own log handler. */ extern cdio_log_level_t cdio_loglevel_default; /** * This type defines the signature of a log handler. For every * message being logged, the handler will receive the log level and * the message string. * * @see cdio_log_set_handler * @see cdio_log_level_t * * @param level The log level. * @param message The log message. */ typedef void (*cdio_log_handler_t) (cdio_log_level_t level, const char message[]); /** * The initial or default log handler in effect. * * @param level The log level. * @param message The log message. */ extern void cdio_default_log_handler(cdio_log_level_t level, const char message[]); /** * Set a custom log handler for libcdio. The return value is the log * handler being replaced. If the provided parameter is NULL, then * the handler will be reset to the default handler. * * @see cdio_log_handler_t * * @param new_handler The new log handler. * @return The previous log handler. */ cdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler); /** * Handle an message with the given log level. * * @see cdio_debug * @see cdio_info * @see cdio_warn * @see cdio_error * @param level The log level. * @param format printf-style format string * @param ... remaining arguments needed by format string */ void cdio_log (cdio_log_level_t level, const char format[], ...) GNUC_PRINTF(2, 3); /** * Handle a debugging message. * * @see cdio_log for a more generic routine */ void cdio_debug (const char format[], ...) GNUC_PRINTF(1,2); /** * Handle an informative message. * * @see cdio_log for a more generic routine */ void cdio_info (const char format[], ...) GNUC_PRINTF(1,2); /** * Handle a warning message. * * @see cdio_log for a more generic routine */ void cdio_warn (const char format[], ...) GNUC_PRINTF(1,2); /** * Handle an error message. Execution is terminated. * * @see cdio_log for a more generic routine. */ void cdio_error (const char format[], ...) GNUC_PRINTF(1,2); #ifdef __cplusplus } #endif #endif /* CDIO_LOGGING_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/memory.h000066400000000000000000000020441474051130400171410ustar00rootroot00000000000000/* Copyright (C) 2014 Robert Kausch 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file memory.h * * \brief memory management utility functions. * */ #ifndef CDIO_MEMORY_H_ #define CDIO_MEMORY_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! Free the passed pointer. */ void cdio_free(void *p_memory); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_MEMORY_H_ */ libcdio-2.2.0/include/cdio/mmc.h000066400000000000000000001067331474051130400164170ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 2016, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file mmc.h \brief Common definitions for MMC (Multimedia Commands). Applications include this for direct MMC access. The documents we make use of are described in several specifications made by the SCSI committee T10 http://www.t10.org. In particular, SCSI Primary Commands (SPC), SCSI Block Commands (SBC), and Multi-Media Commands (MMC). These documents generally have a numeric level number appended. For example SPC-3 refers to ``SCSI Primary Commands - 3'. In year 2010 the current versions were SPC-3, SBC-2, MMC-5. */ #ifndef CDIO_MMC_H_ #define CDIO_MMC_H_ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* On GNU/Linux see and */ #ifdef WORDS_BIGENDIAN # if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD) # define __MMC_BIG_ENDIAN_BITFIELD # endif #else # if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD) # define __MMC_LITTLE_ENDIAN_BITFIELD # endif #endif /** Structure of a SCSI/MMC sense reply. This has been adapted from GNU/Linux request_sense of include this for direct MMC access. See SCSI Primary Commands-2 (SPC-3) table 26 page 38. */ typedef struct cdio_mmc_request_sense { #if defined(__MMC_BIG_ENDIAN_BITFIELD) uint8_t valid : 1; /**< valid bit is 1 if info is valid */ uint8_t error_code : 7; #else uint8_t error_code : 7; uint8_t valid : 1; /**< valid bit is 1 if info is valid */ #endif uint8_t segment_number; #if defined(__MMC_BIG_ENDIAN_BITFIELD) uint8_t filemark : 1; /**< manditory in sequential * access devices */ uint8_t eom : 1; /**< end of medium. manditory in * sequential access and * printer devices */ uint8_t ili : 1; /**< incorrect length indicator */ uint8_t reserved1 : 1; uint8_t sense_key : 4; #else uint8_t sense_key : 4; uint8_t reserved1 : 1; uint8_t ili : 1; /**< incorrect length indicator */ uint8_t eom : 1; /**< end of medium. manditory in * sequential access and * printer devices */ uint8_t filemark : 1; /**< manditory in sequential * access devices */ #endif uint8_t information[4]; uint8_t additional_sense_len; /**< Additional sense length (n-7) */ uint8_t command_info[4]; /**< Command-specific information */ uint8_t asc; /**< Additional sense code */ uint8_t ascq; /**< Additional sense code qualifier */ uint8_t fruc; /**< Field replaceable unit code */ uint8_t sks[3]; /**< Sense-key specific */ uint8_t asb[46]; /**< Additional sense bytes */ } cdio_mmc_request_sense_t; /** Meanings of the values of mmc_request_sense.sense_key */ typedef enum { CDIO_MMC_SENSE_KEY_NO_SENSE = 0, CDIO_MMC_SENSE_KEY_RECOVERED_ERROR = 1, CDIO_MMC_SENSE_KEY_NOT_READY = 2, CDIO_MMC_SENSE_KEY_MEDIUM_ERROR = 3, CDIO_MMC_SENSE_KEY_HARDWARE_ERROR = 4, CDIO_MMC_SENSE_KEY_ILLEGAL_REQUEST = 5, CDIO_MMC_SENSE_KEY_UNIT_ATTENTION = 6, CDIO_MMC_SENSE_KEY_DATA_PROTECT = 7, CDIO_MMC_SENSE_KEY_BLANK_CHECK = 8, CDIO_MMC_SENSE_KEY_VENDOR_SPECIFIC = 9, CDIO_MMC_SENSE_KEY_COPY_ABORTED = 10, CDIO_MMC_SENSE_KEY_ABORTED_COMMAND = 11, CDIO_MMC_SENSE_KEY_OBSOLETE = 12, } cdio_mmc_sense_key_t; /** \brief The opcode-portion (generic packet commands) of an MMC command. In general, those opcodes that end in 6 take a 6-byte command descriptor, those that end in 10 take a 10-byte descriptor and those that in in 12 take a 12-byte descriptor. (Not that you need to know that, but it seems to be a big deal in the MMC specification.) */ typedef enum { CDIO_MMC_GPCMD_TEST_UNIT_READY = 0x00, /**< test if drive ready. */ CDIO_MMC_GPCMD_REQUEST_SENSE = 0x03, CDIO_MMC_GPCMD_FORMAT_UNIT = 0x04, CDIO_MMC_GPCMD_INQUIRY = 0x12, /**< Request drive information. */ CDIO_MMC_GPCMD_MODE_SELECT_6 = 0x15, /**< Select medium (6 bytes). */ CDIO_MMC_GPCMD_MODE_SENSE_6 = 0x1a, /**< Get medium or device information. Should be issued before MODE SELECT to get mode support or save current settings. (6 bytes). */ CDIO_MMC_GPCMD_START_STOP_UNIT = 0x1b, /**< Enable/disable Disc operations. (6 bytes). */ CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1e, /**< Enable/disable Disc removal. (6 bytes). */ /** Group 2 Commands (CDB's here are 10-bytes) */ CDIO_MMC_GPCMD_READ_FORMAT_CAPACITIES = 0x23, /**< MMC-5 Section 6.24 */ CDIO_MMC_GPCMD_READ_CAPACITIY = 0x25, /**< MMC-5 Section 6.19 */ CDIO_MMC_GPCMD_READ_10 = 0x28, /**< Read data from drive (10 bytes). */ CDIO_MMC_GPCMD_WRITE_10 = 0x2a, CDIO_MMC_GPCMD_SEEK_10 = 0x2b, CDIO_MMC_GPCMD_ERASE_10 = 0x2c, /**< MMC5 Section 6.4 */ CDIO_MMC_GPCMD_WRITE_AND_VERIFY_10 = 0x2e, CDIO_MMC_GPCMD_VERIFY_10 = 0x2f, CDIO_MMC_GPCMD_SYNCHRONIZE_CACHE = 0x35, CDIO_MMC_GPCMD_WRITE_BUFFER = 0x3b, CDIO_MMC_GPCMD_READ_BUFFER = 0x3c, CDIO_MMC_GPCMD_READ_SUBCHANNEL = 0x42, /**< Read Sub-Channel data. (10 bytes). */ CDIO_MMC_GPCMD_READ_TOC = 0x43, /**< READ TOC/PMA/ATIP. (10 bytes). */ CDIO_MMC_GPCMD_READ_HEADER = 0x44, CDIO_MMC_GPCMD_PLAY_AUDIO_10 = 0x45, /**< Begin audio playing at current position (10 bytes). */ CDIO_MMC_GPCMD_GET_CONFIGURATION = 0x46, /**< Get drive Capabilities (10 bytes) */ CDIO_MMC_GPCMD_PLAY_AUDIO_MSF = 0x47, /**< Begin audio playing at specified MSF (10 bytes). */ CDIO_MMC_GPCMD_PLAY_AUDIO_TI = 0x48, CDIO_MMC_GPCMD_PLAY_TRACK_REL_10 = 0x49, /**< Play audio at the track relative LBA. (10 bytes). Doesn't seem to be part of MMC standards but is handled by Plextor drives. */ CDIO_MMC_GPCMD_GET_EVENT_STATUS = 0x4a, /**< Report events and Status. */ CDIO_MMC_GPCMD_PAUSE_RESUME = 0x4b, /**< Stop or restart audio playback. (10 bytes). Used with a PLAY command. */ CDIO_MMC_GPCMD_READ_DISC_INFORMATION = 0x51, /**< Get CD information. (10 bytes). */ CDIO_MMC_GPCMD_READ_TRACK_INFORMATION = 0x52, /**< Information about a logical track. */ CDIO_MMC_GPCMD_RESERVE_TRACK = 0x53, CDIO_MMC_GPCMD_SEND_OPC_INFORMATION = 0x54, CDIO_MMC_GPCMD_MODE_SELECT_10 = 0x55, /**< Select medium (10-bytes). */ CDIO_MMC_GPCMD_REPAIR_TRACK = 0x58, CDIO_MMC_GPCMD_MODE_SENSE_10 = 0x5a, /**< Get medium or device information. Should be issued before MODE SELECT to get mode support or save current settings. (6 bytes). */ CDIO_MMC_GPCMD_CLOSE_TRACK_SESSION = 0x5b, CDIO_MMC_GPCMD_READ_BUFFER_CAPACITY = 0x5c, CDIO_MMC_GPCMD_SEND_CUE_SHEET = 0x5d, /** Group 5 Commands (CDB's here are 12-bytes) */ CDIO_MMC_GPCMD_REPORT_LUNS = 0xa0, CDIO_MMC_GPCMD_BLANK = 0xa1, CDIO_MMC_GPCMD_SECURITY_PROTOCOL_IN = 0xa2, CDIO_MMC_GPCMD_SEND_KEY = 0xa3, CDIO_MMC_GPCMD_REPORT_KEY = 0xa4, CDIO_MMC_GPCMD_PLAY_AUDIO_12 = 0xa5, /**< Begin audio playing at current position (12 bytes) */ CDIO_MMC_GPCMD_LOAD_UNLOAD = 0xa6, /**< Load/unload a Disc (12 bytes) */ CDIO_MMC_GPCMD_SET_READ_AHEAD = 0xa7, CDIO_MMC_GPCMD_READ_12 = 0xa8, /**< Read data from drive (12 bytes). */ CDIO_MMC_GPCMD_PLAY_TRACK_REL_12 = 0xa9, /**< Play audio at the track relative LBA. (12 bytes). Doesn't seem to be part of MMC standards but is handled by Plextor drives. */ CDIO_MMC_GPCMD_WRITE_12 = 0xaa, CDIO_MMC_GPCMD_READ_MEDIA_SERIAL_12 = 0xab, /**< MMC-5 Section 6.25 */ CDIO_MMC_GPCMD_GET_PERFORMANCE = 0xac, CDIO_MMC_GPCMD_READ_DVD_STRUCTURE = 0xad, /**< Get DVD structure info from media (12 bytes). */ CDIO_MMC_GPCMD_SECURITY_PROTOCOL_OUT = 0xb5, CDIO_MMC_GPCMD_SET_STREAMING = 0xb6, CDIO_MMC_GPCMD_READ_MSF = 0xb9, /**< Read almost any field of a CD sector at specified MSF. (12 bytes). */ CDIO_MMC_GPCMD_SET_SPEED = 0xbb, /**< Set drive speed (12 bytes). This is listed as optional in ATAPI 2.6, but is (curiously) missing from Mt. Fuji, Table 57. It is mentioned in Mt. Fuji Table 377 as an MMC command for SCSI devices though... Most ATAPI drives support it. */ CDIO_MMC_GPCMD_MECHANISM_STATUS = 0xbd, CDIO_MMC_GPCMD_READ_CD = 0xbe, /**< Read almost any field of a CD sector at current location. (12 bytes). */ CDIO_MMC_GPCMD_SEND_DISC_STRUCTURE = 0xbf, /** Vendor-unique Commands */ CDIO_MMC_GPCMD_CD_PLAYBACK_STATUS = 0xc4 /**< SONY unique = command */, CDIO_MMC_GPCMD_PLAYBACK_CONTROL = 0xc9 /**< SONY unique = command */, CDIO_MMC_GPCMD_READ_CDDA = 0xd8 /**< Vendor unique = command */, CDIO_MMC_GPCMD_READ_CDXA = 0xdb /**< Vendor unique = command */, CDIO_MMC_GPCMD_READ_ALL_SUBCODES = 0xdf /**< Vendor unique = command */ } cdio_mmc_gpcmd_t; /** Read Subchannel states */ typedef enum { CDIO_MMC_READ_SUB_ST_INVALID = 0x00, /**< audio status not supported */ CDIO_MMC_READ_SUB_ST_PLAY = 0x11, /**< audio play operation in progress */ CDIO_MMC_READ_SUB_ST_PAUSED = 0x12, /**< audio play operation paused */ CDIO_MMC_READ_SUB_ST_COMPLETED = 0x13, /**< audio play successfully completed */ CDIO_MMC_READ_SUB_ST_ERROR = 0x14, /**< audio play stopped due to error */ CDIO_MMC_READ_SUB_ST_NO_STATUS = 0x15, /**< no current audio status to return */ } cdio_mmc_read_sub_state_t; /** Level values that can go into READ_CD */ typedef enum { CDIO_MMC_READ_TYPE_ANY = 0, /**< All types */ CDIO_MMC_READ_TYPE_CDDA = 1, /**< Only CD-DA sectors */ CDIO_MMC_READ_TYPE_MODE1 = 2, /**< mode1 sectors (user data = 2048) */ CDIO_MMC_READ_TYPE_MODE2 = 3, /**< mode2 sectors form1 or form2 */ CDIO_MMC_READ_TYPE_M2F1 = 4, /**< mode2 sectors form1 */ CDIO_MMC_READ_TYPE_M2F2 = 5 /**< mode2 sectors form2 */ } cdio_mmc_read_cd_type_t; /** Format values for READ_TOC */ typedef enum { CDIO_MMC_READTOC_FMT_TOC = 0, CDIO_MMC_READTOC_FMT_SESSION = 1, CDIO_MMC_READTOC_FMT_FULTOC = 2, CDIO_MMC_READTOC_FMT_PMA = 3, /**< Q subcode data */ CDIO_MMC_READTOC_FMT_ATIP = 4, /**< includes media type */ CDIO_MMC_READTOC_FMT_CDTEXT = 5 /**< CD-TEXT info */ } cdio_mmc_readtoc_t; /** Page codes for MODE SENSE and MODE SET. */ typedef enum { CDIO_MMC_R_W_ERROR_PAGE = 0x01, CDIO_MMC_WRITE_PARMS_PAGE = 0x05, CDIO_MMC_CDR_PARMS_PAGE = 0x0d, CDIO_MMC_AUDIO_CTL_PAGE = 0x0e, CDIO_MMC_POWER_PAGE = 0x1a, CDIO_MMC_FAULT_FAIL_PAGE = 0x1c, CDIO_MMC_TO_PROTECT_PAGE = 0x1d, CDIO_MMC_CAPABILITIES_PAGE = 0x2a, CDIO_MMC_ALL_PAGES = 0x3f, } cdio_mmc_mode_page_t; /** READ DISC INFORMATION Data Types */ typedef enum { CDIO_MMC_READ_DISC_INFO_STANDARD = 0x0, CDIO_MMC_READ_DISC_INFO_TRACK = 0x1, CDIO_MMC_READ_DISC_INFO_POW = 0x2, } cdio_mmc_read_disc_info_datatype_t; /* For backward compatibility. */ #define CDIO_MMC_GPCMD_READ_DISC_INFO CDIO_MMC_GPCMD_READ_DISC_INFORMATION #define CDIO_MMC_GPCMD_READ_DISC_STRUCTURE CDIO_MMC_GPMD_READ_DVD_STRUCTURE PRAGMA_BEGIN_PACKED struct mmc_audio_volume_entry_s { uint8_t selection; /* Only the lower 4 bits are used. */ uint8_t volume; } GNUC_PACKED; typedef struct mmc_audio_volume_entry_s mmc_audio_volume_entry_t; /** This struct is used by cdio_audio_get_volume and cdio_audio_set_volume */ struct mmc_audio_volume_s { mmc_audio_volume_entry_t port[4]; } GNUC_PACKED; typedef struct mmc_audio_volume_s mmc_audio_volume_t; PRAGMA_END_PACKED /** Return type codes for GET_CONFIGURATION. */ typedef enum { CDIO_MMC_GET_CONF_ALL_FEATURES = 0, /**< all features without regard to currency. */ CDIO_MMC_GET_CONF_CURRENT_FEATURES = 1, /**< features which are currently in effect (e.g. based on medium inserted). */ CDIO_MMC_GET_CONF_NAMED_FEATURE = 2 /**< just the feature named in the GET_CONFIGURATION cdb. */ } cdio_mmc_get_conf_t; /** FEATURE codes used in GET CONFIGURATION. */ typedef enum { CDIO_MMC_FEATURE_PROFILE_LIST = 0x000, /**< Profile List Feature */ CDIO_MMC_FEATURE_CORE = 0x001, CDIO_MMC_FEATURE_MORPHING = 0x002, /**< Report/prevent operational changes */ CDIO_MMC_FEATURE_REMOVABLE_MEDIUM = 0x003, /**< Removable Medium Feature */ CDIO_MMC_FEATURE_WRITE_PROTECT = 0x004, /**< Write Protect Feature */ CDIO_MMC_FEATURE_RANDOM_READABLE = 0x010, /**< Random Readable Feature */ CDIO_MMC_FEATURE_MULTI_READ = 0x01D, /**< Multi-Read Feature */ CDIO_MMC_FEATURE_CD_READ = 0x01E, /**< CD Read Feature */ CDIO_MMC_FEATURE_DVD_READ = 0x01F, /**< DVD Read Feature */ CDIO_MMC_FEATURE_RANDOM_WRITABLE = 0x020, /**< Random Writable Feature */ CDIO_MMC_FEATURE_INCR_WRITE = 0x021, /**< Incremental Streaming Writable Feature */ CDIO_MMC_FEATURE_SECTOR_ERASE = 0x022, /**< Sector Erasable Feature */ CDIO_MMC_FEATURE_FORMATABLE = 0x023, /**< Formattable Feature */ CDIO_MMC_FEATURE_DEFECT_MGMT = 0x024, /**< Management Ability of the Logical Unit/media system to provide an apparently defect-free space.*/ CDIO_MMC_FEATURE_WRITE_ONCE = 0x025, /**< Write Once Feature */ CDIO_MMC_FEATURE_RESTRICT_OVERW = 0x026, /**< Restricted Overwrite Feature */ CDIO_MMC_FEATURE_CD_RW_CAV = 0x027, /**< CD-RW CAV Write Feature */ CDIO_MMC_FEATURE_MRW = 0x028, /**< MRW Feature */ CDIO_MMC_FEATURE_ENHANCED_DEFECT = 0x029, /**< Enhanced Defect Reporting */ CDIO_MMC_FEATURE_DVD_PRW = 0x02A, /**< DVD+RW Feature */ CDIO_MMC_FEATURE_DVD_PR = 0x02B, /**< DVD+R Feature */ CDIO_MMC_FEATURE_RIGID_RES_OVERW = 0x02C, /**< Rigid Restricted Overwrite */ CDIO_MMC_FEATURE_CD_TAO = 0x02D, /**< CD Track at Once */ CDIO_MMC_FEATURE_CD_SAO = 0x02E, /**< CD Mastering (Session at Once) */ CDIO_MMC_FEATURE_DVD_R_RW_WRITE = 0x02F, /**< DVD-R/RW Write */ CDIO_MMC_FEATURE_CD_RW_MEDIA_WRITE= 0x037, /**< CD-RW Media Write Support */ CDIO_MMC_FEATURE_DVD_PR_2_LAYER = 0x03B, /**< DVD+R Double Layer */ CDIO_MMC_FEATURE_POWER_MGMT = 0x100, /**< Initiator and device directed power management */ CDIO_MMC_FEATURE_CDDA_EXT_PLAY = 0x103, /**< Ability to play audio CDs via the Logical Unit's own analog output */ CDIO_MMC_FEATURE_MCODE_UPGRADE = 0x104, /* Ability for the device to accept new microcode via the interface */ CDIO_MMC_FEATURE_TIME_OUT = 0x105, /**< Ability to respond to all commands within a specific time */ CDIO_MMC_FEATURE_DVD_CSS = 0x106, /**< Ability to perform DVD CSS/CPPM authentication and RPC */ CDIO_MMC_FEATURE_RT_STREAMING = 0x107, /**< Ability to read and write using Initiator requested performance parameters */ CDIO_MMC_FEATURE_LU_SN = 0x108, /**< The Logical Unit has a unique identifier. */ CDIO_MMC_FEATURE_FIRMWARE_DATE = 0x1FF, /**< Firmware creation date report */ } cdio_mmc_feature_t; typedef enum { CDIO_MMC_FEATURE_INTERFACE_UNSPECIFIED = 0, CDIO_MMC_FEATURE_INTERFACE_SCSI = 1, CDIO_MMC_FEATURE_INTERFACE_ATAPI = 2, CDIO_MMC_FEATURE_INTERFACE_IEEE_1394 = 3, CDIO_MMC_FEATURE_INTERFACE_IEEE_1394A = 4, CDIO_MMC_FEATURE_INTERFACE_FIBRE_CH = 5 } cdio_mmc_feature_interface_t; /** The largest Command Descriptor Block (CDB) size. The possible sizes are 6, 10, and 12 bytes. */ #define MAX_CDB_LEN 12 /** \brief A Command Descriptor Block (CDB) used in sending MMC commands. */ typedef struct mmc_cdb_s { uint8_t field[MAX_CDB_LEN]; } mmc_cdb_t; /** \brief Format of header block in data returned from an MMC GET_CONFIGURATION command. */ typedef struct mmc_feature_list_header_s { unsigned char length_msb; unsigned char length_1sb; unsigned char length_2sb; unsigned char length_lsb; unsigned char reserved1; unsigned char reserved2; unsigned char profile_msb; unsigned char profile_lsb; } cdio_mmc_feature_list_header_t; /** An enumeration indicating whether an MMC command is sending data, or getting data, or does none of both. */ typedef enum mmc_direction_s { SCSI_MMC_DATA_READ, SCSI_MMC_DATA_WRITE, SCSI_MMC_DATA_NONE } cdio_mmc_direction_t; /** Indicate to applications that \p SCSI_MMC_DATA_NONE is available. It has been added after version 0.82 and should be used with commands that neither read nor write payload bytes. (On Linux, at least, these work with \p SCSI_MMC_DATA_READ and \p SCSI_MMC_DATA_WRITE, too.) */ #define SCSI_MMC_HAS_DIR_NONE 1 typedef struct mmc_subchannel_s { uint8_t reserved; uint8_t audio_status; uint16_t data_length; /**< Really ISO 9660 7.2.2 */ uint8_t format; uint8_t address: 4; uint8_t control: 4; uint8_t track; uint8_t index; uint8_t abs_addr[4]; uint8_t rel_addr[4]; } cdio_mmc_subchannel_t; #define CDIO_MMC_SET_COMMAND(cdb, command) \ cdb[0] = command #define CDIO_MMC_SET_READ_TYPE(cdb, sector_type) \ cdb[1] = (sector_type << 2) #define CDIO_MMC_GETPOS_LEN16(p, pos) \ (p[pos]<<8) + p[pos+1] #define CDIO_MMC_GET_LEN16(p) \ (p[0]<<8) + p[1] #define CDIO_MMC_GET_LEN32(p) \ (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3]; #define CDIO_MMC_SET_LEN16(cdb, pos, len) \ cdb[pos ] = (len >> 8) & 0xff; \ cdb[pos+1] = (len ) & 0xff #define CDIO_MMC_SET_READ_LBA(cdb, lba) \ cdb[2] = (lba >> 24) & 0xff; \ cdb[3] = (lba >> 16) & 0xff; \ cdb[4] = (lba >> 8) & 0xff; \ cdb[5] = (lba ) & 0xff #define CDIO_MMC_SET_START_TRACK(cdb, command) \ cdb[6] = command #define CDIO_MMC_SET_READ_LENGTH24(cdb, len) \ cdb[6] = (len >> 16) & 0xff; \ cdb[7] = (len >> 8) & 0xff; \ cdb[8] = (len ) & 0xff #define CDIO_MMC_SET_READ_LENGTH16(cdb, len) \ CDIO_MMC_SET_LEN16(cdb, 7, len) #define CDIO_MMC_SET_READ_LENGTH8(cdb, len) \ cdb[8] = (len ) & 0xff #define CDIO_MMC_MCSB_ALL_HEADERS 0xf #define CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cdb, val) \ cdb[9] = val << 3; /** Get the output port volumes and port selections used on AUDIO PLAY commands via a MMC \p MODE \p SENSE command using the CD Audio Control Page. @param p_cdio the CD object to be acted upon. @param p_volume volume parameters retrieved @return \p DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_audio_get_volume (CdIo_t *p_cdio, /*out*/ mmc_audio_volume_t *p_volume); /** Read Audio Subchannel information @param p_cdio the CD object to be acted upon. @param p_subchannel place for returned subchannel information */ driver_return_code_t mmc_audio_read_subchannel (CdIo_t *p_cdio, /*out*/ cdio_subchannel_t *p_subchannel); /** Return a string containing the name of the audio state as returned from the Q_SUBCHANNEL. */ const char *mmc_audio_state2str( uint8_t i_audio_state ); /** Get the block size used in read requests, via MMC (e.g. READ_10, READ_MSF, ...) @param p_cdio the CD object to be acted upon. @return the blocksize if > 0; error if <= 0 */ int mmc_get_blocksize ( CdIo_t *p_cdio ); /** Return the length in bytes of the Command Descriptor Buffer (CDB) for a given MMC command. The length will be either 6, 10, or 12. */ uint8_t mmc_get_cmd_len(uint8_t mmc_cmd); /** Get the lsn of the end of the CD @param p_cdio the CD object to be acted upon. @return the lsn. On error return CDIO_INVALID_LSN. */ lsn_t mmc_get_disc_last_lsn( const CdIo_t *p_cdio ); /** Return the discmode as reported by the MMC Read (FULL) \p TOC command. Information was obtained from Section 5.1.13 (Read TOC/PMA/ATIP) pages 56-62 from the MMC draft specification, revision 10a at http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf See especially tables 72, 73 and 75. */ discmode_t mmc_get_discmode( const CdIo_t *p_cdio ); typedef enum { CDIO_MMC_LEVEL_WEIRD, CDIO_MMC_LEVEL_1, CDIO_MMC_LEVEL_2, CDIO_MMC_LEVEL_3, CDIO_MMC_LEVEL_NONE } cdio_mmc_level_t; /** Get the MMC level supported by the device. @param p_cdio the CD object to be acted upon. @return MMC level supported by the device. */ cdio_mmc_level_t mmc_get_drive_mmc_cap(CdIo_t *p_cdio); /** Get the DVD type associated with cd object. @param p_cdio the CD object to be acted upon. @param s location to store DVD information. @return the DVD discmode. */ discmode_t mmc_get_dvd_struct_physical ( const CdIo_t *p_cdio, cdio_dvd_struct_t *s); /** Find out if media tray is open or closed. @param p_cdio the CD object to be acted upon. @return 1 if media is open, 0 if closed. Error return codes are the same as \p driver_return_code_t. */ int mmc_get_tray_status ( const CdIo_t *p_cdio ); /** Get the CD-ROM hardware info via an MMC \p INQUIRY command. @param p_cdio the CD object to be acted upon. @param p_hw_info place to store hardware information retrieved @return true if we were able to get hardware info, false if we had an error. */ bool mmc_get_hwinfo ( const CdIo_t *p_cdio, /* out*/ cdio_hwinfo_t *p_hw_info ); /** Find out if media has changed since the last call. @param p_cdio the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as \p driver_return_code_t. */ int mmc_get_media_changed(const CdIo_t *p_cdio); /** Get the media catalog number (\p MCN) from the CD via MMC. @param p_cdio the CD object to be acted upon. @return the media catalog number r NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * mmc_get_mcn(const CdIo_t *p_cdio); /** Get the international standard recording code (\p ISRC) of the track via MMC. @param p_cdio the CD object to be acted upon. @param i_track the track to get the ISRC info for @return international standard recording code or NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * mmc_get_track_isrc(const CdIo_t *p_cdio, track_t i_track); /** Read cdtext information for a cdtext_t object. This is the raw SCSI/MMC reply as retrieved by mmc_read_toc_cdtext(). It consists of 4 header bytes and a variable number of text packs. The first two bytes of the header, a Big-Endian number, specifies the number of following bytes. The count also includes the next two header bytes which should be 0. See also information in mmc_read_toc_cdtext(). Here is some code to parse the text packs into a \p cdtext_t object: @code #include #include reply = mmc_read_cdtext(p_cdio); if (NULL != reply) cdtext_data_init(p_cdtext, reply + 4, (size_t) CDIO_MMC_GET_LEN16(reply) - 2); @endcode @param p_cdio the CD object to be acted upon. @return pointer to data on success, \p NULL on error or if CD-Text information does not exist. Note: the caller must free the returned memory. */ uint8_t * mmc_read_cdtext (const CdIo_t *p_cdio); /** Report if CD-ROM has a particular kind of interface (ATAPI, SCSCI, ...) Is it possible for an interface to have several? If not this routine could probably return the single \p mmc_feature_interface_t. @param p_cdio the CD object to be acted upon. @param e_interface @return true if we have the interface and false if not. */ bool_3way_t mmc_have_interface(CdIo_t *p_cdio, cdio_mmc_feature_interface_t e_interface ); /** Read just the user data part of some sort of data sector (via mmc_read_cd). @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least \p CDIO_CD_FRAMESIZE, \p M2RAW_SECTOR_SIZE, or \p M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, \p M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of each block @param i_blocks number of blocks to read */ driver_return_code_t mmc_read_data_sectors ( CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ); /** Read sectors using SCSI-MMC GPCMD_READ_CD. Can read only up to 25 blocks. */ driver_return_code_t mmc_read_sectors ( const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, int read_sector_type, uint32_t i_blocks); /** Run a Multimedia command (MMC). @param p_cdio CD structure set by cdio_open(). @param i_timeout_ms time in milliseconds we will wait for the command to complete. @param p_cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. @param e_direction direction the transfer is to go. @param i_buf Size of buffer @param p_buf Buffer for data, both sending and receiving. @return 0 if command completed successfully. */ driver_return_code_t mmc_run_cmd( const CdIo_t *p_cdio, unsigned int i_timeout_ms, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); /** Run a Multimedia command (MMC) specifying the CDB length. The motivation here is for example ot use in is an undocumented debug command for LG drives (namely E7), whose length is being miscalculated by mmc_get_cmd_len(); it doesn't follow the usual code number to length conventions. Patch supplied by SukkoPera. @param p_cdio CD structure set by cdio_open(). @param i_timeout_ms time in milliseconds we will wait for the command to complete. @param p_cdb CDB bytes. All values that are needed should be set on input. @param i_cdb number of CDB bytes. @param e_direction direction the transfer is to go. @param i_buf Size of buffer @param p_buf Buffer for data, both sending and receiving. @return 0 if command completed successfully. */ driver_return_code_t mmc_run_cmd_len( const CdIo_t *p_cdio, unsigned int i_timeout_ms, const mmc_cdb_t *p_cdb, unsigned int i_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); /** Obtain the SCSI sense reply of the most-recently-performed MMC command. These bytes give an indication of possible problems which occured in the drive while the command was performed. With some commands they tell about the current state of the drive (e.g. 00h \p TEST \p UNIT \p READY). @param p_cdio CD structure set by cdio_open(). @param pp_sense returns the sense bytes received from the drive. This is allocated memory or NULL if no sense bytes are available. Dispose non-NULL pointers by cdio_free() when no longer needed. See SPC-3 4.5.3 Fixed format sense data. SCSI error codes as of SPC-3 Annex D, MMC-5 Annex F: sense[2]&15 = Key , sense[12] = \p ASC , sense[13] = \p ASCQ @return number of valid bytes in sense, 0 when no sense bytes are available, and less than 0 when there is an internal error. */ int mmc_last_cmd_sense ( const CdIo_t *p_cdio, cdio_mmc_request_sense_t **pp_sense); /** Set the block size for subsequest read requests, via MMC. */ driver_return_code_t mmc_set_blocksize ( const CdIo_t *p_cdio, uint16_t i_blocksize); /** Get string name for MMC command @param command cdio_mmc_gpcmd_t command value @return string name of command */ const char *mmc_cmd2str(uint8_t command); #ifdef __cplusplus } #endif /* __cplusplus */ /** The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions */ extern cdio_mmc_feature_t debug_cdio_mmc_feature; extern cdio_mmc_feature_interface_t debug_cdio_mmc_feature_interface; extern cdio_mmc_feature_profile_t debug_cdio_mmc_feature_profile; extern cdio_mmc_get_conf_t debug_cdio_mmc_get_conf; extern cdio_mmc_gpcmd_t debug_cdio_mmc_gpcmd; extern cdio_mmc_read_sub_state_t debug_cdio_mmc_read_sub_state; extern cdio_mmc_read_cd_type_t debug_cdio_mmc_read_cd_type; extern cdio_mmc_readtoc_t debug_cdio_mmc_readtoc; extern cdio_mmc_mode_page_t debug_cdio_mmc_mode_page; #ifndef DO_NOT_WANT_OLD_MMC_COMPATIBILITY #define CDIO_MMC_GPCMD_START_STOP CDIO_MMC_GPCMD_START_STOP_UNIT #define CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL \ CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL #endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/ #endif /* CDIO_MMC_H_ */ /* * Local variables: * c-file-style: "ruby" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/mmc_cmds.h000066400000000000000000000021051474051130400174110ustar00rootroot00000000000000/* Copyright (C) 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file mmc_cmds.h * * \brief The top-level header for libcdio multi-media commands (MMC). */ #ifndef CDIO_MMC_CMDS_H_ #define CDIO_MMC_CMDS_H_ #include #include #include #endif /* CDIO_MMC_CMDS_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/mmc_hl_cmds.h000066400000000000000000000107061474051130400201020ustar00rootroot00000000000000/* Copyright (C) 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file mmc_hl_cmds.h \brief Higher-level MMC commands which build on top of the lower-level MMC commands. */ #ifndef CDIO_MMC_HL_CMDS_H_ #define CDIO_MMC_HL_CMDS_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Close tray using a MMC START STOP UNIT command. @param p_cdio the CD object to be acted upon. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_close_tray( CdIo_t *p_cdio ); /** Detects if a disc (CD or DVD) is erasable or not. @param p_cdio the CD object to be acted upon. @param b_erasable if not NULL, on return will be set indicate whether the operation was a success (DRIVER_OP_SUCCESS) or if not to some other value. @return true if the disc is detected as erasable (rewritable), false otherwise. */ driver_return_code_t mmc_get_disc_erasable(const CdIo_t *p_cdio, bool *b_erasable); /** Eject using MMC commands. If CD-ROM is "locked" we'll unlock it. Command is not "immediate" -- we'll wait for the command to complete. For a more general (and lower-level) routine, @see mmc_start_stop_unit. @param p_cdio the CD object to be acted upon. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_eject_media( const CdIo_t *p_cdio ); /** Detects the disc type using the SCSI-MMC GET CONFIGURATION command. @param p_cdio the CD object to be acted upon. @param i_timeout_ms number of millisections to wait before timeout @param p_disctype the disc type set on success. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_get_disctype(const CdIo_t *p_cdio, unsigned int i_timeout_ms, cdio_mmc_feature_profile_t *p_disctype); /** Run a SCSI-MMC MODE_SENSE command (6- or 10-byte version) and put the results in p_buf @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_sense( CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, int page); /** Set the drive speed in CD-ROM speed units. @param p_cdio CD structure set by cdio_open(). @param i_drive_speed speed in CD-ROM speed units. Note this not Kbs as would be used in the MMC spec or in mmc_set_speed(). To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). On many CD-ROM drives, specifying a value too large will result in using the fastest speed. @return the drive speed if greater than 0. -1 if we had an error. is -2 returned if this is not implemented for the current driver. @see cdio_set_speed and mmc_set_speed */ driver_return_code_t mmc_set_drive_speed( const CdIo_t *p_cdio, int i_drive_speed ); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_MMC_HL_CMDS_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/mmc_ll_cmds.h000066400000000000000000000417421474051130400201120ustar00rootroot00000000000000/* Copyright (C) 2018 Thomas Schmitt Copyright (C) 2010, 2012, 2016, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file mmc_ll_cmds.h \brief Wrappers for specific Multimedia Command (MMC) commands e.g., READ DISC, START/STOP UNIT. The documents we make use of are described in several specifications made by the SCSI committee T10 http://www.t10.org. In particular, SCSI Primary Commands (SPC), SCSI Block Commands (SBC), and Multi-Media Commands (MMC). These documents generally have a numeric level number appended. For example SPC-3 refers to ``SCSI Primary Commands - 3'. In year 2010 the current versions were SPC-3, SBC-2, MMC-5. */ #ifndef CDIO_MMC_LL_CMDS_H_ #define CDIO_MMC_LL_CMDS_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Get drive capabilities via SCSI-MMC \p GET \p CONFIGURATION @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param i_return_type value in range 0..2 giving what kind of configuration to return: - 0 — Full Header and Full Descriptors; - 1 — Feature Headers and those with their Current Bit. - 2 — One Feature header and zero or one Feature Descriptors. @param i_starting_feature_number feature number from which to start getting information. @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return \p DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as \p driver_return_code_t */ driver_return_code_t mmc_get_configuration(const CdIo_t *p_cdio, void *p_buf, unsigned int i_size, unsigned int i_return_type, unsigned int i_starting_feature_number, unsigned int i_timeout_ms); /** Return results of media event status via SCSI-MMC \p GET \p EVENT \p STATUS @param p_cdio the CD object to be acted upon. @param out_buf media status code from operation @return \p DRIVER_OP_SUCCESS (0) if we got the status. Return codes are the same as \p driver_return_code_t */ driver_return_code_t mmc_get_event_status(const CdIo_t *p_cdio, uint8_t out_buf[2]); /** Run a SCSI-MMC \p MODE \p SELECT (10-byte) command and put the results in \p p_buf. @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return \p DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_select_10(CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, int page, unsigned int i_timeout_ms); /** Run a SCSI-MMC \p MODE \p SENSE command (10-byte version) and put the results in \p p_buf. @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param i_page_code which "page" of the mode sense command we are interested in @return \p DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_sense_10( CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, unsigned int i_page_code); /** Run a SCSI-MMC \p MODE \p SENSE command (6-byte version) and put the results in \p p_buf. @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @return \p DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_sense_6( CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, int page); /** Request preventing/allowing medium removal on a drive via SCSI-MMC \p PREVENT/ALLOW \p MEDIUM \p REMOVAL. @param p_cdio the CD object to be acted upon. @param b_persistent make b_prevent state persistent @param b_prevent true of drive locked and false if unlocked @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return \p DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as \p driver_return_code_t */ driver_return_code_t mmc_prevent_allow_medium_removal(const CdIo_t *p_cdio, bool b_persistent, bool b_prevent, unsigned int i_timeout_ms); /** Issue a MMC READ_CD command. @param p_cdio object to read from @param p_buf Place to store data. The caller should ensure that \p p_buf can hold at least \p i_blocksize * \p i_blocks bytes. @param i_lsn sector to read @param expected_sector_type restricts reading to a specific CD sector type. Only 3 bits with values 1-5 are used: - 0 — all sector types - 1 — CD-DA sectors only - 2 — Mode 1 sectors only - 3 — Mode 2 formless sectors only. Note in contrast to all other values an MMC CD-ROM is not required to support this mode. - 4 — Mode 2 Form 1 sectors only - 5 — Mode 2 Form 2 sectors only @param b_digital_audio_play Control error concealment when the data being read is CD-DA. If the data being read is not CD-DA, this parameter is ignored. If the data being read is CD-DA and DAP is false zero, then the user data returned should not be modified by flaw obscuring mechanisms such as audio data mute and interpolate. If the data being read is CD-DA and DAP is true, then the user data returned should be modified by flaw obscuring mechanisms such as audio data mute and interpolate. b_sync_header return the sync header (which will probably have the same value as \p CDIO_SECTOR_SYNC_HEADER of size \p CDIO_CD_SYNC_SIZE). @param header_codes Header Codes refer to the sector header and the sub-header that is present in mode 2 formed sectors: - 0 — No header information is returned. - 1 — The 4-byte sector header of data sectors is be returned, - 2 — The 8-byte sector sub-header of mode 2 formed sectors is returned. - 3 &mdash Both sector header and sub-header (12 bytes) is returned. The Header preceeds the rest of the bytes (e.g. user-data bytes) that might get returned. @param b_user_data Return user data if true. For CD-DA, the User Data is \p CDIO_CD_FRAMESIZE_RAW bytes. For Mode 1, The User Data is \p ISO_BLOCKSIZE bytes beginning at offset \p CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE. For Mode 2 formless, The User Data is M2RAW_SECTOR_SIZE bytes beginning at offset \p CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE. For data Mode 2, form 1, User Data is ISO_BLOCKSIZE bytes beginning at offset \p CDIO_CD_XA_SYNC_HEADER. For data Mode 2, form 2, User Data is 2 groups of 324 bytes beginning at offset \p CDIO_CD_XA_SYNC_HEADER. @param b_sync @param b_edc_ecc true if we return EDC/ECC error detection/correction bits. The presence and size of EDC redundancy or ECC parity is defined according to sector type: CD-DA sectors have neither EDC redundancy nor ECC parity. Data Mode 1 sectors have 288 bytes of EDC redundancy, Pad, and ECC parity beginning at offset 2064. Data Mode 2 formless sectors have neither EDC redundancy nor ECC parity Data Mode 2 form 1 sectors have 280 bytes of EDC redundancy and ECC parity beginning at offset 2072 Data Mode 2 form 2 sectors optionally have 4 bytes of EDC redundancy beginning at offset 2348. @param c2_error_information If true associate a bit with each sector for C2 error The resulting bit field is ordered exactly as the main channel bytes. Each 8-bit boundary defines a byte of flag bits. @param subchannel_selection subchannel-selection bits - 0 — No Sub-channel data shall be returned. (0 bytes) - 1 — RAW P-W Sub-channel data shall be returned. (96 byte) - 2 — Formatted Q sub-channel data shall be transferred (16 bytes) - 3 — Reserved - 4 — Corrected and de-interleaved R-W sub-channel (96 bytes) - 5-7 — Reserved @param i_blocksize size of the a block expected to be returned @param i_blocks number of blocks expected to be returned. @return \p DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_read_cd(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, int expected_sector_type, bool b_digital_audio_play, bool b_sync, uint8_t header_codes, bool b_user_data, bool b_edc_ecc, uint8_t c2_error_information, uint8_t subchannel_selection, uint16_t i_blocksize, uint32_t i_blocks); /** Request information about et drive capabilities via SCSI-MMC READ DISC INFORMATION @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param data_type kind of information to retrieve. @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return DRIVER_OP_SUCCESS (0) if we got the status. */ driver_return_code_t mmc_read_disc_information(const CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, cdio_mmc_read_disc_info_datatype_t data_type, unsigned int i_timeout_ms); /** Set the drive speed in K bytes per second using SCSI-MMC SET SPEED. @param p_cdio CD structure set by cdio_open(). @param i_Kbs_speed speed in K bytes per second. Note this is not in standard CD-ROM speed units, e.g. 1x, 4x, 16x as it is in cdio_set_speed. To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). Also note that ATAPI specs say that a value less than 176 will result in an error. On many CD-ROM drives, specifying a value too large will result in using the fastest speed. @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return the drive speed if greater than 0. -1 if we had an error. is -2 returned if this is not implemented for the current driver. @see cdio_set_speed and mmc_set_drive_speed */ driver_return_code_t mmc_set_speed( const CdIo_t *p_cdio, int i_Kbs_speed, unsigned int i_timeout_ms); /** Load or Unload media using a MMC START STOP UNIT command. @param p_cdio the CD object to be acted upon. @param b_eject eject if true and close tray if false @param b_immediate wait or don't wait for operation to complete @param power_condition Set CD-ROM to idle/standby/sleep. If nonzero, eject/load is ignored, so set to 0 if you want to eject or load. @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return \p DRIVER_OP_SUCCESS if we ran the command ok. @see mmc_eject_media or mmc_close_tray */ driver_return_code_t mmc_start_stop_unit(const CdIo_t *p_cdio, bool b_eject, bool b_immediate, uint8_t power_condition, unsigned int i_timeout_ms); /** Check if drive is ready using SCSI-MMC \p TEST \p UNIT \p READY command. @param p_cdio the CD object to be acted upon. @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in \p mmc_timeout_ms. @return \p DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_test_unit_ready(const CdIo_t *p_cdio, unsigned int i_timeout_ms); /** Issue a \p READ \p SUB-CHANNEL command to read current position, \p ISRC or \p MCN from subchannel Q. Note: \p READ \p SUB-CHANNEL is deprecated as of MMC-5 but the alternative requires manual parsing of the subchannel. @param p_cdio the CD object to be acted upon. @param i_track track number (only for ISRC) @param sub_chan_param 1 for CD current position, 2 for \p MCN, 3 for \p ISRC @param i_length pointer to number of bytes to request. Will be overwritten by the number of bytes available. @param p_buf pointer to the location for the returned data @param i_timeout_ms numober of milliseconds to wait for command completion @return \p DRIVER_OP_SUCCESS on success */ driver_return_code_t mmc_read_subchannel ( const CdIo_t *p_cdio, track_t i_track, unsigned char sub_chan_param, unsigned int *i_length, char *p_buf, unsigned int i_timeout_ms ); /** Issue a READ TOC/PMA/ATIP command to read the CD-TEXT from R-W sub-channel. On a successful return (when \p DRIVER_OP_SUCCESS is returned), \p pbuf contains the raw SCSI/MMC reply as retrieved by mmc_read_toc_cdtext(). The first two bytes of the header, a Big-Endian number, specifies the number of following bytes. The count also includes the next two header bytes which should be 0. See also Table 495, of the MMC-5 specification. Here is code that can be used to get the number of text packs: @code #include CDIO_MMC_GET_LEN16(p_buf) - 2 @endcode and start of the text packs is at: @code p_buf + 4 @endcode The number of bytes returned is limited by the value in parameter \p *i_length. which should tell the byte capacity of \p p_buf. The maximum size according to specification is 4 + 8 * 256 * 18 = 36,864 bytes. Instead of retrieving everything in one go by allocating the maximum possible value in the passed-in \p *p_buf, another approach is to first get the header bytes in a small \p p_buf, then re-allocate the buffer using the length given by \p CDIO_MMC_GET_LEN16(p_buf) + 2 (bytes), and then to call mmc_read_toc_cdtext() again with \p *i_length set to this size. @param p_cdio the CD object to be acted upon. @param i_length pointer to number of bytes to request. Will be overwritten by the number of bytes available. @param p_buf pointer to the location for the returned data @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in \p mmc_timeout_ms. @return \p DRIVER_OP_SUCCESS on success */ driver_return_code_t mmc_read_toc_cdtext ( const CdIo_t *p_cdio, unsigned int *i_length, unsigned char *p_buf, unsigned int i_timeout_ms ); #ifndef DO_NOT_WANT_OLD_MMC_COMPATIBILITY #define mmc_start_stop_media(c, e, i, p, t) \ mmc_start_stop_unit(c, e, i, p, t, 0) #endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_MMC_HL_CMDS_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/mmc_util.h000066400000000000000000000156351474051130400174540ustar00rootroot00000000000000/* Copyright (C) 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file mmc_util.h \brief Multimedia Command (MMC) "helper" routines that don't depend on anything other than headers. */ #ifndef CDIO_MMC_UTIL_H_ #define CDIO_MMC_UTIL_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Profile profile codes used in GET_CONFIGURATION - PROFILE LIST. */ typedef enum { CDIO_MMC_FEATURE_PROF_NON_REMOVABLE = 0x0001, /**< Re-writable disc, capable of changing behavior */ CDIO_MMC_FEATURE_PROF_REMOVABLE = 0x0002, /**< disk Re-writable; with removable media */ CDIO_MMC_FEATURE_PROF_MO_ERASABLE = 0x0003, /**< Erasable Magneto-Optical disk with sector erase capability */ CDIO_MMC_FEATURE_PROF_MO_WRITE_ONCE = 0x0004, /**< Write Once Magneto-Optical write once */ CDIO_MMC_FEATURE_PROF_AS_MO = 0x0005, /**< Advance Storage Magneto-Optical */ CDIO_MMC_FEATURE_PROF_CD_ROM = 0x0008, /**< Read only Compact Disc capable */ CDIO_MMC_FEATURE_PROF_CD_R = 0x0009, /**< Write once Compact Disc capable */ CDIO_MMC_FEATURE_PROF_CD_RW = 0x000A, /**< CD-RW Re-writable Compact Disc capable */ CDIO_MMC_FEATURE_PROF_DVD_ROM = 0x0010, /**< Read only DVD */ CDIO_MMC_FEATURE_PROF_DVD_R_SEQ = 0x0011, /**< Re-recordable DVD using Sequential recording */ CDIO_MMC_FEATURE_PROF_DVD_RAM = 0x0012, /**< Re-writable DVD */ CDIO_MMC_FEATURE_PROF_DVD_RW_RO = 0x0013, /**< Re-recordable DVD using Restricted Overwrite */ CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ = 0x0014, /**< Re-recordable DVD using Sequential recording */ CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ = 0x0015, /**< DVD-R/DL sequential recording */ CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR = 0x0016, /**< DVD-R/DL layer jump recording */ CDIO_MMC_FEATURE_PROF_DVD_PRW = 0x001A, /**< DVD+RW - DVD ReWritable */ CDIO_MMC_FEATURE_PROF_DVD_PR = 0x001B, /**< DVD+R - DVD Recordable */ CDIO_MMC_FEATURE_PROF_DDCD_ROM = 0x0020, /**< Read only DDCD */ CDIO_MMC_FEATURE_PROF_DDCD_R = 0x0021, /**< DDCD-R Write only DDCD */ CDIO_MMC_FEATURE_PROF_DDCD_RW = 0x0022, /**< Re-Write only DDCD */ CDIO_MMC_FEATURE_PROF_DVD_PRW_DL = 0x002A, /**< "DVD+RW/DL */ CDIO_MMC_FEATURE_PROF_DVD_PR_DL = 0x002B, /**< DVD+R - DVD Recordable double layer */ CDIO_MMC_FEATURE_PROF_BD_ROM = 0x0040, /**< BD-ROM */ CDIO_MMC_FEATURE_PROF_BD_SEQ = 0x0041, /**< BD-R sequential recording */ CDIO_MMC_FEATURE_PROF_BD_R_RANDOM = 0x0042, /**< BD-R random recording */ CDIO_MMC_FEATURE_PROF_BD_RE = 0x0043, /**< BD-RE */ CDIO_MMC_FEATURE_PROF_HD_DVD_ROM = 0x0050, /**< HD-DVD-ROM */ CDIO_MMC_FEATURE_PROF_HD_DVD_R = 0x0051, /**< HD-DVD-R */ CDIO_MMC_FEATURE_PROF_HD_DVD_RAM = 0x0052, /**<"HD-DVD-RAM */ CDIO_MMC_FEATURE_PROF_NON_CONFORM = 0xFFFF, /**< The Logical Unit does not conform to any Profile. */ } cdio_mmc_feature_profile_t; /** @param i_feature MMC feature number @return string containing the name of the given feature */ const char *mmc_feature2str( int i_feature ); /** Get drive capabilities for a device. @param p_cdio the CD object to be acted upon. @param p_read_cap list of read capabilities that are set on return @param p_write_cap list of write capabilities that are set on return @param p_misc_cap list of miscellaneous capabilities (that are neither read nor write related) that are set on return */ void mmc_get_drive_cap ( CdIo_t *p_cdio, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap); /** Return a string containing the name of the given feature */ const char *mmc_feature_profile2str( int i_feature_profile ); bool mmc_is_disctype_bd(cdio_mmc_feature_profile_t disctype); bool mmc_is_disctype_cdrom(cdio_mmc_feature_profile_t disctype); bool mmc_is_disctype_dvd(cdio_mmc_feature_profile_t disctype); bool mmc_is_disctype_hd_dvd (cdio_mmc_feature_profile_t disctype); bool mmc_is_disctype_overwritable (cdio_mmc_feature_profile_t disctype); bool mmc_is_disctype_rewritable(cdio_mmc_feature_profile_t disctype); /** The default read timeout is 3 minutes. */ #define MMC_READ_TIMEOUT_DEFAULT 3*60*1000 /** Set this to the maximum value in milliseconds that we will wait on an MMC read command. */ extern uint32_t mmc_read_timeout_ms; /** Maps a mmc_sense_key_t into a string name. */ extern const char mmc_sense_key2str[16][40]; /** The default timeout (non-read) is 6 seconds. */ #define MMC_TIMEOUT_DEFAULT 6000 /** Set this to the maximum value in milliseconds that we will wait on an MMC command. */ extern uint32_t mmc_timeout_ms; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_MMC_UTIL_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/posix.h000066400000000000000000000021441474051130400167740ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file posix.h * * \brief various POSIX definitions. */ #ifndef CDIO_POSIX_H_ #define CDIO_POSIX_H_ typedef uint32_t posix_mode_t; typedef uint32_t posix_nlink_t; typedef uint32_t posix_uid_t; typedef uint32_t posix_gid_t; typedef uint16_t unicode16_t; #endif /* CDIO_POSIX_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/read.h000066400000000000000000000206601474051130400165500ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2007, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file read.h * * \brief The top-level header for sector (block, frame)-related * libcdio calls. */ #ifndef CDIO_READ_H_ #define CDIO_READ_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** All the different ways a block/sector can be read. */ typedef enum { CDIO_READ_MODE_AUDIO, /**< CD-DA, audio, Red Book */ CDIO_READ_MODE_M1F1, /**< Mode 1 Form 1 */ CDIO_READ_MODE_M1F2, /**< Mode 1 Form 2 */ CDIO_READ_MODE_M2F1, /**< Mode 2 Form 1 */ CDIO_READ_MODE_M2F2 /**< Mode 2 Form 2 */ } cdio_read_mode_t; /*! Reposition read offset Similar to (if not the same as) libc's fseek() @param p_cdio object which gets adjusted @param offset amount to seek @param whence like corresponding parameter in libc's fseek, e.g. SEEK_SET or SEEK_END. @return (off_t) -1 on error. */ off_t cdio_lseek(const CdIo_t *p_cdio, off_t offset, int whence); /*! Reads into buf the next size bytes. Similar to (if not the same as) libc's read(). This is a "cooked" read, or one handled by the OS. It probably won't work on audio data. For that use cdio_read_audio_sector(s). @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least i_size bytes. @param i_size number of bytes to read @return (ssize_t) -1 on error. */ ssize_t cdio_read(const CdIo_t *p_cdio, void *p_buf, size_t i_size); /*! Read an audio sector @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least CDIO_FRAMESIZE_RAW bytes. @param i_lsn sector to read */ driver_return_code_t cdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn); /*! Reads audio sectors @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least CDIO_FRAMESIZE_RAW * i_blocks bytes. @param i_lsn sector to read @param i_blocks number of sectors to read */ driver_return_code_t cdio_read_audio_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, uint32_t i_blocks); /*! Read data sectors @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least ISO_BLOCKSIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. @param i_blocks number of blocks to read */ driver_return_code_t cdio_read_data_sectors ( const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ); /*! Reads a mode 1 sector @param p_cdio object to read from @param p_buf place to read data into. @param i_lsn sector to read @param b_form2 true for reading mode 1 form 2 sectors or false for mode 1 form 1 sectors. */ driver_return_code_t cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2); /*! Reads mode 1 sectors @param p_cdio object to read from @param p_buf place to read data into @param i_lsn sector to read @param b_form2 true for reading mode 1 form 2 sectors or false for mode 1 form 1 sectors. @param i_blocks number of sectors to read */ driver_return_code_t cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2, uint32_t i_blocks); /*! Reads a mode 2 sector @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for form 2) bytes. @param i_lsn sector to read @param b_form2 true for reading mode 2 form 2 sectors or false for mode 2 form 1 sectors. @return 0 if no error, nonzero otherwise. */ driver_return_code_t cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2); /** The special case of reading a single block is a common one so we provide a routine for that as a convenience. */ driver_return_code_t cdio_read_sector(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, cdio_read_mode_t read_mode); /*! Reads mode 2 sectors @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for form 2) * i_blocks bytes. @param i_lsn sector to read @param b_form2 true for reading mode2 form 2 sectors or false for mode 2 form 1 sectors. @param i_blocks number of sectors to read @return 0 if no error, nonzero otherwise. */ driver_return_code_t cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2, uint32_t i_blocks); /*! Reads a number of sectors (AKA blocks). @param p_cdio cdio object @param p_buf place to read data into. The caller should make sure this location is large enough. See below for size information. @param read_mode the kind of "mode" to use in reading. @param i_lsn sector to read @param i_blocks number of sectors to read @return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations are returned on error. If read_mode is CDIO_MODE_AUDIO, *p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes. If read_mode is CDIO_MODE_DATA, *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE, M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum which is M2RAW_SECTOR_SIZE. If read_mode is CDIO_MODE_M2F1, *p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes. If read_mode is CDIO_MODE_M2F2, *p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes. */ driver_return_code_t cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, cdio_read_mode_t read_mode, uint32_t i_blocks); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_READ_H_ */ libcdio-2.2.0/include/cdio/rock.h000066400000000000000000000373631474051130400166030ustar00rootroot00000000000000/* Copyright (C) 2005, 2006 2008, 2012 Rocky Bernstein See also rock.c by Eric Youngdale (1993) from GNU/Linux This is Copyright 1993 Yggdrasil Computing, Incorporated 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! \file rock.h \brief Things related to the Rock Ridge Interchange Protocol (RRIP) Applications will probably not include this directly but via the iso9660.h header. */ #ifndef CDIO_ROCK_H_ #define CDIO_ROCK_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! An enumeration for some of the ISO_ROCK_* \#defines below. This isn't really an enumeration one would really use in a program it is to be helpful in debuggers where wants just to refer to the ISO_ROCK_* names and get something. */ extern enum iso_rock_enums { ISO_ROCK_IRUSR = 000400, /**< read permission (owner) */ ISO_ROCK_IWUSR = 000200, /**< write permission (owner) */ ISO_ROCK_IXUSR = 000100, /**< execute permission (owner) */ ISO_ROCK_IRGRP = 000040, /**< read permission (group) */ ISO_ROCK_IWGRP = 000020, /**< write permission (group) */ ISO_ROCK_IXGRP = 000010, /**< execute permission (group) */ ISO_ROCK_IROTH = 000004, /**< read permission (other) */ ISO_ROCK_IWOTH = 000002, /**< write permission (other) */ ISO_ROCK_IXOTH = 000001, /**< execute permission (other) */ ISO_ROCK_ISUID = 004000, /**< set user ID on execution */ ISO_ROCK_ISGID = 002000, /**< set group ID on execution */ ISO_ROCK_ISVTX = 001000, /**< save swapped text even after use */ ISO_ROCK_ISSOCK = 0140000, /**< socket */ ISO_ROCK_ISLNK = 0120000, /**< symbolic link */ ISO_ROCK_ISREG = 0100000, /**< regular */ ISO_ROCK_ISBLK = 060000, /**< block special */ ISO_ROCK_ISCHR = 020000, /**< character special */ ISO_ROCK_ISDIR = 040000, /**< directory */ ISO_ROCK_ISFIFO = 010000 /**< pipe or FIFO */ } iso_rock_enums; #define ISO_ROCK_IRUSR 000400 /** read permission (owner) */ #define ISO_ROCK_IWUSR 000200 /** write permission (owner) */ #define ISO_ROCK_IXUSR 000100 /** execute permission (owner) */ #define ISO_ROCK_IRGRP 000040 /** read permission (group) */ #define ISO_ROCK_IWGRP 000020 /** write permission (group) */ #define ISO_ROCK_IXGRP 000010 /** execute permission (group) */ #define ISO_ROCK_IROTH 000004 /** read permission (other) */ #define ISO_ROCK_IWOTH 000002 /** write permission (other) */ #define ISO_ROCK_IXOTH 000001 /** execute permission (other) */ #define ISO_ROCK_ISUID 004000 /** set user ID on execution */ #define ISO_ROCK_ISGID 002000 /** set group ID on execution */ #define ISO_ROCK_ISVTX 001000 /** save swapped text even after use */ #define ISO_ROCK_ISSOCK 0140000 /** socket */ #define ISO_ROCK_ISLNK 0120000 /** symbolic link */ #define ISO_ROCK_ISREG 0100000 /** regular */ #define ISO_ROCK_ISBLK 060000 /** block special */ #define ISO_ROCK_ISCHR 020000 /** character special */ #define ISO_ROCK_ISDIR 040000 /** directory */ #define ISO_ROCK_ISFIFO 010000 /** pipe or FIFO */ /** Enforced file locking (shared w/set group ID) */ #define ISO_ROCK_ENFMT ISO_ROCK_ISGID PRAGMA_BEGIN_PACKED /*! The next two structs are used by the system-use-sharing protocol (SUSP), in which the Rock Ridge extensions are embedded. It is quite possible that other extensions are present on the disk, and this is fine as long as they all use SUSP. */ /*! system-use-sharing protocol */ typedef struct iso_su_sp_s{ uint8_t magic[2]; uint8_t skip; } GNUC_PACKED iso_su_sp_t; /*! system-use extension record */ typedef struct iso_su_er_s { iso711_t len_id; /**< Identifier length. Value 10?. */ uint8_t len_des; uint8_t len_src; iso711_t ext_ver; /**< Extension version. Value 1? */ char data[EMPTY_ARRAY_SIZE]; } GNUC_PACKED iso_su_er_t; typedef struct iso_su_ce_s { iso733_t extent; iso733_t offset; iso733_t size; } GNUC_PACKED iso_su_ce_t; /*! POSIX file attributes, PX. See Rock Ridge Section 4.1.2 */ typedef struct iso_rock_px_s { iso733_t st_mode; /*! file mode permissions; same as st_mode of POSIX:5.6.1 */ iso733_t st_nlinks; /*! number of links to file; same as st_nlinks of POSIX:5.6.1 */ iso733_t st_uid; /*! user id owner of file; same as st_uid of POSIX:5.6.1 */ iso733_t st_gid; /*! group id of file; same as st_gid of of POSIX:5.6.1 */ } GNUC_PACKED iso_rock_px_t ; /*! POSIX device number, PN. A PN is mandatory if the file type recorded in the "PX" File Mode field for a Directory Record indicates a character or block device (ISO_ROCK_ISCHR | ISO_ROCK_ISBLK). This entry is ignored for other (non-Direcotry) file types. No more than one "PN" is recorded in the System Use Area of a Directory Record. See Rock Ridge Section 4.1.2 */ typedef struct iso_rock_pn_s { iso733_t dev_high; /**< high-order 32 bits of the 64 bit device number. 7.2.3 encoded */ iso733_t dev_low; /**< low-order 32 bits of the 64 bit device number. 7.2.3 encoded */ } GNUC_PACKED iso_rock_pn_t ; /*! These are the bits and their meanings for flags in the SL structure. */ typedef enum { ISO_ROCK_SL_CONTINUE = 1, ISO_ROCK_SL_CURRENT = 2, ISO_ROCK_SL_PARENT = 4, ISO_ROCK_SL_ROOT = 8 } iso_rock_sl_flag_t; #define ISO_ROCK_SL_CONTINUE 1 #define ISO_ROCK_SL_CURRENT 2 #define ISO_ROCK_SL_PARENT 4 #define ISO_ROCK_SL_ROOT 8 typedef struct iso_rock_sl_part_s { uint8_t flags; uint8_t len; char text[EMPTY_ARRAY_SIZE]; } GNUC_PACKED iso_rock_sl_part_t ; /*! Symbolic link. See Rock Ridge Section 4.1.3 */ typedef struct iso_rock_sl_s { uint8_t flags; iso_rock_sl_part_t link; } GNUC_PACKED iso_rock_sl_t ; /*! Alternate name. See Rock Ridge Section 4.1.4 */ /*! These are the bits and their meanings for flags in the NM structure. */ typedef enum { ISO_ROCK_NM_CONTINUE = 1, ISO_ROCK_NM_CURRENT = 2, ISO_ROCK_NM_PARENT = 4, } iso_rock_nm_flag_t; #define ISO_ROCK_NM_CONTINUE 1 #define ISO_ROCK_NM_CURRENT 2 #define ISO_ROCK_NM_PARENT 4 typedef struct iso_rock_nm_s { uint8_t flags; char name[EMPTY_ARRAY_SIZE]; } GNUC_PACKED iso_rock_nm_t ; /*! Child link. See Section 4.1.5.1 */ typedef struct iso_rock_cl_s { iso733_t location; } GNUC_PACKED iso_rock_cl_t ; /*! Parent link. See Section 4.1.5.2 */ typedef struct iso_rock_pl_s { iso733_t location; } GNUC_PACKED iso_rock_pl_t ; /*! These are the bits and their meanings for flags in the TF structure. */ typedef enum { ISO_ROCK_TF_CREATE = 1, ISO_ROCK_TF_MODIFY = 2, ISO_ROCK_TF_ACCESS = 4, ISO_ROCK_TF_ATTRIBUTES = 8, ISO_ROCK_TF_BACKUP = 16, ISO_ROCK_TF_EXPIRATION = 32, ISO_ROCK_TF_EFFECTIVE = 64, ISO_ROCK_TF_LONG_FORM = 128 } iso_rock_tf_flag_t; /* These are the bits and their meanings for flags in the TF structure. */ #define ISO_ROCK_TF_CREATE 1 #define ISO_ROCK_TF_MODIFY 2 #define ISO_ROCK_TF_ACCESS 4 #define ISO_ROCK_TF_ATTRIBUTES 8 #define ISO_ROCK_TF_BACKUP 16 #define ISO_ROCK_TF_EXPIRATION 32 #define ISO_ROCK_TF_EFFECTIVE 64 #define ISO_ROCK_TF_LONG_FORM 128 /*! Time stamp(s) for a file. See Rock Ridge Section 4.1.6 */ typedef struct iso_rock_tf_s { uint8_t flags; /**< See ISO_ROCK_TF_* bits above. */ uint8_t time_bytes[EMPTY_ARRAY_SIZE]; /**< A homogenious array of iso9660_ltime_t or iso9660_dtime_t entries depending on flags & ISO_ROCK_TF_LONG_FORM. Lacking a better method, we store this as an array of bytes and a cast to the appropriate type will have to be made before extraction. */ } GNUC_PACKED iso_rock_tf_t ; /*! File data in sparse format. See Rock Ridge Section 4.1.7 */ typedef struct iso_rock_sf_s { iso733_t virtual_size_high; /**< high-order 32 bits of virtual size */ iso733_t virtual_size_low; /**< low-order 32 bits of virtual size */ uint8_t table_depth; } GNUC_PACKED iso_rock_sf_t ; typedef struct iso_extension_record_s { char signature[2]; /**< signature word; either 'SP', 'CE', 'ER', 'RR', 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'TF', or 'ZF' */ iso711_t len; /**< length of system-user area - 44 for PX 20 for PN, 5+strlen(text) for SL, 21 for SF, etc. */ iso711_t version; /**< version number - value 1 */ union { iso_su_sp_t SP; /**< system-use-sharing protocol - not strictly part of Rock Ridge */ iso_su_er_t ER; /**< system-use extension packet - not strictly part of Rock Ridge */ iso_su_ce_t CE; /**< system-use - strictly part of Rock Ridge */ iso_rock_px_t PX; /**< Rock Ridge POSIX file attributes */ iso_rock_pn_t PN; /**< Rock Ridge POSIX device number */ iso_rock_sl_t SL; /**< Rock Ridge symbolic link */ iso_rock_nm_t NM; /**< Rock Ridge alternate name */ iso_rock_cl_t CL; /**< Rock Ridge child link */ iso_rock_pl_t PL; /**< Rock Ridge parent link */ iso_rock_tf_t TF; /**< Rock Ridge timestamp(s) for a file */ iso_rock_sf_t SF; /**< Rock Ridge sparse file */ } u; } GNUC_PACKED iso_extension_record_t; /* Bits for the u_su_fields of iso_rock_statbuf_t */ #define ISO_ROCK_SUF_SP 0x00000001 #define ISO_ROCK_SUF_ER 0x00000002 #define ISO_ROCK_SUF_CE 0x00000004 #define ISO_ROCK_SUF_PX 0x00000008 #define ISO_ROCK_SUF_PN 0x00000010 #define ISO_ROCK_SUF_SL 0x00000020 #define ISO_ROCK_SUF_NM 0x00000040 #define ISO_ROCK_SUF_TF 0x00000080 #define ISO_ROCK_SUF_CL 0x00000100 #define ISO_ROCK_SUF_PL 0x00000200 #define ISO_ROCK_SUF_RE 0x00000400 #define ISO_ROCK_SUF_SF 0x00000800 #define ISO_ROCK_SUF_FORMAL (ISO_ROCK_SUF_ER | ISO_ROCK_SUF_PX | ISO_ROCK_SUF_PN | \ ISO_ROCK_SUF_SL | ISO_ROCK_SUF_NM | ISO_ROCK_SUF_CL | \ ISO_ROCK_SUF_PL | ISO_ROCK_SUF_RE | ISO_ROCK_SUF_TF | \ ISO_ROCK_SUF_SF) typedef struct iso_rock_time_s { bool b_used; /**< If true, field has been set and is valid. Otherwise remaning fields are meaningless. */ bool b_longdate; /**< If true date format is a iso9660_ltime_t. Otherwise date is iso9660_dtime_t */ union { iso9660_ltime_t ltime; iso9660_dtime_t dtime; } t; } GNUC_PACKED iso_rock_time_t; typedef struct iso_rock_statbuf_s { bool_3way_t b3_rock; /**< has Rock Ridge extension. If "yep", then the fields are used. */ posix_mode_t st_mode; /**< protection */ posix_nlink_t st_nlinks; /**< number of hard links */ posix_uid_t st_uid; /**< user ID of owner */ posix_gid_t st_gid; /**< group ID of owner */ uint8_t s_rock_offset; int i_symlink; /**< size of psz_symlink */ int i_symlink_max; /**< max allocated to psz_symlink */ char *psz_symlink; /**< if symbolic link, name of pointed to file. */ iso_rock_time_t create; /**< create time See ISO 9660:9.5.4. */ iso_rock_time_t modify; /**< time of last modification ISO 9660:9.5.5. st_mtime field of POSIX:5.6.1. */ iso_rock_time_t access; /**< time of last file access st_atime field of POSIX:5.6.1. */ iso_rock_time_t attributes; /**< time of last attribute change. st_ctime field of POSIX:5.6.1. */ iso_rock_time_t backup; /**< time of last backup. */ iso_rock_time_t expiration; /**< time of expiration; See ISO 9660:9.5.6. */ iso_rock_time_t effective; /**< Effective time; See ISO 9660:9.5.7. */ uint32_t i_rdev; /**< the upper 16-bits is major device number, the lower 16-bits is the minor device number */ uint32_t u_su_fields; /**< System Use field attributes */ } iso_rock_statbuf_t; PRAGMA_END_PACKED /*! return length of name field; 0: not found, -1: to be ignored */ int get_rock_ridge_filename(iso9660_dir_t * de, /*in*/ void * p_iso, /*out*/ char * retname, /*out*/ iso9660_stat_t *p_stat); int parse_rock_ridge_stat(iso9660_dir_t *de, /*out*/ iso9660_stat_t *p_stat); /*! Returns POSIX mode bitstring for a given file. */ mode_t iso9660_get_posix_filemode_from_rock(const iso_rock_statbuf_t *rr); /*! Returns a string which interpreting the POSIX mode st_mode. For example: \verbatim drwxrws--- -rw---Sr-- lrwxrwxrwx \endverbatim A description of the characters in the string follows The 1st character is either "d" if the entry is a directory, "l" is a symbolic link or "-" if neither. The 2nd to 4th characters refer to permissions for a user while the the 5th to 7th characters refer to permissions for a group while, and the 8th to 10h characters refer to permissions for everyone. In each of these triplets the first character (2, 5, 8) is "r" if the entry is allowed to be read. The second character of a triplet (3, 6, 9) is "w" if the entry is allowed to be written. The third character of a triplet (4, 7, 10) is "x" if the entry is executable but not user (for character 4) or group (for characters 6) settable and "s" if the item has the corresponding user/group set. For a directory having an executable property on ("x" or "s") means the directory is allowed to be listed or "searched". If the execute property is not allowed for a group or user but the corresponding group/user is set "S" indicates this. If none of these properties holds the "-" indicates this. */ const char *iso9660_get_rock_attr_str(posix_mode_t st_mode); /** These variables are not used, but are defined to facilatate debugging by letting us use enumerations values (which also correspond to \#define's inside a debugged program. */ extern iso_rock_nm_flag_t iso_rock_nm_flag; extern iso_rock_sl_flag_t iso_rock_sl_flag; extern iso_rock_tf_flag_t iso_rock_tf_flag; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_ROCK_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/scsi_mmc.h000066400000000000000000000015741474051130400174350ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file scsi_mmc.h * * \brief Obsolete please use instead. */ /* ust a moment while, I transfer your call... */ #include libcdio-2.2.0/include/cdio/sector.h000066400000000000000000000270251474051130400171360ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! \file sector.h \brief Things related to CD-ROM layout: tracks, sector sizes, MSFs, LBAs. A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 2340, or 2352 bytes long. Sector types of the standard CD-ROM data formats: \verbatim format sector type user data size (bytes) ----------------------------------------------------------------------------- 1 (Red Book) CD-DA 2352 (CDIO_CD_FRAMESIZE_RAW) 2 (Yellow Book) Mode1 Form1 2048 (CDIO_CD_FRAMESIZE) 3 (Yellow Book) Mode1 Form2 2336 (M2RAW_SECTOR_SIZE) 4 (Green Book) Mode2 Form1 2048 (CDIO_CD_FRAMESIZE) 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes) The layout of the standard CD-ROM data formats: ----------------------------------------------------------------------------- - audio (red): | audio_sample_bytes | | 2352 | - data (yellow, mode1): | sync - head - data - EDC - zero - ECC | | 12 - 4 - 2048 - 4 - 8 - 276 | - data (yellow, mode2): | sync - head - data | | 12 - 4 - 2336 | - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC | | 12 - 4 - 8 - 2048 - 4 - 276 | - XA data (green, mode2 form2): | sync - head - sub - data - Spare | | 12 - 4 - 8 - 2324 - 4 | \endverbatim */ #ifndef CDIO_SECTOR_H_ #define CDIO_SECTOR_H_ #ifdef __cplusplus extern "C" { #endif #include /*! Information that can be obtained through a Read Subchannel command. */ typedef enum cdio_subchannel { CDIO_SUBCHANNEL_SUBQ_DATA = 0, CDIO_SUBCHANNEL_CURRENT_POSITION = 1, CDIO_SUBCHANNEL_MEDIA_CATALOG = 2, CDIO_SUBCHANNEL_TRACK_ISRC = 3 } cdio_subchannel; /*! track flags * Q Sub-channel Control Field (4.2.3.3) */ typedef enum { NONE = 0x00, /* no flags set */ PRE_EMPHASIS = 0x01, /* audio track recorded with pre-emphasis */ COPY_PERMITTED = 0x02, /* digital copy permitted */ DATA = 0x04, /* data track */ FOUR_CHANNEL_AUDIO = 0x08, /* 4 audio channels */ SCMS = 0x10 /* SCMS (5.29.2.7) */ } flag_t; #define CDIO_PREGAP_SECTORS 150 #define CDIO_POSTGAP_SECTORS 150 /*! An enumeration for some of the CDIO_CD \#defines below. This isn't really an enumeration one would really use in a program it is to be helpful in debuggers where wants just to refer to the CDIO_CD_ names and get something. */ extern enum cdio_cd_enums { CDIO_CD_MINS = 74, /**< max. minutes per CD, not really a limit */ CDIO_CD_SECS_PER_MIN = 60, /**< seconds per minute */ CDIO_CD_FRAMES_PER_SEC = 75, /**< frames per second */ CDIO_CD_SYNC_SIZE = 12, /**< 12 sync bytes per raw data frame */ CDIO_CD_CHUNK_SIZE = 24, /**< lowest-level "data bytes piece" */ CDIO_CD_NUM_OF_CHUNKS = 98, /**< chunks per frame */ CDIO_CD_FRAMESIZE_SUB = 96, /**< subchannel data "frame" size */ CDIO_CD_HEADER_SIZE = 4, /**< header (address) bytes per raw frame */ CDIO_CD_SUBHEADER_SIZE = 8, /**< subheader bytes per raw XA data frame */ CDIO_CD_ECC_SIZE = 276, /**< bytes ECC per most raw data frame types */ CDIO_CD_FRAMESIZE = 2048, /**< bytes per frame, "cooked" mode */ CDIO_CD_FRAMESIZE_RAW = 2352, /**< bytes per frame, "raw" mode */ CDIO_CD_FRAMESIZE_RAWER = 2646, /**< The maximum possible returned */ CDIO_CD_FRAMESIZE_RAW1 = 2340, CDIO_CD_FRAMESIZE_RAW0 = 2336, CDIO_CD_MAX_SESSIONS = 99, CDIO_CD_MIN_SESSION_NO = 1, /**<, Smallest CD session number */ CDIO_CD_MAX_LSN = 450150, /**< Largest LSN in a CD */ CDIO_CD_MIN_LSN = -450150, /**< Smallest LSN in a CD */ } cdio_cd_enums; /*! Some generally useful CD-ROM information -- mostly based on the above. This is from linux.h - not to slight other OS's. This was the first place I came across such useful stuff. */ #define CDIO_CD_MINS 74 /**< max. minutes per CD, not really a limit */ #define CDIO_CD_SECS_PER_MIN 60 /**< seconds per minute */ #define CDIO_CD_FRAMES_PER_SEC 75 /**< frames per second */ #define CDIO_CD_SYNC_SIZE 12 /**< 12 sync bytes per raw data frame */ #define CDIO_CD_CHUNK_SIZE 24 /**< lowest-level "data bytes piece" */ #define CDIO_CD_NUM_OF_CHUNKS 98 /**< chunks per frame */ #define CDIO_CD_FRAMESIZE_SUB 96 /**< subchannel data "frame" size */ #define CDIO_CD_HEADER_SIZE 4 /**< header (address) bytes per raw data frame */ #define CDIO_CD_SUBHEADER_SIZE 8 /**< subheader bytes per raw XA data frame */ #define CDIO_CD_EDC_SIZE 4 /**< bytes EDC per most raw data frame types */ #define CDIO_CD_M1F1_ZERO_SIZE 8 /**< bytes zero per yellow book mode 1 frame */ #define CDIO_CD_ECC_SIZE 276 /**< bytes ECC per most raw data frame types */ #define CDIO_CD_FRAMESIZE 2048 /**< bytes per frame, "cooked" mode */ #define CDIO_CD_FRAMESIZE_RAW 2352 /**< bytes per frame, "raw" mode */ #define CDIO_CD_FRAMESIZE_RAWER 2646 /**< The maximum possible returned bytes */ #define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/ #define CDIO_CD_FRAMESIZE_RAW0 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE-CDIO_CD_HEADER_SIZE) /*2336*/ /*! "before data" part of raw XA (green, mode2) frame */ #define CDIO_CD_XA_HEADER (CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE) /*! "after data" part of raw XA (green, mode2 form1) frame */ #define CDIO_CD_XA_TAIL (CDIO_CD_EDC_SIZE+CDIO_CD_ECC_SIZE) /*! "before data" sync bytes + header of XA (green, mode2) frame */ #define CDIO_CD_XA_SYNC_HEADER (CDIO_CD_SYNC_SIZE+CDIO_CD_XA_HEADER) /*! String of bytes used to identify the beginning of a Mode 1 or Mode 2 sector. */ extern const uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE]; /**< {0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}; */ /*! An enumeration for some of the M2*_SECTOR_SIZE \#defines below. This isn't really an enumeration one would really use in a program it is to be helpful in debuggers where wants just to refer to the M2*_SECTOR_SIZE names and get something. */ extern enum m2_sector_enums { M2F2_SECTOR_SIZE = 2324, M2SUB_SECTOR_SIZE = 2332, M2RAW_SECTOR_SIZE = 2336 } m2_sector_enums; #define M2F2_SECTOR_SIZE 2324 #define M2SUB_SECTOR_SIZE 2332 #define M2RAW_SECTOR_SIZE 2336 /*! Largest CD session number */ #define CDIO_CD_MAX_SESSIONS 99 /*! Smallest CD session number */ #define CDIO_CD_MIN_SESSION_NO 1 /*! Largest LSN in a CD */ #define CDIO_CD_MAX_LSN 450150 /*! Smallest LSN in a CD */ #define CDIO_CD_MIN_LSN -450150 #define CDIO_CD_FRAMES_PER_MIN \ (CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN) typedef enum cdio_cd_minutes_sectors { CDIO_CD_74MIN_SECTORS = UINT32_C(74) * CDIO_CD_FRAMES_PER_MIN, CDIO_CD_80MIN_SECTORS = UINT32_C(80) * CDIO_CD_FRAMES_PER_MIN, CDIO_CD_90MIN_SECTORS = UINT32_C(90) * CDIO_CD_FRAMES_PER_MIN, CDIO_CD_MAX_SECTORS = UINT32_C(100) * CDIO_CD_FRAMES_PER_MIN - CDIO_PREGAP_SECTORS } cdio_cd_minutes_sectors; #define msf_t_SIZEOF 3 /*! Convert an LBA into a string representation of the MSF. \warning cdio_lba_to_msf_str returns new allocated string */ char *cdio_lba_to_msf_str (lba_t i_lba); /*! Convert an MSF into a string representation of the MSF. \warning cdio_msf_to_msf_str returns new allocated string */ char *cdio_msf_to_str (const msf_t *p_msf); /*! Convert an LBA into the corresponding LSN. */ lba_t cdio_lba_to_lsn (lba_t i_lba); /*! Convert an LBA into the corresponding MSF. */ void cdio_lba_to_msf(lba_t i_lba, msf_t *p_msf); /*! Convert an LSN into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_lsn_to_lba (lsn_t i_lsn); /*! Convert an LSN into the corresponding MSF. */ void cdio_lsn_to_msf (lsn_t i_lsn, msf_t *p_msf); /*! Convert a MSF into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_msf_to_lba (const msf_t *p_msf); /*! Convert a MSF into the corresponding LSN. CDIO_INVALID_LSN is returned if there is an error. */ lsn_t cdio_msf_to_lsn (const msf_t *p_msf); /*! Convert a MSF - broken out as 3 integer components into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds, unsigned int frames); /*! Convert a string of the form MM:SS:FF into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_mmssff_to_lba (const char *psz_mmssff); #ifdef __cplusplus } #endif #ifndef DO_NOT_WANT_PARANOIA_COMPATIBILITY /** For compatibility with good ol' paranoia */ #define CD_FRAMESIZE_RAW CDIO_CD_FRAMESIZE_RAW #endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/ #endif /* CDIO_SECTOR_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/track.h000066400000000000000000000216621474051130400167440ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file track.h * \brief The top-level header for track-related libcdio calls. */ #ifndef CDIO_TRACK_H_ #define CDIO_TRACK_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! Printable tags for track_format_t enumeration. */ extern const char *track_format2str[6]; typedef enum { TRACK_FORMAT_AUDIO, /**< Audio track, e.g. CD-DA */ TRACK_FORMAT_CDI, /**< CD-i. How this is different from DATA below? */ TRACK_FORMAT_XA, /**< Mode2 of some sort */ TRACK_FORMAT_DATA, /**< Mode1 of some sort */ TRACK_FORMAT_PSX, /**< Playstation CD. Like audio but only 2336 bytes * of user data. */ TRACK_FORMAT_ERROR /**< Dunno what is, or some other error. */ } track_format_t; typedef enum { CDIO_TRACK_FLAG_FALSE, CDIO_TRACK_FLAG_TRUE, CDIO_TRACK_FLAG_ERROR, CDIO_TRACK_FLAG_UNKNOWN } track_flag_t; /*! \brief Structure containing attributes associated with a track */ typedef struct { track_flag_t preemphasis; /**< Linear preemphasis on an audio track */ track_flag_t copy_permit; /**< Whether copying is permitted */ int channels; /**< Number of audio channels, 2, 4. -2 if not implemented or -1 for error. */ } track_flags_t; /*! The leadout track is always 0xAA, regardless of # of tracks on disc, or what value may be used internally. For example although OS X uses a different value for the lead-out track internally than given below, programmers should use CDIO_CDROM_LEADOUT_TRACK and not worry about this. */ /*! An enumeration for some of the CDIO_CDROM_* \#defines below. This isn't really an enumeration one would really use in a program; it is to be helpful in debuggers where wants just to refer to the CDIO_CDROM_* names and get something. */ extern enum cdio_track_enums { CDIO_CDROM_LBA = 0x01, /**< "logical block": first frame is #0 */ CDIO_CDROM_MSF = 0x02, /**< "minute-second-frame": binary, not BCD here! */ CDIO_CDROM_DATA_TRACK = 0x04, CDIO_CDROM_CDI_TRACK = 0x10, CDIO_CDROM_XA_TRACK = 0x20, CDIO_CD_MAX_TRACKS = 99, /**< Largest CD track number */ CDIO_CDROM_LEADOUT_TRACK = 0xAA, /**< Lead-out track number */ CDIO_INVALID_TRACK = 0xFF, /**< Constant for invalid track number */ } cdio_track_enums; #define CDIO_CD_MIN_TRACK_NO 1 /**< Smallest CD track number */ /*! track modes (Table 350) reference: MMC-3 draft revsion - 10g */ typedef enum { AUDIO, /**< 2352 byte block length */ MODE1, /**< 2048 byte block length */ MODE1_RAW, /**< 2352 byte block length */ MODE2, /**< 2336 byte block length */ MODE2_FORM1, /**< 2048 byte block length */ MODE2_FORM2, /**< 2324 byte block length */ MODE2_FORM_MIX, /**< 2336 byte block length */ MODE2_RAW /**< 2352 byte block length */ } trackmode_t; /*! Get the number of the first track. @return the track number or CDIO_INVALID_TRACK on error. */ track_t cdio_get_first_track_num(const CdIo_t *p_cdio); /*! Return the last track number. CDIO_INVALID_TRACK is returned on error. */ track_t cdio_get_last_track_num (const CdIo_t *p_cdio); /*! Find the track which contains lsn. CDIO_INVALID_TRACK is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track 0 is returned. Otherwise we return the track that spans the lsn. */ track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn); /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track); /*! Return copy protection status on a track. Is this meaningful if not an audio track? */ track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio, track_t i_track); /*! Get the format (audio, mode2, mode1) of track. */ track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t i_track); /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track); /*! Return the ending LSN for track number i_track in cdio. CDIO_INVALID_LSN is returned on error. */ lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t i_track); /*! Get the starting LBA for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @param p_cdio object to get information from @param i_track the track number we want the LSN for @return the starting LBA or CDIO_INVALID_LBA on error. */ lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track); /*! Return the starting LSN for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @param p_cdio object to get information from @param i_track the track number we want the LSN for @return the starting LSN or CDIO_INVALID_LSN on error. */ lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track); /*! Return the starting LBA for the pregap for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. @param p_cdio object to get information from @param i_track the track number we want the LBA for @return the starting LBA or CDIO_INVALID_LBA on error. */ lba_t cdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t i_track); /*! Return the starting LSN for the pregap for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. @param p_cdio object to get information from @param i_track the track number we want the LSN for @return the starting LSN or CDIO_INVALID_LSN on error. */ lsn_t cdio_get_track_pregap_lsn(const CdIo_t *p_cdio, track_t i_track); /*! Get the International Standard Recording Code (ISRC) for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. @return the International Standard Recording Code (ISRC) or NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track); /*! Return the starting MSF (minutes/secs/frames) for track number i_track in p_cdio. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. @return true if things worked or false if there is no track entry. */ bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t i_track, /*out*/ msf_t *msf); /*! Get linear preemphasis status on an audio track This is not meaningful if not an audio track? */ track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio, track_t i_track); /*! Get the number of sectors between this track an the next. This includes any pregap sectors before the start of the next track. Track numbers usually start at something greater than 0, usually 1. @return the number of sectors or 0 if there is an error. */ unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_TRACK_H_ */ libcdio-2.2.0/include/cdio/types.h000066400000000000000000000230041474051130400167740ustar00rootroot00000000000000/* Copyright (C) 2002-2008, 2012, 2017, 2019, 2024 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file types.h * \brief Common type definitions used pervasively in libcdio. */ #ifndef CDIO_TYPES_H_ #define CDIO_TYPES_H_ #ifdef __cplusplus extern "C" { #else # include #endif /* __cplusplus */ /* If is not available on your platform please contact the libcdio mailing list so that we can fix it! */ #if !defined(ARE_THERE_STILL_ENVS_WITHOUT_SYS_TYPES) #include #endif #if defined(AMIGA) typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; typedef u_int64_t uint64_t; #else /* If is not available on your platform please contact the libcdio mailing list so that we can fix it! For MSVC, you can find both a public domain stdint.h and inttypes.h in the MSVC/missing directory of libcdio. */ #include #endif typedef uint8_t ubyte; /* MSVC does not define mode_t and ssize_t by default. The way to compensate for missing UNIX types is to include a custom unistd.h that defines them. Such a file is provided with the libcdio source, in the MSVC/missing directory */ #if defined(_MSC_VER) #include #endif /* default HP/UX macros are broken */ #if defined(__hpux__) # undef UINT16_C # undef UINT32_C # undef UINT64_C # undef INT64_C #endif /* if it's still not defined, take a good guess... should work for most 32bit and 64bit archs */ #ifndef UINT16_C # define UINT16_C(c) c ## U #endif #ifndef UINT32_C # if defined (SIZEOF_INT) && SIZEOF_INT == 4 # define UINT32_C(c) c ## U # elif defined (SIZEOF_LONG) && SIZEOF_LONG == 4 # define UINT32_C(c) c ## UL # else # define UINT32_C(c) c ## U # endif #endif #ifndef UINT64_C # if defined (SIZEOF_LONG) && SIZEOF_LONG == 8 # define UINT64_C(c) c ## UL # elif defined (SIZEOF_INT) && SIZEOF_INT == 8 # define UINT64_C(c) c ## U # else # define UINT64_C(c) c ## ULL # endif #endif #ifndef INT64_C # if defined (SIZEOF_LONG) && SIZEOF_LONG == 8 # define INT64_C(c) c ## L # elif defined (SIZEOF_INT) && SIZEOF_INT == 8 # define INT64_C(c) c # else # define INT64_C(c) c ## LL # endif #endif /* some GCC optimizations -- gcc 2.5+ */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define GNUC_PRINTF( format_idx, arg_idx ) \ __attribute__((format (printf, format_idx, arg_idx))) #define GNUC_SCANF( format_idx, arg_idx ) \ __attribute__((format (scanf, format_idx, arg_idx))) #define GNUC_FORMAT( arg_idx ) \ __attribute__((format_arg (arg_idx))) #define GNUC_NORETURN \ __attribute__((noreturn)) #define GNUC_CONST \ __attribute__((const)) #define GNUC_UNUSED \ __attribute__((unused)) #define GNUC_PACKED \ __attribute__((packed)) #else /* !__GNUC__ */ #define GNUC_PRINTF( format_idx, arg_idx ) #define GNUC_SCANF( format_idx, arg_idx ) #define GNUC_FORMAT( arg_idx ) #define GNUC_NORETURN #define GNUC_CONST #define GNUC_UNUSED #define GNUC_PACKED #ifdef _MSC_VER #define __PRETTY_FUNCTION__ __FUNCSIG__ #endif #endif /* !__GNUC__ */ #if defined(__MINGW32__) || (defined( __clang_major__) && __clang_major__ > 9) # define PRAGMA_BEGIN_PACKED _Pragma("pack(push)") \ _Pragma("pack(1)") # define PRAGMA_END_PACKED _Pragma("pack(pop)") #elif __GNUC__ > 4 || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901) /* should work with GCC > 4.0 clang and most EDG-frontend based C and C++ compilers */ # define PRAGMA_BEGIN_PACKED _Pragma("pack(1)") # define PRAGMA_END_PACKED _Pragma("pack()") #elif defined(_MSC_VER) # define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1)) # define PRAGMA_END_PACKED __pragma(pack(pop)) #else /* neither gcc nor _Pragma() available... */ /* ...so let's be naive and hope the regression testsuite is run... */ # define PRAGMA_BEGIN_PACKED # define PRAGMA_END_PACKED #endif /* * user directed static branch prediction gcc 2.96+ */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95) # define GNUC_LIKELY(x) __builtin_expect((x),true) # define GNUC_UNLIKELY(x) __builtin_expect((x),false) #else # define GNUC_LIKELY(x) (x) # define GNUC_UNLIKELY(x) (x) #endif #ifndef NULL # define NULL ((void*) 0) #endif /** Provide a notice for deprecated elements. Before gcc 4.5 'deprecated' takes no arguments. */ #if defined(__GNUC__) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) # define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated(notice))) # else # define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated)) # endif #elif defined(_MSC_VER) #define LIBCDIO_DEPRECATED(object, notice) __declspec(deprecated(notice)) object #else #define LIBCDIO_DEPRECATED(object, notice) #endif /** our own offsetof()-like macro */ #define __cd_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) /*! \brief MSF (minute/second/frame) structure One CD-ROMs addressing scheme especially used in audio formats (Red Book) is an address by minute, sector and frame which BCD-encoded in three bytes. An alternative format is an lba_t. Note: the fields in this structure are BCD encoded. Use cdio_to_bcd8() or cdio_from_bcd8() to convert an integer into or out of this format. The format specifier %x (not %d) can be used if you need to format or print values in this structure. @see lba_t */ PRAGMA_BEGIN_PACKED struct msf_s { uint8_t m, s, f; /* BCD encoded! */ } GNUC_PACKED; PRAGMA_END_PACKED typedef struct msf_s msf_t; #define msf_t_SIZEOF 3 /*! \brief UTF-8 char definition Type to denote UTF-8 strings. */ typedef char cdio_utf8_t; typedef enum { nope = 0, yep = 1, dunno = 2 } bool_3way_t; /* type used for bit-fields in structs (1 <= bits <= 8) */ #if defined(__GNUC__) /* this is strict ISO C99 which allows only 'unsigned int', 'signed int' and '_Bool' explicitly as bit-field type */ typedef unsigned int bitfield_t; #else /* other compilers might increase alignment requirements to match the 'unsigned int' type -- fixme: find out how unalignment accesses can be pragma'ed on non-gcc compilers */ typedef uint8_t bitfield_t; #endif /*! The type of a Logical Block Address. We allow for an lba to be negative to be consistent with an lba, although I'm not sure this this is possible. */ typedef int32_t lba_t; /*! The type of a Logical Sector Number. Note that an lba can be negative and the MMC3 specs allow for a conversion of a negative lba. @see msf_t */ typedef int32_t lsn_t; /* Address in either MSF or logical format */ union cdio_cdrom_addr { msf_t msf; lba_t lba; }; /*! The type of a track number 0..99. */ typedef uint8_t track_t; /*! The type of a session number 0..99. */ typedef uint8_t session_t; /*! Constant for invalid session number */ #define CDIO_INVALID_SESSION 0xFF /*! Constant for invalid LBA. It is 151 less than the most negative LBA -45150. This provide slack for the 150-frame offset in LBA to LSN 150 conversions */ #define CDIO_INVALID_LBA -45301 /*! Constant for invalid LSN */ #define CDIO_INVALID_LSN CDIO_INVALID_LBA /*! Number of ASCII bytes in a media catalog number (MCN). We include an extra 0 byte so these can be used as C strings. */ #define CDIO_MCN_SIZE 13 /*! Type to hold ASCII bytes in a media catalog number (MCN). We include an extra 0 byte so these can be used as C strings. */ typedef char cdio_mcn_t[CDIO_MCN_SIZE+1]; /*! Number of ASCII bytes in International Standard Recording Codes (ISRC) */ #define CDIO_ISRC_SIZE 12 /*! Type to hold ASCII bytes in a ISRC. We include an extra 0 byte so these can be used as C strings. */ typedef char cdio_isrc_t[CDIO_ISRC_SIZE+1]; typedef int cdio_fs_anal_t; /*! track flags Q Sub-channel Control Field (4.2.3.3) */ typedef enum { CDIO_TRACK_FLAG_NONE = 0x00, /**< no flags set */ CDIO_TRACK_FLAG_PRE_EMPHASIS = 0x01, /**< audio track recorded with pre-emphasis */ CDIO_TRACK_FLAG_COPY_PERMITTED = 0x02, /**< digital copy permitted */ CDIO_TRACK_FLAG_DATA = 0x04, /**< data track */ CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO = 0x08, /**< 4 audio channels */ CDIO_TRACK_FLAG_SCMS = 0x10 /**< SCMS (5.29.2.7) */ } cdio_track_flag; /* Note that this matches the free() prototype.*/ typedef void (*CdioDataFree_t)(void *ptr); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_TYPES_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/udf.h000066400000000000000000000145501474051130400164140ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2010 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file udf.h * * \brief The top-level interface header for libudf: UDF filesystem * library; applications include this. * */ #ifndef UDF_H #define UDF_H #include #include #include typedef uint16_t partition_num_t; /** Opaque structures. */ typedef struct udf_s udf_t; typedef struct udf_file_s udf_file_t; typedef struct udf_dirent_s { char *psz_name; bool b_dir; /* true if this entry is a directory. */ bool b_parent; /* True if has parent directory (e.g. not root directory). If not set b_dir will probably be true. */ udf_t *p_udf; uint32_t i_part_start; uint32_t i_loc, i_loc_end; uint64_t dir_left; uint8_t *sector; udf_fileid_desc_t *fid; /* This field has to come last because it is variable in length. */ udf_file_entry_t fe; } udf_dirent_t; /** Imagine the below a \#define'd value rather than distinct values of an enum. */ typedef enum { UDF_BLOCKSIZE = 2048 } udf_enum1_t; /** This variable is trickery to force the above enum symbol value to be recorded in debug symbol tables. It is used to allow one refer to above enumeration values in a debugger and debugger expressions */ extern udf_enum1_t debug_udf_enum1; #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! Close UDF and free resources associated with p_udf. */ bool udf_close (udf_t *p_udf); /*! Seek to a position i_start and then read i_blocks. Number of blocks read is returned. One normally expects the return to be equal to i_blocks. */ driver_return_code_t udf_read_sectors (const udf_t *p_udf, void *ptr, lsn_t i_start, long int i_blocks); /*! Open an UDF for reading. Maybe in the future we will have a mode. NULL is returned on error. Caller must free result - use udf_close for that. */ udf_t *udf_open (const char *psz_path); /*! Return the partition number of the the opened udf handle. -1 Is returned if we have an error. */ int16_t udf_get_part_number(const udf_t *p_udf); /*! Get the root in p_udf. If b_any_partition is false then the root must be in the given partition. NULL is returned if the partition is not found or a root is not found or there is on error. Caller must free result - use udf_file_free for that. */ udf_dirent_t *udf_get_root (udf_t *p_udf, bool b_any_partition, partition_num_t i_partition); /** * Gets the Volume Identifier string, in 8bit unicode (latin-1) * psz_volid, place to put the string * i_volid, size of the buffer psz_volid points to * returns the size of buffer needed for all data */ int udf_get_volume_id(udf_t *p_udf, /*out*/ char *psz_volid, unsigned int i_volid); /** * Gets the Volume Set Identifier, as a 128-byte dstring (not decoded) * WARNING This is not a null terminated string * volsetid, place to put the data * i_volsetid, size of the buffer psz_volsetid points to * the buffer should be >=128 bytes to store the whole volumesetidentifier * returns the size of the available volsetid information (128) * or 0 on error */ int udf_get_volumeset_id(udf_t *p_udf, /*out*/ uint8_t *volsetid, unsigned int i_volsetid); /** * Gets the Logical Volume Identifier string, in 8bit unicode (latin-1) * psz_logvolid, place to put the string * i_logvolid, size of the buffer psz_logvolid points to * returns the size of buffer needed for all data * A call to udf_get_root() should have been issued before this call */ int udf_get_logical_volume_id(udf_t *p_udf, /*out*/ char *psz_logvolid, unsigned int i_logvolid); /*! Return a file pointer matching psz_name. */ udf_dirent_t *udf_fopen(udf_dirent_t *p_udf_root, const char *psz_name); /*! udf_mode_string - fill in string PSZ_STR with an ls-style ASCII representation of the i_mode. PSZ_STR is returned. 10 characters are stored in PSZ_STR; a terminating null byte is added. The characters stored in PSZ_STR are: 0 File type. 'd' for directory, 'c' for character special, 'b' for block special, 'm' for multiplex, 'l' for symbolic link, 's' for socket, 'p' for fifo, '-' for regular, '?' for any other file type 1 'r' if the owner may read, '-' otherwise. 2 'w' if the owner may write, '-' otherwise. 3 'x' if the owner may execute, 's' if the file is set-user-id, '-' otherwise. 'S' if the file is set-user-id, but the execute bit isn't set. 4 'r' if group members may read, '-' otherwise. 5 'w' if group members may write, '-' otherwise. 6 'x' if group members may execute, 's' if the file is set-group-id, '-' otherwise. 'S' if it is set-group-id but not executable. 7 'r' if any user may read, '-' otherwise. 8 'w' if any user may write, '-' otherwise. 9 'x' if any user may execute, 't' if the file is "sticky" (will be retained in swap space after execution), '-' otherwise. 'T' if the file is sticky but not executable. */ char *udf_mode_string (mode_t i_mode, char *psz_str); bool udf_get_lba(const udf_file_entry_t *p_udf_fe, /*out*/ uint32_t *start, /*out*/ uint32_t *end); #ifdef __cplusplus } #endif /* __cplusplus */ #include #include #endif /*UDF_H*/ libcdio-2.2.0/include/cdio/udf_file.h000066400000000000000000000066401474051130400174140ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** * \file udf_file.h * * \brief Routines involving UDF file operations * */ #ifndef UDF_FILE_H #define UDF_FILE_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Return the file id descriptor of the given file. */ bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent, /*out*/ udf_fileid_desc_t *p_udf_fid); /** Return the name of the file */ const char *udf_get_filename(const udf_dirent_t *p_udf_dirent); /** Return the name of the file */ bool udf_get_file_entry(const udf_dirent_t *p_udf_dirent, /*out*/ udf_file_entry_t *p_udf_fe); /** Return the number of hard links of the file. Return 0 if error. */ uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent); /** Return the file length the file. Return 2147483647L if error. */ uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent); /** Returns a POSIX mode for a given p_udf_dirent. */ mode_t udf_get_posix_filemode(const udf_dirent_t *p_udf_dirent); /** Return the next subdirectory. */ udf_dirent_t *udf_opendir(const udf_dirent_t *p_udf_dirent); /** Attempts to read up to count bytes from UDF directory entry p_udf_dirent into the buffer starting at buf. buf should be a multiple of UDF_BLOCKSIZE bytes. Reading continues after the point at which we last read or from the beginning the first time. If count is zero, read() returns zero and has no other results. If count is greater than SSIZE_MAX, the result is unspecified. If there is an error, cast the result to driver_return_code_t for the specific error code. */ /** Attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. If count is zero, read() returns zero and has no other results. If count is greater than SSIZE_MAX, the result is unspecified. */ ssize_t udf_read_block(const udf_dirent_t *p_udf_dirent, void * buf, size_t count); /** Advances p_udf_direct to the the next directory entry in the pointed to by p_udf_dir. It also returns this as the value. NULL is returned on reaching the end-of-file or if an error. Also p_udf_dirent is free'd. If the end of is not reached the caller must call udf_dirent_free() with p_udf_dirent when done with it to release resources. */ udf_dirent_t *udf_readdir(udf_dirent_t *p_udf_dirent); /** free free resources associated with p_udf_dirent. */ bool udf_dirent_free(udf_dirent_t *p_udf_dirent); /** Return true if the file is a directory. */ bool udf_is_dir(const udf_dirent_t *p_udf_dirent); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /*UDF_FILE_H*/ libcdio-2.2.0/include/cdio/udf_time.h000066400000000000000000000044501474051130400174300ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! * \file udf_time.h * * \brief UDF time conversion and access files. * */ #ifndef UDF_TIME_H #define UDF_TIME_H #include #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) && !defined(__struct_timespec_defined) struct timespec { time_t tv_sec; /* Seconds */ long tv_nsec; /* Nanoseconds */ }; #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! Return the access time of the file. */ time_t udf_get_access_time(const udf_dirent_t *p_udf_dirent); /*! Return the attribute (most recent create or access) time of the file */ time_t udf_get_attribute_time(const udf_dirent_t *p_udf_dirent); /*! Return the modification time of the file. */ time_t udf_get_modification_time(const udf_dirent_t *p_udf_dirent); /*! Return the access timestamp of the file */ udf_timestamp_t *udf_get_access_timestamp(const udf_dirent_t *p_udf_dirent); /*! Return the modification timestamp of the file */ udf_timestamp_t *udf_get_modification_timestamp(const udf_dirent_t *p_udf_dirent); /*! Return the attr timestamp of the file */ udf_timestamp_t *udf_get_attr_timestamp(const udf_dirent_t *p_udf_dirent); /*! Convert a UDF timestamp to a time_t. If microseconds are desired, use dest_usec. The return value is the same as dest. */ time_t *udf_stamp_to_time(time_t *dest, long int *dest_usec, const udf_timestamp_t src); udf_timestamp_t *udf_timespec_to_stamp(const struct timespec ts, udf_timestamp_t *dest); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /*UDF_TIME_H*/ libcdio-2.2.0/include/cdio/utf8.h000066400000000000000000000077441474051130400165330ustar00rootroot00000000000000/* Copyright (C) 2008, 2012, 2014 Rocky Bernstein Copyright (C) 2006 Burkhard Plaum 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file utf8.h * * \brief UTF-8 support */ #include /** \brief Opaque characterset converter */ typedef struct cdio_charset_coverter_s cdio_charset_coverter_t; /** \brief Create a charset converter * \param src_charset Source charset * \param dst_charset Destination charset * \returns A newly allocated charset converter */ cdio_charset_coverter_t * cdio_charset_converter_create(const char * src_charset, const char * dst_charset); /** \brief Destroy a characterset converter * \param cnv A characterset converter */ void cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv); /** \brief Convert a string from one character set to another * \param cnv A charset converter * \param src Source string * \param src_len Length of source string * \param dst Returns destination string * \param dst_len If non NULL, returns the length of the destination string * \returns true if conversion was sucessful, false else. * * The destination string must be freed by the caller with cdio_free(). * If you pass -1 for src_len, strlen() will be used. */ bool cdio_charset_convert(cdio_charset_coverter_t*cnv, char * src, int src_len, char ** dst, int * dst_len); /** \brief Convert a string from UTF-8 to another charset * \param src Source string (0 terminated) * \param dst Returns destination string * \param dst_len If non NULL, returns the length of the destination string * \param dst_charset The characterset to convert to * \returns true if conversion was sucessful, false else. * * This is a convenience function, which creates a charset converter, * converts one string and destroys the charset converter. * * The destination string must be freed by the caller with cdio_free(). */ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, int * dst_len, const char * dst_charset); /** \brief Convert a string from another charset to UTF-8 * \param src Source string * \param src_len Length of the source string * \param dst Returns destination string (0 terminated) * \param src_charset The characterset to convert from * \returns true if conversion was sucessful, false else. * * This is a convenience function, which creates a charset converter, * converts one string and destroys the charset converter. * * The destination string must be freed by the caller with cdio_free(). * If you pass -1 for src_len, strlen() will be used. */ bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char * src_charset); #ifdef _WIN32 /** \brief Convert an UTF8 string to UTF-16 (allocate returned string) * \param str Source string * \returns NULL if the conversion was unsuccesful. Caller must free the * returned string with cdio_free(). * This is a convenience function available on Windows platforms only. */ wchar_t* cdio_utf8_to_wchar(const char* str); #include /* for FILE */ /** \brief Provides an UTF-8 compliant version of fopen for Windows * The parameters and return value are the same as fopen(). */ FILE* fopen_utf8(const char* filename, const char* mode); #endif libcdio-2.2.0/include/cdio/util.h000066400000000000000000000067471474051130400166240ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_UTIL_H_ #define CDIO_UTIL_H_ /*! \file util.h \brief Miscellaneous utility functions. Warning: this will probably get removed/replaced by using glib.h */ #include #include #if !defined CDIO_INLINE #if defined(__cplusplus) || defined(inline) #define CDIO_INLINE inline #elif defined(__GNUC__) #define CDIO_INLINE __inline__ #elif defined(_MSC_VER) #define CDIO_INLINE __inline #else #define CDIO_INLINE #endif #endif /* CDIO_INLINE */ #undef MAX #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #undef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #undef IN #define IN(x, low, high) ((x) >= (low) && (x) <= (high)) #undef CLAMP #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) static CDIO_INLINE uint32_t _cdio_len2blocks (uint32_t i_len, uint16_t i_blocksize) { uint32_t i_blocks; i_blocks = i_len / (uint32_t) i_blocksize; if (i_len % i_blocksize) i_blocks++; return i_blocks; } /*! free() and NULL out p_obj it is not already null. */ #define CDIO_FREE_IF_NOT_NULL(p_obj) \ if (NULL != p_obj) { free(p_obj); p_obj=NULL; }; /* round up to next block boundary */ static CDIO_INLINE unsigned _cdio_ceil2block (unsigned offset, uint16_t i_blocksize) { return _cdio_len2blocks (offset, i_blocksize) * i_blocksize; } static CDIO_INLINE unsigned int _cdio_ofs_add (unsigned offset, unsigned length, uint16_t i_blocksize) { if (i_blocksize - (offset % i_blocksize) < length) offset = _cdio_ceil2block (offset, i_blocksize); offset += length; return offset; } static CDIO_INLINE const char * _cdio_bool_str (bool b) { return b ? "yes" : "no"; } #ifdef __cplusplus extern "C" { #endif void * _cdio_memdup (const void *mem, size_t count); char * _cdio_strdup_upper (const char str[]); /*! Duplicate path and make it platform compliant. Typically needed for MinGW/MSYS where a "/c/..." path must be translated to "c:/..." for use with fopen(), etc. Returned string must be freed by the caller using cdio_free(). */ char * _cdio_strdup_fixpath (const char path[]); void _cdio_strfreev(char **strv); size_t _cdio_strlenv(char **str_array); char ** _cdio_strsplit(const char str[], char delim); uint8_t cdio_to_bcd8(uint8_t n); uint8_t cdio_from_bcd8(uint8_t p); /*! cdio_realpath() same as POSIX.1-2001 realpath if that's around. If not we do poor-man's simulation of that behavior. */ char *cdio_realpath (const char *psz_src, char *psz_dst); #ifdef WANT_FOLLOW_SYMLINK_COMPATIBILITY # define cdio_follow_symlink cdio_realpath #endif #ifdef __cplusplus } #endif #endif /* CDIO_UTIL_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/include/cdio/version.h.in000066400000000000000000000014361474051130400177270ustar00rootroot00000000000000/** \file version.h * * \brief A file containing the libcdio package version * number (@LIBCDIO_VERSION_NUM@) and OS build name. */ /*! CDIO_VERSION is a C-Preprocessor macro of a string that shows what version is used. cdio_version_string has the same value, but it is a constant variable that can be accessed at run time. */ #define CDIO_VERSION "@VERSION@ @build@" extern const char *cdio_version_string; /**< = CDIO_VERSION */ /*! LIBCDIO_VERSION_NUM is a C-Preprocessor macro that can be used for testing in the C preprocessor. libcdio_version_num has the same value, but it is a constant variable that can be accessed at run time. */ #define LIBCDIO_VERSION_NUM @LIBCDIO_VERSION_NUM@ extern const unsigned int libcdio_version_num; /**< = LIBCDIO_VERSION_NUM */ libcdio-2.2.0/include/cdio/xa.h000066400000000000000000000145171474051130400162510ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel See also iso9660.h by Eric Youngdale (1993) and in cdrtools. These are Copyright 1993 Yggdrasil Computing, Incorporated Copyright (c) 1999,2000 J. Schilling 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! \file xa.h \brief Things related to the ISO-9660 XA (Extended Attributes) format Applications will probably not include this directly but via the iso9660.h header. */ #ifndef CDIO_XA_H_ #define CDIO_XA_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! An enumeration for some of the XA_* \#defines below. This isn't really an enumeration one would really use in a program it is to be helpful in debuggers where wants just to refer to the XA_* names and get something. */ typedef enum { ISO_XA_MARKER_OFFSET = 1024, XA_PERM_RSYS = 0x0001, /**< System Group Read */ XA_PERM_XSYS = 0x0004, /**< System Group Execute */ XA_PERM_RUSR = 0x0010, /**< User (owner) Read */ XA_PERM_XUSR = 0x0040, /**< User (owner) Execute */ XA_PERM_RGRP = 0x0100, /**< Group Read */ XA_PERM_XGRP = 0x0400, /**< Group Execute */ XA_PERM_ROTH = 0x1000, /**< Other (world) Read */ XA_PERM_XOTH = 0x4000, /**< Other (world) Execute */ XA_ATTR_MODE2FORM1 = (1 << 11), XA_ATTR_MODE2FORM2 = (1 << 12), XA_ATTR_INTERLEAVED = (1 << 13), XA_ATTR_CDDA = (1 << 14), XA_ATTR_DIRECTORY = (1 << 15), XA_PERM_ALL_READ = (XA_PERM_RUSR | XA_PERM_RSYS | XA_PERM_RGRP), XA_PERM_ALL_EXEC = (XA_PERM_XUSR | XA_PERM_XSYS | XA_PERM_XGRP), XA_PERM_ALL_ALL = (XA_PERM_ALL_READ | XA_PERM_ALL_EXEC), XA_FORM1_DIR = (XA_ATTR_DIRECTORY | XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL), XA_FORM1_FILE = (XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL), XA_FORM2_FILE = (XA_ATTR_MODE2FORM2 | XA_PERM_ALL_ALL) } xa_misc_enum_t; extern const char ISO_XA_MARKER_STRING[sizeof("CD-XA001")-1]; #define ISO_XA_MARKER_STRING "CD-XA001" /*! \brief "Extended Architecture" according to the Philips Yellow Book. CD-ROM EXtended Architecture is a modification to the CD-ROM specification that defines two new types of sectors. CD-ROM XA was developed jointly by Sony, Philips, and Microsoft, and announced in August 1988. Its specifications were published in an extension to the Yellow Book. CD-i, Photo CD, Video CD and CD-EXTRA have all subsequently been based on CD-ROM XA. CD-XA defines another way of formatting sectors on a CD-ROM, including headers in the sectors that describe the type (audio, video, data) and some additional info (markers, resolution in case of a video or audio sector, file numbers, etc). The data written on a CD-XA is consistent with and can be in ISO-9660 file system format and therefore be readable by ISO-9660 file system translators. But also a CD-I player can also read CD-XA discs even if its own `Green Book' file system only resembles ISO 9660 and isn't fully compatible. Note structure is big-endian. */ typedef struct iso9660_xa_s { uint16_t group_id; /**< 0 */ uint16_t user_id; /**< 0 */ uint16_t attributes; /**< XA_ATTR_ */ char signature[2]; /**< { 'X', 'A' } */ uint8_t filenum; /**< file number, see also XA subheader */ uint8_t reserved[5]; /**< zero */ } GNUC_PACKED iso9660_xa_t; /*! Returns POSIX mode bitstring for a given file. */ posix_mode_t iso9660_get_posix_filemode_from_xa(uint16_t i_perms); /*! Returns a string interpreting the extended attribute xa_attr. For example: \verbatim d---1xrxrxr ---2--r-r-r -a--1xrxrxr \endverbatim A description of the characters in the string follows. The 1st character is either "d" if the entry is a directory, or "-" if not The 2nd character is either "a" if the entry is CDDA (audio), or "-" if not The 3rd character is either "i" if the entry is interleaved, or "-" if not The 4th character is either "2" if the entry is mode2 form2 or "-" if not The 5th character is either "1" if the entry is mode2 form1 or "-" if not Note that an entry will either be in mode2 form1 or mode form2. That is you will either see "2-" or "-1" in the 4th & 5th positions. The 6th and 7th characters refer to permissions for a user while the the 8th and 9th characters refer to permissions for a group while, and the 10th and 11th characters refer to permissions for everyone. In each of these pairs the first character (6, 8, 10) is "x" if the entry is executable. For a directory this means the directory is allowed to be listed or "searched". The second character of a pair (7, 9, 11) is "r" if the entry is allowed to be read. */ const char * iso9660_get_xa_attr_str (uint16_t xa_attr); /*! Allocates and initalizes a new iso9600_xa_t variable and returns it. The caller must free the returned result using iso9660_xa_free(). @see iso9660_xa */ iso9660_xa_t * iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr, uint8_t filenum); /*! Frees the passed iso9600_xa_t structure. @see iso9660_xa */ void iso9660_xa_free (iso9660_xa_t *_xa); #ifdef __cplusplus } /** The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ extern xa_misc_enum_t debugger_xa_misc_enum; #endif /* __cplusplus */ #endif /* CDIO_XA_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/000077500000000000000000000000001474051130400136655ustar00rootroot00000000000000libcdio-2.2.0/lib/.gitignore000066400000000000000000000000331474051130400156510ustar00rootroot00000000000000/*~ /Makefile /Makefile.in libcdio-2.2.0/lib/Makefile.am000066400000000000000000000017001474051130400157170ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2006, 2008, 2012 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ######################################################## # make all libraries ######################################################## if ENABLE_CXX_BINDINGS cxxdirs = cdio++ endif SUBDIRS = driver iso9660 udf $(cxxdirs) libcdio-2.2.0/lib/cdio++/000077500000000000000000000000001474051130400147315ustar00rootroot00000000000000libcdio-2.2.0/lib/cdio++/.gitignore000066400000000000000000000000661474051130400167230ustar00rootroot00000000000000/.deps /.libs /Makefile /Makefile.in /*.lo /*.la /*.o libcdio-2.2.0/lib/cdio++/Makefile.am000066400000000000000000000051451474051130400167720ustar00rootroot00000000000000# Copyright (C) 2005, 2006, 2007, 2008, 2025 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################## # Things to make the libcdio++ library ######################################################## # # From libtool documentation amended with guidance from N. Boullis: # # 1. Start with version information of `0:0:0' for each libtool library. # # 2. It is probably not a good idea to update the version information # several times between public releases, but rather once per public # release. (This seems to be more an aesthetic consideration than # a hard technical one.) # # 3. If the library source code has changed at all since the last # update, then increment REVISION (`C:R:A' becomes `C:R+1:A'). # # 4. If any interfaces have been added, removed, or changed since the # last update, increment CURRENT, and set REVISION to 0. # # 5. If any interfaces have been added since the last public release, # then increment AGE. # # 6. If any interfaces have been removed or changed since the last # public release, then set AGE to 0. A changed interface means an # incompatibility with previous versions. lib_LTLIBRARIES = libiso9660++.la libcdio++.la libcdiopp_la_CURRENT = 1 libcdiopp_la_REVISION = 0 libcdiopp_la_AGE = 0 libcdiopp_sources = cdio.cpp devices.cpp libcdio___la_SOURCES = $(libcdiopp_sources) libcdio___la_LDFLAGS = -version-info $(libcdiopp_la_CURRENT):$(libcdiopp_la_REVISION):$(libcdiopp_la_AGE) @LT_NO_UNDEFINED@ libcdio___la_LIBADD = $(top_builddir)/lib/driver/libcdio.la libiso9660pp_la_CURRENT = 1 libiso9660pp_la_REVISION = 0 libiso9660pp_la_AGE = 0 libiso9660pp_sources = iso9660.cpp libiso9660___la_SOURCES = $(libiso9660pp_sources) libiso9660___la_LIBADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) libiso9660___la_LDFLAGS = -version-info $(libiso9660pp_la_CURRENT):$(libiso9660pp_la_REVISION):$(libiso9660pp_la_AGE) @LT_NO_UNDEFINED@ AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_builddir)/include libcdio-2.2.0/lib/cdio++/cdio.cpp000066400000000000000000000026521474051130400163600ustar00rootroot00000000000000/* -*- C++ -*- $Id: cdio.cpp,v 1.2 2008/04/20 13:44:31 karl Exp $ Copyright (C) 2006, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include void possible_throw_device_exception(driver_return_code_t drc) { switch (drc) { case DRIVER_OP_SUCCESS: return; case DRIVER_OP_ERROR: throw DriverOpError(); case DRIVER_OP_UNSUPPORTED: throw DriverOpUnsupported(); case DRIVER_OP_UNINIT: throw DriverOpUninit(); case DRIVER_OP_NOT_PERMITTED: throw DriverOpNotPermitted(); case DRIVER_OP_BAD_PARAMETER: throw DriverOpBadParameter(); case DRIVER_OP_BAD_POINTER: throw DriverOpBadPointer(); case DRIVER_OP_NO_DRIVER: throw DriverOpNoDriver(); default: throw DriverOpException(drc); } } libcdio-2.2.0/lib/cdio++/devices.cpp000066400000000000000000000154021474051130400170610ustar00rootroot00000000000000/* -*- C++ -*- Copyright (C) 2006, 2008, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include /*! Close media tray in CD drive if there is a routine to do so. @param psz_drive the name of CD-ROM to be closed. @param driver_id is the driver to be used or that got used if it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't report back the driver used. */ void closeTray (const char *psz_drive, /*in/out*/ driver_id_t &driver_id) { driver_return_code_t drc = cdio_close_tray (psz_drive, &driver_id); possible_throw_device_exception(drc); } /*! Close media tray in CD drive if there is a routine to do so. @param psz_drive the name of CD-ROM to be closed. If omitted or NULL, we'll scan for a suitable CD-ROM. */ void closeTray (const char *psz_drive) { driver_id_t driver_id = DRIVER_UNKNOWN; closeTray(psz_drive, driver_id); } /*! Get a string decribing driver_id. @param driver_id the driver you want the description for @return a sring of driver description */ const char * driverDescribe (driver_id_t driver_id) { return cdio_driver_describe(driver_id); } /*! Eject media in CD drive if there is a routine to do so. If the CD is ejected, object is destroyed. */ void ejectMedia (const char *psz_drive) { driver_return_code_t drc = cdio_eject_media_drive(psz_drive); possible_throw_device_exception(drc); } /*! Free device list returned by GetDevices @param device_list list returned by GetDevices @see GetDevices */ void freeDeviceList (char * device_list[]) { cdio_free_device_list(device_list); } /*! Return a string containing the default CD device if none is specified. if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable one set the default device for that. NULL is returned if we couldn't get a default device. */ char * getDefaultDevice(/*in/out*/ driver_id_t &driver_id) { return cdio_get_default_device_driver(&driver_id); } /*! Return an array of device names. If you want a specific devices for a driver, give that device. If you want hardware devices, give DRIVER_DEVICE and if you want all possible devices, image drivers and hardware drivers give DRIVER_UNKNOWN. NULL is returned if we couldn't return a list of devices. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ char ** getDevices(driver_id_t driver_id) { return cdio_get_devices(driver_id); } /*! Like GetDevices above, but we may change the p_driver_id if we were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. */ char ** getDevices (driver_id_t &driver_id) { return cdio_get_devices_ret(&driver_id); } /*! Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If search_devices is NULL, then we'll search all possible CD drives. If "b_any" is set false then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If "any" is set true, then if any of the capabilities matches, we call that a success. To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL. @return the array of device names or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found. */ char ** getDevices(/*in*/ char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any) { return cdio_get_devices_with_cap(ppsz_search_devices, capabilities, b_any); } /*! Like GetDevices above but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well. */ char ** getDevices(/*in*/ char* ppsz_search_devices[], cdio_fs_anal_t capabilities, /*out*/ driver_id_t &driver_id, bool b_any) { return cdio_get_devices_with_cap_ret(ppsz_search_devices, capabilities, b_any, &driver_id); } /*! Return true if we Have driver for driver_id */ bool haveDriver (driver_id_t driver_id) { return cdio_have_driver(driver_id); } /*! Determine if bin_name is the bin file part of a CDRWIN CD disk image. @param bin_name location of presumed CDRWIN bin image file. @return the corresponding CUE file if bin_name is a BIN file or NULL if not a BIN file. */ char *isBinFile(const char *psz_bin_name) { return cdio_is_binfile(psz_bin_name); } /*! Determine if cue_name is the cue sheet for a CDRWIN CD disk image. @return corresponding BIN file if cue_name is a CDRWIN cue file or NULL if not a CUE file. */ char * isCueFile(const char *psz_cue_name) { return cdio_is_cuefile(psz_cue_name); } /*! Determine if psz_source refers to a real hardware CD-ROM. @param psz_source location name of object @param driver_id driver for reading object. Use DRIVER_UNKNOWN if you don't know what driver to use. @return true if psz_source is a device; If false is returned we could have a CD disk image. */ bool isDevice(const char *psz_source, driver_id_t driver_id) { return cdio_is_device(psz_source, driver_id); } /*! Determine if psz_nrg is a Nero CD disk image. @param psz_nrg location of presumed NRG image file. @return true if psz_nrg is a Nero NRG image or false if not a NRG image. */ bool isNero(const char *psz_nrg) { return cdio_is_nrg(psz_nrg); } /*! Determine if psz_toc is a TOC file for a cdrdao CD disk image. @param psz_toc location of presumed TOC image file. @return true if toc_name is a cdrdao TOC file or false if not a TOC file. */ bool isTocFile(const char *psz_toc) { return cdio_is_tocfile(psz_toc); } libcdio-2.2.0/lib/cdio++/iso9660.cpp000066400000000000000000000157271474051130400165700ustar00rootroot00000000000000/* -*- C++ -*- Copyright (C) 2006, 2008, 2011, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @return Stat * of entry if we found lsn, or NULL otherwise. Caller must release returned object using delete when done. */ ISO9660::Stat * ISO9660::FS::find_lsn(lsn_t i_lsn) { return new Stat(iso9660_find_fs_lsn(p_cdio, i_lsn)); } /*! Read the Primary Volume Descriptor for a CD. True is returned if read, and false if there was an error. */ ISO9660::PVD * ISO9660::FS::read_pvd () { iso9660_pvd_t pvd; bool b_okay = iso9660_fs_read_pvd (p_cdio, &pvd); if (b_okay) { return new PVD(&pvd); } return (PVD *) NULL; } /*! Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ bool ISO9660::FS::read_superblock (iso_extension_mask_t iso_extension_mask) { return iso9660_fs_read_superblock (p_cdio, iso_extension_mask); } /*! Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. The caller must free the returned result. */ bool ISO9660::FS::readdir (const char psz_path[], stat_vector_t& stat_vector) { CdioList_t * p_stat_list = iso9660_fs_readdir (p_cdio, psz_path); if (p_stat_list) { CdioListNode_t *p_entnode; _CDIO_LIST_FOREACH (p_entnode, p_stat_list) { iso9660_stat_t *p_statbuf = (iso9660_stat_t *) _cdio_list_node_data (p_entnode); stat_vector.push_back(new ISO9660::Stat(p_statbuf)); } _cdio_list_free (p_stat_list, false, (CdioDataFree_t) iso9660_stat_free); return true; } else { return false; } } /*! Close previously opened ISO 9660 image and free resources associated with the image. Call this when done using using an ISO 9660 image. @return true is unconditionally returned. If there was an error false would be returned. */ bool ISO9660::IFS::close() { iso9660_close(p_iso9660); p_iso9660 = (iso9660_t *) NULL; return true; } /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. Returns Stat* of entry if we found lsn, or NULL otherwise. Caller must release returned object using delete when done. */ ISO9660::Stat * ISO9660::IFS::find_lsn(lsn_t i_lsn) { return new Stat(iso9660_ifs_find_lsn(p_iso9660, i_lsn)); } /*! Return the Joliet level recognized. */ uint8_t ISO9660::IFS::get_joliet_level() { return iso9660_ifs_get_joliet_level(p_iso9660); } /*! Return true if ISO 9660 image has extended attrributes (XA). */ bool ISO9660::IFS::is_xa () { return iso9660_ifs_is_xa (p_iso9660); } /*! Open an ISO 9660 image for "fuzzy" reading. This means that we will try to guess various internal offset based on internal checks. This may be useful when trying to read an ISO 9660 image contained in a file format that libiso9660 doesn't know natively (or knows imperfectly.) Maybe in the future we will have a mode. NULL is returned on error. @see open */ bool ISO9660::IFS::open_fuzzy (const char *psz_path, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) { p_iso9660 = iso9660_open_fuzzy_ext(psz_path, iso_extension_mask, i_fuzz); //return p_iso9660 != (iso9660_t *) NULL; return true; } /*! Read the Primary Volume Descriptor for an ISO 9660 image. A PVD object is returned if read, and NULL if there was an error. */ ISO9660::PVD * ISO9660::IFS::read_pvd () { iso9660_pvd_t pvd; bool b_okay = iso9660_ifs_read_pvd (p_iso9660, &pvd); if (b_okay) { return new PVD(&pvd); } return (PVD *) NULL; } /*! Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. @see read_superblock */ bool ISO9660::IFS::read_superblock (iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) { return iso9660_ifs_read_superblock (p_iso9660, iso_extension_mask); } /*! Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. @see read_superblock */ bool ISO9660::IFS::read_superblock_fuzzy (iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) { return iso9660_ifs_fuzzy_read_superblock (p_iso9660, iso_extension_mask, i_fuzz); } char * ISO9660::PVD::get_application_id() { return iso9660_get_application_id(&pvd); } int ISO9660::PVD::get_pvd_block_size() { return iso9660_get_pvd_block_size(&pvd); } /*! Return the PVD's preparer ID. NULL is returned if there is some problem in getting this. */ char * ISO9660::PVD::get_preparer_id() { return iso9660_get_preparer_id(&pvd); } /*! Return the PVD's publisher ID. NULL is returned if there is some problem in getting this. */ char * ISO9660::PVD::get_publisher_id() { return iso9660_get_publisher_id(&pvd); } const char * ISO9660::PVD::get_pvd_id() { return iso9660_get_pvd_id(&pvd); } int ISO9660::PVD::get_pvd_space_size() { return iso9660_get_pvd_space_size(&pvd); } uint8_t ISO9660::PVD::get_pvd_type() { return iso9660_get_pvd_type(&pvd); } /*! Return the primary volume id version number (of pvd). If there is an error 0 is returned. */ int ISO9660::PVD::get_pvd_version() { return iso9660_get_pvd_version(&pvd); } /*! Return the LSN of the root directory for pvd. If there is an error CDIO_INVALID_LSN is returned. */ lsn_t ISO9660::PVD::get_root_lsn() { return iso9660_get_root_lsn(&pvd); } /*! Return the PVD's system ID. NULL is returned if there is some problem in getting this. */ char * ISO9660::PVD::get_system_id() { return iso9660_get_system_id(&pvd); } /*! Return the PVD's volume ID. NULL is returned if there is some problem in getting this. */ char * ISO9660::PVD::get_volume_id() { return iso9660_get_volume_id(&pvd); } /*! Return the PVD's volumeset ID. NULL is returned if there is some problem in getting this. */ char * ISO9660::PVD::get_volumeset_id() { return iso9660_get_volumeset_id(&pvd); } libcdio-2.2.0/lib/driver/000077500000000000000000000000001474051130400151605ustar00rootroot00000000000000libcdio-2.2.0/lib/driver/.gitignore000066400000000000000000000001711474051130400171470ustar00rootroot00000000000000/*.lo /*.o /*.orig /*.rej /*~ /.deps /.libs /Makefile /Makefile.in /abs_path /follow_symlink /libcdio.la /libcdio.la.ver libcdio-2.2.0/lib/driver/FreeBSD/000077500000000000000000000000001474051130400163725ustar00rootroot00000000000000libcdio-2.2.0/lib/driver/FreeBSD/Makefile000066400000000000000000000015531474051130400200360ustar00rootroot00000000000000# $Id: Makefile,v 1.2 2008/04/21 18:30:19 karl Exp $ # # Copyright (C) 2004, 2008 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # The make is done above. This boilerplate Makefile just transfers the call all install check clean: cd .. && $(MAKE) $@ libcdio-2.2.0/lib/driver/FreeBSD/freebsd.c000066400000000000000000001034741474051130400201610ustar00rootroot00000000000000/* Copyright (C) 2003, 2004-2005, 2008-2011, 2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains FreeBSD-specific code and implements low-level control of the CD drive. Culled initially I think from xine's or mplayer's FreeBSD code with lots of modifications. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include "freebsd.h" #ifdef HAVE_FREEBSD_CDROM #ifdef HAVE_SYS_PARAM_H #include #endif #include /* For freebsd_dev_lock() */ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef _HAVE_SYS_STAT_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #include static lba_t get_track_lba_freebsd(void *p_user_data, track_t i_track); static access_mode_t str_to_access_mode_freebsd(const char *psz_access_mode) { const access_mode_t default_access_mode = DEFAULT_FREEBSD_AM; if (NULL==psz_access_mode) return default_access_mode; if (!strcmp(psz_access_mode, "ioctl")) return _AM_IOCTL; else if (!strcmp(psz_access_mode, "CAM")) return _AM_CAM; else if (!strcmp(psz_access_mode, "MMC_RDWR")) return _AM_MMC_RDWR; else if (!strcmp(psz_access_mode, "MMC_RDWR_EXCL")) return _AM_MMC_RDWR_EXCL; else { cdio_warn ("unknown access type: %s. Default used.", psz_access_mode); return default_access_mode; } } static void free_freebsd (void *p_obj) { _img_private_t *p_env = p_obj; if (NULL == p_env) return; if (NULL != p_env->device) free(p_env->device); switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: free_freebsd_cam(p_env); break; case _AM_IOCTL: cdio_generic_free(p_obj); break; case _AM_NONE: break; } } /* Check a drive to see if it is a CD-ROM Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive and -1 if no device exists . */ static bool cdio_is_cdrom(char *drive, char *mnttype) { return cdio_is_cdrom_freebsd_ioctl(drive, mnttype); } /*! Reads i_blocks of audio sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t read_audio_sectors_freebsd (void *p_user_data, void *p_buf, lsn_t i_lsn, unsigned int i_blocks) { _img_private_t *p_env = p_user_data; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return mmc_read_sectors( p_env->gen.cdio, p_buf, i_lsn, CDIO_MMC_READ_TYPE_CDDA, i_blocks); case _AM_IOCTL: return read_audio_sectors_freebsd_ioctl(p_user_data, p_buf, i_lsn, i_blocks); case _AM_NONE: cdio_info ("access mode not set"); return DRIVER_OP_ERROR; } return DRIVER_OP_ERROR; } /*! Reads a single mode2 sector from cd device into data starting from i_lsn. Returns 0 if no error. */ static driver_return_code_t read_mode2_sector_freebsd (void *p_user_data, void *data, lsn_t i_lsn, bool b_form2) { _img_private_t *p_env = p_user_data; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return read_mode2_sector_freebsd_cam(p_env, data, i_lsn, b_form2); case _AM_IOCTL: return read_mode2_sector_freebsd_ioctl(p_env, data, i_lsn, b_form2); case _AM_NONE: cdio_info ("access mode not set"); return DRIVER_OP_ERROR; } return DRIVER_OP_ERROR; } /*! Reads i_blocks of mode2 sectors from cd device into data starting from lsn. */ static driver_return_code_t read_mode2_sectors_freebsd (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2, unsigned int i_blocks) { _img_private_t *p_env = p_user_data; if ( (p_env->access_mode == _AM_CAM || p_env->access_mode == _AM_MMC_RDWR || p_env->access_mode == _AM_MMC_RDWR_EXCL) && b_form2 ) { /* We have a routine that covers this case without looping. */ return read_mode2_sectors_freebsd_cam(p_env, p_data, i_lsn, i_blocks); } else { unsigned int i; uint16_t i_blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; /* For each frame, pick out the data part we need */ for (i = 0; i < i_blocks; i++) { int retval = read_mode2_sector_freebsd (p_env, ((char *)p_data) + (i_blocksize * i), i_lsn + i, b_form2); if (retval) return retval; } } return DRIVER_OP_SUCCESS; } /*! Return the size of the CD in logical block address (LBA) units. @return the lsn. On error return CDIO_INVALID_LSN. */ static lsn_t get_disc_last_lsn_freebsd (void *p_obj) { _img_private_t *p_env = p_obj; if (!p_env) return CDIO_INVALID_LSN; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return get_disc_last_lsn_mmc(p_env); case _AM_IOCTL: return get_disc_last_lsn_freebsd_ioctl(p_env); case _AM_NONE: cdio_info ("access mode not set"); return DRIVER_OP_ERROR; } return DRIVER_OP_ERROR; } /*! Set the arg "key" with "value" in the source device. Currently "source" and "access-mode" are valid keys. "source" sets the source device in I/O operations "access-mode" sets the the method of CD access DRIVER_OP_SUCCESS is returned if no error was found, and nonzero if there as an error. */ static driver_return_code_t set_arg_freebsd (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return DRIVER_OP_ERROR; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { p_env->access_mode = str_to_access_mode_freebsd(value); if (p_env->access_mode == _AM_CAM && !p_env->b_cam_init) return init_freebsd_cam(p_env) ? DRIVER_OP_SUCCESS : DRIVER_OP_ERROR; } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } /* Set CD-ROM drive speed */ static int set_speed_freebsd (void *p_user_data, int i_speed) { const _img_private_t *p_env = p_user_data; if (!p_env) return -1; #ifdef CDRIOCREADSPEED i_speed *= 177; return ioctl(p_env->gen.fd, CDRIOCREADSPEED, &i_speed); #else return -2; #endif } /*! Read and cache the CD's Track Table of Contents and track info. Return false if unsuccessful; */ static bool read_toc_freebsd (void *p_user_data) { _img_private_t *p_env = p_user_data; track_t i, j; /* read TOC header */ if ( ioctl(p_env->gen.fd, CDIOREADTOCHEADER, &p_env->tochdr) == -1 ) { cdio_warn("error in ioctl(CDIOREADTOCHEADER): %s\n", strerror(errno)); return false; } p_env->gen.i_first_track = p_env->tochdr.starting_track; p_env->gen.i_tracks = p_env->tochdr.ending_track - p_env->gen.i_first_track + 1; j=0; for (i=p_env->gen.i_first_track; i<=p_env->gen.i_tracks; i++, j++) { struct ioc_read_toc_single_entry *p_toc = &(p_env->tocent[i-p_env->gen.i_first_track]); p_toc->track = i; p_toc->address_format = CD_LBA_FORMAT; if ( ioctl(p_env->gen.fd, CDIOREADTOCENTRY, p_toc) ) { cdio_warn("%s %d: %s\n", "error in ioctl CDROMREADTOCENTRY for track", i, strerror(errno)); return false; } set_track_flags(&(p_env->gen.track_flags[i]), p_toc->entry.control); } p_env->tocent[j].track = CDIO_CDROM_LEADOUT_TRACK; p_env->tocent[j].address_format = CD_LBA_FORMAT; if ( ioctl(p_env->gen.fd, CDIOREADTOCENTRY, &(p_env->tocent[j]) ) ){ cdio_warn("%s: %s\n", "error in ioctl CDROMREADTOCENTRY for leadout track", strerror(errno)); return false; } p_env->gen.toc_init = true; return true; } /*! Get the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_get_volume_freebsd (void *p_user_data, /*out*/ cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDIOCGETVOL, p_volume); } /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_pause_freebsd (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDIOCPAUSE); } /*! Playing starting at given MSF through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_play_msf_freebsd (void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf) { const _img_private_t *p_env = p_user_data; struct ioc_play_msf freebsd_play_msf; freebsd_play_msf.start_m = cdio_from_bcd8(p_start_msf->m); freebsd_play_msf.start_s = cdio_from_bcd8(p_start_msf->s); freebsd_play_msf.start_f = cdio_from_bcd8(p_start_msf->f); freebsd_play_msf.end_m = cdio_from_bcd8(p_end_msf->m); freebsd_play_msf.end_s = cdio_from_bcd8(p_end_msf->s); freebsd_play_msf.end_f = cdio_from_bcd8(p_end_msf->f); return ioctl(p_env->gen.fd, CDIOCPLAYMSF, &freebsd_play_msf); } /*! Playing CD through analog output at the desired track and index @param p_user_data the CD object to be acted upon. @param p_track_index location to start/end. */ static driver_return_code_t audio_play_track_index_freebsd (void *p_user_data, cdio_track_index_t *p_track_index) { const _img_private_t *p_env = p_user_data; msf_t start_msf; msf_t end_msf; struct ioc_play_msf freebsd_play_msf; lsn_t i_lsn = get_track_lba_freebsd(p_user_data, p_track_index->i_start_track); cdio_lsn_to_msf(i_lsn, &start_msf); i_lsn = get_track_lba_freebsd(p_user_data, p_track_index->i_end_track); cdio_lsn_to_msf(i_lsn, &end_msf); freebsd_play_msf.start_m = start_msf.m; freebsd_play_msf.start_s = start_msf.s; freebsd_play_msf.start_f = start_msf.f; freebsd_play_msf.end_m = end_msf.m; freebsd_play_msf.end_s = end_msf.s; freebsd_play_msf.end_f = end_msf.f; return ioctl(p_env->gen.fd, CDIOCPLAYMSF, &freebsd_play_msf); } /*! Read Audio Subchannel information @param p_user_data the CD object to be acted upon. @param p_subchannel returned information */ #if 1 static driver_return_code_t audio_read_subchannel_freebsd (void *p_user_data, /*out*/ cdio_subchannel_t *p_subchannel) { const _img_private_t *p_env = p_user_data; int i_rc; struct cd_sub_channel_info bsdinfo; struct ioc_read_subchannel read_subchannel; memset(& bsdinfo, 0, sizeof(struct cd_sub_channel_info)); read_subchannel.address_format = CD_MSF_FORMAT; read_subchannel.data_format = CD_CURRENT_POSITION; read_subchannel.track = 0; read_subchannel.data_len = sizeof(struct cd_sub_channel_info); read_subchannel.data = & bsdinfo; i_rc = ioctl(p_env->gen.fd, CDIOCREADSUBCHANNEL, &read_subchannel); if (0 == i_rc) { p_subchannel->audio_status = bsdinfo.header.audio_status; p_subchannel->address = bsdinfo.what.position.addr_type; p_subchannel->control = bsdinfo.what.position.control; p_subchannel->track = bsdinfo.what.position.track_number; p_subchannel->index = bsdinfo.what.position.index_number; p_subchannel->abs_addr.m = cdio_to_bcd8 (bsdinfo.what.position.absaddr.msf.minute); p_subchannel->abs_addr.s = cdio_to_bcd8 (bsdinfo.what.position.absaddr.msf.second); p_subchannel->abs_addr.f = cdio_to_bcd8 (bsdinfo.what.position.absaddr.msf.frame); p_subchannel->rel_addr.m = cdio_to_bcd8 (bsdinfo.what.position.reladdr.msf.minute); p_subchannel->rel_addr.s = cdio_to_bcd8 (bsdinfo.what.position.reladdr.msf.second); p_subchannel->rel_addr.f = cdio_to_bcd8 (bsdinfo.what.position.reladdr.msf.frame); } return i_rc; } #endif /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_resume_freebsd (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDIOCRESUME, 0); } /*! Set the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_set_volume_freebsd (void *p_user_data, cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDIOCSETVOL, p_volume); } /*! Eject media. Return 1 if successful, 0 otherwise. */ static int eject_media_freebsd (void *p_user_data) { _img_private_t *p_env = p_user_data; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return eject_media_freebsd_cam(p_env); case _AM_IOCTL: return eject_media_freebsd_ioctl(p_env); case _AM_NONE: cdio_info ("access mode not set"); return 0; } return 0; } /*! Stop playing an audio CD. @param p_user_data the CD object to be acted upon. */ static driver_return_code_t audio_stop_freebsd (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDIOCSTOP); } /*! Produce a text composed from the system SCSI address tuple according to habits of Linux 2.4 and 2.6 : "Bus,Host,Channel,Target,Lun" and store it in generic_img_private_t.scsi_tuple. Channel has no meaning on FreeBSD. Expect it to be 0. It is only in the text to avoid an unnecessary difference in format. Bus and Host will always be the same. To be accessed via cdio_get_arg("scsi-tuple-freebsd") or "scsi-tuple". For simplicity the FreeBSD driver also replies on "scsi-tuple-linux". Drivers which implement this code have to return 5 valid decimal numbers separated by comma, or empty text if no such numbers are available. @return 1=success , 0=failure */ static int set_scsi_tuple_freebsd(_img_private_t *env) { int bus_no = -1, host_no = -1, channel_no = -1, target_no = -1, lun_no = -1; int ret; char tuple[160]; ret = obtain_scsi_adr_freebsd_cam(env->gen.source_name, &bus_no, &host_no, &channel_no, &target_no, &lun_no); if (ret != 1) return 0; if (env->gen.scsi_tuple != NULL) free (env->gen.scsi_tuple); env->gen.scsi_tuple = NULL; if (bus_no < 0 || host_no < 0 || channel_no < 0 || target_no < 0 || lun_no < 0) { env->gen.scsi_tuple = strdup(""); return 0; } sprintf(tuple, "%d,%d,%d,%d,%d", bus_no, host_no, channel_no, target_no, lun_no); env->gen.scsi_tuple = strdup(tuple); return 1; } static bool is_mmc_supported(void *user_data) { _img_private_t *env = user_data; switch (env->access_mode) { case _AM_IOCTL: case _AM_NONE: return false; case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return true; } /* Not reached. */ return false; } /*! Return the value associated with the key "arg". */ static const char * get_arg_freebsd (void *user_data, const char key[]) { _img_private_t *env = user_data; if (!strcmp (key, "source")) { return env->gen.source_name; } else if (!strcmp (key, "access-mode")) { switch (env->access_mode) { case _AM_IOCTL: return "ioctl"; case _AM_CAM: return "CAM"; case _AM_MMC_RDWR: return "MMC_RDWR"; case _AM_MMC_RDWR_EXCL: return "MMC_RDWR_EXCL"; case _AM_NONE: return "no access method"; } } else if (strcmp (key, "scsi-tuple") == 0) { if (env->gen.scsi_tuple == NULL) set_scsi_tuple_freebsd(env); return env->gen.scsi_tuple; } else if (!strcmp (key, "mmc-supported?")) { return is_mmc_supported(user_data) ? "true" : "false"; } return NULL; } /*! Return the media catalog number MCN. Note: string is malloc'd so caller should free() then returned string when done with it. FIXME: This is just a guess. */ static char * get_mcn_freebsd (const void *p_user_data) { const _img_private_t *p_env = p_user_data; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return mmc_get_mcn(p_env->gen.cdio); case _AM_IOCTL: return mmc_get_mcn(p_env->gen.cdio); case _AM_NONE: cdio_info ("access mode not set"); return NULL; } return NULL; } /*! Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * get_track_isrc_freebsd (const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return mmc_get_track_isrc(p_env->gen.cdio, i_track); case _AM_IOCTL: return mmc_get_track_isrc(p_env->gen.cdio, i_track); case _AM_NONE: cdio_info ("access mode not set"); return NULL; } return NULL; } static void get_drive_cap_freebsd (const void *p_user_data, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap) { const _img_private_t *p_env = p_user_data; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: get_drive_cap_mmc (p_user_data, p_read_cap, p_write_cap, p_misc_cap); case _AM_IOCTL: cdio_info ("get_drive_cap not supported in ioctl access mode"); return; case _AM_NONE: cdio_info ("access mode not set"); return; } } /*! Run a SCSI MMC command. p_user_data internal CD structure. i_timeout_ms time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. i_cdb Size of p_cdb p_cdb CDB bytes. e_direction direction the transfer is to go. i_buf Size of buffer p_buf Buffer for data, both sending and receiving */ static driver_return_code_t run_mmc_cmd_freebsd( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { const _img_private_t *p_env = p_user_data; int ret; switch (p_env->access_mode) { case _AM_CAM: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: ret = run_mmc_cmd_freebsd_cam( p_user_data, i_timeout_ms, i_cdb, p_cdb, e_direction, i_buf, p_buf ); if (ret != 0) return DRIVER_OP_ERROR; return 0; case _AM_IOCTL: return DRIVER_OP_UNSUPPORTED; case _AM_NONE: cdio_info ("access mode not set"); return DRIVER_OP_ERROR; } return DRIVER_OP_ERROR; } /*! Get format of track. FIXME: We're just guessing this from the GNU/Linux code. */ static track_format_t get_track_format_freebsd(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if (!p_env->gen.toc_init) read_toc_freebsd (p_user_data) ; if (i_track > TOTAL_TRACKS || i_track == 0) return TRACK_FORMAT_ERROR; i_track -= FIRST_TRACK_NUM; /* This is pretty much copied from the "badly broken" cdrom_count_tracks in linux/cdrom.c. */ if (p_env->tocent[i_track].entry.control & CDIO_CDROM_DATA_TRACK) { if (p_env->tocent[i_track].address_format == CDIO_CDROM_CDI_TRACK) return TRACK_FORMAT_CDI; else if (p_env->tocent[i_track].address_format == CDIO_CDROM_XA_TRACK) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool get_track_green_freebsd(void *user_data, track_t i_track) { _img_private_t *p_env = user_data; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = TOTAL_TRACKS+1; if (i_track > TOTAL_TRACKS+1 || i_track == 0) return false; /* FIXME: Dunno if this is the right way, but it's what I was using in cdinfo for a while. */ return ((p_env->tocent[i_track-FIRST_TRACK_NUM].entry.control & 2) != 0); } /*! Return the starting LSN track number i_track in obj. Track numbers start at 1. The "leadout" track is specified either by using i_track LEADOUT_TRACK or the total tracks+1. CDIO_INVALID_LBA is returned if there is no track entry. */ static lba_t get_track_lba_freebsd(void *user_data, track_t i_track) { _img_private_t *p_env = user_data; if (!p_env->gen.toc_init) read_toc_freebsd (p_env) ; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = TOTAL_TRACKS+1; if (i_track > TOTAL_TRACKS+1 || i_track == 0 || !p_env->gen.toc_init) { return CDIO_INVALID_LBA; } else { return cdio_lsn_to_lba(ntohl(p_env->tocent[i_track-FIRST_TRACK_NUM].entry.addr.lba)); } } #endif /* HAVE_FREEBSD_CDROM */ /*! Return an array of strings giving possible CD devices. */ char ** cdio_get_devices_freebsd (void) { #ifndef HAVE_FREEBSD_CDROM return NULL; #else char drive[40]; char **drives = NULL; unsigned int num_drives=0; bool exists = true; char c; /* Scan the system for CD-ROM drives. */ #ifdef USE_ETC_FSTAB struct fstab *fs; setfsent(); /* Check what's in /etc/fstab... */ while ( (fs = getfsent()) ) { if (strncmp(fs->fs_spec, "/dev/sr", 7)) cdio_add_device_list(&drives, fs->fs_spec, &num_drives); } #endif /* Scan the system for CD-ROM drives. Not always 100% reliable, so use the USE_MNTENT code above first. */ /* Scan SCSI and CAM devices */ exists = true; for ( c='0'; exists && c <='9'; c++ ) { sprintf(drive, "/dev/cd%c%s", c, DEVICE_POSTFIX); exists = cdio_is_cdrom(drive, NULL); if ( exists ) { cdio_add_device_list(&drives, drive, &num_drives); } } /* Scan ATAPI devices */ /* ??? ts 9 Jan 2009 For now i assume atapicam running if a cdN device was found. man atapicam strongly discourages to mix usage of CAM and ATAPI device. So on the risk to sabotage systems without atapicam but with real old SCSI drives, i list no ATAPI addresses if there was a CAM/SCSI address. exists = !have_cam_drive; ts 13 Jan 2009 Regrettably USB drives appear as SCSI drives. We rather need to determine whether atapicam runs, or to make pairs of cd and acd. */ for ( c='0'; exists && c <='9'; c++ ) { sprintf(drive, "/dev/acd%c%s", c, DEVICE_POSTFIX); exists = cdio_is_cdrom(drive, NULL); if ( exists ) { cdio_add_device_list(&drives, drive, &num_drives); } } cdio_add_device_list(&drives, NULL, &num_drives); return drives; #endif /*HAVE_FREEBSD_CDROM*/ } /*! Return a string containing the default CD device if none is specified. */ char * cdio_get_default_device_freebsd(void) { #ifndef HAVE_FREEBSD_CDROM return NULL; #else char drive[40]; bool exists=true; char c; /* Scan the system for CD-ROM drives. */ #ifdef USE_ETC_FSTAB struct fstab *fs; setfsent(); /* Check what's in /etc/fstab... */ while ( (fs = getfsent()) ) { if (strncmp(fs->fs_spec, "/dev/sr", 7)) return strdup(fs->fs_spec); } #endif /* Scan the system for CD-ROM drives. Not always 100% reliable, so use the USE_MNTENT code above first. */ /* Scan SCSI and CAM devices */ for ( c='0'; exists && c <='9'; c++ ) { sprintf(drive, "/dev/cd%c%s", c, DEVICE_POSTFIX); exists = cdio_is_cdrom(drive, NULL); if ( exists ) { return strdup(drive); } } /* Scan are ATAPI devices */ exists = true; for ( c='0'; exists && c <='9'; c++ ) { sprintf(drive, "/dev/acd%c%s", c, DEVICE_POSTFIX); exists = cdio_is_cdrom(drive, NULL); if ( exists ) { return strdup(drive); } } return NULL; #endif /*HAVE_FREEBSD_CDROM*/ } /*! Close tray on CD-ROM. @param psz_device the CD-ROM drive to be closed. */ driver_return_code_t close_tray_freebsd (const char *psz_device) { #ifdef HAVE_FREEBSD_CDROM int fd = open (psz_device, O_RDONLY|O_NONBLOCK, 0); int i_rc; if((i_rc = ioctl(fd, CDIOCCLOSE)) != 0) { cdio_warn ("ioctl CDIOCCLOSE failed: %s\n", strerror(errno)); close(fd); return DRIVER_OP_ERROR; } close(fd); return DRIVER_OP_SUCCESS; #else return DRIVER_OP_NO_DRIVER; #endif /*HAVE_FREEBSD_CDROM*/ } /*! Find out if media has changed since the last call. @param p_user_data the environment of the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ #ifdef HAVE_FREEBSD_CDROM int get_media_changed_freebsd (const void *p_user_data) { const _img_private_t *p_env = p_user_data; int changed = 0 ; changed = mmc_get_media_changed( p_env->gen.cdio ); return ((changed > 0) ? changed : 0); } static const char* get_access_mode(const char *psz_source) { char *psz_src = NULL; if (!psz_source) { psz_src = cdio_get_default_device_freebsd(); } else { psz_src = strdup(psz_source); } if (psz_src != NULL) { if (!(strncmp(psz_src, "/dev/acd", 8))) { free(psz_src); return "ioctl"; } else { char devname[256]; int bytes = readlink(psz_src, devname, 255); if (bytes > 0) { devname[bytes]=0; if (!(strncmp(devname, "acd", 3))) { free(psz_src); return "ioctl"; } } } } if (psz_src != NULL) free(psz_src); return "CAM"; } /* Lock the inode associated to dev_fd and the inode associated to devname. Return OS errno, number of pass device of dev_fd, locked fd to devname, error message. A return value of > 0 means success, <= 0 means failure. */ static int freebsd_dev_lock(int dev_fd, char *devname, int *os_errno, int *pass_dev_no, int *lock_fd, char msg[4096], int flag) { int lock_denied = 0, fd_stbuf_valid, name_stbuf_valid, i, pass_l = 100; int max_retry = 3, tries; struct stat fd_stbuf, name_stbuf; char pass_name[16], *lock_name; *os_errno = 0; *pass_dev_no = -1; *lock_fd = -1; msg[0] = 0; fd_stbuf_valid = !fstat(dev_fd, &fd_stbuf); /* Try to find name of pass device by inode number */ lock_name = (char *) "effective device"; if(fd_stbuf_valid) { for (i = 0; i < pass_l; i++) { sprintf(pass_name, "/dev/pass%d", i); if (stat(pass_name, &name_stbuf) != -1) if(fd_stbuf.st_ino == name_stbuf.st_ino && fd_stbuf.st_dev == name_stbuf.st_dev) break; } if (i < pass_l) { lock_name = pass_name; *pass_dev_no = i; } } name_stbuf_valid = !stat(devname, &name_stbuf); for (tries= 0; tries <= max_retry; tries++) { lock_denied = flock(dev_fd, LOCK_EX | LOCK_NB); *os_errno = errno; if (lock_denied) { if (errno == EAGAIN && tries < max_retry) { /* <<< debugging fprintf(stderr, "\nlibcdio_DEBUG: EAGAIN , tries= %d\n", tries); */ usleep(2000000); continue; } sprintf(msg, "Device busy. flock(LOCK_EX) failed on %s of %s", strlen(lock_name) > 2000 || *pass_dev_no < 0 ? "pass device" : lock_name, strlen(devname) > 2000 ? "drive" : devname); return 0; } break; } /* fprintf(stderr, "libburn_DEBUG: flock obtained on %s of %s\n", lock_name, devname); */ /* Eventually lock the official device node too */ if (fd_stbuf_valid && name_stbuf_valid && (fd_stbuf.st_ino != name_stbuf.st_ino || fd_stbuf.st_dev != name_stbuf.st_dev)) { *lock_fd = open(devname, O_RDONLY); if (*lock_fd == 0) { close(*lock_fd); *lock_fd = -1; } if (*lock_fd > 0) { for (tries = 0; tries <= max_retry; tries++) { lock_denied = flock(*lock_fd, LOCK_EX | LOCK_NB); if (lock_denied) { if (errno == EAGAIN && tries < max_retry) { usleep(2000000); continue; } close(*lock_fd); *lock_fd = -1; sprintf(msg, "Device busy. flock(LOCK_EX) failed on %s", strlen(devname) > 4000 ? "drive" : devname); return 0; } break; } } /* fprintf(stderr, "libburn_DEBUG: flock obtained on %s\n", devname); */ } return 1; } #endif /*HAVE_FREEBSD_CDROM*/ /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo * cdio_open_freebsd (const char *psz_source_name) { return cdio_open_am_freebsd(psz_source_name, NULL); } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo * cdio_open_am_freebsd (const char *psz_orig_source_name, const char *psz_access_mode) { #ifdef HAVE_FREEBSD_CDROM CdIo *ret; _img_private_t *_data; char *psz_source_name; int open_access_mode; /* Access mode passed to cdio_generic_init. */ cdio_funcs_t _funcs = { .audio_get_volume = audio_get_volume_freebsd, .audio_pause = audio_pause_freebsd, .audio_play_msf = audio_play_msf_freebsd, .audio_play_track_index = audio_play_track_index_freebsd, .audio_read_subchannel = audio_read_subchannel_freebsd, .audio_resume = audio_resume_freebsd, .audio_set_volume = audio_set_volume_freebsd, .audio_stop = audio_stop_freebsd, .eject_media = eject_media_freebsd, .free = free_freebsd, .get_arg = get_arg_freebsd, .get_blocksize = get_blocksize_mmc, .get_cdtext = get_cdtext_generic, .get_cdtext_raw = read_cdtext_generic, .get_default_device = cdio_get_default_device_freebsd, .get_devices = cdio_get_devices_freebsd, .get_disc_last_lsn = get_disc_last_lsn_freebsd, .get_discmode = get_discmode_generic, .get_drive_cap = get_drive_cap_freebsd, .get_first_track_num = get_first_track_num_generic, .get_media_changed = get_media_changed_freebsd, .get_mcn = get_mcn_freebsd, .get_num_tracks = get_num_tracks_generic, .get_track_channels = get_track_channels_generic, .get_track_copy_permit = get_track_copy_permit_generic, .get_track_format = get_track_format_freebsd, .get_track_green = get_track_green_freebsd, .get_track_lba = get_track_lba_freebsd, .get_track_preemphasis = get_track_preemphasis_generic, .get_track_msf = NULL, .get_track_isrc = get_track_isrc_freebsd, .lseek = cdio_generic_lseek, .read = cdio_generic_read, .read_audio_sectors = read_audio_sectors_freebsd, .read_data_sectors = read_data_sectors_mmc, .read_mode2_sector = read_mode2_sector_freebsd, .read_mode2_sectors = read_mode2_sectors_freebsd, .read_toc = read_toc_freebsd, .run_mmc_cmd = run_mmc_cmd_freebsd, .set_arg = set_arg_freebsd, .set_blocksize = set_blocksize_mmc, .set_speed = set_speed_freebsd, }; if (!psz_access_mode) psz_access_mode = get_access_mode(psz_orig_source_name); _data = calloc(1, sizeof (_img_private_t)); _data->access_mode = str_to_access_mode_freebsd(psz_access_mode); _data->gen.init = false; _data->gen.fd = -1; _data->gen.toc_init = false; _data->gen.b_cdtext_error = false; if (NULL == psz_orig_source_name) { psz_source_name=cdio_get_default_device_freebsd(); if (NULL == psz_source_name) { cdio_generic_free (_data); return NULL; } _data->device = psz_source_name; set_arg_freebsd(_data, "source", psz_source_name); } else { if (cdio_is_device_generic(psz_orig_source_name)) { set_arg_freebsd(_data, "source", psz_orig_source_name); _data->device = strdup(psz_orig_source_name); } else { /* The below would be okay if all device drivers worked this way. */ #if 0 cdio_info ("source %s is a not a device", psz_orig_source_name); #endif cdio_generic_free (_data); return NULL; } } ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) { cdio_generic_free (_data); return NULL; } open_access_mode = 0; if (_AM_MMC_RDWR == _data->access_mode) { open_access_mode |= O_RDWR; } else if (_AM_MMC_RDWR_EXCL == _data->access_mode) { open_access_mode |= O_RDWR; } else { open_access_mode |= O_RDONLY; } /* fprintf(stderr, "libcdio_DEBUG: am = %d (MMC_RDWR_EXCL = %d), open = %d (O_RDWR = %d)\n", _data->access_mode, _AM_MMC_RDWR_EXCL, open_access_mode, O_RDWR); */ if (cdio_generic_init(_data, open_access_mode)) { if (_AM_MMC_RDWR_EXCL == _data->access_mode) { int os_errno, pass_dev_no = -1, flock_fd = -1, lock_result; char msg[4096]; lock_result = freebsd_dev_lock(_data->gen.fd, _data->gen.source_name, &os_errno, &pass_dev_no, &flock_fd, msg, 0); if (lock_result <= 0) { cdio_warn ("%s", msg); goto err_exit; } /* One should rather keep this fd open until _data->gen.fd gets closed. It eventually locks a device sibling of _data->gen.source_name. */ if (flock_fd > 0) close(flock_fd); } if ( _data->access_mode == _AM_IOCTL ) { return ret; } else { if (init_freebsd_cam(_data)) return ret; } } err_exit: free(ret); cdio_generic_free(_data); return NULL; #else return NULL; #endif /* HAVE_FREEBSD_CDROM */ } bool cdio_have_freebsd (void) { #ifdef HAVE_FREEBSD_CDROM return true; #else return false; #endif /* HAVE_FREEBSD_CDROM */ } libcdio-2.2.0/lib/driver/FreeBSD/freebsd.h000066400000000000000000000147601474051130400201650ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2008, 2010, 2012, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains FreeBSD-specific code and implements low-level control of the CD drive. Culled initially I think from xine's or mplayer's FreeBSD code with lots of modifications. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include "cdio_assert.h" #include "cdio_private.h" /*! For ioctl access /dev/acd0c is preferred over /dev/cd0c. For cam access /dev/cd0c is preferred. DEFAULT_CDIO_DEVICE and DEFAULT_FREEBSD_AM should be consistent. */ #ifndef DEFAULT_CDIO_DEVICE #define DEFAULT_CDIO_DEVICE "/dev/cd0c" #endif #ifndef DEFAULT_FREEBSD_AM #define DEFAULT_FREEBSD_AM _AM_CAM #endif #include #ifdef HAVE_FREEBSD_CDROM #include #include #include #include #include #ifdef HAVE_SYS_CDIO_H # include #endif #ifndef CDIOCREADAUDIO struct ioc_read_audio { u_char address_format; union msf_lba address; int nframes; u_char* buffer; }; #define CDIOCREADAUDIO _IOWR('c',31,struct ioc_read_audio) #endif #include #include #include #include #include /* for __FreeBSD_version */ #if (__FreeBSD_version < 500000) && (__FreeBSD_kernel_version < 500000) #define DEVICE_POSTFIX "c" #else #define DEVICE_POSTFIX "" #endif #define HAVE_FREEBSD_CAM #ifdef HAVE_FREEBSD_CAM #include #include #include #include #define ERRCODE(s) ((((s)[2]&0x0F)<<16)|((s)[12]<<8)|((s)[13])) #define EMEDIUMTYPE EINVAL #define ENOMEDIUM ENODEV #define CREAM_ON_ERRNO(s) do { \ switch ((s)[12]) \ { case 0x04: errno=EAGAIN; break; \ case 0x20: errno=ENODEV; break; \ case 0x21: if ((s)[13]==0) errno=ENOSPC; \ else errno=EINVAL; \ break; \ case 0x30: errno=EMEDIUMTYPE; break; \ case 0x3A: errno=ENOMEDIUM; break; \ } \ } while(0) #endif /*HAVE_FREEBSD_CAM*/ #include #define TOTAL_TRACKS ( p_env->tochdr.ending_track \ - p_env->tochdr.starting_track + 1) #define FIRST_TRACK_NUM (p_env->tochdr.starting_track) typedef enum { _AM_NONE, _AM_IOCTL, _AM_CAM, _AM_MMC_RDWR, _AM_MMC_RDWR_EXCL, } access_mode_t; typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; #ifdef HAVE_FREEBSD_CAM char *device; struct cam_device *cam; union ccb ccb; #endif access_mode_t access_mode; bool b_ioctl_init; bool b_cam_init; /* Track information */ struct ioc_toc_header tochdr; /* Entry info for each track. Add 1 for leadout. */ struct ioc_read_toc_single_entry tocent[CDIO_CD_MAX_TRACKS+1]; } _img_private_t; bool cdio_is_cdrom_freebsd_ioctl(char *drive, char *mnttype); track_format_t get_track_format_freebsd_ioctl(const _img_private_t *env, track_t i_track); bool get_track_green_freebsd_ioctl(const _img_private_t *env, track_t i_track); driver_return_code_t eject_media_freebsd_ioctl (_img_private_t *p_env); driver_return_code_t eject_media_freebsd_cam (_img_private_t *p_env); void get_drive_cap_freebsd_cam (const _img_private_t *p_env, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); int get_media_changed_freebsd (const void *p_user_data); char *get_mcn_freebsd_ioctl (const _img_private_t *p_env); void free_freebsd_cam (void *obj); /*! Using the ioctl method, r nblocks of audio sectors from cd device into data starting from lsn. Returns 0 if no error. */ int read_audio_sectors_freebsd_ioctl (_img_private_t *env, void *data, lsn_t lsn, unsigned int nblocks); /*! Using the CAM method, reads nblocks of mode2 sectors from cd device using into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_freebsd_cam (_img_private_t *env, void *data, lsn_t lsn, bool b_form2); /*! Using the ioctl method, reads nblocks of mode2 sectors from cd device using into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_freebsd_ioctl (_img_private_t *env, void *data, lsn_t lsn, bool b_form2); /*! Using the CAM method, reads nblocks of mode2 form2 sectors from cd device using into data starting from lsn. Returns 0 if no error. Note: if you want form1 sectors, the caller has to pick out the appropriate piece. */ int read_mode2_sectors_freebsd_cam (_img_private_t *env, void *buf, lsn_t lsn, unsigned int nblocks); bool read_toc_freebsd_ioctl (_img_private_t *env); /*! Run a SCSI MMC command. p_user_data internal CD structure. i_timeout time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. i_cdb Size of p_cdb p_cdb CDB bytes. e_direction direction the transfer is to go. i_buf Size of buffer p_buf Buffer for data, both sending and receiving Return 0 if no error. */ int run_mmc_cmd_freebsd_cam( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); /*! Return the size of the CD in logical block address (LBA) units. */ lsn_t get_disc_last_lsn_freebsd_ioctl (_img_private_t *_obj); bool init_freebsd_cam (_img_private_t *env); void free_freebsd_cam (void *user_data); /** Try to obtain SCSI address tuple of path. @return 1 is success , 0 is failure */ int obtain_scsi_adr_freebsd_cam(char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no); #endif /*HAVE_FREEBSD_CDROM*/ libcdio-2.2.0/lib/driver/FreeBSD/freebsd_cam.c000066400000000000000000000335311474051130400207750ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2009, 2010, 2012, 2016 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains FreeBSD-specific code and implements low-level control of the CD drive via SCSI emulation. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_FREEBSD_CDROM #include "freebsd.h" #include /* Default value in seconds we will wait for a command to complete. */ #define DEFAULT_TIMEOUT_MSECS 10000 /*! Run a SCSI MMC command. p_user_data internal CD structure. i_timeout_ms time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. i_cdb Size of p_cdb p_cdb CDB bytes. e_direction direction the transfer is to go. i_buf Size of buffer p_buf Buffer for data, both sending and receiving Return 0 if no error. */ int run_mmc_cmd_freebsd_cam( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { _img_private_t *p_env = p_user_data; int i_status, sense_size; int direction = CAM_DEV_QFRZDIS | CAM_PASS_ERR_RECOVER; union ccb ccb; p_env->gen.scsi_mmc_sense_valid = 0; if (!p_env || !p_env->cam) return -2; memset(&ccb, 0, sizeof(ccb)); ccb.ccb_h.path_id = p_env->cam->path_id; ccb.ccb_h.target_id = p_env->cam->target_id; ccb.ccb_h.target_lun = p_env->cam->target_lun; ccb.ccb_h.timeout = i_timeout_ms; if (SCSI_MMC_DATA_NONE == e_direction) i_buf = 0; if (!i_buf) direction |= CAM_DIR_NONE; else direction |= (e_direction == SCSI_MMC_DATA_READ)?CAM_DIR_IN : CAM_DIR_OUT; memcpy(ccb.csio.cdb_io.cdb_bytes, p_cdb->field, i_cdb); ccb.csio.cdb_len = mmc_get_cmd_len(ccb.csio.cdb_io.cdb_bytes[0]); cam_fill_csio (&(ccb.csio), 1, NULL, direction | CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, p_buf, i_buf, sizeof(ccb.csio.sense_data), ccb.csio.cdb_len, 30*1000); if (cam_send_ccb(p_env->cam, &ccb) < 0) { cdio_warn ("transport failed: %s", strerror(errno)); return -1; } if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { return 0; } /* Record SCSI sense reply for API call mmc_last_cmd_sense(). */ sense_size = ccb.csio.sense_len; if (sense_size > sizeof(p_env->gen.scsi_mmc_sense)) sense_size = sizeof(p_env->gen.scsi_mmc_sense); memcpy((void *) p_env->gen.scsi_mmc_sense, &ccb.csio.sense_data, sense_size); p_env->gen.scsi_mmc_sense_valid = sense_size; errno = EIO; i_status = ERRCODE(((unsigned char *)&ccb.csio.sense_data)); if (i_status == 0) i_status = -1; else CREAM_ON_ERRNO(((unsigned char *)&ccb.csio.sense_data)); /* There are many harmless or intentional reasons why to get an SCSI error condition. Higher levels should decide whether this is an incident or just a normal outcome. cdio_warn ("scsi error condition detected : 0x%X", i_status); */ return i_status; } bool init_freebsd_cam (_img_private_t *p_env) { char pass[100]; p_env->cam=NULL; memset (&p_env->ccb, 0, sizeof(p_env->ccb)); p_env->ccb.ccb_h.func_code = XPT_GDEVLIST; if (-1 == p_env->gen.fd) p_env->gen.fd = open (p_env->device, O_RDONLY, 0); if (p_env->gen.fd < 0) { cdio_warn ("open (%s): %s", p_env->device, strerror (errno)); return false; } if (ioctl(p_env->gen.fd, CDIOCALLOW) == -1) { cdio_warn("ioctl(fd, CDIOCALLOW) failed: %s\n", strerror(errno)); } if (ioctl (p_env->gen.fd, CAMGETPASSTHRU, &p_env->ccb) < 0) { cdio_warn ("open: %s", strerror (errno)); return false; } sprintf (pass,"/dev/%.15s%u", p_env->ccb.cgdl.periph_name, p_env->ccb.cgdl.unit_number); p_env->cam = cam_open_pass (pass,O_RDWR,NULL); if (!p_env->cam) return false; p_env->gen.init = true; p_env->b_cam_init = true; return true; } void free_freebsd_cam (void *user_data) { _img_private_t *p_env = user_data; if (NULL == p_env) return; if (p_env->gen.fd > 0) close (p_env->gen.fd); p_env->gen.fd = -1; if(p_env->cam) cam_close_device(p_env->cam); free (p_env); } driver_return_code_t read_mode2_sector_freebsd_cam (_img_private_t *p_env, void *data, lsn_t lsn, bool b_form2) { if ( b_form2 ) return read_mode2_sectors_freebsd_cam(p_env, data, lsn, 1); else { /* Need to pick out the data portion from a mode2 form2 frame */ char buf[M2RAW_SECTOR_SIZE] = { 0, }; int retval = read_mode2_sectors_freebsd_cam(p_env, buf, lsn, 1); if ( retval ) return retval; memcpy (((char *)data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ int read_mode2_sectors_freebsd_cam (_img_private_t *p_env, void *p_buf, lsn_t lsn, unsigned int nblocks) { mmc_cdb_t cdb = {{0, }}; bool b_read_10 = false; CDIO_MMC_SET_READ_LBA(cdb.field, lsn); if (b_read_10) { int retval; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_10); CDIO_MMC_SET_READ_LENGTH16(cdb.field, nblocks); if ((retval = mmc_set_blocksize (p_env->gen.cdio, M2RAW_SECTOR_SIZE))) return retval; if ((retval = run_mmc_cmd_freebsd_cam (p_env, 0, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, M2RAW_SECTOR_SIZE * nblocks, p_buf))) { mmc_set_blocksize (p_env->gen.cdio, CDIO_CD_FRAMESIZE); return retval; } return mmc_set_blocksize (p_env->gen.cdio, CDIO_CD_FRAMESIZE); } else { CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_CD); CDIO_MMC_SET_READ_LENGTH24(cdb.field, nblocks); cdb.field[1] = 0; /* sector size mode2 */ cdb.field[9] = 0x58; /* 2336 mode2 */ return run_mmc_cmd_freebsd_cam (p_env, 0, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, M2RAW_SECTOR_SIZE * nblocks, p_buf); } } /*! Eject media in CD-ROM drive. Return DRIVER_OP_SUCCESS if successful, DRIVER_OP_ERROR on error. */ driver_return_code_t eject_media_freebsd_cam (_img_private_t *p_env) { int i_status; mmc_cdb_t cdb = {{0, }}; uint8_t buf[1]; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL); i_status = run_mmc_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_WRITE, 0, &buf); if (i_status) return i_status; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_START_STOP); cdb.field[4] = 1; i_status = run_mmc_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_WRITE, 0, &buf); if (i_status) return i_status; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_START_STOP); cdb.field[4] = 2; /* eject */ return run_mmc_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_WRITE, 0, &buf); } /* This is a CAM based device enumerator. Currently its only purpose is to eventually obtain the info needed for cdio_get_arg("scsi-tuple") */ /* Stemming from code in libburn/sg-freebsd.c , originally contributed by Alexander Nedotsukov , without copyright claim to libburn in October 2006. Contributed by libburn and adapted to libcdio without copyright claim in January 2010. */ struct burn_drive_enumeration_state { int fd; union ccb ccb; unsigned int i; int skip_device; }; typedef struct burn_drive_enumeration_state *burn_drive_enumerator_t; /* Some helper functions for scsi_give_next_adr() */ static int sg_init_enumerator(burn_drive_enumerator_t *idx_) { struct burn_drive_enumeration_state *idx; int bufsize; idx = malloc(sizeof(*idx)); if (idx == NULL) { cdio_warn("cannot malloc memory for CAM based drive enumerator"); return -1; } idx->skip_device = 0; if ((idx->fd = open(XPT_DEVICE, O_RDWR)) == -1) { cdio_warn("could not open %s (errno = %d \"%s\")", XPT_DEVICE, errno, strerror(errno)); free(idx); idx = NULL; return -1; } memset(&(idx->ccb), 0, sizeof(union ccb)); idx->ccb.ccb_h.path_id = CAM_XPT_PATH_ID; idx->ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; idx->ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; idx->ccb.ccb_h.func_code = XPT_DEV_MATCH; bufsize = sizeof(struct dev_match_result) * 100; idx->ccb.cdm.match_buf_len = bufsize; idx->ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (idx->ccb.cdm.matches == NULL) { cdio_warn("cannot malloc memory for CAM enumerator matches"); close(idx->fd); free(idx); return -1; } idx->ccb.cdm.num_matches = 0; idx->i = idx->ccb.cdm.num_matches; /* to trigger buffer load */ /* * We fetch all nodes, since we display most of them in the default * case, and all in the verbose case. */ idx->ccb.cdm.num_patterns = 0; idx->ccb.cdm.pattern_buf_len = 0; *idx_ = idx; return 1; } static void sg_destroy_enumerator(burn_drive_enumerator_t *idx_) { struct burn_drive_enumeration_state *idx = *idx_; if(idx->fd != -1) close(idx->fd); free(idx->ccb.cdm.matches); free(idx); *idx_ = NULL; } static int sg_next_enumeration_buffer(burn_drive_enumerator_t *idx_) { struct burn_drive_enumeration_state *idx = *idx_; /* * We do the ioctl multiple times if necessary, in case there are * more than 100 nodes in the EDT. */ if (ioctl(idx->fd, CAMIOCOMMAND, &(idx->ccb)) == -1) { cdio_warn("error sending CAMIOCOMMAND ioctl, (errno = %d \"%s\")", errno, strerror(errno)); return -1; } if ((idx->ccb.ccb_h.status != CAM_REQ_CMP) || ((idx->ccb.cdm.status != CAM_DEV_MATCH_LAST) && (idx->ccb.cdm.status != CAM_DEV_MATCH_MORE))) { cdio_warn("got CAM error %#x, CDM error %d\n", idx->ccb.ccb_h.status, idx->ccb.cdm.status); return -1; } return 1; } /** Returns the next index object state and the next enumerated drive address. @param idx An opaque handle. Make no own theories about it. @param adr Takes the reply @param adr_size Gives maximum size of reply including final 0 @param initialize 1 = start new, 0 = continue, use no other values for now -1 = finish @return 1 = reply is a valid address , 0 = no further address available -1 = severe error (e.g. adr_size too small) */ /* This would be the public interface of the enumerator. In libcdio it is private for now. */ static int give_next_adr_freebsd_cam(burn_drive_enumerator_t *idx_, char adr[], int adr_size, int initialize) { struct burn_drive_enumeration_state *idx; int ret; if (initialize == 1) { ret = sg_init_enumerator(idx_); if (ret<=0) return ret; } else if (initialize == -1) { sg_destroy_enumerator(idx_); return 0; } idx = *idx_; do { if (idx->i >= idx->ccb.cdm.num_matches) { ret = sg_next_enumeration_buffer(idx_); if (ret<=0) return -1; idx->i = 0; } else (idx->i)++; while (idx->i < idx->ccb.cdm.num_matches) { switch (idx->ccb.cdm.matches[idx->i].type) { case DEV_MATCH_BUS: break; case DEV_MATCH_DEVICE: { struct device_match_result* result; result = &(idx->ccb.cdm.matches[idx->i].result.device_result); if (result->flags & DEV_RESULT_UNCONFIGURED) idx->skip_device = 1; else idx->skip_device = 0; break; } case DEV_MATCH_PERIPH: { struct periph_match_result* result; result = &(idx->ccb.cdm.matches[idx->i].result.periph_result); /* A specialized CD drive enumerator would have to test for strcmp(result->periph_name, "cd") != 0 rather than strcmp(result->periph_name, "pass") == 0 */ if (idx->skip_device || strcmp(result->periph_name, "pass") == 0) break; ret = snprintf(adr, adr_size, "/dev/%s%d", result->periph_name, result->unit_number); if(ret >= adr_size) return -1; /* Found next enumerable address */ return 1; } default: /* fprintf(stderr, "unknown match type\n"); */ break; } (idx->i)++; } } while ((idx->ccb.ccb_h.status == CAM_REQ_CMP) && (idx->ccb.cdm.status == CAM_DEV_MATCH_MORE)); return 0; } /** Try to obtain SCSI address tuple of path. @return 1 is success , 0 is failure */ int obtain_scsi_adr_freebsd_cam(char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no) { burn_drive_enumerator_t idx; int ret; char buf[64]; struct periph_match_result* result; ret = sg_init_enumerator(&idx); if (ret <= 0) return 0; while(1) { ret = give_next_adr_freebsd_cam(&idx, buf, sizeof(buf), 0); if (ret <= 0) break; if (strcmp(path, buf) == 0) { result = &(idx->ccb.cdm.matches[idx->i].result.periph_result); *bus_no = result->path_id; *host_no = result->path_id; *channel_no = 0; *target_no = result->target_id; *lun_no = result->target_lun; sg_destroy_enumerator(&idx); return 1; } } sg_destroy_enumerator(&idx); return (0); } #endif /* HAVE_FREEBSD_CDROM */ libcdio-2.2.0/lib/driver/FreeBSD/freebsd_ioctl.c000066400000000000000000000176351474051130400213560ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2013, 2016 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains FreeBSD-specific code and implements low-level control of the CD drive. Culled initially I think from xine's or mplayer's FreeBSD code with lots of modifications. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_FREEBSD_CDROM #include "freebsd.h" /* Check a drive to see if it is a CD-ROM Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive and -1 if no device exists . */ bool cdio_is_cdrom_freebsd_ioctl(char *drive, char *mnttype) { bool is_cd=false; int cdfd; struct ioc_toc_header tochdr; /* If it doesn't exist, return -1 */ if ( !cdio_is_device_quiet_generic(drive) ) { return(false); } /* ts 13 Jan 2009 The ioctl below seems to be of little significance if one does not insist in readable media. Various of its failures are not caused by not being a CD drive but by unreadable media situations. A burn program must handle these situations rather than refusing to see the drive. */ return(true); #ifndef Libcdio_on_freeBSD_unsuitable_code /* If it does exist, verify that it's an available CD-ROM */ cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); /* Should we want to test the condition in more detail: ENOENT is the error for /dev/xxxxx does not exist; ENODEV means there's no drive present. */ if ( cdfd >= 0 ) { int ret; ret = ioctl(cdfd, CDIOREADTOCHEADER, &tochdr); /* fprintf(stderr, "libcdio_DEBUG: ioctl(\"%s\", (O_RDONLY|O_EXCL|O_NONBLOCK) = %d (errno= %d)\n", drive, ret, errno); */ if ( ret != -1 ) { is_cd = true; } else if ( errno == ENXIO ) { /* Device not configured */ /* ts 9 Jan 2010 , FreeBSD 8.0 This error is issued with CAM device cd0 if no media is loaded. */ is_cd = true; } else if ( errno == EIO ) { /* I/O error */ /* ts 9 Jan 2010 , FreeBSD 8.0 This error is issued with ATAPI device acd0 if no media is loaded. */ is_cd = true; } else if ( errno == EINVAL ) { /* Invalid argument */ /* ts 13 Jan 2010 , FreeBSD 8.0 This error is issued with USB device cd1 if a blank CD-RW is loaded. */ is_cd = true; } close(cdfd); } else if ( mnttype && (strcmp(mnttype, "iso9660") == 0) ) { /* Even if we can't read it, it might be mounted */ is_cd = true; } return(is_cd); #endif /* Libcdio_on_freeBSD_unsuitable_codE */ } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ int read_audio_sectors_freebsd_ioctl (_img_private_t *_obj, void *data, lsn_t lsn, unsigned int nblocks) { int bsize = CDIO_CD_FRAMESIZE_RAW; /* set block size */ if (ioctl(_obj->gen.fd, CDRIOCSETBLOCKSIZE, &bsize) == -1) return 1; /* read a frame */ if (pread(_obj->gen.fd, data, nblocks*bsize, lsn*bsize) != nblocks*bsize) { perror("read_audio_sectors_freebsd_ioctl"); return 1; } return 0; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_freebsd_ioctl (_img_private_t *p_env, void *data, lsn_t lsn, bool b_form2) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; int retval; if ( !b_form2 ) return cdio_generic_read_form1_sector (p_env, buf, lsn); if ( (retval = read_audio_sectors_freebsd_ioctl (p_env, buf, lsn, 1)) ) return retval; memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, M2RAW_SECTOR_SIZE); return 0; } /*! Return the size of the CD in logical block address (LBA) units. */ lsn_t get_disc_last_lsn_freebsd_ioctl (_img_private_t *p_obj) { struct ioc_read_toc_single_entry tocent; uint32_t size; tocent.track = CDIO_CDROM_LEADOUT_TRACK; tocent.address_format = CDIO_CDROM_LBA; if (ioctl (p_obj->gen.fd, CDIOREADTOCENTRY, &tocent) == -1) { perror ("ioctl(CDROMREADTOCENTRY)"); exit (EXIT_FAILURE); } size = tocent.entry.addr.lba; return size; } /*! Eject media in CD-ROM drive. Return DRIVER_OP_SUCCESS if successful, DRIVER_OP_ERROR on error. */ driver_return_code_t eject_media_freebsd_ioctl (_img_private_t *p_env) { _img_private_t *p_obj = p_env; int ret=DRIVER_OP_ERROR; if (ioctl(p_obj->gen.fd, CDIOCALLOW) == -1) { cdio_warn("ioctl(fd, CDIOCALLOW) failed: %s\n", strerror(errno)); } else if (ioctl(p_obj->gen.fd, CDIOCEJECT) == -1) { cdio_warn("ioctl(CDIOCEJECT) failed: %s\n", strerror(errno)); } else { ret=DRIVER_OP_SUCCESS;; } return ret; } /*! Return the media catalog number MCN. Note: string is malloc'd so caller should free() then returned string when done with it. FIXME: This is just a guess. */ char * get_mcn_freebsd_ioctl (const _img_private_t *p_env) { struct ioc_read_subchannel subchannel; struct cd_sub_channel_info subchannel_info; subchannel.address_format = CDIO_CDROM_MSF; subchannel.data_format = CDIO_SUBCHANNEL_MEDIA_CATALOG; subchannel.track = 0; subchannel.data_len = sizeof(subchannel_info); subchannel.data = &subchannel_info; if(ioctl(p_env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) { perror("CDIOCREADSUBCHANNEL"); return NULL; } /* Probably need a loop over tracks rather than give up if we can't find in track 0. */ if (subchannel_info.what.media_catalog.mc_valid) return strdup((char *)subchannel_info.what.media_catalog.mc_number); else return NULL; } /*! Get format of track. FIXME: We're just guessing this from the GNU/Linux code. */ track_format_t get_track_format_freebsd_ioctl(const _img_private_t *p_env, track_t i_track) { struct ioc_read_subchannel subchannel; struct cd_sub_channel_info subchannel_info; subchannel.address_format = CDIO_CDROM_LBA; subchannel.data_format = CDIO_SUBCHANNEL_CURRENT_POSITION; subchannel.track = i_track; subchannel.data_len = 1; subchannel.data = &subchannel_info; if(ioctl(p_env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) { perror("CDIOCREADSUBCHANNEL"); return 1; } if (subchannel_info.what.position.control == 0x04) { if (subchannel_info.what.position.data_format == 0x10) return TRACK_FORMAT_CDI; else if (subchannel_info.what.position.data_format == 0x20) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ bool get_track_green_freebsd_ioctl(const _img_private_t *p_env, track_t i_track) { struct ioc_read_subchannel subchannel; struct cd_sub_channel_info subchannel_info; subchannel.address_format = CDIO_CDROM_LBA; subchannel.data_format = CDIO_SUBCHANNEL_CURRENT_POSITION; subchannel.track = i_track; subchannel.data_len = 1; subchannel.data = &subchannel_info; if(ioctl(p_env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) { perror("CDIOCREADSUBCHANNEL"); return 1; } /* FIXME: Dunno if this is the right way, but it's what I was using in cdinfo for a while. */ return (subchannel_info.what.position.control & 2) != 0; } #endif /* HAVE_FREEBSD_CDROM */ libcdio-2.2.0/lib/driver/MSWindows/000077500000000000000000000000001474051130400170525ustar00rootroot00000000000000libcdio-2.2.0/lib/driver/MSWindows/Makefile000066400000000000000000000015531474051130400205160ustar00rootroot00000000000000# $Id: Makefile,v 1.2 2008/04/21 18:30:21 karl Exp $ # # Copyright (C) 2004, 2008 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # The make is done above. This boilerplate Makefile just transfers the call all install check clean: cd .. && $(MAKE) $@ libcdio-2.2.0/lib/driver/MSWindows/aspi32.c000066400000000000000000000545651474051130400203360ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2009, 2010, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains Win32-specific code and implements low-level control of the CD drive via the ASPI API. Inspired by vlc's cdrom.h code */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include #include #include #include "cdio_assert.h" #include #ifdef HAVE_WIN32_CDROM #include #include #include #include #include #include #include #include "win32.h" #include #include #include "aspi32.h" /* Amount of time we are willing to wait for an operation to complete. 10 seconds? */ #define OP_TIMEOUT_MS 10000 static const char *aspierror(int nErrorCode) { switch (nErrorCode) { case SS_PENDING: return "SRB being processed"; break; case SS_COMP: return "SRB completed without error"; break; case SS_ABORTED: return "SRB aborted"; break; case SS_ABORT_FAIL: return "Unable to abort SRB"; break; case SS_ERR: return "SRB completed with error"; break; case SS_INVALID_CMD: return "Invalid ASPI command"; break; case SS_INVALID_HA: return "Invalid host adapter number"; break; case SS_NO_DEVICE: return "SCSI device not installed"; break; case SS_INVALID_SRB: return "Invalid parameter set in SRB"; break; case SS_OLD_MANAGER: return "ASPI manager doesn't support"; break; case SS_ILLEGAL_MODE: return "Unsupported MS Windows mode"; break; case SS_NO_ASPI: return "No ASPI managers"; break; case SS_FAILED_INIT: return "ASPI for windows failed init"; break; case SS_ASPI_IS_BUSY: return "No resources available to execute command."; break; case SS_BUFFER_TOO_BIG: return "Buffer size is too big to handle."; break; case SS_MISMATCHED_COMPONENTS: return "The DLLs/EXEs of ASPI don't version check"; break; case SS_NO_ADAPTERS: return "No host adapters found"; break; case SS_INSUFFICIENT_RESOURCES: return "Couldn't allocate resources needed to init"; break; case SS_ASPI_IS_SHUTDOWN: return "Call came to ASPI after PROCESS_DETACH"; break; case SS_BAD_INSTALL: return "The DLL or other components are installed wrong."; break; default: return "Unknown ASPI error."; } } /* General ioctl() CD-ROM command function */ static bool mciSendCommand_aspi(int id, UINT msg, DWORD flags, void *arg) { MCIERROR mci_error; mci_error = mciSendCommand(id, msg, flags, (DWORD_PTR)arg); if ( mci_error ) { char error[256]; mciGetErrorStringA(mci_error, error, 256); cdio_warn("mciSendCommand() error: %s", error); } return(mci_error == 0); } /* See if the ASPI DLL is loadable. If so pointers are returned and we return true. Return false if there was a problem. */ static bool have_aspi( HMODULE *hASPI, long (**lpGetSupport)( void ), long (**lpSendCommand)( void* ) ) { /* check if aspi is available */ *hASPI = LoadLibraryA( "wnaspi32.dll" ); if( *hASPI == NULL ) { cdio_warn("Unable to load ASPI DLL"); return false; } *lpGetSupport = (void *) GetProcAddress( *hASPI, "GetASPI32SupportInfo" ); *lpSendCommand = (void *) GetProcAddress( *hASPI, "SendASPI32Command" ); /* make sure that we've got both function addresses */ if( *lpGetSupport == NULL || *lpSendCommand == NULL ) { cdio_debug("Unable to get ASPI function pointers"); FreeLibrary( *hASPI ); return false; } return true; } /*! Get disc type associated with cd object. */ discmode_t get_discmode_aspi (_img_private_t *p_env) { track_t i_track; discmode_t discmode=CDIO_DISC_MODE_NO_INFO; /* See if this is a DVD. */ cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */ dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL; dvd.physical.layer_num = 0; if (0 == mmc_get_dvd_struct_physical_private (p_env, &run_mmc_cmd_aspi, &dvd)) { switch(dvd.physical.layer[0].book_type) { case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM; case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM; case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R; case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW; case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR; case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW; default: return CDIO_DISC_MODE_DVD_OTHER; } } if (!p_env->gen.toc_init) read_toc_aspi (p_env); if (!p_env->gen.toc_init) return CDIO_DISC_MODE_NO_INFO; for (i_track = p_env->gen.i_first_track; i_track < p_env->gen.i_first_track + p_env->gen.i_tracks ; i_track ++) { track_format_t track_fmt=get_track_format_aspi(p_env, i_track); switch(track_fmt) { case TRACK_FORMAT_AUDIO: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_XA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_DATA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_ERROR: default: discmode = CDIO_DISC_MODE_ERROR; } } return discmode; } const char * is_cdrom_aspi(const char drive_letter) { static char psz_win32_drive[7]; HMODULE hASPI = NULL; long (*lpGetSupport)( void ) = NULL; long (*lpSendCommand)( void* ) = NULL; DWORD dwSupportInfo; int i_adapter, i_hostadapters; char c_drive; int i_rc; if ( !have_aspi(&hASPI, &lpGetSupport, &lpSendCommand) ) return NULL; /* ASPI support seems to be there. */ dwSupportInfo = lpGetSupport(); i_rc = HIBYTE( LOWORD ( dwSupportInfo ) ); if( SS_COMP != i_rc ) { cdio_debug("ASPI: %s", aspierror(i_rc)); FreeLibrary( hASPI ); return NULL; } i_hostadapters = LOBYTE( LOWORD( dwSupportInfo ) ); if( i_hostadapters == 0 ) { FreeLibrary( hASPI ); return NULL; } c_drive = toupper((unsigned char) drive_letter) - 'A'; for( i_adapter = 0; i_adapter < i_hostadapters; i_adapter++ ) { struct SRB_GetDiskInfo srbDiskInfo; int i_target; SRB_HAInquiry srbInquiry; srbInquiry.SRB_Cmd = SC_HA_INQUIRY; srbInquiry.SRB_HaId = i_adapter; lpSendCommand( (void*) &srbInquiry ); if( srbInquiry.SRB_Status != SS_COMP ) continue; if( !srbInquiry.HA_Unique[3]) srbInquiry.HA_Unique[3]=8; for(i_target=0; i_target < srbInquiry.HA_Unique[3]; i_target++) { int i_lun; for( i_lun=0; i_lun<8; i_lun++) { srbDiskInfo.SRB_Cmd = SC_GET_DISK_INFO; srbDiskInfo.SRB_Flags = 0; srbDiskInfo.SRB_Hdr_Rsvd = 0; srbDiskInfo.SRB_HaId = i_adapter; srbDiskInfo.SRB_Target = i_target; srbDiskInfo.SRB_Lun = i_lun; lpSendCommand( (void*) &srbDiskInfo ); if( (srbDiskInfo.SRB_Status == SS_COMP) && (srbDiskInfo.SRB_Int13HDriveInfo == c_drive) ) { /* Make sure this is a CD-ROM device. */ struct SRB_GDEVBlock srbGDEVBlock; memset( &srbGDEVBlock, 0, sizeof(struct SRB_GDEVBlock) ); srbGDEVBlock.SRB_Cmd = SC_GET_DEV_TYPE; srbDiskInfo.SRB_HaId = i_adapter; srbGDEVBlock.SRB_Target = i_target; srbGDEVBlock.SRB_Lun = i_lun; lpSendCommand( (void*) &srbGDEVBlock ); if( ( srbGDEVBlock.SRB_Status == SS_COMP ) && ( srbGDEVBlock.SRB_DeviceType == DTYPE_CDROM ) ) { sprintf( psz_win32_drive, "%c:", drive_letter ); FreeLibrary( hASPI ); return(psz_win32_drive); } } } } } FreeLibrary( hASPI ); return NULL; } /*! Initialize CD device. */ bool init_aspi (_img_private_t *env) { HMODULE hASPI = NULL; long (*lpGetSupport)( void ) = NULL; long (*lpSendCommand)( void* ) = NULL; DWORD dwSupportInfo; int i_adapter, i_hostadapters; unsigned char c_drive; int i_rc; if (2 == strlen(env->gen.source_name) && isalpha((unsigned char) env->gen.source_name[0]) ) { c_drive = env->gen.source_name[0]; } else if ( 6 == strlen(env->gen.source_name) && isalpha((unsigned char) env->gen.source_name[4] )) { c_drive = env->gen.source_name[4]; } else { c_drive = 'C'; } if ( !have_aspi(&hASPI, &lpGetSupport, &lpSendCommand) ) return false; /* ASPI support seems to be there. */ dwSupportInfo = lpGetSupport(); i_rc = HIBYTE( LOWORD ( dwSupportInfo ) ); if( SS_COMP != i_rc ) { cdio_info("ASPI: %s", aspierror(i_rc)); FreeLibrary( hASPI ); return false; } i_hostadapters = LOBYTE( LOWORD( dwSupportInfo ) ); if( i_hostadapters == 0 ) { FreeLibrary( hASPI ); return false; } c_drive = toupper(c_drive) - 'A'; for( i_adapter = 0; i_adapter < i_hostadapters; i_adapter++ ) { struct SRB_GetDiskInfo srbDiskInfo; int i_target; SRB_HAInquiry srbInquiry; srbInquiry.SRB_Cmd = SC_HA_INQUIRY; srbInquiry.SRB_HaId = i_adapter; lpSendCommand( (void*) &srbInquiry ); if( srbInquiry.SRB_Status != SS_COMP ) continue; if( !srbInquiry.HA_Unique[3]) srbInquiry.HA_Unique[3]=8; for(i_target=0; i_target < srbInquiry.HA_Unique[3]; i_target++) { int i_lun; for (i_lun = 0; i_lun < 8; i_lun++ ) { srbDiskInfo.SRB_Cmd = SC_GET_DISK_INFO; srbDiskInfo.SRB_Flags = 0; srbDiskInfo.SRB_Hdr_Rsvd = 0; srbDiskInfo.SRB_HaId = i_adapter; srbDiskInfo.SRB_Target = i_target; srbDiskInfo.SRB_Lun = i_lun; lpSendCommand( (void*) &srbDiskInfo ); if( (srbDiskInfo.SRB_Status == SS_COMP) ) { if (srbDiskInfo.SRB_Int13HDriveInfo != c_drive) { continue; } else { /* Make sure this is a CD-ROM device. */ struct SRB_GDEVBlock srbGDEVBlock; memset( &srbGDEVBlock, 0, sizeof(struct SRB_GDEVBlock) ); srbGDEVBlock.SRB_Cmd = SC_GET_DEV_TYPE; srbGDEVBlock.SRB_HaId = i_adapter; srbGDEVBlock.SRB_Target = i_target; lpSendCommand( (void*) &srbGDEVBlock ); if( ( srbGDEVBlock.SRB_Status == SS_COMP ) && ( srbGDEVBlock.SRB_DeviceType == DTYPE_CDROM ) ) { env->i_sid = MAKEWORD( i_adapter, i_target ); env->hASPI = hASPI; env->lpSendCommand = lpSendCommand; env->b_aspi_init = true; env->i_lun = i_lun; cdio_debug("Using ASPI layer for %s", env->gen.source_name); return true; } else { FreeLibrary( hASPI ); cdio_debug( "%s: is not a CD-ROM drive", env->gen.source_name ); return false; } } } } } } FreeLibrary( hASPI ); cdio_info( "Unable to find host adapter id and target (ASPI) for %s", env->gen.source_name ); return false; } /*! Run a SCSI MMC command. env private CD structure i_timeout_ms time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. We return 0 if command completed successfully. */ int run_mmc_cmd_aspi( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t * p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { _img_private_t *p_env = p_user_data; HANDLE hEvent; struct SRB_ExecSCSICmd ssc; int sense_size; /* Create the transfer completion event */ hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); if( hEvent == NULL ) { cdio_info("CreateEvent failed"); return 1; } p_env->gen.scsi_mmc_sense_valid = 0; memset( &ssc, 0, sizeof( ssc ) ); ssc.SRB_Cmd = SC_EXEC_SCSI_CMD; ssc.SRB_Flags = SCSI_MMC_DATA_READ == e_direction ? SRB_DIR_IN | SRB_EVENT_NOTIFY : SRB_DIR_OUT | SRB_EVENT_NOTIFY; ssc.SRB_HaId = LOBYTE( p_env->i_sid ); ssc.SRB_Target = HIBYTE( p_env->i_sid ); ssc.SRB_Lun = p_env->i_lun; ssc.SRB_SenseLen = SENSE_LEN; ssc.SRB_PostProc = (LPVOID) hEvent; ssc.SRB_CDBLen = i_cdb; /* Result buffer */ ssc.SRB_BufPointer = p_buf; ssc.SRB_BufLen = i_buf; memcpy( ssc.CDBByte, p_cdb, i_cdb ); ResetEvent( hEvent ); p_env->lpSendCommand( (void*) &ssc ); /* If the command has still not been processed, wait until it's * finished */ if( ssc.SRB_Status == SS_PENDING ) { WaitForSingleObject( hEvent, msecs2secs(i_timeout_ms) ); } CloseHandle( hEvent ); /* check that the transfer went as planned */ if( ssc.SRB_Status != SS_COMP ) { cdio_info("ASPI: %s", aspierror(ssc.SRB_Status)); return DRIVER_OP_ERROR; } else { sense_size = ssc.SenseArea[7] + 8; /* SPC 4.5.3, Table 26: 252 bytes legal, 263 bytes possible */ if (sense_size > SENSE_LEN) sense_size = SENSE_LEN; memcpy((void *) p_env->gen.scsi_mmc_sense, ssc.SenseArea, sense_size); p_env->gen.scsi_mmc_sense_valid = sense_size; } return DRIVER_OP_SUCCESS; } /*! Reads nblocks sectors from cd device into data starting from lsn. Returns 0 if no error. */ static int read_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn, int sector_type, unsigned int nblocks) { mmc_cdb_t cdb = {{0, }}; unsigned int i_buf; int synchronous = 0; int header_code = 2; int i_user_data = 1; int edc_ecc = 0; int error_field = 0; #if 0 sector_type = 0; /*all types */ #endif /* Set up passthrough command */ CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_CD); CDIO_MMC_SET_READ_TYPE (cdb.field, sector_type); CDIO_MMC_SET_READ_LBA (cdb.field, lsn); CDIO_MMC_SET_READ_LENGTH24(cdb.field, nblocks); #if 1 cdb.field[ 9 ] = (synchronous << 7) | (header_code << 5) | (i_user_data << 4) | (edc_ecc << 3) | (error_field << 1); /* ssc.CDBByte[ 9 ] = READ_CD_USERDATA_MODE2; */ #else CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cmd, CDIO_MMC_MCSB_ALL_HEADERS); #endif switch (sector_type) { case CDIO_MMC_READ_TYPE_ANY: case CDIO_MMC_READ_TYPE_CDDA: i_buf = CDIO_CD_FRAMESIZE_RAW; break; case CDIO_MMC_READ_TYPE_M2F1: i_buf = CDIO_CD_FRAMESIZE; break; case CDIO_MMC_READ_TYPE_M2F2: i_buf = 2324; break; case CDIO_MMC_READ_TYPE_MODE1: i_buf = CDIO_CD_FRAMESIZE; break; default: i_buf = CDIO_CD_FRAMESIZE_RAW; } return run_mmc_cmd_aspi(p_env, OP_TIMEOUT_MS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, i_buf*nblocks, data); } /*! Reads an audio device into data starting from lsn. Returns 0 if no error. */ int read_audio_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn, unsigned int i_blocks) { if (read_sectors_aspi(p_env, data, lsn, CDIO_MMC_READ_TYPE_CDDA, i_blocks)) { return read_sectors_aspi(p_env, data, lsn, CDIO_MMC_READ_TYPE_ANY, i_blocks); } return 0; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_aspi (_img_private_t *p_env, void *data, lsn_t lsn, bool b_form2) { return read_sectors_aspi(p_env, data, lsn, b_form2 ? CDIO_MMC_READ_TYPE_M2F2 : CDIO_MMC_READ_TYPE_M2F1, 1); } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ int read_mode1_sector_aspi (_img_private_t *p_env, void *data, lsn_t lsn, bool b_form2) { return read_sectors_aspi(p_env, data, lsn, CDIO_MMC_READ_TYPE_MODE1, 1); } /*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ bool read_toc_aspi (_img_private_t *p_env) { mmc_cdb_t cdb = {{0, }}; unsigned char tocheader[ 4 ]; int i_status; /* Operation code */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC); /* Format */ cdb.field[ 2 ] = CDIO_MMC_READTOC_FMT_TOC; /* Starting track */ CDIO_MMC_SET_START_TRACK(cdb.field, 0); CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(tocheader)); i_status = run_mmc_cmd_aspi (p_env, OP_TIMEOUT_MS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, sizeof(tocheader), &tocheader); if (0 != i_status) return false; p_env->gen.i_first_track = tocheader[2]; p_env->gen.i_tracks = tocheader[3] - tocheader[2] + 1; { int i, j, i_toclength; unsigned char *p_fulltoc; i_toclength = 4 /* header */ + tocheader[0] + ((unsigned int) tocheader[1] << 8); p_fulltoc = malloc( i_toclength ); if( p_fulltoc == NULL ) { cdio_error( "out of memory" ); return false; } CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_toclength); i_status = run_mmc_cmd_aspi (p_env, OP_TIMEOUT_MS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, i_toclength, p_fulltoc); if( 0 != i_status ) { p_env->gen.i_tracks = 0; } j = p_env->gen.i_first_track; for( i = 0 ; i <= p_env->gen.i_tracks ; i++, j++ ) { int i_index = 8 + 8 * i; p_env->tocent[ i ].start_lsn = ((int)p_fulltoc[ i_index ] << 24) + ((int)p_fulltoc[ i_index+1 ] << 16) + ((int)p_fulltoc[ i_index+2 ] << 8) + (int)p_fulltoc[ i_index+3 ]; p_env->tocent[i].Control = (UCHAR)p_fulltoc[ 1 + 8 * i ]; set_track_flags(&(p_env->gen.track_flags[j]), p_env->tocent[i].Control); cdio_debug( "p_sectors: %i %lu", i, (unsigned long int) p_env->tocent[i].start_lsn ); } free( p_fulltoc ); } p_env->gen.toc_init = true; return true; } /* Eject media will eventually get removed from _cdio_win32.c */ #if 0 /*! Eject media. Return 1 if successful, 0 otherwise. */ int wnaspi32_eject_media (void *user_data) { _img_private_t *env = user_data; MCI_OPEN_PARMS op; MCI_STATUS_PARMS st; DWORD i_flags; char psz_drive[4]; int ret; memset( &op, 0, sizeof(MCI_OPEN_PARMS) ); op.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO; strcpy( psz_drive, "X:" ); psz_drive[0] = env->gen.source_name[0]; op.lpstrElementName = psz_drive; /* Set the flags for the device type */ i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE; if( mciSendCommand_aspi( 0, MCI_OPEN, i_flags, &op ) ) { st.dwItem = MCI_STATUS_READY; /* Eject disc */ ret = mciSendCommand_aspi( op.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0 ) != 0; /* Release access to the device */ mciSendCommand_aspi( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 ); } else ret = 0; return ret; } #endif /*! Get format of track. */ track_format_t get_track_format_aspi(const _img_private_t *p_env, track_t track_num) { MCI_OPEN_PARMS op; MCI_STATUS_PARMS st; DWORD i_flags; memset( &op, 0, sizeof(MCI_OPEN_PARMS) ); op.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO; op.lpstrElementName = p_env->gen.source_name; /* Set the flags for the device type */ i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE; if( mciSendCommand_aspi( 0, MCI_OPEN, i_flags, &op ) ) { st.dwItem = MCI_CDA_STATUS_TYPE_TRACK; st.dwTrack = track_num; i_flags = MCI_TRACK | MCI_STATUS_ITEM ; mciSendCommand_aspi( op.wDeviceID, MCI_STATUS, i_flags, &st ); /* Release access to the device */ mciSendCommand_aspi( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 ); switch(st.dwReturn) { case MCI_CDA_TRACK_AUDIO: return TRACK_FORMAT_AUDIO; case MCI_CDA_TRACK_OTHER: return TRACK_FORMAT_DATA; default: return TRACK_FORMAT_XA; } } return TRACK_FORMAT_ERROR; } #endif /* HAVE_WIN32_CDROM */ libcdio-2.2.0/lib/driver/MSWindows/aspi32.h000066400000000000000000000217531474051130400203340ustar00rootroot00000000000000/* Win32 aspi specific */ /* $Id: aspi32.h,v 1.6 2008/04/21 18:30:21 karl Exp $ Copyright (C) 2003, 2004, 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #define ASPI_HAID 0 #define ASPI_TARGET 0 #define DTYPE_CDROM 0x05 #define SENSE_LEN 0x0E #define SC_HA_INQUIRY 0x00 #define SC_GET_DEV_TYPE 0x01 #define SC_EXEC_SCSI_CMD 0x02 #define SC_GET_DISK_INFO 0x06 //***************************************************************************** // %%% SRB Status %%% //***************************************************************************** #define SS_PENDING 0x00 // SRB being processed #define SS_COMP 0x01 // SRB completed without error #define SS_ABORTED 0x02 // SRB aborted #define SS_ABORT_FAIL 0x03 // Unable to abort SRB #define SS_ERR 0x04 // SRB completed with error #define SS_INVALID_CMD 0x80 // Invalid ASPI command #define SS_INVALID_HA 0x81 // Invalid host adapter number #define SS_NO_DEVICE 0x82 // SCSI device not installed #define SS_INVALID_SRB 0xE0 // Invalid parameter set in SRB #define SS_OLD_MANAGER 0xE1 // ASPI manager doesn't support Windows #define SS_BUFFER_ALIGN 0xE1 // Buffer not aligned (replaces // OLD_MANAGER in Win32) #define SS_ILLEGAL_MODE 0xE2 // Unsupported Windows mode #define SS_NO_ASPI 0xE3 // No ASPI managers resident #define SS_FAILED_INIT 0xE4 // ASPI for windows failed init #define SS_ASPI_IS_BUSY 0xE5 // No resources available to execute // cmd #define SS_BUFFER_TOO_BIG 0xE6 // Buffer size to big to handle! #define SS_MISMATCHED_COMPONENTS 0xE7 // The DLLs/EXEs of ASPI don't version // check #define SS_NO_ADAPTERS 0xE8 // No host adapters to manage #define SS_INSUFFICIENT_RESOURCES 0xE9 // Couldn't allocate resources needed // to init #define SS_ASPI_IS_SHUTDOWN 0xEA // Call came to ASPI after // PROCESS_DETACH #define SS_BAD_INSTALL 0xEB // The DLL or other components are installed wrong //***************************************************************************** // %%% Host Adapter Status %%% //***************************************************************************** #define HASTAT_OK 0x00 // Host adapter did not detect an // error #define HASTAT_SEL_TO 0x11 // Selection Timeout #define HASTAT_DO_DU 0x12 // Data overrun data underrun #define HASTAT_BUS_FREE 0x13 // Unexpected bus free #define HASTAT_PHASE_ERR 0x14 // Target bus phase sequence // failure #define HASTAT_TIMEOUT 0x09 // Timed out while SRB was // waiting to beprocessed. #define HASTAT_COMMAND_TIMEOUT 0x0B // Adapter timed out processing SRB. #define HASTAT_MESSAGE_REJECT 0x0D // While processing SRB, the // adapter received a MESSAGE #define HASTAT_BUS_RESET 0x0E // A bus reset was detected. #define HASTAT_PARITY_ERROR 0x0F // A parity error was detected. #define HASTAT_REQUEST_SENSE_FAILED 0x10 // The adapter failed in issuing #define SS_NO_ADAPTERS 0xE8 #define SRB_DIR_IN 0x08 #define SRB_DIR_OUT 0x10 #define SRB_EVENT_NOTIFY 0x40 #define SECTOR_TYPE_MODE2 0x14 #define READ_CD_USERDATA_MODE2 0x10 #define READ_TOC 0x43 #define READ_TOC_FORMAT_TOC 0x0 #pragma pack(1) struct SRB_GetDiskInfo { unsigned char SRB_Cmd; unsigned char SRB_Status; unsigned char SRB_HaId; unsigned char SRB_Flags; unsigned long SRB_Hdr_Rsvd; unsigned char SRB_Target; unsigned char SRB_Lun; unsigned char SRB_DriveFlags; unsigned char SRB_Int13HDriveInfo; unsigned char SRB_Heads; unsigned char SRB_Sectors; unsigned char SRB_Rsvd1[22]; }; struct SRB_GDEVBlock { unsigned char SRB_Cmd; unsigned char SRB_Status; unsigned char SRB_HaId; unsigned char SRB_Flags; unsigned long SRB_Hdr_Rsvd; unsigned char SRB_Target; unsigned char SRB_Lun; unsigned char SRB_DeviceType; unsigned char SRB_Rsvd1; }; struct SRB_ExecSCSICmd { unsigned char SRB_Cmd; unsigned char SRB_Status; unsigned char SRB_HaId; unsigned char SRB_Flags; unsigned long SRB_Hdr_Rsvd; unsigned char SRB_Target; unsigned char SRB_Lun; unsigned short SRB_Rsvd1; unsigned long SRB_BufLen; unsigned char *SRB_BufPointer; unsigned char SRB_SenseLen; unsigned char SRB_CDBLen; unsigned char SRB_HaStat; unsigned char SRB_TargStat; unsigned long *SRB_PostProc; unsigned char SRB_Rsvd2[20]; unsigned char CDBByte[16]; unsigned char SenseArea[SENSE_LEN+2]; }; /***************************************************************************** %%% SRB - HOST ADAPTER INQUIRY - SC_HA_INQUIRY (0) %%% *****************************************************************************/ typedef struct // Offset { // HX/DEC BYTE SRB_Cmd; // 00/000 ASPI command code = SC_HA_INQUIRY BYTE SRB_Status; // 01/001 ASPI command status byte BYTE SRB_HaId; // 02/002 ASPI host adapter number BYTE SRB_Flags; // 03/003 ASPI request flags DWORD SRB_Hdr_Rsvd; // 04/004 Reserved, MUST = 0 BYTE HA_Count; // 08/008 Number of host adapters present BYTE HA_SCSI_ID; // 09/009 SCSI ID of host adapter BYTE HA_ManagerId[16]; // 0A/010 String describing the manager BYTE HA_Identifier[16]; // 1A/026 String describing the host adapter BYTE HA_Unique[16]; // 2A/042 Host Adapter Unique parameters WORD HA_Rsvd1; // 3A/058 Reserved, MUST = 0 } SRB_HAInquiry; /*! Get disc type associated with cd object. */ discmode_t get_discmode_aspi (_img_private_t *p_env); /*! Return the the kind of drive capabilities of device. Note: string is malloc'd so caller should free() then returned string when done with it. */ char * get_mcn_aspi (const _img_private_t *env); /*! Get the format (XA, DATA, AUDIO) of a track. */ track_format_t get_track_format_aspi(const _img_private_t *env, track_t i_track); /*! Initialize internal structures for CD device. */ bool init_aspi (_img_private_t *env); const char *is_cdrom_aspi(const char drive_letter); /*! Reads an audio device using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ int read_audio_sectors_aspi (_img_private_t *obj, void *data, lsn_t lsn, unsigned int nblocks); /*! Reads a single mode1 sector using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ int read_mode1_sector_aspi (_img_private_t *env, void *data, lsn_t lsn, bool b_form2); /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_aspi (_img_private_t *env, void *data, lsn_t lsn, bool b_form2); /*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ bool read_toc_aspi (_img_private_t *env); /*! Run a SCSI MMC command. env private CD structure i_timeout time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. Return 0 if command completed successfully. */ int run_mmc_cmd_aspi( void *p_user_data, unsigned int i_timeout, unsigned int i_cdb, const mmc_cdb_t * p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); libcdio-2.2.0/lib/driver/MSWindows/win32.c000066400000000000000000000673041474051130400201720ustar00rootroot00000000000000/* Copyright (C) 2003-2006, 2008, 2010-2012, 2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains Win32-specific code and implements low-level control of the CD drive. Inspired by vlc's cdrom.h code */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include #include #include #include "cdio_assert.h" #include "cdio_private.h" /* protoype for cdio_is_device_win32 */ #include #ifdef HAVE_WIN32_CDROM #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #include #include #include "win32.h" #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #if defined (_MSC_VER) || defined (_XBOX) #undef IN extern const char* is_cdrom_aspi(const char drive_letter); #else #include "aspi32.h" #endif #ifdef _XBOX #include "stdint.h" #include #define WIN_NT 1 #else #define WIN_NT ( GetVersion() < 0x80000000 ) #endif /* mingw-w64 defines this to lseek64 when LFS is enabled */ #ifdef lseek # undef lseek #endif /*! Set the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_get_volume_win32 ( void *p_user_data, /*out*/ cdio_audio_volume_t *p_volume) { if ( WIN_NT ) { return audio_get_volume_win32ioctl (p_user_data, p_volume); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } } /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_pause_win32 (void *p_user_data) { if ( WIN_NT ) { return audio_pause_win32ioctl (p_user_data); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } } /*! Playing CD through analog output at the given MSF. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_play_msf_win32 (void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf) { if ( WIN_NT ) { return audio_play_msf_win32ioctl (p_user_data, p_start_msf, p_end_msf); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } } /*! Read Audio Subchannel information @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_read_subchannel_win32 (void *p_user_data, cdio_subchannel_t *p_subchannel) { if ( WIN_NT ) { return audio_read_subchannel_win32ioctl (p_user_data, p_subchannel); } else { return audio_read_subchannel_mmc(p_user_data, p_subchannel); } } /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_resume_win32 (void *p_user_data) { if ( WIN_NT ) { return audio_resume_win32ioctl (p_user_data); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } } /*! Set the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_set_volume_win32 ( void *p_user_data, cdio_audio_volume_t *p_volume) { if ( WIN_NT ) { return audio_set_volume_win32ioctl (p_user_data, p_volume); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } } static driver_return_code_t audio_stop_win32 ( void *p_user_data) { if ( WIN_NT ) { return audio_stop_win32ioctl (p_user_data); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } } /* General ioctl() CD-ROM command function */ static bool _cdio_mciSendCommand(int id, UINT msg, DWORD flags, void *arg) { #ifdef _XBOX return false; #else MCIERROR mci_error; mci_error = mciSendCommand(id, msg, flags, (DWORD_PTR)arg); if ( mci_error ) { char error[256]; mciGetErrorStringA(mci_error, error, 256); cdio_warn("mciSendCommand() error: %s", error); } return(mci_error == 0); #endif } static access_mode_t str_to_access_mode_win32(const char *psz_access_mode) { const access_mode_t default_access_mode = WIN_NT ? _AM_IOCTL : _AM_ASPI; if (NULL==psz_access_mode) return default_access_mode; if (!strcmp(psz_access_mode, "ioctl")) return _AM_IOCTL; else if (!strcmp(psz_access_mode, "ASPI")) { #ifdef _XBOX cdio_warn ("XBOX doesn't support access type: %s. Default used instead.", psz_access_mode); return default_access_mode; #else return _AM_ASPI; #endif } else if (!strcmp(psz_access_mode, "MMC_RDWR")) { return _AM_MMC_RDWR; } else if (!strcmp(psz_access_mode, "MMC_RDWR_EXCL")) { return _AM_MMC_RDWR_EXCL; } else { cdio_warn ("unknown access type: %s. Default used instead.", psz_access_mode); return default_access_mode; } } static discmode_t get_discmode_win32(void *p_user_data) { _img_private_t *p_env = p_user_data; if (p_env->hASPI) { return get_discmode_aspi (p_env); } else { return get_discmode_win32ioctl (p_env); } } static driver_return_code_t get_last_session_win32(void *p_user_data, /*out*/ lsn_t *i_last_session) { if ( WIN_NT ) { return get_last_session_win32ioctl(p_user_data, i_last_session); } else { return DRIVER_OP_UNSUPPORTED; } } static const char * is_cdrom_win32(const char drive_letter) { if ( WIN_NT ) { return is_cdrom_win32ioctl (drive_letter); } else { return is_cdrom_aspi(drive_letter); } } /*! Run a SCSI MMC command. env private CD structure i_timeout_ms time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. Return 0 if command completed successfully. */ static int run_mmc_cmd_win32( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { _img_private_t *p_env = p_user_data; if (p_env->hASPI) { return run_mmc_cmd_aspi( p_env, i_timeout_ms, i_cdb, p_cdb, e_direction, i_buf, p_buf ); } else { return run_mmc_cmd_win32ioctl( p_env, i_timeout_ms, i_cdb, p_cdb, e_direction, i_buf, p_buf ); } } /*! Initialize CD device. */ static bool init_win32 (void *p_user_data) { _img_private_t *p_env = p_user_data; bool b_ret; if (p_env->gen.init) { cdio_error ("init called more than once"); return false; } p_env->gen.init = true; p_env->gen.toc_init = false; p_env->gen.b_cdtext_error = false; p_env->gen.fd = open (p_env->gen.source_name, O_RDONLY|O_BINARY, 0); /* Initializations */ p_env->h_device_handle = NULL; p_env->i_sid = 0; p_env->hASPI = 0; p_env->lpSendCommand = 0; p_env->b_aspi_init = false; p_env->b_ioctl_init = false; switch (p_env->access_mode) { case _AM_IOCTL: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: b_ret = init_win32ioctl(p_env); break; case _AM_ASPI: b_ret = init_aspi(p_env); break; default: return 0; } /* It looks like get_media_changed_mmc will always return 1 (media changed) on the first call. So we call it here to clear that flag. We may have to rethink this if there's a problem doing this extra work down the line. */ if (b_ret) get_media_changed_mmc(p_user_data); return b_ret; } /*! Release and free resources associated with cd. */ static void free_win32 (void *p_user_data) { _img_private_t *p_env = p_user_data; if (NULL == p_env) return; if (p_env->gen.fd >= 0) close(p_env->gen.fd); free (p_env->gen.source_name); if( p_env->h_device_handle ) CloseHandle( p_env->h_device_handle ); if( p_env->hASPI ) FreeLibrary( p_env->hASPI ); free (p_env); } /*! Reads an audio device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t read_audio_sectors (void *p_user_data, void *p_buf, lsn_t i_lsn, unsigned int i_blocks) { _img_private_t *p_env = p_user_data; if ( p_env->hASPI ) { return read_audio_sectors_aspi( p_env, p_buf, i_lsn, i_blocks ); } else { #if 0 return read_audio_sectors_win32ioctl( p_env, p_buf, i_lsn, i_blocks ); #else return mmc_read_sectors( p_env->gen.cdio, p_buf, i_lsn, CDIO_MMC_READ_TYPE_CDDA, i_blocks); #endif } } /*! Reads an audio device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t read_data_sectors_win32 (void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks) { driver_return_code_t rc = read_data_sectors_mmc(p_user_data, p_buf, i_lsn, i_blocksize, i_blocks); if ( DRIVER_OP_SUCCESS != rc ) { /* Try using generic "cooked" mode. */ return read_data_sectors_generic( p_user_data, p_buf, i_lsn, i_blocksize, i_blocks ); } return DRIVER_OP_SUCCESS; } /*! Reads a single mode1 sector from cd device into data starting from lsn. Returns 0 if no error. */ static int read_mode1_sector_win32 (void *p_user_data, void *p_buf, lsn_t lsn, bool b_form2) { _img_private_t *p_env = p_user_data; if (p_env->gen.ioctls_debugged == 75) cdio_debug ("only displaying every 75th ioctl from now on"); if (p_env->gen.ioctls_debugged == 30 * 75) cdio_debug ("only displaying every 30*75th ioctl from now on"); if (p_env->gen.ioctls_debugged < 75 || (p_env->gen.ioctls_debugged < (30 * 75) && p_env->gen.ioctls_debugged % 75 == 0) || p_env->gen.ioctls_debugged % (30 * 75) == 0) cdio_debug ("reading %lu", (unsigned long int) lsn); p_env->gen.ioctls_debugged++; if ( p_env->hASPI ) { return read_mode1_sector_aspi( p_env, p_buf, lsn, b_form2 ); } else { return read_mode1_sector_win32ioctl( p_env, p_buf, lsn, b_form2 ); } } /*! Reads nblocks of mode1 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static int read_mode1_sectors_win32 (void *p_user_data, void *p_buf, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *p_env = p_user_data; int i; int retval; for (i = 0; i < nblocks; i++) { if (b_form2) { retval = read_mode1_sector_win32 (p_env, ((char *)p_buf) + (M2RAW_SECTOR_SIZE * i), lsn + i, true); if ( retval ) return retval; } else { char buf[M2RAW_SECTOR_SIZE] = { 0, }; if ( (retval = read_mode1_sector_win32 (p_env, buf, lsn + i, false)) ) return retval; memcpy (((char *)p_buf) + (CDIO_CD_FRAMESIZE * i), buf, CDIO_CD_FRAMESIZE); } } return 0; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ static int read_mode2_sector_win32 (void *p_user_data, void *data, lsn_t lsn, bool b_form2) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; _img_private_t *p_env = p_user_data; if (p_env->gen.ioctls_debugged == 75) cdio_debug ("only displaying every 75th ioctl from now on"); if (p_env->gen.ioctls_debugged == 30 * 75) cdio_debug ("only displaying every 30*75th ioctl from now on"); if (p_env->gen.ioctls_debugged < 75 || (p_env->gen.ioctls_debugged < (30 * 75) && p_env->gen.ioctls_debugged % 75 == 0) || p_env->gen.ioctls_debugged % (30 * 75) == 0) cdio_debug ("reading %lu", (unsigned long int) lsn); p_env->gen.ioctls_debugged++; if ( p_env->hASPI ) { int ret; ret = read_mode2_sector_aspi(p_user_data, buf, lsn, 1); if( ret != 0 ) return ret; if (b_form2) memcpy (data, buf, M2RAW_SECTOR_SIZE); else memcpy (((char *)data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE); return 0; } else { return read_mode2_sector_win32ioctl( p_env, data, lsn, b_form2 ); } } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static int read_mode2_sectors_win32 (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned int i_blocks) { int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < i_blocks; i++) { if ( (retval = read_mode2_sector_win32 (p_user_data, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return 0; } /*! Return the size of the CD in logical block address (LBA) units. */ static lsn_t get_disc_last_lsn_win32 (void *p_user_data) { _img_private_t *p_env = p_user_data; return p_env->tocent[p_env->gen.i_tracks].start_lsn; } /*! Set the key "arg" to "value" in source device. */ static int set_arg_win32 (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return -2; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { p_env->access_mode = str_to_access_mode_win32(value); if (p_env->access_mode == _AM_ASPI && !p_env->b_aspi_init) return init_aspi(p_env) ? 1 : -3; else if (p_env->access_mode == _AM_IOCTL && !p_env->b_ioctl_init) return init_win32ioctl(p_env) ? 1 : -3; else return -4; return 0; } else return -1; return 0; } /*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ static bool read_toc_win32 (void *p_user_data) { _img_private_t *p_env = p_user_data; bool ret; if( p_env->hASPI ) { ret = read_toc_aspi( p_env ); } else { ret = read_toc_win32ioctl( p_env ); } if (ret) p_env->gen.toc_init = true ; return ret; } /*! Close media tray. */ static driver_return_code_t open_close_media_win32 (const char *psz_win32_drive, DWORD command_flags) { #ifdef _XBOX return DRIVER_OP_UNSUPPORTED; #else MCI_OPEN_PARMS op; DWORD i_flags; int ret; memset( &op, 0, sizeof(MCI_OPEN_PARMS) ); op.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO; op.lpstrElementName = psz_win32_drive; /* Set the flags for the device type */ i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE; if( _cdio_mciSendCommand( 0, MCI_OPEN, i_flags, &op ) ) { /* Eject disc */ ret = _cdio_mciSendCommand( op.wDeviceID, MCI_SET, command_flags, 0 ) == 0; /* Release access to the device */ _cdio_mciSendCommand( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 ); } else ret = DRIVER_OP_ERROR; return ret; #endif } /*! Eject media. */ static driver_return_code_t eject_media_win32 (void *p_user_data) { const _img_private_t *p_env = p_user_data; char psz_drive[4]; unsigned int i_device = strlen(p_env->gen.source_name); strcpy( psz_drive, "X:" ); if (6 == i_device) { psz_drive[0] = p_env->gen.source_name[4]; } else if (2 == i_device) { psz_drive[0] = p_env->gen.source_name[0]; } else { cdio_info ("Can't pick out drive letter from device %s", p_env->gen.source_name); return DRIVER_OP_ERROR; } return open_close_media_win32(psz_drive, MCI_SET_DOOR_OPEN); } static bool is_mmc_supported(void *user_data) { _img_private_t *env = user_data; switch (env->access_mode) { case _AM_NONE: return false; case _AM_IOCTL: case _AM_ASPI: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: return true; } /* Not reached. */ return false; } /*! Return the value associated with the key "arg". */ static const char * get_arg_win32 (void *p_user_data, const char key[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { return p_env->gen.source_name; } else if (!strcmp (key, "access-mode")) { switch (p_env->access_mode) { case _AM_IOCTL: return "ioctl"; case _AM_ASPI: return "ASPI"; case _AM_MMC_RDWR: return "MMC_RDWR"; case _AM_MMC_RDWR_EXCL: return "MMC_RDWR_EXCL"; case _AM_NONE: return "no access method"; } } else if (!strcmp (key, "scsi-tuple")) { return p_env->gen.scsi_tuple; } else if (!strcmp (key, "mmc-supported?")) { return is_mmc_supported(p_user_data) ? "true" : "false"; } return NULL; } /** Read CD-Text binary data. */ static uint8_t * read_cdtext_win32(void *p_user_data) { const _img_private_t *p_env = p_user_data; if( p_env->hASPI ) { return read_cdtext_generic(p_user_data); } else { return read_cdtext_win32ioctl(p_user_data); } } /** Read CD-Text and return cdtext_t structure. */ static cdtext_t * get_cdtext_win32 (void *p_user_data) { const _img_private_t *p_env = p_user_data; if( p_env->hASPI ) { return get_cdtext_generic(p_user_data); } else { return get_cdtext_win32ioctl(p_user_data); } } /*! Return the media catalog number MCN. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * _cdio_get_mcn (const void *p_user_data) { const _img_private_t *p_env = p_user_data; if( p_env->hASPI ) { return mmc_get_mcn( p_env->gen.cdio ); } else { return get_mcn_win32ioctl(p_env); } } /*! Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * _cdio_get_track_isrc (const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; if( p_env->hASPI ) { return mmc_get_track_isrc( p_env->gen.cdio, i_track ); } else { return get_track_isrc_win32ioctl(p_env, i_track); } } /*! Get format of track. */ static track_format_t _cdio_get_track_format(void *p_obj, track_t i_track) { _img_private_t *p_env = p_obj; if ( !p_env ) return TRACK_FORMAT_ERROR; if (!p_env->gen.toc_init) if (!read_toc_win32 (p_env)) return TRACK_FORMAT_ERROR; if ( i_track < p_env->gen.i_first_track || i_track >= p_env->gen.i_tracks + p_env->gen.i_first_track ) return TRACK_FORMAT_ERROR; if( p_env->hASPI ) { return get_track_format_aspi(p_env, i_track); } else { return get_track_format_win32ioctl(p_env, i_track); } } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool _cdio_get_track_green(void *p_obj, track_t i_track) { _img_private_t *p_env = p_obj; switch (_cdio_get_track_format(p_env, i_track)) { case TRACK_FORMAT_XA: return true; case TRACK_FORMAT_ERROR: case TRACK_FORMAT_CDI: case TRACK_FORMAT_AUDIO: return false; case TRACK_FORMAT_DATA: if (_AM_ASPI == p_env->access_mode ) return ((p_env->tocent[i_track-p_env->gen.i_first_track].Control & 8) != 0); default: break; } /* FIXME: Dunno if this is the right way, but it's what I was using in cd-info for a while. */ return ((p_env->tocent[i_track-p_env->gen.i_first_track].Control & 2) != 0); } /*! Return the starting MSF (minutes/secs/frames) for track number i_tracks in obj. Track numbers start at 1. The "leadout" track is specified either by using i_tracks LEADOUT_TRACK or the total tracks+1. False is returned if there is no track entry. */ static bool _cdio_get_track_msf(void *p_user_data, track_t i_tracks, msf_t *p_msf) { _img_private_t *p_env = p_user_data; if (!p_msf) return false; if (!p_env->gen.toc_init) if (!read_toc_win32 (p_env)) return false; if (i_tracks == CDIO_CDROM_LEADOUT_TRACK) i_tracks = p_env->gen.i_tracks + p_env->gen.i_first_track; if (i_tracks > (p_env->gen.i_tracks + p_env->gen.i_first_track) || i_tracks < p_env->gen.i_first_track) { return false; } else { cdio_lsn_to_msf( p_env->tocent[i_tracks - p_env->gen.i_first_track].start_lsn, p_msf); return true; } } #endif /* HAVE_WIN32_CDROM */ /*! Return an array of strings giving possible CD devices. */ char ** cdio_get_devices_win32 (void) { #ifndef HAVE_WIN32_CDROM return NULL; #else char **drives = NULL; unsigned int num_drives=0; char drive_letter; /* Scan the system for CD-ROM drives. */ #ifdef FINISHED /* Now check the currently mounted CD drives */ if (NULL != (ret_drive = cdio_check_mounts("/etc/mtab"))) { cdio_add_device_list(&drives, drive, &num_drives); } /* Finally check possible mountable drives in /etc/fstab */ if (NULL != (ret_drive = cdio_check_mounts("/etc/fstab"))) { cdio_add_device_list(&drives, drive, &num_drives); } #endif /* Scan the system for CD-ROM drives. Not always 100% reliable, so use the USE_MNTENT code above first. */ for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) { const char *drive_str=is_cdrom_win32(drive_letter); if (drive_str != NULL) { cdio_add_device_list(&drives, drive_str, &num_drives); } } cdio_add_device_list(&drives, NULL, &num_drives); return drives; #endif /*HAVE_WIN32_CDROM*/ } /*! Return a string containing the default CD device if none is specified. if CdIo is NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that. NULL is returned if we couldn't get a default device. */ char * cdio_get_default_device_win32(void) { #ifdef HAVE_WIN32_CDROM char drive_letter; for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) { const char *drive_str=is_cdrom_win32(drive_letter); if (drive_str != NULL) { return strdup(drive_str); } } #endif return NULL; } /*! Return true if source_name could be a device containing a CD-ROM and we are on a MS Windows platform. */ bool cdio_is_device_win32(const char *source_name) { #ifdef HAVE_WIN32_CDROM unsigned int len; if (NULL == source_name) return false; len = strlen(source_name); if ((len == 2) && isalpha((unsigned char) source_name[0]) && (source_name[len-1] == ':')) return true; if ( ! WIN_NT ) return false; /* Test to see if of form: \\.\x: */ return ( (len == 6) && source_name[0] == '\\' && source_name[1] == '\\' && source_name[2] == '.' && source_name[3] == '\\' && isalpha((unsigned char) source_name[len-2]) && (source_name[len-1] == ':') ); #else return false; #endif } driver_return_code_t close_tray_win32 (const char *psz_win32_drive) { #ifdef HAVE_WIN32_CDROM #if 1 return open_close_media_win32(psz_win32_drive, MCI_SET_DOOR_CLOSED|MCI_WAIT); #else if ( WIN_NT ) { return close_tray_win32ioctl (psz_win32_drive); } else { return DRIVER_OP_UNSUPPORTED; /* not yet, but soon I hope */ } #endif #else return DRIVER_OP_UNSUPPORTED; #endif /* HAVE_WIN32_CDROM*/ } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_win32 (const char *psz_source_name) { #ifdef HAVE_WIN32_CDROM if ( WIN_NT ) { return cdio_open_am_win32(psz_source_name, "ioctl"); } else { return cdio_open_am_win32(psz_source_name, "ASPI"); } #else return NULL; #endif /* HAVE_WIN32_CDROM */ } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_am_win32 (const char *psz_orig_source, const char *psz_access_mode) { #ifdef HAVE_WIN32_CDROM CdIo_t *ret; _img_private_t *_data; char *psz_source; cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); _funcs.audio_get_volume = audio_get_volume_win32; _funcs.audio_pause = audio_pause_win32; _funcs.audio_play_msf = audio_play_msf_win32; #if 0 _funcs.audio_play_track_index = audio_play_track_index_win32; #endif _funcs.audio_read_subchannel = audio_read_subchannel_win32; _funcs.audio_resume = audio_resume_win32; _funcs.audio_set_volume = audio_set_volume_win32; _funcs.audio_stop = audio_stop_win32; _funcs.eject_media = eject_media_win32; _funcs.free = free_win32; _funcs.get_arg = get_arg_win32; _funcs.get_cdtext = get_cdtext_win32; _funcs.get_cdtext_raw = read_cdtext_win32; _funcs.get_default_device = cdio_get_default_device_win32; _funcs.get_devices = cdio_get_devices_win32; _funcs.get_disc_last_lsn = get_disc_last_lsn_win32; _funcs.get_discmode = get_discmode_win32; _funcs.get_drive_cap = get_drive_cap_mmc; _funcs.get_first_track_num = get_first_track_num_generic; _funcs.get_hwinfo = NULL; _funcs.get_last_session = get_last_session_win32; _funcs.get_media_changed = get_media_changed_mmc; _funcs.get_mcn = _cdio_get_mcn; _funcs.get_num_tracks = get_num_tracks_generic; _funcs.get_track_channels = get_track_channels_generic, _funcs.get_track_copy_permit = get_track_copy_permit_generic, _funcs.get_track_format = _cdio_get_track_format; _funcs.get_track_green = _cdio_get_track_green; _funcs.get_track_lba = NULL; /* This could be done if need be. */ _funcs.get_track_msf = _cdio_get_track_msf; _funcs.get_track_preemphasis = get_track_preemphasis_generic, _funcs.get_track_isrc = _cdio_get_track_isrc; _funcs.lseek = NULL; _funcs.read = NULL; _funcs.read_audio_sectors = read_audio_sectors; _funcs.read_data_sectors = read_data_sectors_win32; _funcs.read_mode1_sector = read_mode1_sector_win32; _funcs.read_mode1_sectors = read_mode1_sectors_win32; _funcs.read_mode2_sector = read_mode2_sector_win32; _funcs.read_mode2_sectors = read_mode2_sectors_win32; _funcs.read_toc = read_toc_win32; _funcs.run_mmc_cmd = run_mmc_cmd_win32; _funcs.set_arg = set_arg_win32; _funcs.set_blocksize = set_blocksize_mmc; _funcs.set_speed = set_drive_speed_mmc; _data = calloc(1, sizeof (_img_private_t)); if (NULL == _data) { goto error_exit; } _data->access_mode = str_to_access_mode_win32(psz_access_mode); _data->gen.init = false; _data->gen.fd = -1; if (NULL == psz_orig_source) { psz_source=cdio_get_default_device_win32(); if (NULL == psz_source) { goto error_exit; } set_arg_win32(_data, "source", psz_source); free(psz_source); } else { if (cdio_is_device_win32(psz_orig_source)) set_arg_win32(_data, "source", psz_orig_source); else { /* The below would be okay as an info message if all device drivers worked this way. */ cdio_debug ("source %s is a not a device", psz_orig_source); goto error_exit; } } ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) { goto error_exit; } if (init_win32(_data)) { return ret; } error_exit: free_win32(_data); return(NULL); #else return NULL; #endif /* HAVE_WIN32_CDROM */ } bool cdio_have_win32 (void) { #ifdef HAVE_WIN32_CDROM return true; #else return false; #endif /* HAVE_WIN32_CDROM */ } libcdio-2.2.0/lib/driver/MSWindows/win32.h000066400000000000000000000147171474051130400201770ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2014 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "cdio_private.h" #pragma pack() typedef struct { lsn_t start_lsn; UCHAR Control : 4; UCHAR Format; } track_info_t; typedef enum { _AM_NONE, _AM_IOCTL, _AM_ASPI, _AM_MMC_RDWR, _AM_MMC_RDWR_EXCL, } access_mode_t; typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; access_mode_t access_mode; /* Some of the more OS specific things. */ /* Entry info for each track, add 1 for leadout. */ track_info_t tocent[CDIO_CD_MAX_TRACKS+1]; HANDLE h_device_handle; /* device descriptor */ HMODULE hASPI; short i_sid; short i_lun; long (*lpSendCommand)( void* ); bool b_ioctl_init; bool b_aspi_init; } _img_private_t; /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_pause_win32ioctl (void *p_user_data); /*! Playing starting at given MSF through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_play_msf_win32ioctl (void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf); /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_resume_win32ioctl (void *p_user_data); /*! Get disc type associated with cd object. */ discmode_t get_discmode_win32ioctl (_img_private_t *p_env); /*! Get the volume settings of an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_get_volume_win32ioctl ( void *p_user_data, /*out*/ cdio_audio_volume_t *p_volume); /*! Read Audio Subchannel information @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_read_subchannel_win32ioctl (void *p_user_data, cdio_subchannel_t *p_subchannel); /*! Set the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_stop_win32ioctl ( void *p_user_data ); /*! Set the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_set_volume_win32ioctl ( void *p_user_data, cdio_audio_volume_t *p_volume); /*! Close the tray of a CD-ROM @param p_user_data the CD object to be acted upon. */ driver_return_code_t close_tray_win32ioctl (const char *psz_win32_drive); /*! Reads an audio device using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ driver_return_code_t read_audio_sectors_win32ioctl (_img_private_t *p_obj, void *p_data, lsn_t lsn, unsigned int nblocks); /*! Reads a single mode2 sector using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_win32ioctl (_img_private_t *p_env, void *p_data, lsn_t lsn, bool b_form2); /*! Reads a single mode1 sector using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ int read_mode1_sector_win32ioctl (_img_private_t *p_env, void *p_data, lsn_t lsn, bool b_form2); const char *is_cdrom_win32ioctl (const char drive_letter); /*! Run a SCSI MMC command. env private CD structure i_timeout_ms time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. Return 0 if command completed successfully. */ int run_mmc_cmd_win32ioctl( void *p_user_data, unsigned int i_timeout, unsigned int i_cdb, const mmc_cdb_t * p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); /*! Initialize internal structures for CD device. */ bool init_win32ioctl (_img_private_t *p_env); /*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ bool read_toc_win32ioctl (_img_private_t *p_env); /*! Get the LSN of the first track of the last session of on the CD. */ driver_return_code_t get_last_session_win32ioctl (void *p_user_data, /*out*/ lsn_t *i_last_session); /*! Read CD-Text binary data. */ uint8_t *read_cdtext_win32ioctl (void *p_user_data); /*! Read CD-Text and return cdtext_t structure. */ cdtext_t *get_cdtext_win32ioctl (void *p_user_data); /*! Return the media catalog number MCN. Note: string is malloc'd so caller should free() then returned string when done with it. */ char *get_mcn_win32ioctl (const _img_private_t *p_env); /*! Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ char *get_track_isrc_win32ioctl (const _img_private_t *p_env, track_t i_track); /*! Return the the kind of drive capabilities of device. Note: string is malloc'd so caller should free() then returned string when done with it. */ void get_drive_cap_aspi (const _img_private_t *p_env, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); /*! Return the the kind of drive capabilities of device. Note: string is malloc'd so caller should free() then returned string when done with it. */ void get_drive_cap_win32ioctl (const _img_private_t *p_env, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); /*! Get the format (XA, DATA, AUDIO) of a track. */ track_format_t get_track_format_win32ioctl(const _img_private_t *p_env, track_t i_track); libcdio-2.2.0/lib/driver/MSWindows/win32_ioctl.c000066400000000000000000001205741474051130400213630ustar00rootroot00000000000000/* Copyright (C) 2004-2005, 2008, 2010-2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains Win32-specific code using the DeviceIoControl access method. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_WIN32_CDROM #if defined (_XBOX) # include "inttypes.h" # include "NtScsi.h" # include "undocumented.h" #else # if defined (__MINGW64_VERSION_MAJOR) # define _NTSRB_ /* Bad things happen if srb.h gets included */ # endif # include # ifdef HAVE_DDK_SCSI_H # include # endif # ifdef HAVE_NTDDCDRM_H # include # endif # ifdef HAVE_DDK_NTDDCDRM_H # include # endif # ifdef HAVE_NTDDSCSI_H # include # endif # ifdef HAVE_DDK_NTDDSCSI_H # include # endif #endif #if defined (_WIN32) #include #endif #include /* offsetof() macro */ #include #include #include #include #include #include #include "cdio_assert.h" #include #include "cdio/logging.h" #include "cdtext_private.h" #if defined (_XBOX) #define windows_error(loglevel,i_err) { \ cdio_log(loglevel, "Error: file %s: line %d (%s) %ld\n", \ __FILE__, __LINE__, __PRETTY_FUNCTION__, i_err); \ } #else #define windows_error(loglevel,i_err) { \ char error_msg[80]; \ long int count; \ count = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, \ NULL, i_err, MAKELANGID(LANG_NEUTRAL, \ SUBLANG_DEFAULT), \ error_msg, sizeof(error_msg), NULL); \ (count != 0) ? \ cdio_log(loglevel, "Error: file %s: line %d (%s)\n\t%s\n", \ __FILE__, __LINE__, __PRETTY_FUNCTION__, error_msg) \ : \ cdio_log(loglevel, "Error: file %s: line %d (%s) %ld\n", \ __FILE__, __LINE__, __PRETTY_FUNCTION__, (long int) i_err); \ } #endif #define MAX_ERROR_BUFFER 256 #define MAX_DATA_BUFFER 2048 typedef struct _TRACK_DATA_FULL { UCHAR SessionNumber; UCHAR Control : 4; UCHAR Adr : 4; UCHAR TNO; UCHAR POINT; /* Tracknumber (of session?) or lead-out/in (0xA0, 0xA1, 0xA2) */ UCHAR Min; /* Only valid if disctype is CDDA ? */ UCHAR Sec; /* Only valid if disctype is CDDA ? */ UCHAR Frame; /* Only valid if disctype is CDDA ? */ UCHAR Zero; /* Always zero */ UCHAR PMIN; /* start min, if POINT is a track; if lead-out/in 0xA0: First Track */ UCHAR PSEC; UCHAR PFRAME; } TRACK_DATA_FULL, *PTRACK_DATA_FULL; typedef struct _CDROM_TOC_FULL { UCHAR Length[2]; UCHAR FirstSession; UCHAR LastSession; TRACK_DATA_FULL TrackData[CDIO_CD_MAX_TRACKS+3]; } CDROM_TOC_FULL, *PCDROM_TOC_FULL; #define SPT_CDB_LENGTH 32 #define SPT_SENSE_LENGTH 32 #define SPTWB_DATA_LENGTH 512 #ifndef EMPTY_ARRAY_SIZE #define EMPTY_ARRAY_SIZE 0 #endif typedef struct { SCSI_PASS_THROUGH_DIRECT sptd; ULONG Filler; /* Realign buffer to double-word boundary */ UCHAR ucSenseBuf[SPT_SENSE_LENGTH]; } SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER; #include typedef struct _SCSI_PASS_THROUGH_WITH_BUFFERS { SCSI_PASS_THROUGH Spt; ULONG Filler; /* realign buffer to double-word boundary */ UCHAR ucSenseBuf[SPT_SENSE_LENGTH]; UCHAR ucDataBuf[EMPTY_ARRAY_SIZE]; } SCSI_PASS_THROUGH_WITH_BUFFERS; #ifdef HAVE_STDBOOL_H # include #endif #include "win32.h" #define OP_TIMEOUT_MS 60 /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_pause_win32ioctl (void *p_user_data) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; bool b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, (DWORD) 0, NULL, 0, &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /*! Playing starting at given MSF through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_play_msf_win32ioctl (void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf) { const _img_private_t *p_env = p_user_data; CDROM_PLAY_AUDIO_MSF play; DWORD dw_bytes_returned; bool b_success; play.StartingM = cdio_from_bcd8(p_start_msf->m); play.StartingS = cdio_from_bcd8(p_start_msf->s); play.StartingF = cdio_from_bcd8(p_start_msf->f); play.EndingM = cdio_from_bcd8(p_end_msf->m); play.EndingS = cdio_from_bcd8(p_end_msf->s); play.EndingF = cdio_from_bcd8(p_end_msf->f); b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), NULL, 0, &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /*! Read Audio Subchannel information @param p_cdio the CD object to be acted upon. */ driver_return_code_t audio_read_subchannel_win32ioctl (void *p_user_data, cdio_subchannel_t *p_subchannel) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; CDROM_SUB_Q_DATA_FORMAT q_data_format; SUB_Q_CHANNEL_DATA q_subchannel_data; q_data_format.Format = CDIO_SUBCHANNEL_CURRENT_POSITION; q_data_format.Track=0; /* Not sure if this has to be set or if so what it should be. */ if( ! DeviceIoControl( p_env->h_device_handle, IOCTL_CDROM_READ_Q_CHANNEL, &q_data_format, sizeof(q_data_format), &q_subchannel_data, sizeof(q_subchannel_data), &dw_bytes_returned, NULL ) ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } p_subchannel->audio_status = q_subchannel_data.CurrentPosition.Header.AudioStatus; p_subchannel->track = q_subchannel_data.CurrentPosition.TrackNumber; p_subchannel->index = q_subchannel_data.CurrentPosition.IndexNumber; p_subchannel->index = q_subchannel_data.CurrentPosition.IndexNumber; p_subchannel->address = q_subchannel_data.CurrentPosition.ADR; p_subchannel->control = q_subchannel_data.CurrentPosition.Control; { const UCHAR *abs_addr = q_subchannel_data.CurrentPosition.AbsoluteAddress; const UCHAR *rel_addr = q_subchannel_data.CurrentPosition.TrackRelativeAddress; p_subchannel->abs_addr.m = cdio_to_bcd8(abs_addr[1]); p_subchannel->abs_addr.s = cdio_to_bcd8(abs_addr[2]); p_subchannel->abs_addr.f = cdio_to_bcd8(abs_addr[3]); p_subchannel->rel_addr.m = cdio_to_bcd8(rel_addr[1]); p_subchannel->rel_addr.s = cdio_to_bcd8(rel_addr[2]); p_subchannel->rel_addr.f = cdio_to_bcd8(rel_addr[3]); } return DRIVER_OP_SUCCESS; } /** Resume playing an audio CD. @param p_user_data the CD object to be acted upon. */ driver_return_code_t audio_resume_win32ioctl (void *p_user_data) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; bool b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_RESUME_AUDIO, NULL, (DWORD) 0, NULL, 0, &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Set the volume of an audio CD. @param p_user_data pointer to the CD object to be acted upon. @param p_volume pointer to the volume levels */ driver_return_code_t audio_set_volume_win32ioctl (void *p_user_data, /*in*/ cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; bool b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_SET_VOLUME, p_volume, (DWORD) sizeof(cdio_audio_volume_t), NULL, 0, &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } driver_return_code_t audio_get_volume_win32ioctl (void *p_user_data, /*out*/ cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; bool b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_GET_VOLUME, NULL, 0, p_volume, (DWORD) sizeof(cdio_audio_volume_t), &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Stop playing an audio CD. @param p_user_data the CD object to be acted upon. */ driver_return_code_t audio_stop_win32ioctl (void *p_user_data) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; bool b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_STOP_AUDIO, NULL, (DWORD) 0, NULL, 0, &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Close the tray of a CD-ROM @param p_user_data the CD object to be acted upon. */ driver_return_code_t close_tray_win32ioctl (const char *psz_win32_drive) { #ifdef WIN32 DWORD dw_bytes_returned; DWORD dw_access_flags; OSVERSIONINFO ov; HANDLE h_device_handle; BOOL b_success; memset(&ov,0,sizeof(OSVERSIONINFO)); ov.dwOSVersionInfoSize=sizeof(OSVERSIONINFO); GetVersionEx(&ov); if((ov.dwPlatformId==VER_PLATFORM_WIN32_NT) && (ov.dwMajorVersion>4)) dw_access_flags = GENERIC_READ|GENERIC_WRITE; /* add gen write on W2k/XP */ else dw_access_flags = GENERIC_READ; h_device_handle = CreateFile( psz_win32_drive, dw_access_flags, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); if( h_device_handle == INVALID_HANDLE_VALUE ) { return DRIVER_OP_ERROR; } b_success = DeviceIoControl(h_device_handle, IOCTL_STORAGE_LOAD_MEDIA2, NULL, (DWORD) 0, NULL, 0, &dw_bytes_returned, NULL); CloseHandle(h_device_handle); if ( b_success != 0 ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; #else return DRIVER_OP_UNSUPPORTED; #endif } /** Produce a text composed from the system SCSI address tuple "Port,Path,Target,Lun" and store it in generic_img_private_t.scsi_tuple. To be accessed via cdio_get_arg("scsi-tuple-linux") or ("scsi-tuple"). Drivers which implement this code have to return 5 valid decimal numbers separated by comma, or empty text if no such numbers are available. @return 1=success , 0=failure */ static int set_scsi_tuple_win32ioctl(_img_private_t *env) #ifdef WIN32 { char tuple[160]; char dataBuffer[MAX_DATA_BUFFER]; PSCSI_ADDRESS scsiAddress = (PSCSI_ADDRESS) dataBuffer; ULONG bytesReturned; memset(dataBuffer, 0, sizeof(dataBuffer)); if (DeviceIoControl(env->h_device_handle, IOCTL_SCSI_GET_ADDRESS, NULL, 0, dataBuffer, sizeof(dataBuffer), &bytesReturned, FALSE )) { snprintf(tuple, sizeof(tuple), "%d,%d,%d,%d", scsiAddress->PortNumber, scsiAddress->PathId, scsiAddress->TargetId, scsiAddress->Lun); env->gen.scsi_tuple = strdup(tuple); return 1; } else { /* No tuple. */ env->gen.scsi_tuple = strdup(""); return 0; } } #else { env->gen.scsi_tuple = strdup(""); return 0; } #endif /** Run a SCSI MMC command. p_user_data private CD structure u_timeout_ms time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. u_cdb CDB length p_cdb CDB bytes. All values that are needed should be set on input. e_direction direction the transfer is to go. p_buf Buffer for data, both sending and receiving u_buf Size of buffer Return DRIVER_OP_SUCCESS if command completed successfully. */ #ifdef USE_PASSTHROUGH_DIRECT int run_mmc_cmd_win32ioctl( void *p_user_data, unsigned int u_timeout_ms, unsigned int u_cdb, const mmc_cdb_t * p_cdb, cdio_mmc_direction_t e_direction, unsigned int u_buf, /*in/out*/ void *p_buf ) { _img_private_t *p_env = p_user_data; SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER swb; BOOL b_success; DWORD dw_bytes_returned; char dummy_buf[2]; /* Used if we can't use p_buf. See below. */ int rc = DRIVER_OP_SUCCESS; unsigned int u_swb_len = sizeof(SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER); p_env->gen.scsi_mmc_sense_valid = 0; memset(&swb, 0, u_swb_len); swb.sptd.Length = sizeof(SCSI_PASS_THROUGH_DIRECT); swb.sptd.PathId = 0; /* SCSI card ID will be filled in automatically */ swb.sptd.TargetId= 0; /* SCSI target ID will also be filled in */ swb.sptd.Lun = 0; /* SCSI lun ID will also be filled in */ swb.sptd.CdbLength = u_cdb; swb.sptd.SenseInfoLength = sizeof(swb.ucSenseBuf); swb.sptd.DataIn = (SCSI_MMC_DATA_READ == e_direction) ? SCSI_IOCTL_DATA_IN : (SCSI_MMC_DATA_WRITE == e_direction) ? SCSI_IOCTL_DATA_OUT : SCSI_IOCTL_DATA_UNSPECIFIED; /* MS Windows seems to flip out of the size of the buffer is 0 or 1. For the 1 byte case see: BUG: SCSI Pass Through Fails with Invalid User Buffer Error http://support.microsoft.com/kb/259573 So in those cases we will provide our own. */ if (u_buf <= 1) { swb.sptd.DataBuffer = &dummy_buf; swb.sptd.DataTransferLength = 2; } else { swb.sptd.DataBuffer = p_buf; swb.sptd.DataTransferLength = u_buf; } swb.sptd.TimeOutValue = msecs2secs(u_timeout_ms); swb.sptd.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, ucSenseBuf); p_env->gen.scsi_mmc_sense_valid = 0; memcpy(swb.sptd.Cdb, p_cdb, u_cdb); /* Send the command to drive */ b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_SCSI_PASS_THROUGH_DIRECT, (void *)&swb, u_swb_len, &swb, u_swb_len, &dw_bytes_returned, NULL); if (u_buf == 1) memcpy(p_buf, &dummy_buf[0], 1); if ( 0 == b_success ) { long int last_error = GetLastError(); windows_error(CDIO_LOG_INFO, last_error); switch (last_error) { case 87: rc = DRIVER_OP_BAD_PARAMETER; break; default: rc = DRIVER_OP_ERROR; } } #ifdef FIXED_ADDITIONAL_SENSE_BUF /* Record SCSI sense reply for API call mmc_last_cmd_sense(). */ if (p_swb->ucSenseBuf.additional_sense_len) { /* SCSI Primary Command standard SPC 4.5.3, Table 26: 252 bytes legal, 263 bytes possible */ int i_sense_size = p_swb->ucSenseBuf.additional_sense_len + 8; if (i_sense_size > sizeof(p_swb->ucSenseBuf)) { cdio_warn("Sense size retuned %d is greater buffer size %d\n", i_sense_size, sizeof(p_swb->ucSenseBuf)); sense_size = sizeof(p_swb->ucSenseBuf); } memcpy((void *) p_env->gen.scsi_mmc_sense, p_swb->ucSenseBuf, i_sense_size); p_env->gen.scsi_mmc_sense_valid = sense_size; if (DRIVER_OP_SUCCESS == rc) rc = DRIVER_OP_MMC_SENSE_DATA; } #endif return rc; } #else int run_mmc_cmd_win32ioctl( void *p_user_data, unsigned int u_timeout_ms, unsigned int u_cdb, const mmc_cdb_t * p_cdb, cdio_mmc_direction_t e_direction, unsigned int u_buf, /*in/out*/ void *p_buf ) { _img_private_t *p_env = p_user_data; SCSI_PASS_THROUGH_WITH_BUFFERS *p_sptwb; BOOL b_success; DWORD dw_bytes_returned; int rc = DRIVER_OP_SUCCESS; unsigned int u_swb_len = sizeof(SCSI_PASS_THROUGH_WITH_BUFFERS) + u_buf; p_sptwb = malloc(u_swb_len); if (!p_sptwb) return DRIVER_OP_ERROR; p_env->gen.scsi_mmc_sense_valid = 0; memset(p_sptwb, 0, u_swb_len); p_sptwb->Spt.Length = sizeof(SCSI_PASS_THROUGH); p_sptwb->Spt.PathId = 0; /* SCSI card ID will be filled in automatically */ p_sptwb->Spt.TargetId= 0; /* SCSI target ID will also be filled in */ p_sptwb->Spt.Lun = 0; /* SCSI lun ID will also be filled in */ p_sptwb->Spt.CdbLength = u_cdb; p_sptwb->Spt.SenseInfoLength = sizeof(p_sptwb->ucSenseBuf); p_sptwb->Spt.DataIn = (SCSI_MMC_DATA_READ == e_direction) ? SCSI_IOCTL_DATA_IN : (SCSI_MMC_DATA_WRITE == e_direction) ? SCSI_IOCTL_DATA_OUT : SCSI_IOCTL_DATA_UNSPECIFIED; if (SCSI_MMC_DATA_WRITE == e_direction) memcpy(&(p_sptwb->ucDataBuf), p_buf, u_buf); p_sptwb->Spt.DataTransferLength= u_buf; p_sptwb->Spt.TimeOutValue = msecs2secs(u_timeout_ms); p_sptwb->Spt.DataBufferOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf); p_sptwb->Spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucSenseBuf); memcpy(p_sptwb->Spt.Cdb, p_cdb, u_cdb); /*printf("Test 3 Sizeof SCSI_PASS_THROUGH_DIRECT %d\n", sizeof(*p_sptwb));*/ /* Send the command to drive */ b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_SCSI_PASS_THROUGH, (void *)p_sptwb, u_swb_len, p_sptwb, u_swb_len, &dw_bytes_returned, NULL); if ( 0 == b_success ) { char buffer[100]; long int last_error = GetLastError(); snprintf(buffer, sizeof(buffer), "MMC command code: 0x%x\n", p_cdb->field[0]); windows_error(CDIO_LOG_INFO, last_error); cdio_log(CDIO_LOG_INFO, buffer); switch (last_error) { case 87: rc = DRIVER_OP_BAD_PARAMETER; break; default: rc = DRIVER_OP_ERROR; } } memcpy(p_buf, &(p_sptwb->ucDataBuf), u_buf); /* Record SCSI sense reply for API call mmc_last_cmd_sense(). */ if (p_sptwb->Spt.ScsiStatus && p_sptwb->Spt.SenseInfoLength > 0) { int i_sense_size = p_sptwb->Spt.SenseInfoLength; if (i_sense_size > sizeof(p_sptwb->ucSenseBuf)) { cdio_warn("sense size returned %d is greater buffer size %d\n", i_sense_size, (int)sizeof(p_sptwb->ucSenseBuf)); i_sense_size = sizeof(p_sptwb->ucSenseBuf); } memcpy((void *) p_env->gen.scsi_mmc_sense, &(p_sptwb->ucSenseBuf), i_sense_size); p_env->gen.scsi_mmc_sense_valid = p_sptwb->Spt.SenseInfoLength; } free(p_sptwb); return rc; } #endif /** Get disc type associated with cd object. */ static discmode_t dvd_discmode_win32ioctl (_img_private_t *p_env) { discmode_t discmode=CDIO_DISC_MODE_NO_INFO; driver_return_code_t rc; /* See if this is a DVD. */ cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */ dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL; dvd.physical.layer_num = 0; rc = mmc_get_dvd_struct_physical_private (p_env, &run_mmc_cmd_win32ioctl, &dvd); if (DRIVER_OP_SUCCESS == rc) { switch(dvd.physical.layer[0].book_type) { case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM; case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM; case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R; case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW; case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR; case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW; default: return CDIO_DISC_MODE_DVD_OTHER; } } return discmode; } /** Get disc type associated with cd object. */ discmode_t get_discmode_win32ioctl (_img_private_t *p_env) { track_t i_track; discmode_t discmode; if (!p_env) return CDIO_DISC_MODE_ERROR; discmode = dvd_discmode_win32ioctl(p_env); if (CDIO_DISC_MODE_NO_INFO != discmode) return discmode; if (!p_env->gen.toc_init) read_toc_win32ioctl (p_env); if (!p_env->gen.toc_init) return CDIO_DISC_MODE_ERROR; for (i_track = p_env->gen.i_first_track; i_track < p_env->gen.i_first_track + p_env->gen.i_tracks ; i_track ++) { track_format_t track_fmt=get_track_format_win32ioctl(p_env, i_track); switch(track_fmt) { case TRACK_FORMAT_AUDIO: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_XA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_DATA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_ERROR: default: discmode = CDIO_DISC_MODE_ERROR; } } return discmode; } /* Returns a string that can be used in a CreateFile call if c_drive letter is a character. If not NULL is returned. */ const char * is_cdrom_win32ioctl(const char c_drive_letter) { #ifdef _XBOX char sz_win32_drive_full[] = "\\\\.\\X:"; sz_win32_drive_full[4] = c_drive_letter; return strdup(sz_win32_drive_full); #else UINT uDriveType; char sz_win32_drive[4]; sz_win32_drive[0]= c_drive_letter; sz_win32_drive[1]=':'; sz_win32_drive[2]='\\'; sz_win32_drive[3]='\0'; uDriveType = GetDriveType(sz_win32_drive); switch(uDriveType) { case DRIVE_CDROM: { char sz_win32_drive_full[] = "\\\\.\\X:"; sz_win32_drive_full[4] = c_drive_letter; return strdup(sz_win32_drive_full); } default: cdio_debug("Drive %c is not a CD-ROM", c_drive_letter); return NULL; } #endif } /** Reads an audio device using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ driver_return_code_t read_audio_sectors_win32ioctl (_img_private_t *p_env, void *data, lsn_t lsn, unsigned int nblocks) { DWORD dw_bytes_returned; RAW_READ_INFO cdrom_raw; /* Initialize CDROM_RAW_READ structure */ cdrom_raw.DiskOffset.QuadPart = (long long) CDIO_CD_FRAMESIZE_RAW * lsn; cdrom_raw.SectorCount = nblocks; cdrom_raw.TrackMode = CDDA; if( DeviceIoControl( p_env->h_device_handle, IOCTL_CDROM_RAW_READ, &cdrom_raw, sizeof(RAW_READ_INFO), data, CDIO_CD_FRAMESIZE_RAW * nblocks, &dw_bytes_returned, NULL ) == 0 ) { cdio_info("Error reading audio-mode lsn %lu\n)", (long unsigned int) lsn); windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Reads a single raw sector using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ static int read_raw_sector (_img_private_t *p_env, void *p_buf, lsn_t lsn) { mmc_cdb_t cdb = {{0, }}; /* ReadCD CDB12 command. The values were taken from MMC1 draft paper. */ CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_CD); CDIO_MMC_SET_READ_LBA (cdb.field, lsn); CDIO_MMC_SET_READ_LENGTH24(cdb.field, 1); cdb.field[9]=0xF8; /* Raw read, 2352 bytes per sector */ return run_mmc_cmd_win32ioctl(p_env, OP_TIMEOUT_MS, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, CDIO_CD_FRAMESIZE_RAW, p_buf); } /** Reads a single mode2 sector using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ int read_mode2_sector_win32ioctl (_img_private_t *p_env, void *p_data, lsn_t lsn, bool b_form2) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; int ret = read_raw_sector (p_env, buf, lsn); if ( 0 != ret) return ret; memcpy (p_data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_XA_HEADER, b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE); return 0; } /** Reads a single mode2 sector using the DeviceIoControl method into data starting from lsn. Returns 0 if no error. */ int read_mode1_sector_win32ioctl (_img_private_t *env, void *data, lsn_t lsn, bool b_form2) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; int ret = read_raw_sector (env, buf, lsn); if ( 0 != ret) return ret; memcpy (data, buf + CDIO_CD_SYNC_SIZE+CDIO_CD_HEADER_SIZE, b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE); return 0; } /** Initialize internal structures for CD device. */ bool init_win32ioctl (_img_private_t *env) { #ifdef WIN32 OSVERSIONINFO ov; #endif #ifdef _XBOX ANSI_STRING filename; OBJECT_ATTRIBUTES attributes; IO_STATUS_BLOCK status; HANDLE hDevice; NTSTATUS error; #else unsigned int len=strlen(env->gen.source_name); char psz_win32_drive[7]; DWORD dw_access_flags; #endif cdio_debug("using winNT/2K/XP ioctl layer"); #ifdef WIN32 memset(&ov,0,sizeof(OSVERSIONINFO)); ov.dwOSVersionInfoSize=sizeof(OSVERSIONINFO); GetVersionEx(&ov); if((ov.dwPlatformId==VER_PLATFORM_WIN32_NT) && (ov.dwMajorVersion>4)) dw_access_flags = GENERIC_READ|GENERIC_WRITE; /* add gen write on W2k/XP */ else dw_access_flags = GENERIC_READ; #endif if (cdio_is_device_win32(env->gen.source_name)) { #ifdef _XBOX // Use XBOX cdrom, no matter what drive letter is given. RtlInitAnsiString(&filename,"\\Device\\Cdrom0"); InitializeObjectAttributes(&attributes, &filename, OBJ_CASE_INSENSITIVE, NULL); error = NtCreateFile( &hDevice, GENERIC_READ |SYNCHRONIZE | FILE_READ_ATTRIBUTES, &attributes, &status, NULL, 0, FILE_SHARE_READ, FILE_OPEN, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); if (!NT_SUCCESS(error)) { return false; } env->h_device_handle = hDevice; #else snprintf( psz_win32_drive, sizeof(psz_win32_drive), "\\\\.\\%c:", env->gen.source_name[len-2] ); env->h_device_handle = CreateFile( psz_win32_drive, dw_access_flags, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); if( env->h_device_handle == INVALID_HANDLE_VALUE ) { /* No good. try toggle write. */ dw_access_flags ^= GENERIC_WRITE; env->h_device_handle = CreateFile( psz_win32_drive, dw_access_flags, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); if (env->h_device_handle == NULL) return false; } #endif env->b_ioctl_init = true; set_scsi_tuple_win32ioctl(env); return true; } return false; } /** Read and cache the CD's Track Table of Contents and track info. via a SCSI MMC READ_TOC (FULTOC). Return true if successful or false if an error. */ static bool read_fulltoc_win32mmc (_img_private_t *p_env) { mmc_cdb_t cdb = {{0, }}; CDROM_TOC_FULL cdrom_toc_full; int i_status, i, j; int i_track_format = 0; int i_seen_flag; /* Operation code */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC); cdb.field[1] = 0x00; /* Format */ cdb.field[2] = CDIO_MMC_READTOC_FMT_FULTOC; memset(&cdrom_toc_full, 0, sizeof(cdrom_toc_full)); /* Setup to read header, to get length of data */ CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(cdrom_toc_full)); i_status = run_mmc_cmd_win32ioctl (p_env, 1000*60*3, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, sizeof(cdrom_toc_full), &cdrom_toc_full); if ( 0 != i_status ) { cdio_debug ("SCSI MMC READ_TOC failed\n"); return false; } i_seen_flag=0; for( i = 0 ; i <= CDIO_CD_MAX_TRACKS+3; i++ ) { if ( 0xA0 == cdrom_toc_full.TrackData[i].POINT ) { /* First track number */ p_env->gen.i_first_track = cdrom_toc_full.TrackData[i].PMIN; i_track_format = cdrom_toc_full.TrackData[i].PSEC; i_seen_flag|=0x01; } if ( 0xA1 == cdrom_toc_full.TrackData[i].POINT ) { /* Last track number */ p_env->gen.i_tracks = cdrom_toc_full.TrackData[i].PMIN - p_env->gen.i_first_track + 1; i_seen_flag|=0x02; } j = cdrom_toc_full.TrackData[i].POINT; if ( 0xA2 == j ) { /* Start position of the lead out */ p_env->tocent[ p_env->gen.i_tracks ].start_lsn = cdio_lba_to_lsn( cdio_msf3_to_lba( cdrom_toc_full.TrackData[i].PMIN, cdrom_toc_full.TrackData[i].PSEC, cdrom_toc_full.TrackData[i].PFRAME ) ); p_env->tocent[ p_env->gen.i_tracks ].Control = cdrom_toc_full.TrackData[i].Control; p_env->tocent[ p_env->gen.i_tracks ].Format = i_track_format; i_seen_flag|=0x04; } if (cdrom_toc_full.TrackData[i].POINT > 0 && cdrom_toc_full.TrackData[i].POINT <= p_env->gen.i_tracks) { p_env->tocent[j-1].start_lsn = cdio_lba_to_lsn( cdio_msf3_to_lba( cdrom_toc_full.TrackData[i].PMIN, cdrom_toc_full.TrackData[i].PSEC, cdrom_toc_full.TrackData[i].PFRAME ) ); p_env->tocent[j-1].Control = cdrom_toc_full.TrackData[i].Control; p_env->tocent[j-1].Format = i_track_format; set_track_flags(&(p_env->gen.track_flags[j]), p_env->tocent[j-1].Control); cdio_debug("p_sectors: %i, %lu", i, (unsigned long int) (p_env->tocent[i].start_lsn)); if (cdrom_toc_full.TrackData[i].POINT == p_env->gen.i_tracks) i_seen_flag|=0x08; } if ( 0x0F == i_seen_flag ) break; } if ( 0x0F == i_seen_flag ) { p_env->gen.toc_init = true; return true; } return false; } /** Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ bool read_toc_win32ioctl (_img_private_t *p_env) { CDROM_TOC cdrom_toc; DWORD dw_bytes_returned; unsigned int i, j; bool b_fulltoc_first; /* Do we do fulltoc or DeviceIoControl first? */ if ( ! p_env ) return false; /* The MMC5 spec says: For media other than CD, information may be fabricated in order ^^^ ^^ to emulate a CD structure for the specific media. There is no requirement though that it *has* to and some DVD drives like one by Thompson for XBOX don't support a IOCTL_CDROM_READ_TOC for DVD's. So if we have a DVD we should not prefer getting the TOC via MMC. But on the other hand in GNU/Linux it is reported that using the TOC via MMC gives better information such as for CD DATA Form 2 (used in SVCDs). So if we *don't* have a DVD I think we want to try MMC first. Is this complicated enough? I could be wrong... */ b_fulltoc_first = (CDIO_DISC_MODE_NO_INFO == dvd_discmode_win32ioctl(p_env)); if ( b_fulltoc_first && read_fulltoc_win32mmc(p_env) ) return true; /* SCSI-MMC READ_TOC (FULTOC) read failed or we don't want to try it initiaily. Try reading TOC via DeviceIoControl... */ if( DeviceIoControl( p_env->h_device_handle, IOCTL_CDROM_READ_TOC, NULL, 0, &cdrom_toc, sizeof(CDROM_TOC), &dw_bytes_returned, NULL ) == 0 ) { cdio_log_level_t loglevel = b_fulltoc_first ? CDIO_LOG_WARN : CDIO_LOG_DEBUG; cdio_log(loglevel, "could not read TOC"); windows_error(loglevel, GetLastError()); #ifdef RUN_MMC_CMD_WIN32IOCTL_FULLY_FIXED /* rocky: there is some brokenness in run_mmc_cmd_win32ioctl. So until that is fixed, not running the below will mitigate that somewhat. */ if ( !b_fulltoc_first && read_fulltoc_win32mmc(p_env) ) return true; #endif return false; } p_env->gen.i_first_track = cdrom_toc.FirstTrack; p_env->gen.i_tracks = cdrom_toc.LastTrack - cdrom_toc.FirstTrack + 1; j = p_env->gen.i_first_track; for( i = 0 ; i <= p_env->gen.i_tracks ; i++, j++ ) { p_env->tocent[ i ].start_lsn = cdio_lba_to_lsn( cdio_msf3_to_lba( cdrom_toc.TrackData[i].Address[1], cdrom_toc.TrackData[i].Address[2], cdrom_toc.TrackData[i].Address[3] ) ); p_env->tocent[i].Control = cdrom_toc.TrackData[i].Control; p_env->tocent[i].Format = cdrom_toc.TrackData[i].Adr; p_env->gen.track_flags[j].preemphasis = p_env->tocent[i].Control & 0x1 ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; p_env->gen.track_flags[j].copy_permit = p_env->tocent[i].Control & 0x2 ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; p_env->gen.track_flags[j].channels = p_env->tocent[i].Control & 0x8 ? 4 : 2; cdio_debug("p_sectors: %i, %lu", i, (unsigned long int) (p_env->tocent[i].start_lsn)); } p_env->gen.toc_init = true; return true; } /** Get the LSN of the first track of the last session of on the CD. */ driver_return_code_t get_last_session_win32ioctl (void *p_user_data, /*out*/ lsn_t *i_last_session) { const _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; CDROM_TOC_SESSION_DATA session; bool b_success = DeviceIoControl(p_env->h_device_handle, IOCTL_CDROM_GET_LAST_SESSION, NULL, (DWORD) 0, &session, sizeof(session), &dw_bytes_returned, NULL); if ( ! b_success ) { windows_error(CDIO_LOG_INFO, GetLastError()); return DRIVER_OP_ERROR; } *i_last_session = (session.TrackData[0].Address[0] << 24) | (session.TrackData[0].Address[1] << 16) | (session.TrackData[0].Address[2] << 8) | (session.TrackData[0].Address[3]); return DRIVER_OP_SUCCESS; } /** Read CD-Text binary data. */ uint8_t * read_cdtext_win32ioctl(void *p_user_data) { _img_private_t *p_env = p_user_data; DWORD dw_bytes_returned; CDROM_READ_TOC_EX read_toc_ex; size_t size = CDTEXT_LEN_BINARY_MAX + 4; uint8_t *data = malloc(size); memset( &read_toc_ex, 0, sizeof(read_toc_ex) ); memset( data, 0, size ); read_toc_ex.Format = CDROM_READ_TOC_EX_FORMAT_CDTEXT; if( ! DeviceIoControl( p_env->h_device_handle, IOCTL_CDROM_READ_TOC_EX, &read_toc_ex, sizeof(read_toc_ex), data, size, &dw_bytes_returned, NULL ) ) { cdio_debug( "could not read CD-Text" ); free( data ); return NULL; } return data; } /** Read CD-Text and return cdtext_t structure. */ cdtext_t * get_cdtext_win32ioctl (void *p_user_data) { generic_img_private_t *p_env = p_user_data; uint8_t *p_cdtext_data = NULL; size_t len; if (!p_env) return NULL; if (p_env->b_cdtext_error) return NULL; if (NULL == p_env->cdtext) { p_cdtext_data = read_cdtext_win32ioctl (p_env); if (NULL != p_cdtext_data) { len = CDIO_MMC_GET_LEN16(p_cdtext_data)-2; p_env->cdtext = cdtext_init(); if(len <= 0 || 0 != cdtext_data_init (p_env->cdtext, &p_cdtext_data[4], len)) { p_env->b_cdtext_error = true; cdtext_destroy (p_env->cdtext); p_env->cdtext = NULL; } free(p_cdtext_data); } } return p_env->cdtext; } /** Return the media catalog number MCN. Note: string is malloc'd so caller should free() then returned string when done with it. */ char * get_mcn_win32ioctl (const _img_private_t *p_env) { DWORD dw_bytes_returned; SUB_Q_MEDIA_CATALOG_NUMBER mcn; CDROM_SUB_Q_DATA_FORMAT q_data_format; memset( &mcn, 0, sizeof(mcn) ); q_data_format.Format = CDIO_SUBCHANNEL_MEDIA_CATALOG; /* MSDN info on CDROM_SUB_Q_DATA_FORMAT says if Format is set to get MCN, track must be set 0. */ q_data_format.Track=0; if( ! DeviceIoControl( p_env->h_device_handle, IOCTL_CDROM_READ_Q_CHANNEL, &q_data_format, sizeof(q_data_format), &mcn, sizeof(mcn), &dw_bytes_returned, NULL ) ) { cdio_warn( "could not read Q Channel at track %d", 1); } else if (mcn.Mcval) return strdup((const char *) mcn.MediaCatalog); return NULL; } /** Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ char * get_track_isrc_win32ioctl (const _img_private_t *p_env, track_t i_track) { DWORD dw_bytes_returned; SUB_Q_TRACK_ISRC isrc; CDROM_SUB_Q_DATA_FORMAT q_data_format; memset( &isrc, 0, sizeof(isrc) ); q_data_format.Format = CDIO_SUBCHANNEL_TRACK_ISRC; q_data_format.Track = i_track; if( ! DeviceIoControl( p_env->h_device_handle, IOCTL_CDROM_READ_Q_CHANNEL, &q_data_format, sizeof(q_data_format), &isrc, sizeof(isrc), &dw_bytes_returned, NULL ) ) { cdio_warn( "could not read Q Channel at track %d", 1); } else if (isrc.Tcval) return strdup((const char *) isrc.TrackIsrc); return NULL; } /** Get the format (XA, DATA, AUDIO) of a track. */ track_format_t get_track_format_win32ioctl(const _img_private_t *env, track_t i_track) { /* This is pretty much copied from the "badly broken" cdrom_count_tracks in linux/cdrom.c. */ if (env->tocent[i_track - env->gen.i_first_track].Control & 0x04) { if (env->tocent[i_track - env->gen.i_first_track].Format == 0x10) return TRACK_FORMAT_CDI; else if (env->tocent[i_track - env->gen.i_first_track].Format == 0x20) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; } #endif /*HAVE_WIN32_CDROM*/ libcdio-2.2.0/lib/driver/Makefile.am000066400000000000000000000146441474051130400172250ustar00rootroot00000000000000# Copyright (C) 2003-2010, 2012-2013, 2017 # Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################## # Things to make the libcdio library ######################################################## # # From libtool documentation amended with guidance from N. Boullis: # # 1. Start with version information of `0:0:0' for each libtool library. # # 2. It is probably not a good idea to update the version information # several times between public releases, but rather once per public # release. (This seems to be more an aesthetic consideration than # a hard technical one.) # # 3. If the library source code has changed at all since the last # update, then increment REVISION (`C:R:A' becomes `C:R+1:A'). # # 4. If any interfaces have been added, removed, or changed since the # last update, increment CURRENT, and set REVISION to 0. # # 5. If any interfaces have been added since the last public release, # then increment AGE. # # 6. If any interfaces have been removed or changed since the last # public release, then set AGE to 0. A changed interface means an # incompatibility with previous versions. libcdio_la_CURRENT = 19 libcdio_la_REVISION = 0 libcdio_la_AGE = 0 EXTRA_DIST = image/Makefile \ mmc/Makefile \ FreeBSD/Makefile MSWindows/Makefile \ libcdio.sym noinst_HEADERS = cdio_assert.h cdio_private.h filemode.h portable.h libcdio_sources = \ _cdio_generic.c \ _cdio_stdio.c \ _cdio_stdio.h \ _cdio_stream.c \ _cdio_stream.h \ abs_path.c \ aix.c \ audio.c \ cd_types.c \ cdio.c \ cdtext.c \ cdtext_private.h \ device.c \ disc.c \ ds.c \ FreeBSD/freebsd.c \ FreeBSD/freebsd.h \ FreeBSD/freebsd_cam.c \ FreeBSD/freebsd_ioctl.c \ generic.h \ gnu_linux.c \ image.h \ image/bincue.c \ image/cdrdao.c \ image_common.c \ image_common.h \ image/nrg.c \ image/nrg.h \ logging.c \ memory.c \ mmc/mmc.c \ mmc/mmc_cmd_helper.h \ mmc/mmc_hl_cmds.c \ mmc/mmc_ll_cmds.c \ mmc/mmc_private.h \ mmc/mmc_util.c \ MSWindows/aspi32.c \ MSWindows/aspi32.h \ MSWindows/win32_ioctl.c \ MSWindows/win32.c \ MSWindows/win32.h \ netbsd.c \ osx.c \ read.c \ realpath.c \ sector.c \ solaris.c \ track.c \ utf8.c \ util.c lib_LTLIBRARIES = libcdio.la libcdio_la_LIBADD = $(LTLIBICONV) libcdio_la_SOURCES = $(libcdio_sources) libcdio_la_ldflags = -version-info $(libcdio_la_CURRENT):$(libcdio_la_REVISION):$(libcdio_la_AGE) @LT_NO_UNDEFINED@ $(DARWIN_PKG_LIB_HACK) AM_CPPFLAGS = $(LIBCDIO_CFLAGS) ######################################################## # Things to version the symbols in the libraries ######################################################## # An explanation of the versioning problem from Nicolas Boullis and # the versioned symbol solution he uses below... # # Currently, libvcdinfo uses the cdio_open function from libcdio. # Let's imagine a program foobar that uses both the vcdinfo_open # function from libvcdinfo and the cdio_open function from libcdio. # Currently, libcdio has SONAME libcdio.so.0, libvcdinfo has SONAME # libvcdinfo.so.0 and requires libcdio.so.0, and foobar requires both # libvcdinfo.so.0 and libcdio.so.0. Everything looks fine. # # Now, for some reason, you decide to change the cdio_open function. # That's your right, but you have to bump the CURRENT version and (if I # understand it correctly, athough this is not that clear in libtool's # documentation) set the AGE to 0. Anyway, this bumps the SONAME, which is # sane since the interface changes incompatibly. # Now, you have a new libcdio with SONAME libcdio.so.1. But libvcdinfo and # foobar still require libcdio.so.0. Everything is still fine. # Now, after some minor changes, the author of foobar recompiles foobar. # Then, foobar now requires libvcdinfo.so.0 and libcdio.so.1. And foobar # now segfaults... # What is happening? When you run foobar, if brings both libvcdinfo.so.0 # and libcdio.so.1, but libvcdinfo.so.0 also brings libcdio.so.0. So you # have both libcdio.so.0 and libcdio.so.1 that bring their symbols to the # global namespace. Hence, you have to incompatible versions of the # cdio_open function in the name space. When foobar calls cdio_open, it # may choose the wrong function, and segfaults... # With versioned symbols, the cdio_open function from libcdio.so.0 may be # known as (something that looks like) cdio_open@@CDIO_0. An the cdio_open # function from libcdio.so.1 as cdio_open@@CDIO_1. Both versions of # libcdio would still be brought in by the most recent foobar, but foobar # (and libvcdinfo) know which versioned function to use and then use the # good one. # This is some simple versioning where every symbol is versioned with # something that looks like the SONAME of the library. More complex (and # better) versioning is possible; it is for example what is used by glibc. # But good complex versioning is something that requires much more # work... # The below is a impliments symbol versioning. First of all, I # compute MAJOR as CURENT - AGE; that is what is used within libtool # (at least on GNU/Linux systems) for the number in the SONAME. The # nm command gives the list of symbols known in each of the object # files that will be part of the shared library. And the sed command # extracts from this list those symbols that will be shared. (This sed # command comes from libtool.) libcdio_la_MAJOR = $(shell expr $(libcdio_la_CURRENT) - $(libcdio_la_AGE)) if BUILD_VERSIONED_LIBS libcdio_la_LDFLAGS = $(libcdio_la_ldflags) -Wl,--version-script=libcdio.la.ver libcdio_la_DEPENDENCIES = libcdio.la.ver libcdio.la.ver: $(srcdir)/libcdio.sym @echo 'CDIO_$(libcdio_la_MAJOR) { ' > $@ @echo ' global:' >> $@ @sed 's/^/ /;s/$$/;/' $< >> $@ @echo ' local:' >> $@ @echo ' *;' >> $@ @echo '};' >> $@ else libcdio_la_LDFLAGS = $(libcdio_la_ldflags) endif MOSTLYCLEANFILES = libcdio.la.ver libcdio-2.2.0/lib/driver/_cdio_generic.c000066400000000000000000000323731474051130400201050ustar00rootroot00000000000000/* Copyright (C) 2004-2009, 2011-2013, 2017, 2024 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains generic implementations of device-driver routines. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include #include "cdio_assert.h" #include "cdio_private.h" #include "_cdio_stdio.h" #include "filemode.h" #ifndef PATH_MAX #define PATH_MAX 4096 #endif /* If available and LFS is enabled, try to use lseek64 */ #if defined(HAVE_LSEEK64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) #if defined(_MSC_VER) #include #endif #define CDIO_LSEEK lseek64 #else #define CDIO_LSEEK lseek #endif /*! Eject media -- there's nothing to do here. We always return -2. Should we also free resources? */ driver_return_code_t cdio_generic_unimplemented_eject_media (void *p_user_data) { /* Sort of a stub here. Perhaps log a message? */ return DRIVER_OP_UNSUPPORTED; } /*! Set the blocksize for subsequent reads. */ driver_return_code_t cdio_generic_unimplemented_set_blocksize (void *p_user_data, uint16_t i_blocksize) { /* Sort of a stub here. Perhaps log a message? */ return DRIVER_OP_UNSUPPORTED; } /*! Set the drive speed. */ driver_return_code_t cdio_generic_unimplemented_set_speed (void *p_user_data, int i_speed) { /* Sort of a stub here. Perhaps log a message? */ return DRIVER_OP_UNSUPPORTED; } /*! Release and free resources associated with cd. */ void cdio_generic_free (void *p_user_data) { generic_img_private_t *p_env = p_user_data; if (NULL == p_env) return; if (p_env->source_name) free (p_env->source_name); if (NULL != p_env->cdtext) { cdtext_destroy(p_env->cdtext); p_env->cdtext = NULL; } if (p_env->fd >= 0) close (p_env->fd); if (p_env->scsi_tuple != NULL) free (p_env->scsi_tuple); free (p_env); } /*! Initialize CD device. */ bool cdio_generic_init (void *user_data, int open_flags) { generic_img_private_t *p_env = user_data; if (p_env->init) { cdio_warn ("init called more than once"); return false; } p_env->fd = open (p_env->source_name, open_flags, 0); if (p_env->fd < 0) { cdio_warn ("open (%s): %s", p_env->source_name, strerror (errno)); return false; } p_env->init = true; p_env->toc_init = false; p_env->cdtext = NULL; p_env->scsi_tuple = NULL; p_env->b_cdtext_error = false; p_env->u_joliet_level = 0; /* Assume no Joliet extensions initally */ return true; } /*! Reads a single form1 sector from cd device into data starting from lsn. */ int cdio_generic_read_form1_sector (void * user_data, void *data, lsn_t lsn) { if (0 > cdio_generic_lseek(user_data, CDIO_CD_FRAMESIZE*lsn, SEEK_SET)) return DRIVER_OP_ERROR; return cdio_generic_read(user_data, data, CDIO_CD_FRAMESIZE); } /*! Reads into buf the next size bytes. Returns -1 on error. Is in fact libc's lseek()/lseek64(). */ off_t cdio_generic_lseek (void *user_data, off_t offset, int whence) { generic_img_private_t *p_env = user_data; return CDIO_LSEEK(p_env->fd, offset, whence); } /*! Reads into buf the next size bytes. Returns -1 on error. Is in fact libc's read(). */ ssize_t cdio_generic_read (void *user_data, void *buf, size_t size) { generic_img_private_t *p_env = user_data; return read(p_env->fd, buf, size); } /*! Release and free resources associated with stream or disk image. */ void cdio_generic_stdio_free (void *p_user_data) { generic_img_private_t *p_env = p_user_data; if (NULL == p_env) return; if (NULL != p_env->source_name) free (p_env->source_name); if (p_env->data_source) cdio_stdio_destroy (p_env->data_source); } /*! Return true if source_name could be a device containing a CD-ROM. */ bool cdio_is_device_generic(const char *source_name) { struct stat buf; if (0 != stat(source_name, &buf)) { cdio_warn ("Can't get file status for %s:\n%s", source_name, strerror(errno)); return false; } return (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)); } /*! Like above, but don't give a warning device doesn't exist. */ bool cdio_is_device_quiet_generic(const char *source_name) { struct stat buf; if (0 != stat(source_name, &buf)) { return false; } return (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)); } /*! Add/allocate a drive to the end of drives. Use cdio_free_device_list() to free this device_list. */ void cdio_add_device_list(char **device_list[], const char *drive, unsigned int *num_drives) { if (NULL != drive) { unsigned int j; char real_device_1[PATH_MAX]; char real_device_2[PATH_MAX]; cdio_realpath(drive, real_device_1); /* Check if drive is already in list. */ for (j=0; j<*num_drives; j++) { cdio_realpath((*device_list)[j], real_device_2); if (strcmp(real_device_1, real_device_2) == 0) break; } if (j==*num_drives) { /* Drive not in list. Add it. */ (*num_drives)++; *device_list = realloc(*device_list, (*num_drives) * sizeof(char *)); if (NULL == *device_list) return; cdio_debug("Adding drive %s to list of devices", drive); (*device_list)[*num_drives-1] = strdup(drive); } } else { (*num_drives)++; if (*device_list) { *device_list = realloc(*device_list, (*num_drives) * sizeof(char *)); } else { *device_list = malloc((*num_drives) * sizeof(char *)); } if (NULL == *device_list) return; cdio_debug("Adding NULL to end of drive list of size %d", (*num_drives)-1); (*device_list)[*num_drives-1] = NULL; } } /* Get cdtext information in p_user_data for track i_track. For disc information i_track is 0. Return the CD-TEXT or NULL if obj is NULL, CD-TEXT information does not exist, or we don't know how to get this implemented. */ cdtext_t * get_cdtext_generic (void *p_user_data) { generic_img_private_t *p_env = p_user_data; uint8_t *p_cdtext_data = NULL; size_t len; if (!p_env) return NULL; if (p_env->b_cdtext_error) return NULL; if (NULL == p_env->cdtext) { p_cdtext_data = read_cdtext_generic (p_env); if (NULL != p_cdtext_data) { len = CDIO_MMC_GET_LEN16(p_cdtext_data)-2; p_env->cdtext = cdtext_init(); if(len <= 0 || 0 != cdtext_data_init (p_env->cdtext, &p_cdtext_data[4], len)) { p_env->b_cdtext_error = true; cdtext_destroy (p_env->cdtext); p_env->cdtext = NULL; } free(p_cdtext_data); } } return p_env->cdtext; } /*! Get disc type associated with cd object. */ discmode_t get_discmode_generic (void *p_user_data ) { generic_img_private_t *p_env = p_user_data; /* See if this is a DVD. */ cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */ memset(&dvd, 0, sizeof(dvd)); dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL; dvd.physical.layer_num = 0; if (0 == mmc_get_dvd_struct_physical (p_env->cdio, &dvd)) { switch(dvd.physical.layer[0].book_type) { case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM; case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM; case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R; case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW; case CDIO_DVD_BOOK_HD_DVD_ROM: return CDIO_DISC_MODE_HD_DVD_ROM; case CDIO_DVD_BOOK_HD_DVD_RAM: return CDIO_DISC_MODE_HD_DVD_RAM; case CDIO_DVD_BOOK_HD_DVD_R: return CDIO_DISC_MODE_HD_DVD_R; case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR; case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW; case CDIO_DVD_BOOK_DVD_PRW_DL: return CDIO_DISC_MODE_DVD_PRW_DL; case CDIO_DVD_BOOK_DVD_PR_DL: return CDIO_DISC_MODE_DVD_PR_DL; default: return CDIO_DISC_MODE_DVD_OTHER; } } return get_discmode_cd_generic(p_user_data); } /*! Get disc type associated with cd object. */ discmode_t get_discmode_cd_generic (void *p_user_data ) { generic_img_private_t *p_env = p_user_data; track_t i_track; discmode_t discmode=CDIO_DISC_MODE_NO_INFO; if (!p_env->toc_init) p_env->cdio->op.read_toc (p_user_data); if (!p_env->toc_init) return CDIO_DISC_MODE_NO_INFO; for (i_track = p_env->i_first_track; i_track < p_env->i_first_track + p_env->i_tracks ; i_track ++) { track_format_t track_fmt = p_env->cdio->op.get_track_format(p_env, i_track); switch(track_fmt) { case TRACK_FORMAT_AUDIO: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_XA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_DATA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_ERROR: default: discmode = CDIO_DISC_MODE_ERROR; } } return discmode; } /*! Return the number of of the first track. CDIO_INVALID_TRACK is returned on error. */ track_t get_first_track_num_generic(void *p_user_data) { const generic_img_private_t *p_env = p_user_data; if (!p_env->toc_init) p_env->cdio->op.read_toc (p_user_data); return p_env->toc_init ? p_env->i_first_track : CDIO_INVALID_TRACK; } /*! Return the number of tracks in the current medium. */ track_t get_num_tracks_generic(void *p_user_data) { generic_img_private_t *p_env = p_user_data; if (!p_env->toc_init) p_env->cdio->op.read_toc (p_user_data); return p_env->toc_init ? p_env->i_tracks : CDIO_INVALID_TRACK; } /*! Read CD-Text information for a CdIo_t object . return pointer to raw cdtext on success, NULL on failure free when done and not NULL */ uint8_t * read_cdtext_generic(void *p_env) { generic_img_private_t *p_user_data = p_env; return mmc_read_cdtext ( p_user_data->cdio ); } /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int get_track_channels_generic(const void *p_user_data, track_t i_track) { const generic_img_private_t *p_env = p_user_data; return p_env->track_flags[i_track].channels; } /*! Return 1 if copy is permitted on the track, 0 if not, or -1 for error. Is this meaningful if not an audio track? */ track_flag_t get_track_copy_permit_generic(void *p_user_data, track_t i_track) { const generic_img_private_t *p_env = p_user_data; return p_env->track_flags[i_track].copy_permit; } /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error. Is this meaningful if not an audio track? pre-emphasis is a non linear frequency response. */ track_flag_t get_track_preemphasis_generic(const void *p_user_data, track_t i_track) { const generic_img_private_t *p_env = p_user_data; return p_env->track_flags[i_track].preemphasis; } void set_track_flags(track_flags_t *p_track_flag, uint8_t i_flag) { p_track_flag->preemphasis = ( i_flag & CDIO_TRACK_FLAG_PRE_EMPHASIS ) ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; p_track_flag->copy_permit = ( i_flag & CDIO_TRACK_FLAG_COPY_PERMITTED ) ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; p_track_flag->channels = ( i_flag & CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO ) ? 4 : 2; } driver_return_code_t read_data_sectors_generic (void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks) { int rc; if (0 > cdio_generic_lseek(p_user_data, i_blocksize*i_lsn, SEEK_SET)) return DRIVER_OP_ERROR; rc = cdio_generic_read(p_user_data, p_buf, i_blocksize*i_blocks); if (rc > 0) return DRIVER_OP_SUCCESS; return DRIVER_OP_ERROR; } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/_cdio_stdio.c000066400000000000000000000166511474051130400176140ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2011 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include #include #include #include "_cdio_stream.h" #include "_cdio_stdio.h" #include "cdio_assert.h" /* On 32 bit platforms, fseek can only access streams of 2 GB or less. Prefer fseeko/fseeko64, that take a 64 bit offset when LFS is enabled */ #if defined(HAVE_FSEEKO64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) #define CDIO_FSEEK fseeko64 #elif defined(HAVE_FSEEKO) #define CDIO_FSEEK fseeko #else #define CDIO_FSEEK fseek #endif /* Windows' fopen is not UTF-8 compliant, so we use our own */ #if defined(_WIN32) #include #define CDIO_FOPEN fopen_utf8 #else #define CDIO_FOPEN fopen #endif /* Use _stati64 if needed, on platforms that don't have transparent LFS support */ #if defined(HAVE__STATI64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) #define CDIO_STAT_STRUCT _stati64 #if defined(_WIN32) /* Once again, use our own UTF-8 compliant version */ static inline int _stati64_utf8(const char *path, struct _stati64 *buffer) { int ret; wchar_t* wpath = cdio_utf8_to_wchar(path); ret = _wstati64(wpath, buffer); cdio_free(wpath); return ret; } #define CDIO_STAT_CALL _stati64_utf8 #else #define CDIO_STAT_CALL _stati64 #endif #else #define CDIO_STAT_STRUCT stat #define CDIO_STAT_CALL stat #endif #define _STRINGIFY(a) #a #define STRINGIFY(a) _STRINGIFY(a) #define CDIO_STDIO_BUFSIZE (128*1024) typedef struct { char *pathname; FILE *fd; char *fd_buf; off_t st_size; /* used only for source */ } _UserData; static int _stdio_open (void *user_data) { _UserData *const ud = user_data; if ((ud->fd = CDIO_FOPEN (ud->pathname, "rb"))) { ud->fd_buf = calloc (1, CDIO_STDIO_BUFSIZE); setvbuf (ud->fd, ud->fd_buf, _IOFBF, CDIO_STDIO_BUFSIZE); } return (ud->fd == NULL); } static int _stdio_close(void *user_data) { _UserData *const ud = user_data; if (fclose (ud->fd)) cdio_error ("fclose (): %s", strerror (errno)); ud->fd = NULL; free (ud->fd_buf); ud->fd_buf = NULL; return 0; } static void _stdio_free(void *user_data) { _UserData *const ud = user_data; if (ud->pathname) free(ud->pathname); if (ud->fd) /* should be NULL anyway... */ _stdio_close(user_data); free(ud); } /*! Like fseek/fseeko(3) and in fact may be the same. This function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek function clears the end- of-file indicator for the stream and undoes any effects of the ungetc(3) function on the same stream. @return upon successful completion, DRIVER_OP_SUCCESS, else, DRIVER_OP_ERROR is returned and the global variable errno is set to indicate the error. */ static int _stdio_seek(void *p_user_data, off_t i_offset, int whence) { _UserData *const ud = p_user_data; int ret; #if !defined(HAVE_FSEEKO) && !defined(HAVE_FSEEKO64) /* Detect if off_t is lossy-truncated to long to avoid data corruption */ if ( (sizeof(off_t) > sizeof(long)) && (i_offset != (off_t)((long)i_offset)) ) { cdio_error ( STRINGIFY(CDIO_FSEEK) " (): lossy truncation detected!"); errno = EFBIG; return DRIVER_OP_ERROR; } #endif if ( (ret=CDIO_FSEEK (ud->fd, i_offset, whence)) ) { cdio_error ( STRINGIFY(CDIO_FSEEK) " (): %s", strerror (errno)); } return ret; } static off_t _stdio_stat(void *p_user_data) { const _UserData *const ud = p_user_data; return ud->st_size; } /*! Like fread(3) and in fact is about the same. DESCRIPTION: The function fread reads nmemb elements of data, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr. RETURN VALUE: return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero). We do not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred. */ static ssize_t _stdio_read(void *user_data, void *buf, size_t count) { _UserData *const ud = user_data; long read_count; // Define a safe buffer size for _stdio_read const size_t MAX_ALLOWED_COUNT = 0x100000; if (count > MAX_ALLOWED_COUNT) { cdio_error("Requested count exceeds maximum allowed value.\n"); return 0; } read_count = fread(buf, 1, count, ud->fd); if (read_count != count) { /* fixme -- ferror/feof */ if (feof (ud->fd)) { cdio_debug ("fread (): EOF encountered"); clearerr (ud->fd); } else if (ferror (ud->fd)) { cdio_error ("fread (): %s", strerror (errno)); clearerr (ud->fd); } else cdio_debug ("fread (): short read and no EOF?!?"); } return read_count; } /*! Deallocate resources assocaited with obj. After this obj is unusable. */ void cdio_stdio_destroy(CdioDataSource_t *p_obj) { cdio_stream_destroy(p_obj); } CdioDataSource_t * cdio_stdio_new(const char pathname[]) { CdioDataSource_t *new_obj = NULL; cdio_stream_io_functions funcs = { NULL, NULL, NULL, NULL, NULL, NULL }; _UserData *ud = NULL; struct CDIO_STAT_STRUCT statbuf; char* pathdup; if (pathname == NULL) return NULL; /* MinGW may require a translated path */ pathdup = _cdio_strdup_fixpath(pathname); if (pathdup == NULL) return NULL; if (CDIO_STAT_CALL (pathdup, &statbuf) == -1) { cdio_warn ("could not retrieve file info for `%s': %s", pathdup, strerror (errno)); cdio_free(pathdup); return NULL; } ud = calloc (1, sizeof (_UserData)); cdio_assert (ud != NULL); ud->pathname = pathdup; ud->st_size = statbuf.st_size; /* let's hope it doesn't change... */ funcs.open = _stdio_open; funcs.seek = _stdio_seek; funcs.stat = _stdio_stat; funcs.read = _stdio_read; funcs.close = _stdio_close; funcs.free = _stdio_free; new_obj = cdio_stream_new(ud, &funcs); return new_obj; } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/_cdio_stdio.h000066400000000000000000000026231474051130400176130ustar00rootroot00000000000000/* Copyright (C) 2003, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_STDIO_H_ #define CDIO_STDIO_H_ #include "_cdio_stream.h" /*! Initialize a new stdio stream reading from pathname. A pointer to the stream is returned or NULL if there was an error. cdio_stream_free should be called on the returned value when you don't need the stream any more. No other finalization is needed. */ CdioDataSource_t * cdio_stdio_new(const char psz_path[]); /*! Deallocate resources assocaited with obj. After this obj is unusable. */ void cdio_stdio_destroy(CdioDataSource_t *p_obj); #endif /* CDIO_STDIO_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/_cdio_stream.c000066400000000000000000000127321474051130400177610ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2011, 2016 Rocky Bernstein Copyright (C) 2000, 2004, 2005 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDARG_H #include #endif #include "cdio_assert.h" /* #define STREAM_DEBUG */ #include #include #include "_cdio_stream.h" /* * DataSource implementations */ struct _CdioDataSource { void* user_data; cdio_stream_io_functions op; int is_open; off_t position; }; void cdio_stream_close(CdioDataSource_t *p_obj) { if (!p_obj) return; if (p_obj->is_open) { cdio_debug ("closed source..."); p_obj->op.close(p_obj->user_data); p_obj->is_open = 0; p_obj->position = 0; } } void cdio_stream_destroy(CdioDataSource_t *p_obj) { if (!p_obj) return; cdio_stream_close(p_obj); p_obj->op.free(p_obj->user_data); p_obj->user_data = NULL; free(p_obj); } /** Like 3 fgetpos. This function gets the current file position indicator for the stream pointed to by stream. @return unpon successful completion, return value is positive, else, the global variable errno is set to indicate the error. */ off_t cdio_stream_getpos(CdioDataSource_t* p_obj, /*out*/ off_t *i_offset) { if (!p_obj || !p_obj->is_open) return DRIVER_OP_UNINIT; return *i_offset = p_obj->position; } CdioDataSource_t * cdio_stream_new(void *user_data, const cdio_stream_io_functions *funcs) { CdioDataSource_t *new_obj; new_obj = calloc (1, sizeof (CdioDataSource_t)); cdio_assert (new_obj != NULL); new_obj->user_data = user_data; memcpy(&(new_obj->op), funcs, sizeof(cdio_stream_io_functions)); return new_obj; } /* Open if not already open. Return false if we hit an error. Errno should be set for that error. */ static bool _cdio_stream_open_if_necessary(CdioDataSource_t *p_obj) { if (!p_obj) return false; if (!p_obj->is_open) { if (p_obj->op.open(p_obj->user_data)) { cdio_warn ("could not open input stream..."); return false; } else { cdio_debug ("opened source..."); p_obj->is_open = 1; p_obj->position = 0; } } return true; } /** Like fread(3) and in fact may be the same. DESCRIPTION: The function fread reads nmemb elements of data, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr. RETURN VALUE: return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero). We do not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred. */ ssize_t cdio_stream_read(CdioDataSource_t* p_obj, void *ptr, size_t size, size_t nmemb) { long read_bytes; if (!p_obj) return 0; if (!_cdio_stream_open_if_necessary(p_obj)) return 0; read_bytes = (p_obj->op.read)(p_obj->user_data, ptr, size*nmemb); p_obj->position += read_bytes; return read_bytes; } /** Like 3 fseek and in fact may be the same. This function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek function clears the end- of-file indicator for the stream and undoes any effects of the ungetc(3) function on the same stream. @return unpon successful completion, return value is positive, else, the global variable errno is set to indicate the error. */ int cdio_stream_seek(CdioDataSource_t* p_obj, off_t offset, int whence) { if (!p_obj) return DRIVER_OP_UNINIT; if (!_cdio_stream_open_if_necessary(p_obj)) /* errno is set by _cdio_stream_open_if necessary. */ return DRIVER_OP_ERROR; if (offset < 0) return DRIVER_OP_ERROR; if (p_obj->position < 0) return DRIVER_OP_ERROR; if (p_obj->position != offset) { #ifdef STREAM_DEBUG cdio_warn("had to reposition DataSource from %ld to %ld!", p_obj->position, offset); #endif p_obj->position = offset; return p_obj->op.seek(p_obj->user_data, offset, whence); } return 0; } /** Return whatever size of stream reports, I guess unit size is bytes. On error return -1; */ off_t cdio_stream_stat(CdioDataSource_t *p_obj) { if (!p_obj) return -1; if (!_cdio_stream_open_if_necessary(p_obj)) return -1; return p_obj->op.stat(p_obj->user_data); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/_cdio_stream.h000066400000000000000000000103741474051130400177660ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_STREAM_H_ #define CDIO_STREAM_H_ #include #include "cdio_private.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* typedef'ed IO functions prototypes */ typedef int(*cdio_data_open_t)(void *user_data); typedef ssize_t(*cdio_data_read_t)(void *user_data, void *buf, size_t count); typedef int(*cdio_data_seek_t)(void *user_data, off_t offset, int whence); typedef off_t(*cdio_data_stat_t)(void *user_data); typedef int(*cdio_data_close_t)(void *user_data); typedef void(*cdio_data_free_t)(void *user_data); /* abstract data source */ typedef struct { cdio_data_open_t open; cdio_data_seek_t seek; cdio_data_stat_t stat; cdio_data_read_t read; cdio_data_close_t close; cdio_data_free_t free; } cdio_stream_io_functions; /** Like 3 fgetpos. This function gets the current file position indicator for the stream pointed to by stream. @return unpon successful completion, return value is positive, else, the global variable errno is set to indicate the error. */ off_t cdio_stream_getpos(CdioDataSource_t* p_obj, /*out*/ off_t *i_offset); CdioDataSource_t * cdio_stream_new(void *user_data, const cdio_stream_io_functions *funcs); /** Like fread(3) and in fact may be the same. DESCRIPTION: The function fread reads nmemb elements of data, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr. RETURN VALUE: return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero). We do not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred. */ ssize_t cdio_stream_read(CdioDataSource_t* p_obj, void *ptr, size_t i_size, size_t nmemb); /** Like fseek(3)/fseeko(3) and in fact may be the same. This function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek function clears the end- of-file indicator for the stream and undoes any effects of the ungetc(3) function on the same stream. @return upon successful completion, DRIVER_OP_SUCCESS, else, DRIVER_OP_ERROR is returned and the global variable errno is set to indicate the error. */ int cdio_stream_seek(CdioDataSource_t *p_obj, off_t i_offset, int whence); /** Return whatever size of stream reports, I guess unit size is bytes. On error return -1; */ off_t cdio_stream_stat(CdioDataSource_t *p_obj); /** Deallocate resources associated with p_obj. After this p_obj is unusable. */ void cdio_stream_destroy(CdioDataSource_t *p_obj); void cdio_stream_close(CdioDataSource_t *p_obj); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_STREAM_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/abs_path.c000066400000000000000000000045771474051130400171220ustar00rootroot00000000000000/* To compile as a standalone program: gcc -Wall -g -I../.. -DHAVE_CONFIG_H -DSTANDALONE -o abs_path abs_path.c */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include "cdio_private.h" #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifndef PATH_MAX # define PATH_MAX 4096 #endif #ifndef NULL # define NULL 0 #endif #ifdef __CYGWIN__ # undef DOSISH #endif #if defined __CYGWIN__ || defined DOSISH # define DOSISH_UNC # define DOSISH_DRIVE_LETTER # define FILE_ALT_SEPARATOR '\\' #endif #ifndef CDIO_FILE_SEPARATOR # define CDIO_FILE_SEPARATOR '/' #endif #if defined __CYGWIN__ || defined DOSISH # define FILE_ALT_SEPARATOR '\\' #endif #ifdef CDIO_FILE_ALT_SEPARATOR # define isdirsep(x) ((x) == CDIO_FILE_SEPARATOR || (x) == CDIO_FILE_ALT_SEPARATOR) #else # define isdirsep(x) ((x) == CDIO_FILE_SEPARATOR) #endif #define skipprefix(path) (path) #if !defined(CharNext) || defined(_MSC_VER) /* defined as CharNext[AW] on Windows. */ # undef CharNext # define CharNext(p) ((p) + 1) #endif static char * strrdirsep(const char *path) { char *last = NULL; while (*path) { if (isdirsep(*path)) { const char *tmp = path++; while (isdirsep(*path)) path++; if (!*path) break; last = (char *)tmp; } else { path = CharNext(path); } } return last; } char * cdio_dirname(const char *fname) { const char *p; p = strrdirsep(fname); if (!p) return strdup("."); return strndup(fname, p - fname); } /* If fname isn't absolute, add cwd to it. */ char * cdio_abspath(const char *cwd, const char *fname) { if (isdirsep(*fname)) return strdup(fname); else { size_t len = strlen(cwd) + strlen(fname) + 2; char* result = calloc(sizeof(char), len); snprintf(result, len, "%s%c%s", cwd, CDIO_FILE_SEPARATOR, fname); return result; } } #ifdef STANDALONE int main(int argc, char **argv) { char *dest; char *dirname; if (argc != 3) { fprintf(stderr, "Usage: %s FILE REPLACE_BASENAME\n", argv[0]); fprintf(stderr, " Make PATH absolute\n"); exit(1); } dirname = cdio_dirname(argv[1]); dest = cdio_abspath(dirname, argv[2]); printf("%s -> %s\n", argv[1], dest); free(dirname); free(dest); exit(0); } #endif libcdio-2.2.0/lib/driver/aix.c000066400000000000000000000651261474051130400161170ustar00rootroot00000000000000/* Copyright (C) 2004-2006, 2008, 2010, 2011-2013, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include "cdio_assert.h" #include "cdio_private.h" #define DEFAULT_CDIO_DEVICE "/dev/rcd0" #ifdef HAVE_AIX_CDROM #ifdef HAVE_GLOB_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cdtext_private.h" typedef struct _TRACK_DATA { uchar Format; uchar Control : 4; uchar Adr : 4; uchar TrackNumber; uchar Reserved1; uchar Address[4]; } TRACK_DATA, *PTRACK_DATA; typedef struct _CDROM_TOC { uchar Length[2]; uchar FirstTrack; uchar LastTrack; TRACK_DATA TrackData[CDIO_CD_MAX_TRACKS+1]; } CDROM_TOC, *PCDROM_TOC; typedef struct _TRACK_DATA_FULL { uchar SessionNumber; uchar Control : 4; uchar Adr : 4; uchar TNO; uchar POINT; /* Tracknumber (of session?) or lead-out/in (0xA0, 0xA1, 0xA2) */ uchar Min; /* Only valid if disctype is CDDA ? */ uchar Sec; /* Only valid if disctype is CDDA ? */ uchar Frame; /* Only valid if disctype is CDDA ? */ uchar Zero; /* Always zero */ uchar PMIN; /* start min, if POINT is a track; if lead-out/in 0xA0: First Track */ uchar PSEC; uchar PFRAME; } TRACK_DATA_FULL, *PTRACK_DATA_FULL; typedef struct _CDROM_TOC_FULL { uchar Length[2]; uchar FirstSession; uchar LastSession; TRACK_DATA_FULL TrackData[CDIO_CD_MAX_TRACKS+3]; } CDROM_TOC_FULL, *PCDROM_TOC_FULL; /* reader */ typedef enum { _AM_NONE, _AM_CTRL_SCSI } access_mode_t; typedef struct { lsn_t start_lsn; uchar Control : 4; uchar Format; } track_info_t; typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; access_mode_t access_mode; /* Some of the more OS specific things. */ /* Entry info for each track, add 1 for leadout. */ track_info_t tocent[CDIO_CD_MAX_TRACKS+1]; } _img_private_t; static track_format_t get_track_format_aix(void *p_user_data, track_t i_track); static access_mode_t str_to_access_mode_aix(const char *psz_access_mode) { const access_mode_t default_access_mode = _AM_CTRL_SCSI; if (NULL==psz_access_mode) return default_access_mode; if (!strcmp(psz_access_mode, "SCSI")) return _AM_CTRL_SCSI; else { cdio_warn ("unknown access type: %s. Default SCSI used.", psz_access_mode); return default_access_mode; } } /*! Initialize CD device. */ static bool init_aix (_img_private_t *p_env) { if (p_env->gen.init) { cdio_warn ("init called more than once"); return false; } p_env->gen.fd = openx (p_env->gen.source_name, O_RDONLY, NULL, SC_DIAGNOSTIC); /*p_env->gen.fd = openx (p_env->gen.source_name, O_RDONLY, NULL, IDE_SINGLE);*/ if (p_env->gen.fd < 0) { cdio_warn ("open (%s): %s", p_env->gen.source_name, strerror (errno)); return false; } p_env->gen.init = true; p_env->gen.toc_init = false; p_env->gen.u_joliet_level = 0; /* Assume no Joliet extensions initally */ p_env->access_mode = _AM_CTRL_SCSI; return true; } /*! Run a SCSI MMC command. p_user_data internal CD structure. i_timeout_ms time in milliseconds we will wait for the command to complete. i_cdb Size of p_cdb p_cdb CDB bytes. e_direction direction the transfer is to go. i_buf Size of buffer p_buf Buffer for data, both sending and receiving */ static driver_return_code_t run_mmc_cmd_aix( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { const _img_private_t *p_env = p_user_data; struct sc_passthru cgc; int i_rc; memset (&cgc, 0, sizeof (cgc)); memcpy(cgc.scsi_cdb, p_cdb, sizeof(mmc_cdb_t)); #ifdef AIX_DISABLE_ASYNC /* This enables synchronous negotiation mode. Some CD-ROM drives * don't handle this well. */ cgc.flags = 0; #else cgc.flags = SC_ASYNC; #endif if (0 != i_buf) cgc.flags |= MMC_DATA_READ == e_direction ? B_READ : B_WRITE; cgc.timeout_value = msecs2secs(i_timeout_ms); cgc.buffer = p_buf; cgc.data_length = i_buf; cgc.command_length= i_cdb; i_rc = ioctl(p_env->gen.fd, DK_PASSTHRU, &cgc); if (-1 == i_rc) { cdio_warn("DKIOCMD error: %s", strerror(errno)); } return i_rc; } /*! Reads audio sectors from CD device into data starting from lsn. Returns 0 if no error. May have to check size of nblocks. There may be a limit that can be read in one go, e.g. 25 blocks. */ static driver_return_code_t _read_audio_sectors_aix (void *p_user_data, void *data, lsn_t lsn, unsigned int nblocks) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; #ifdef FINISHED struct cdrom_msf *msf = (struct cdrom_msf *) &buf; msf_t _msf; struct cdrom_cdda cdda; _img_private_t *env = p_user_data; cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf); msf->cdmsf_min0 = from_bcd8(_msf.m); msf->cdmsf_sec0 = from_bcd8(_msf.s); msf->cdmsf_frame0 = from_bcd8(_msf.f); if (env->gen.ioctls_debugged == 75) cdio_debug ("only displaying every 75th ioctl from now on"); if (env->gen.ioctls_debugged == 30 * 75) cdio_debug ("only displaying every 30*75th ioctl from now on"); if (env->gen.ioctls_debugged < 75 || (env->gen.ioctls_debugged < (30 * 75) && env->gen.ioctls_debugged % 75 == 0) || env->gen.ioctls_debugged % (30 * 75) == 0) cdio_debug ("reading %d", lsn); env->gen.ioctls_debugged++; cdda.cdda_addr = lsn; cdda.cdda_length = nblocks; cdda.cdda_data = (caddr_t) data; if (ioctl (env->gen.fd, CDROMCDDA, &cdda) == -1) { perror ("ioctl(..,CDROMCDDA,..)"); return 1; /* exit (EXIT_FAILURE); */ } #endif memcpy (data, buf, CDIO_CD_FRAMESIZE_RAW); return 0; } /*! Reads a single mode1 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sector_aix (void *env, void *data, lsn_t lsn, bool b_form2) { #if FIXED do something here. #else return cdio_generic_read_form1_sector(env, data, lsn); #endif } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sectors_aix (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *p_env = p_user_data; unsigned int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode1_sector_aix (p_env, ((char *)p_data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return 0; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sector_aix (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; int offset = 0; #ifdef FINISHED struct cdrom_msf *msf = (struct cdrom_msf *) &buf; msf_t _msf; struct cdrom_cdxa cd_read; _img_private_t *p_env = p_user_data; cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf); msf->cdmsf_min0 = from_bcd8(_msf.m); msf->cdmsf_sec0 = from_bcd8(_msf.s); msf->cdmsf_frame0 = from_bcd8(_msf.f); if (p_env->gen.ioctls_debugged == 75) cdio_debug ("only displaying every 75th ioctl from now on"); if (p_env->gen.ioctls_debugged == 30 * 75) cdio_debug ("only displaying every 30*75th ioctl from now on"); if (p_env->gen.ioctls_debugged < 75 || (p_env->gen.ioctls_debugged < (30 * 75) && p_env->gen.ioctls_debugged % 75 == 0) || p_env->gen.ioctls_debugged % (30 * 75) == 0) cdio_debug ("reading %2.2d:%2.2d:%2.2d", msf->cdmsf_min0, msf->cdmsf_sec0, msf->cdmsf_frame0); p_env->gen.ioctls_debugged++; /* Using CDROMXA ioctl will actually use the same uscsi command * as ATAPI, except we don't need to be root */ offset = CDIO_CD_XA_SYNC_HEADER; cd_read.cdxa_addr = lsn; cd_read.cdxa_data = buf; cd_read.cdxa_length = 1; cd_read.cdxa_format = CDROM_XA_SECTOR_DATA; if (ioctl (p_env->gen.fd, CDROMCDXA, &cd_read) == -1) { perror ("ioctl(..,CDROMCDXA,..)"); return 1; /* exit (EXIT_FAILURE); */ } #endif if (b_form2) memcpy (p_data, buf + (offset-CDIO_CD_SUBHEADER_SIZE), M2RAW_SECTOR_SIZE); else memcpy (((char *)p_data), buf + offset, CDIO_CD_FRAMESIZE); return 0; } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sectors_aix (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *env = p_user_data; unsigned int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode2_sector_aix (env, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return 0; } /*! Return the size of the CD in logical block address (LBA) units. */ static lsn_t get_disc_last_lsn_aix (void *p_user_data) { uint32_t i_size=0; #ifdef FINISHED _img_private_t *env = p_user_data; struct cdrom_tocentry tocent; tocent.cdte_track = CDIO_CDROM_LEADOUT_TRACK; tocent.cdte_format = CDIO_CDROM_LBA; if (ioctl (env->gen.fd, CDROMREADTOCENTRY, &tocent) == -1) { perror ("ioctl(CDROMREADTOCENTRY)"); exit (EXIT_FAILURE); } i_size = tocent.cdte_addr.lba; #endif return i_size; } /*! Set the arg "key" with "value" in the source device. Currently "source" and "access-mode" are valid keys. "source" sets the source device in I/O operations "access-mode" sets the the method of CD access 0 is returned if no error was found, and nonzero if there as an error. */ static driver_return_code_t _set_arg_aix (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return DRIVER_OP_ERROR; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { p_env->access_mode = str_to_access_mode_aix(key); } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } /* * aixioc_send Issue ioctl command. Args: p_env - environment cmd - ioctl command arg - ioctl argument b_print_err - whether an error message is to be displayed if the ioctl fails Return: true/false - ioctl successful */ static bool aixioc_send(_img_private_t *p_env, int cmd, void *arg, bool b_print_err) { struct cd_audio_cmd *ac; if (p_env->gen.fd < 0) return false; if (cmd == DKAUDIO) { ac = (struct cd_audio_cmd *) arg; ac->status = 0; /* Nuke status for audio cmds */ } if (ioctl(p_env->gen.fd, cmd, arg) < 0) { if (b_print_err) { cdio_warn("errno=%d (%s)", errno, strerror(errno)); } return false; } return true; } /*! Read and cache the CD's Track Table of Contents and track info. via a SCSI MMC READ_TOC (FULTOC). Return true if successful or false if an error. */ static bool read_toc_ioctl_aix (void *p_user_data) { _img_private_t *p_env = p_user_data; struct cd_audio_cmd cmdbuf; int i; cmdbuf.msf_flag = false; cmdbuf.audio_cmds = CD_TRK_INFO_AUDIO; if (!aixioc_send(p_env, IDE_CDAUDIO, (void *) &cmdbuf, true)) return false; p_env->gen.i_first_track = cmdbuf.indexing.track_index.first_track; p_env->gen.i_tracks = ( cmdbuf.indexing.track_index.last_track - p_env->gen.i_first_track ) + 1; /* Do it again to get the last MSF data */ cmdbuf.msf_flag = true; if (!aixioc_send(p_env, IDE_CDAUDIO, (void *) &cmdbuf, true)) return false; cmdbuf.audio_cmds = CD_GET_TRK_MSF; for (i = 0; i <= p_env->gen.i_tracks; i++) { int i_track = i + p_env->gen.i_first_track; /* Get the track info */ cmdbuf.indexing.track_msf.track = i_track; if (!aixioc_send(p_env, IDE_CDAUDIO, (void *) &cmdbuf, TRUE)) return false; p_env->tocent[ i_track ].start_lsn = cdio_msf3_to_lba( cmdbuf.indexing.track_msf.mins, cmdbuf.indexing.track_msf.secs, cmdbuf.indexing.track_msf.frames ); } return true; } /*! Read and cache the CD's Track Table of Contents and track info. via a SCSI MMC READ_TOC (FULTOC). Return true if successful or false if an error. */ static bool read_toc_aix (void *p_user_data) { _img_private_t *p_env = p_user_data; mmc_cdb_t cdb = {{0, }}; CDROM_TOC_FULL cdrom_toc_full; int i_status, i, i_seen_flag; int i_track_format = 0; /* Operation code */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC); cdb.field[1] = 0x00; /* Format */ cdb.field[2] = CDIO_MMC_READTOC_FMT_FULTOC; memset(&cdrom_toc_full, 0, sizeof(cdrom_toc_full)); /* Setup to read header, to get length of data */ CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(cdrom_toc_full)); i_status = run_scsi_cmd_aix (p_env, 1000*60*3, mmc_get_cmd_len(cdb.field[0]), &cdb, MMC_DATA_READ, sizeof(cdrom_toc_full), &cdrom_toc_full); if ( 0 != i_status ) { cdio_debug ("SCSI MMC READ_TOC failed\n"); return read_toc_ioctl_aix(p_user_data); } i_seen_flag=0; for( i = 0 ; i <= CDIO_CD_MAX_TRACKS+3; i++ ) { if ( 0xA0 == cdrom_toc_full.TrackData[i].POINT ) { /* First track number */ p_env->gen.i_first_track = cdrom_toc_full.TrackData[i].PMIN; i_track_format = cdrom_toc_full.TrackData[i].PSEC; i_seen_flag|=0x01; } if ( 0xA1 == cdrom_toc_full.TrackData[i].POINT ) { /* Last track number */ p_env->gen.i_tracks = cdrom_toc_full.TrackData[i].PMIN - p_env->gen.i_first_track + 1; i_seen_flag|=0x02; } if ( 0xA2 == cdrom_toc_full.TrackData[i].POINT ) { /* Start position of the lead out */ p_env->tocent[ p_env->gen.i_tracks ].start_lsn = cdio_msf3_to_lba( cdrom_toc_full.TrackData[i].PMIN, cdrom_toc_full.TrackData[i].PSEC, cdrom_toc_full.TrackData[i].PFRAME ); p_env->tocent[ p_env->gen.i_tracks ].Control = cdrom_toc_full.TrackData[i].Control; p_env->tocent[ p_env->gen.i_tracks ].Format = i_track_format; i_seen_flag|=0x04; } if (cdrom_toc_full.TrackData[i].POINT > 0 && cdrom_toc_full.TrackData[i].POINT <= p_env->gen.i_tracks) { p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].start_lsn = cdio_msf3_to_lba( cdrom_toc_full.TrackData[i].PMIN, cdrom_toc_full.TrackData[i].PSEC, cdrom_toc_full.TrackData[i].PFRAME ); p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].Control = cdrom_toc_full.TrackData[i].Control; p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].Format = i_track_format; cdio_debug("p_sectors: %i, %lu", i, (unsigned long int) (p_env->tocent[i].start_lsn)); if (cdrom_toc_full.TrackData[i].POINT == p_env->gen.i_tracks) i_seen_flag|=0x08; } if ( 0x0F == i_seen_flag ) break; } if ( 0x0F == i_seen_flag ) { p_env->gen.toc_init = true; return true; } return false; } /*! Eject media in CD drive. If successful, as a side effect we also free obj. */ static driver_return_code_t eject_media_aix (void *p_user_data) { _img_private_t *p_env = p_user_data; driver_return_code_t ret=DRIVER_OP_SUCCESS; int i_status; if (p_env->gen.fd <= -1) return DRIVER_OP_UNINIT; i_status = ioctl(p_env->gen.fd, DKEJECT); if ( i_status != 0) { cdio_generic_free((void *) p_env); cdio_warn ("DKEJECT failed: %s", strerror(errno)); ret = DRIVER_OP_ERROR; } close(p_env->gen.fd); p_env->gen.fd = -1; return ret; } #if 0 static void * _cdio_malloc_and_zero(size_t size) { void *ptr; if( !size ) size++; if((ptr = malloc(size)) == NULL) { cdio_warn("malloc() failed: %s", strerror(errno)); return NULL; } memset(ptr, 0, size); return ptr; } #endif static bool is_mmc_supported(void *user_data) { _img_private_t *env = user_data; return (_AM_NONE == env->access_mode) ? false : true; } /*! Return the value associated with the key "arg". */ static const char * get_arg_aix (void *p_user_data, const char key[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { return p_env->gen.source_name; } else if (!strcmp (key, "access-mode")) { switch (p_env->access_mode) { case _AM_CTRL_SCSI: return "SCSI"; case _AM_NONE: return "no access method"; } } else if (!strcmp (key, "mmc-supported?")) { return is_mmc_supported(env) ? "true" : "false"; } return NULL; } /*! Return a string containing the default CD device if none is specified. */ char * cdio_get_default_device_aix(void) { return strdup(DEFAULT_CDIO_DEVICE); } /*! Get disc type associated with cd object. */ static discmode_t get_discmode_aix (void *p_user_data) { _img_private_t *p_env = p_user_data; struct mode_form_op media; int ret; memset(&media, 0, sizeof(media)); /* Get the media info */ media.action= CD_GET_MODE; if((ret = ioctl(p_env->gen.fd, DK_CD_MODE, &media)) != 0) { cdio_warn ("DK_CD_MODE failed: %s", strerror(errno)); return CDIO_DISC_MODE_NO_INFO; } switch(media.cd_mode_form) { case CD_DA: return CDIO_DISC_MODE_CD_DA; case DVD_ROM: return CDIO_DISC_MODE_DVD_ROM; case DVD_RAM: return CDIO_DISC_MODE_DVD_RAM; case DVD_RW: return CDIO_DISC_MODE_DVD_RW; default: /* no valid match */ return CDIO_DISC_MODE_NO_INFO; } } /*! Get format of track. */ static track_format_t get_track_format_aix(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if ( !p_env ) return TRACK_FORMAT_ERROR; if (!p_env->gen.init) init_aix(p_env); if (!p_env->gen.toc_init) read_toc_aix (p_user_data) ; if ( (i_track > p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) return TRACK_FORMAT_ERROR; i_track -= p_env->gen.i_first_track; #ifdef FINISHED /* This is pretty much copied from the "badly broken" cdrom_count_tracks in linux/cdrom.c. */ if (p_env->tocent[i_track].cdte_ctrl & CDROM_DATA_TRACK) { if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_CDI_TRACK) return TRACK_FORMAT_CDI; else if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_XA_TRACK) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; #else return TRACK_FORMAT_ERROR; #endif } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool _cdio_get_track_green(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if ( !p_env ) return false; if (!p_env->gen.init) init_aix(p_env); if (!p_env->gen.toc_init) read_toc_aix (p_env) ; if (i_track >= p_env->gen.i_tracks+p_env->gen.i_first_track || i_track < p_env->gen.i_first_track) return false; i_track -= p_env->gen.i_first_track; /* FIXME: Dunno if this is the right way, but it's what I was using in cd-info for a while. */ #ifdef FINISHED return ((p_env->tocent[i_track].cdte_ctrl & 2) != 0); #else return false; #endif } /*! Return the starting MSF (minutes/secs/frames) for track number track_num in obj. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified either by using track_num LEADOUT_TRACK or the total tracks+1. False is returned if there is no entry. */ static bool _cdio_get_track_msf(void *p_user_data, track_t i_track, msf_t *msf) { _img_private_t *p_env = p_user_data; if (NULL == msf) return false; if (!p_env->gen.init) init_aix(p_env); if (!p_env->gen.toc_init) read_toc_aix (p_env) ; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks + p_env->gen.i_first_track; #ifdef FINISHED if (i_track > (p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) { return false; } else { struct cdrom_tocentry *msf0 = &p_env->tocent[i_track-1]; msf->m = to_bcd8(msf0->cdte_addr.msf.minute); msf->s = to_bcd8(msf0->cdte_addr.msf.second); msf->f = to_bcd8(msf0->cdte_addr.msf.frame); return true; } #else return FALSE; #endif } #else /*! Return a string containing the default VCD device if none is specified. */ char * cdio_get_default_device_aix(void) { return strdup(DEFAULT_CDIO_DEVICE); } #endif /* HAVE_AIX_CDROM */ /*! Return an array of strings giving possible CD devices. */ char ** cdio_get_devices_aix (void) { #ifndef HAVE_AIX_CDROM return NULL; #else struct stat st; char **drives = NULL; unsigned int i_files=0; #ifdef HAVE_GLOB_H unsigned int i; glob_t globbuf; globbuf.gl_offs = 0; glob("/dev/rcd?", 0, NULL, &globbuf); for (i=0; iaccess_mode = _AM_CTRL_SCSI; _data->gen.init = false; _data->gen.toc_init = false; _data->gen.fd = -1; _data->gen.b_cdtext_error = false; if (NULL == psz_orig_source) { psz_source = cdio_get_default_device_aix(); if (NULL == psz_source) { free(_data); return NULL; } _set_arg_aix(_data, "source", psz_source); free(psz_source); } else { if (cdio_is_device_generic(psz_orig_source)) _set_arg_aix(_data, "source", psz_orig_source); else { /* The below would be okay if all device drivers worked this way. */ #if 0 cdio_info ("source %s is not a device", psz_orig_source); #endif return NULL; } } ret = cdio_new ( (void *) _data, &_funcs ); if (ret == NULL) return NULL; ret->driver_id = DRIVER_AIX; if (init_aix(_data)) return ret; else { cdio_generic_free (_data); free(ret); return NULL; } #else return NULL; #endif /* HAVE_AIX_CDROM */ } bool cdio_have_aix (void) { #ifdef HAVE_AIX_CDROM return true; #else return false; #endif /* HAVE_AIX_CDROM */ } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/audio.c000066400000000000000000000103101474051130400164200ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! Audio (via line output) related routines. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include #include "cdio_private.h" /* Return the number of seconds (discarding frame portion) of an MSF */ uint32_t cdio_audio_get_msf_seconds(msf_t *p_msf) { return cdio_from_bcd8(p_msf->m)*CDIO_CD_SECS_PER_MIN + cdio_from_bcd8(p_msf->s); } /*! Get volume of an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_get_volume (CdIo_t *p_cdio, /*out*/ cdio_audio_volume_t *p_volume) { cdio_audio_volume_t temp_audio_volume; if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_volume) p_volume = &temp_audio_volume; if (p_cdio->op.audio_get_volume) { return p_cdio->op.audio_get_volume (p_cdio->env, p_volume); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Playing CD through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_pause (CdIo_t *p_cdio) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_pause) { return p_cdio->op.audio_pause (p_cdio->env); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Playing CD through analog output at the given MSF. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_play_msf (CdIo_t *p_cdio, msf_t *p_start_msf, msf_t *p_end_msf) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_play_msf) { return p_cdio->op.audio_play_msf (p_cdio->env, p_start_msf, p_end_msf); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Playing CD through analog output @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_play_track_index (CdIo_t *p_cdio, cdio_track_index_t *p_track_index) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_play_track_index) { return p_cdio->op.audio_play_track_index (p_cdio->env, p_track_index); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Get subchannel information. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_read_subchannel (CdIo_t *p_cdio, cdio_subchannel_t *p_subchannel) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_read_subchannel) { return p_cdio->op.audio_read_subchannel(p_cdio->env, p_subchannel); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_resume (CdIo_t *p_cdio) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_resume) { return p_cdio->op.audio_resume(p_cdio->env); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Set volume of an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_set_volume (CdIo_t *p_cdio, cdio_audio_volume_t *p_volume) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_set_volume) { return p_cdio->op.audio_set_volume(p_cdio->env, p_volume); } else { return DRIVER_OP_UNSUPPORTED; } } /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ driver_return_code_t cdio_audio_stop (CdIo_t *p_cdio) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.audio_stop) { return p_cdio->op.audio_stop(p_cdio->env); } else { return DRIVER_OP_UNSUPPORTED; } } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/cd_types.c000066400000000000000000000250421474051130400171410ustar00rootroot00000000000000/* Copyright (C) 2003-2005, 2006, 2008, 2011, 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This tries to determine what kind of CD-image or filesystems on a track we've got. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include /* Subject: -65- How can I read an IRIX (EFS) CD-ROM on a machine which doesn't use EFS? Date: 18 Jun 1995 00:00:01 EST You want 'efslook', at ftp://viz.tamu.edu/pub/sgi/software/efslook.tar.gz. and ! Robert E. Seastrom 's software (with source ! code) for using an SGI CD-ROM on a Macintosh is at ! ftp://bifrost.seastrom.com/pub/mac/CDROM-Jumpstart.sit151.hqx. */ /** The below variables are trickery to force enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ cdio_fs_cap_t debug_cdio_fs_cap; cdio_fs_t debug_cdio_fs; static char buffer[6][CDIO_CD_FRAMESIZE_RAW]; /* for CD-Data */ /* Some interesting sector numbers stored in the above buffer. */ #define ISO_SUPERBLOCK_SECTOR 16 /* buffer[0] */ #define UFS_SUPERBLOCK_SECTOR 4 /* buffer[2] */ #define BOOT_SECTOR 17 /* buffer[3] */ #define VCD_INFO_SECTOR 150 /* buffer[4] */ #define XISO_SECTOR 32 /* buffer[4] */ #define UDFX_SECTOR 32 /* buffer[4] */ #define UDF_ANCHOR_SECTOR 256 /* buffer[5] */ typedef struct signature { unsigned int buf_num; unsigned int offset; char sig_str[60]; char description[60]; } signature_t; static const signature_t sigs[] = { /*buffer[x] off look for description */ {0, 0, "MICROSOFT*XBOX*MEDIA", "XBOX CD"}, {0, 1, "BEA01", "UDF"}, {0, 1, ISO_STANDARD_ID, "ISO 9660"}, {0, 1, "CD-I", "CD-I"}, {0, 8, "CDTV", "CDTV"}, {0, 8, "CD-RTOS", "CD-RTOS"}, {0, 9, "CDROM", "HIGH SIERRA"}, {0, 16, "CD-BRIDGE", "BRIDGE"}, {0, ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING, "XA"}, {1, 64, "PPPPHHHHOOOOTTTTOOOO____CCCCDDDD", "PHOTO CD"}, {1, 0x438, "\x53\xef", "EXT2 FS"}, {2, 1372, "\x54\x19\x01\x0", "UFS"}, {3, 7, "EL TORITO", "BOOTABLE"}, {4, 0, "VIDEO_CD", "VIDEO CD"}, {4, 0, "SUPERVCD", "SVCD or Chaoji VCD"} }; /* The below index into the above sigs array. Make sure things match. */ #define INDEX_XISO 0 /* Microsoft X-BOX filesystem */ #define INDEX_UDF 1 #define INDEX_ISOFS 2 #define INDEX_CD_I 3 #define INDEX_CDTV 4 #define INDEX_CD_RTOS 5 #define INDEX_HS 6 #define INDEX_BRIDGE 7 #define INDEX_XA 8 #define INDEX_PHOTO_CD 9 #define INDEX_EXT2 10 #define INDEX_UFS 11 #define INDEX_BOOTABLE 12 #define INDEX_VIDEO_CD 13 /* Video CD */ #define INDEX_SVCD 14 /* CVD *or* SVCD */ /* Read a particular block into the global array to be used for further analysis later. */ static driver_return_code_t _cdio_read_block(const CdIo_t *p_cdio, int superblock, uint32_t offset, uint8_t bufnum, track_t i_track) { unsigned int track_sec_count = cdio_get_track_sec_count(p_cdio, i_track); memset(buffer[bufnum], 0, CDIO_CD_FRAMESIZE); if ( track_sec_count < superblock) { cdio_debug("reading block %u skipped track %d has only %u sectors\n", superblock, i_track, track_sec_count); return DRIVER_OP_ERROR; } cdio_debug("about to read sector %lu\n", (long unsigned int) offset+superblock); return cdio_read_data_sectors (p_cdio, buffer[bufnum], offset+superblock, ISO_BLOCKSIZE, 1); } /* Return true if the previously read-in buffer contains a "signature" that matches index "num". */ static bool _cdio_is_it(int num) { const signature_t *sigp=&sigs[num]; int len=strlen(sigp->sig_str); /* TODO: check that num < largest sig. */ return 0 == memcmp(&buffer[sigp->buf_num][sigp->offset], sigp->sig_str, len); } static int _cdio_is_hfs(void) { return (0 == memcmp(&buffer[1][512],"PM",2)) || (0 == memcmp(&buffer[1][512],"TS",2)) || (0 == memcmp(&buffer[1][1024], "BD",2)); } static int _cdio_is_3do(void) { return (0 == memcmp(&buffer[1][0],"\x01\x5a\x5a\x5a\x5a\x5a\x01", 7)) && (0 == memcmp(&buffer[1][40], "CD-ROM", 6)); } static int _cdio_is_joliet(void) { return 2 == buffer[3][0] && buffer[3][88] == 0x25 && buffer[3][89] == 0x2f; } static int _cdio_is_UDF(void) { return 2 == ((uint16_t)buffer[5][0] | ((uint16_t)buffer[5][1] << 8)); } /* ISO 9660 volume space in M2F1_SECTOR_SIZE byte units */ static int _cdio_get_iso9660_fs_sec_count(void) { return ((buffer[0][80] & 0xff) | ((buffer[0][81] & 0xff) << 8) | ((buffer[0][82] & 0xff) << 16) | ((buffer[0][83] & 0xff) << 24)); } static uint8_t _cdio_get_joliet_level( void ) { switch (buffer[3][90]) { case 0x40: return 1; case 0x43: return 2; case 0x45: return 3; } return 0; } /* Try to determine what kind of CD-image and/or filesystem we have at track i_track. Return information about the CD image is returned in cdio_analysis and the return value. */ cdio_fs_anal_t cdio_guess_cd_type(const CdIo_t *p_cdio, int start_session, track_t i_track, /*out*/ cdio_iso_analysis_t *iso_analysis) { int ret = CDIO_FS_UNKNOWN; bool sector0_read_ok; if (TRACK_FORMAT_AUDIO == cdio_get_track_format(p_cdio, i_track)) return CDIO_FS_AUDIO; if ( DRIVER_OP_SUCCESS != _cdio_read_block(p_cdio, ISO_PVD_SECTOR, start_session, 0, i_track) ) return CDIO_FS_UNKNOWN; if ( _cdio_is_it(INDEX_XISO) ) return CDIO_FS_ANAL_XISO; if ( DRIVER_OP_SUCCESS != _cdio_read_block(p_cdio, ISO_SUPERBLOCK_SECTOR, start_session, 0, i_track) ) return ret; if ( _cdio_is_it(INDEX_UDF) ) { /* Detect UDF version Test if we have a valid version of UDF the xbox can read natively */ if (_cdio_read_block(p_cdio, 35, start_session, 5, i_track) < 0) return CDIO_FS_UNKNOWN; iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240]; iso_analysis->UDFVerMajor=(unsigned int)buffer[5][241]; /* Read disc label */ if (_cdio_read_block(p_cdio, 32, start_session, 5, i_track) < 0) return CDIO_FS_UDF; strncpy(iso_analysis->iso_label, buffer[5]+25, 33); iso_analysis->iso_label[32] = '\0'; return CDIO_FS_UDF; } /* We have something that smells of a filesystem. */ if (_cdio_is_it(INDEX_CD_I) && _cdio_is_it(INDEX_CD_RTOS) && !_cdio_is_it(INDEX_BRIDGE) && !_cdio_is_it(INDEX_XA)) { return (CDIO_FS_INTERACTIVE | CDIO_FS_ANAL_ISO9660_ANY); } else { /* read sector 0 ONLY, when NO greenbook CD-I !!!! */ sector0_read_ok = _cdio_read_block(p_cdio, 0, start_session, 1, i_track) == 0; if (_cdio_is_it(INDEX_HS)) ret |= CDIO_FS_HIGH_SIERRA; else if (_cdio_is_it(INDEX_ISOFS)) { if (_cdio_is_it(INDEX_CD_RTOS) && _cdio_is_it(INDEX_BRIDGE)) ret = (CDIO_FS_ISO_9660_INTERACTIVE | CDIO_FS_ANAL_ISO9660_ANY); else if (_cdio_is_hfs()) ret = CDIO_FS_ISO_HFS; else ret = (CDIO_FS_ISO_9660 | CDIO_FS_ANAL_ISO9660_ANY); iso_analysis->isofs_size = _cdio_get_iso9660_fs_sec_count(); strncpy(iso_analysis->iso_label, buffer[0]+40,33); iso_analysis->iso_label[32] = '\0'; if ( _cdio_read_block(p_cdio, UDF_ANCHOR_SECTOR, start_session, 5, i_track) < 0) return ret; /* Maybe there is an UDF anchor in IOS session so its ISO/UDF session and we prefere UDF */ if ( _cdio_is_UDF() ) { /* Detect UDF version. Test if we have a valid version of UDF the xbox can read natively */ if ( _cdio_read_block(p_cdio, 35, start_session, 5, i_track) < 0) return ret; iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240]; iso_analysis->UDFVerMajor=(unsigned int)buffer[5][241]; #if 0 /* We are using ISO/UDF cd's as iso, no need to get UDF disc label */ if (_cdio_read_block(p_cdio, 32, start_session, 5, i_track) < 0) return ret; stnrcpy(iso_analysis->iso_label, buffer[5]+25, 33); iso_analysis->iso_label[32] = '\0'; #endif ret=CDIO_FS_ISO_UDF; } #if 0 if (_cdio_is_rockridge()) ret |= CDIO_FS_ANAL_ROCKRIDGE; #endif if (_cdio_read_block(p_cdio, BOOT_SECTOR, start_session, 3, i_track) < 0) return ret; if (_cdio_is_joliet()) { iso_analysis->joliet_level = _cdio_get_joliet_level(); ret |= (CDIO_FS_ANAL_JOLIET | CDIO_FS_ANAL_ISO9660_ANY); } if (_cdio_is_it(INDEX_BOOTABLE)) ret |= CDIO_FS_ANAL_BOOTABLE; if ( _cdio_is_it(INDEX_XA) && _cdio_is_it(INDEX_ISOFS) && !(sector0_read_ok && _cdio_is_it(INDEX_PHOTO_CD)) ) { if ( _cdio_read_block(p_cdio, VCD_INFO_SECTOR, start_session, 4, i_track) < 0 ) return ret; if (_cdio_is_it(INDEX_BRIDGE) && _cdio_is_it(INDEX_CD_RTOS)) { ret |= CDIO_FS_ANAL_ISO9660_ANY; if (_cdio_is_it(INDEX_VIDEO_CD)) ret |= CDIO_FS_ANAL_VIDEOCD; else if (_cdio_is_it(INDEX_SVCD)) ret |= CDIO_FS_ANAL_SVCD; } else if (_cdio_is_it(INDEX_SVCD)) ret |= CDIO_FS_ANAL_CVD; } } else if (_cdio_is_hfs()) ret |= CDIO_FS_HFS; else if (sector0_read_ok && _cdio_is_it(INDEX_EXT2)) ret |= (CDIO_FS_EXT2 | CDIO_FS_ANAL_ISO9660_ANY); else if (_cdio_is_3do()) ret |= CDIO_FS_3DO; else { if ( _cdio_read_block(p_cdio, UFS_SUPERBLOCK_SECTOR, start_session, 2, i_track) < 0 ) return ret; if (sector0_read_ok && _cdio_is_it(INDEX_UFS)) ret |= CDIO_FS_UFS; else ret |= CDIO_FS_UNKNOWN; } } /* other checks */ if (_cdio_is_it(INDEX_XA)) ret |= (CDIO_FS_ANAL_XA | CDIO_FS_ANAL_ISO9660_ANY); if (_cdio_is_it(INDEX_PHOTO_CD)) ret |= (CDIO_FS_ANAL_PHOTO_CD | CDIO_FS_ANAL_ISO9660_ANY); if (_cdio_is_it(INDEX_CDTV)) ret |= CDIO_FS_ANAL_CDTV; return ret; } libcdio-2.2.0/lib/driver/cdio.c000066400000000000000000000045751474051130400162550ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2011 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "cdio_assert.h" #include #include #include "cdio_private.h" /*! Return the value associatied with key. NULL is returned if obj is NULL or "key" does not exist. */ const char * cdio_get_arg (const CdIo *obj, const char key[]) { if (obj == NULL) return NULL; if (obj->op.get_arg) { return obj->op.get_arg (obj->env, key); } else { return NULL; } } CdIo_t * cdio_new (generic_img_private_t *p_env, cdio_funcs_t *p_funcs) { CdIo_t *p_new_cdio = calloc(1, sizeof (CdIo_t)); if (NULL == p_new_cdio) return NULL; p_new_cdio->env = p_env; /* This is the private "environment" that driver-dependent routines use. */ p_new_cdio->op = *p_funcs; p_env->cdio = p_new_cdio; /* A way for the driver-dependent routines to access the higher-level general cdio object. */ return p_new_cdio; } /*! Set the arg "key" with "value" in the source device. */ driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[], const char value[]) { if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_cdio->op.set_arg) return DRIVER_OP_UNSUPPORTED; if (!key) return DRIVER_OP_ERROR; return p_cdio->op.set_arg (p_cdio->env, key, value); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/cdio_assert.h000066400000000000000000000030641474051130400176330ustar00rootroot00000000000000/* Copyright (C) 2008, 2011, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_ASSERT_H_ #define CDIO_ASSERT_H_ #if defined(__GNUC__) && !defined(__MINGW32__) #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #define cdio_assert(expr) \ { \ if (GNUC_UNLIKELY (!(expr))) cdio_log (CDIO_LOG_ASSERT, \ "file %s: line %d (%s): assertion failed: (%s)", \ __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ } #define cdio_assert_not_reached() \ { \ cdio_log (CDIO_LOG_ASSERT, \ "file %s: line %d (%s): should not be reached", \ __FILE__, __LINE__, __PRETTY_FUNCTION__); \ } #else /* non GNU C */ #include #define cdio_assert(expr) \ assert(expr) #define cdio_assert_not_reached() \ assert(0) #endif #endif /* CDIO_ASSERT_H_ */ libcdio-2.2.0/lib/driver/cdio_private.h000066400000000000000000000442211474051130400200040ustar00rootroot00000000000000/* Copyright (C) 2003-2005, 2008-2009, 2011-2012, 2016-2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Internal routines for CD I/O drivers. */ #ifndef CDIO_DRIVER_PRIVATE_H_ #define CDIO_DRIVER_PRIVATE_H_ #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) # include "config.h" #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include "mmc/mmc_private.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef HAVE_STRNDUP #undef strndup #define strndup libcdio_strndup static inline char *libcdio_strndup(const char *s, size_t n) { char *result; size_t len = strlen (s); if (n < len) len = n; result = (char *) malloc (len + 1); if (!result) return 0; result[len] = '\0'; return (char *) memcpy (result, s, len); } #endif /*HAVE_STRNDUP*/ /*! Get directory name from file name. Callers must free return value after use. */ extern char *cdio_dirname(const char *fname); /*! Construct an absolute file name from path and file name. Callers must free return value after use. */ extern char *cdio_abspath(const char *cwd, const char *fname); /* Opaque type */ typedef struct _CdioDataSource CdioDataSource_t; #ifdef __cplusplus } #endif /* __cplusplus */ #include "generic.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct { /*! Get volume of an audio CD. @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_get_volume) (void *p_env, /*out*/ cdio_audio_volume_t *p_volume); /*! Pause playing CD through analog output @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_pause) (void *p_env); /*! Playing CD through analog output @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_play_msf) ( void *p_env, msf_t *p_start_msf, msf_t *p_end_msf ); /*! Playing CD through analog output @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_play_track_index) ( void *p_env, cdio_track_index_t *p_track_index ); /*! Get subchannel information. @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_read_subchannel) ( void *p_env, cdio_subchannel_t *subchannel ); /*! Resume playing an audio CD. @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_resume) ( void *p_env ); /*! Set volume of an audio CD. @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_set_volume) ( void *p_env, cdio_audio_volume_t *p_volume ); /*! Stop playing an audio CD. @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_stop) ( void *p_env ); /*! Eject media in CD drive. If successful, as a side effect we also free p_env. @param p_env the CD object to be acted upon. If the CD is ejected *p_env is freed and p_env set to NULL. */ driver_return_code_t (*eject_media) ( void *p_env ); /*! Release and free resources associated with cd. */ void (*free) (void *p_env); /*! Return the value associated with the key "arg". */ const char * (*get_arg) (void *p_env, const char key[]); /*! Get the block size for subsequest read requests, via a SCSI MMC MODE_SENSE 6 command. */ int (*get_blocksize) ( void *p_env ); /*! Get cdtext information for a CdIo object. @param obj the CD object that may contain CD-TEXT information. @return the CD-TEXT object or NULL if obj is NULL or CD-TEXT information does not exist. */ cdtext_t * (*get_cdtext) ( void *p_env ); /*! Get raw cdtext information as on the disc for a CdIo object @param obj the CD object that may contain CD-TEXT information. @return pointer to the raw CD-TEXT data or NULL if obj is NULL or no CD-TEXT information present on the disc. free when done and not NULL. */ uint8_t * (*get_cdtext_raw) ( void *p_env ); /*! Return an array of device names. if CdIo is NULL (we haven't initialized a specific device driver), then find a suitable device driver. NULL is returned if we couldn't return a list of devices. */ char ** (*get_devices) ( void ); /*! Get the default CD device. @return a string containing the default CD device or NULL is if we couldn't get a default device. In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ char * (*get_default_device) ( void ); /*! Return the size of the CD in logical block address (LBA) units. @return the lsn. On error 0 or CDIO_INVALD_LSN. */ lsn_t (*get_disc_last_lsn) ( void *p_env ); /*! Get disc mode associated with cd_obj. */ discmode_t (*get_discmode) ( void *p_env ); /*! Return the what kind of device we've got. See cd_types.h for a list of bitmasks for the drive type; */ void (*get_drive_cap) (const void *p_env, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); /*! Return the number of of the first track. CDIO_INVALID_TRACK is returned on error. */ track_t (*get_first_track_num) ( void *p_env ); /*! Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. False is returned if we had an error getting the information. */ bool (*get_hwinfo) ( const CdIo_t *p_cdio, /* out*/ cdio_hwinfo_t *p_hw_info ); /*! Get the LSN of the first track of the last session of on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ driver_return_code_t (*get_last_session) ( void *p_env, /*out*/ lsn_t *i_last_session ); /*! Find out if media has changed since the last call. @param p_env the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ int (*get_media_changed) ( const void *p_env ); /*! Return the media catalog number MCN from the CD or NULL if there is none or we don't have the ability to get it. */ char * (*get_mcn) ( const void *p_env ); /*! Return the number of tracks in the current medium. CDIO_INVALID_TRACK is returned on error. */ track_t (*get_num_tracks) ( void *p_env ); /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int (*get_track_channels) ( const void *p_env, track_t i_track ); /*! Return 0 if track is copy protected, 1 if not, or -1 for error or -2 if not implimented (yet). Is this meaningful if not an audio track? */ track_flag_t (*get_track_copy_permit) ( void *p_env, track_t i_track ); /*! Return the starting LBA for track number i_track in p_env. Tracks numbers start at 1. The "leadout" track is specified either by using track_num LEADOUT_TRACK or the total tracks+1. CDIO_INVALID_LBA is returned on error. */ lba_t (*get_track_lba) ( void *p_env, track_t i_track ); /*! Return the starting LBA for the pregap for track number i_track in p_env. Tracks numbers start at 1. CDIO_INVALID_LBA is returned on error. */ lba_t (*get_track_pregap_lba) ( const void *p_env, track_t i_track ); /*! Return the International Standard Recording Code (ISRC) for track number i_track in p_cdio. Track numbers start at 1. Note: string is malloc'd so caller has to free() the returned string when done with it. */ char * (*get_track_isrc) ( const void *p_env, track_t i_track ); /*! Get format of track. */ track_format_t (*get_track_format) ( void *p_env, track_t i_track ); /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ bool (*get_track_green) ( void *p_env, track_t i_track ); /*! Return the starting MSF (minutes/secs/frames) for track number i_track in p_env. Tracks numbers start at 1. The "leadout" track is specified either by using i_track LEADOUT_TRACK or the total tracks+1. False is returned on error. */ bool (*get_track_msf) ( void *p_env, track_t i_track, msf_t *p_msf ); /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error or -2 if not implimented (yet). Is this meaningful if not an audio track? */ track_flag_t (*get_track_preemphasis) ( const void *p_env, track_t i_track ); /*! lseek - reposition read/write file offset Returns (off_t) -1 on error. Similar to libc's lseek() */ off_t (*lseek) ( void *p_env, off_t offset, int whence ); /*! Reads into buf the next size bytes. Returns -1 on error. Similar to libc's read() */ ssize_t (*read) ( void *p_env, void *p_buf, size_t i_size ); /*! Reads a single mode2 sector from cd device into buf starting from lsn. Returns 0 if no error. */ int (*read_audio_sectors) ( void *p_env, void *p_buf, lsn_t i_lsn, unsigned int i_blocks ); /*! Read a data sector @param p_env environment to read from @param p_buf place to read data into. The caller should make sure this location can store at least CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. */ driver_return_code_t (*read_data_sectors) ( void *p_env, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ); /*! Reads a single mode2 sector from cd device into buf starting from lsn. Returns 0 if no error. */ int (*read_mode2_sector) ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2 ); /*! Reads i_blocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ int (*read_mode2_sectors) ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2, unsigned int i_blocks ); /*! Reads a single mode1 sector from cd device into buf starting from lsn. Returns 0 if no error. */ int (*read_mode1_sector) ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2 ); /*! Reads i_blocks of mode1 sectors from cd device into data starting from lsn. Returns 0 if no error. */ int (*read_mode1_sectors) ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2, unsigned int i_blocks ); bool (*read_toc) ( void *p_env ) ; /*! Run a SCSI MMC command. cdio CD structure set by cdio_open(). i_timeout_ms time in milliseconds we will wait for the command to complete. cdb_len number of bytes in cdb (6, 10, or 12). cdb CDB bytes. All values that are needed should be set on input. b_return_data TRUE if the command expects data to be returned in the buffer len Size of buffer buf Buffer for data, both sending and receiving Returns 0 if command completed successfully. */ mmc_run_cmd_fn_t run_mmc_cmd; /*! Set the arg "key" with "value" in the source device. */ int (*set_arg) ( void *p_env, const char key[], const char value[] ); /*! Set the blocksize for subsequent reads. */ driver_return_code_t (*set_blocksize) ( void *p_env, uint16_t i_blocksize ); /*! Set the drive speed. @return 0 if everything went okay, -1 if we had an error. is -2 returned if this is not implemented for the current driver. */ int (*set_speed) ( void *p_env, int i_speed ); } cdio_funcs_t; typedef struct { uint16_t u_type; uint16_t u_flags; } cdio_header_t; #define CDIO_HEADER_TYPE_CDIO 0x0000 #define CDIO_HEADER_TYPE_ISO 0x0001 #define CDIO_HEADER_FLAGS_DISABLE_RR_DD 0x0001 /*! Implementation of CdIo type */ struct _CdIo { cdio_header_t header; /**< Internal header - MUST come first. */ driver_id_t driver_id; /**< Particular driver opened. */ cdio_funcs_t op; /**< driver-specific routines handling implementation. */ void* env; /**< environment. Passed to routine above. */ }; /* This is used in drivers that must keep their own internal position pointer for doing seeks. Stream-based drivers (like bincue, nrg, toc, network) would use this. */ typedef struct { off_t buff_offset; /* buffer offset in disk-image seeks. */ track_t index; /* Current track index in tocent. */ lba_t lba; /* Current LBA */ } internal_position_t; CdIo_t * cdio_new (generic_img_private_t *p_env, cdio_funcs_t *p_funcs); /* The below structure describes a specific CD Input driver */ typedef struct { driver_id_t id; unsigned int flags; const char *name; const char *describe; bool (*have_driver) (void); CdIo_t *(*driver_open) (const char *psz_source_name); CdIo_t *(*driver_open_am) (const char *psz_source_name, const char *psz_access_mode); char *(*get_default_device) (void); bool (*is_device) (const char *psz_source_name); char **(*get_devices) (void); driver_return_code_t (*close_tray) (const char *psz_device); } CdIo_driver_t; /* The below array gives of the drivers that are currently available for on a particular host. */ extern CdIo_driver_t CdIo_driver[]; /* The last valid entry of Cdio_driver. -1 means uninitialzed. -2 means some sort of error. */ extern int CdIo_last_driver; /* The below array gives all drivers that can possibly appear. on a particular host. */ extern CdIo_driver_t CdIo_all_drivers[]; /*! Add/allocate a drive to the end of drives. Use cdio_free_device_list() to free this device_list. */ void cdio_add_device_list(char **device_list[], const char *psz_drive, unsigned int *i_drives); driver_return_code_t close_tray_bsdi (const char *psz_drive); driver_return_code_t close_tray_freebsd (const char *psz_drive); driver_return_code_t close_tray_linux (const char *psz_drive); driver_return_code_t close_tray_netbsd (const char *psz_drive); driver_return_code_t close_tray_osx (const char *psz_drive); driver_return_code_t close_tray_solaris (const char *psz_drive); driver_return_code_t close_tray_win32 (const char *psz_drive); bool cdio_have_netbsd(void); CdIo_t * cdio_open_netbsd (const char *psz_source); char * cdio_get_default_device_netbsd(void); char **cdio_get_devices_netbsd(void); /*! Set up CD-ROM for reading using the NetBSD driver. The device_name is the some sort of device name. NULL is returned on error or there is no FreeBSD driver. @see cdio_open_cd, cdio_open */ CdIo_t * cdio_open_am_netbsd (const char *psz_source, const char *psz_access_mode); /*! DEPRICATED: use cdio_have_driver(). True if AIX driver is available. */ bool cdio_have_aix (void); /*! DEPRICATED: use cdio_have_driver(). True if BSDI driver is available. */ bool cdio_have_bsdi (void); /*! DEPRICATED: use cdio_have_driver(). True if FreeBSD driver is available. */ bool cdio_have_freebsd (void); /*! DEPRICATED: use cdio_have_driver(). True if GNU/Linux driver is available. */ bool cdio_have_linux (void); /*! DEPRICATED: use cdio_have_driver(). True if Sun Solaris driver is available. */ bool cdio_have_solaris (void); /*! DEPRICATED: use cdio_have_driver(). True if IBM OS2 driver is available. */ bool cdio_have_os2 (void); /*! DEPRICATED: use cdio_have_driver(). True if Apple OSX driver is available. */ bool cdio_have_osx (void); /*! DEPRICATED: use cdio_have_driver(). True if Microsoft Windows driver is available. */ bool cdio_have_win32 (void); /*! True if Nero driver is available. */ bool cdio_have_nrg (void); /*! True if BIN/CUE driver is available. */ bool cdio_have_bincue (void); /*! True if cdrdao CDRDAO driver is available. */ bool cdio_have_cdrdao (void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_DRIVER_PRIVATE_H_ */ libcdio-2.2.0/lib/driver/cdtext.c000066400000000000000000000575571474051130400166420ustar00rootroot00000000000000/* Copyright (C) 2018 Thomas Schmitt Copyright (C) 2004-2005, 2008, 2011, 2012, 2013 Rocky Bernstein toc reading routine adapted from cuetools Copyright (C) 2003 Svend Sanjay Sorensen 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include "cdtext_private.h" #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #define _CDTEXT_DBCC #define MAX_CDTEXT_GENRE_CODE 28 #define MAX_CDTEXT_LANGUAGE_CODE 127 const char *cdtext_field[MAX_CDTEXT_FIELDS] = { "TITLE", "PERFORMER", "SONGWRITER", "COMPOSER", "MESSAGE", "ARRANGER", "ISRC", "UPC_EAN", "GENRE", "DISC_ID", }; const char *cdtext_genre[MAX_CDTEXT_GENRE_CODE] = { "Not Used", "Not Defined", "Adult Contemporary", "Alternative Rock", "Childrens Music", "Classical", "Contemporary Christian", "Country", "Dance", "Easy Listening", "Erotic", "Folk", "Gospel", "Hip Hop", "Jazz", "Latin", "Musical", "New Age", "Opera", "Operetta", "Pop Music", "Rap", "Reggae", "Rock Music", "Rhythm & Blues", "Sound Effects", "Spoken Word", "World Music" }; const char *cdtext_language[MAX_CDTEXT_LANGUAGE_CODE + 1] = { "Unknown", "Albanian", "Breton", "Catalan", "Croatian", "Welsh", "Czech", "Danish", "German", "English", "Spanish", "Esperanto", "Estonian", "Basque", "Faroese", "French", "Frisian", "Irish", "Gaelic", "Galician", "Icelandic", "Italian", "Lappish", "Latin", "Latvian", "Luxembourgian", "Lithuanian", "Hungarian", "Maltese", "Dutch", "Norwegian", "Occitan", "Polish", "Portuguese", "Romanian", "Romansh", "Serbian", "Slovak", "Slovenian", "Finnish", "Swedish", "Turkish", "Flemish", "Wallon", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Zulu", "Vietnamese", "Uzbek", "Urdu", "Ukrainian", "Thai", "Telugu", "Tatar", "Tamil", "Tadzhik", "Swahili", "SrananTongo", "Somali", "Sinhalese", "Shona", "Serbo-croat", "Ruthenian", "Russian", "Quechua", "Pushtu", "Punjabi", "Persian", "Papamiento", "Oriya", "Nepali", "Ndebele", "Marathi", "Moldavian", "Malaysian", "Malagasay", "Macedonian", "Laotian", "Korean", "Khmer", "Kazakh", "Kannada", "Japanese", "Indonesian", "Hindi", "Hebrew", "Hausa", "Gurani", "Gujurati", "Greek", "Georgian", "Fulani", "Dari", "Churash", "Chinese", "Burmese", "Bulgarian", "Bengali", "Bielorussian", "Bambora", "Azerbaijani", "Assamese", "Armenian", "Arabic", "Amharic" }; /*! Return string representation of given field type. */ const char * cdtext_field2str(cdtext_field_t i) { if (i < 0 || i >= MAX_CDTEXT_FIELDS) return "INVALID"; else return cdtext_field[i]; } /*! Return string representation of the given genre code. */ const char * cdtext_genre2str(cdtext_genre_t i) { if (i < 0 || i >= MAX_CDTEXT_GENRE_CODE) return "INVALID"; else return cdtext_genre[i]; } /*! Return string representation of the given language code. */ const char * cdtext_lang2str(cdtext_lang_t i) { if (i >= 0 && i <= CDTEXT_LANGUAGE_WALLON) return cdtext_language[i]; else if (i >= CDTEXT_LANGUAGE_ZULU && i <= CDTEXT_LANGUAGE_AMHARIC) return cdtext_language[i]; return "INVALID"; } /*! Free memory associated with the given cdtext_t object. @param p_cdtext the CD-TEXT object */ void cdtext_destroy(cdtext_t *p_cdtext) { cdtext_field_t k; track_t j; int i; if (!p_cdtext) return; for (i=0; iblock[i].track[j].field[k]) { free(p_cdtext->block[i].track[j].field[k]); p_cdtext->block[i].track[j].field[k] = NULL; } } } } free(p_cdtext); } /*! Returns a copy of the return value of cdtext_get_const or NULL. Must be freed using cdio_free() when done. @see cdtext_get_const */ char * cdtext_get(const cdtext_t *p_cdtext, cdtext_field_t field, track_t track) { const char *ret = cdtext_get_const(p_cdtext, field, track); if (NULL == ret) return NULL; else return strdup(ret); } /*! Returns value of the given field. NULL is returned if key is CDTEXT_INVALID or the field is not set. Strings are encoded in UTF-8. @param p_cdtext the CD-TEXT object @param field type of the field to return @param track specifies the track, 0 stands for disc */ const char * cdtext_get_const(const cdtext_t *p_cdtext, cdtext_field_t field, track_t track) { if (CDTEXT_FIELD_INVALID == field || NULL == p_cdtext || CDIO_CD_MAX_TRACKS < track) return NULL; return p_cdtext->block[p_cdtext->block_i].track[track].field[field]; } /*! Returns the discs genre code. @param p_cdtext the CD-TEXT object */ cdtext_genre_t cdtext_get_genre(const cdtext_t *p_cdtext) { if (NULL == p_cdtext) return CDTEXT_GENRE_UNUSED; return p_cdtext->block[p_cdtext->block_i].genre_code; } /*! Returns the currently active language. @param p_cdtext the CD-TEXT object */ cdtext_lang_t cdtext_get_language(const cdtext_t *p_cdtext) { if (NULL == p_cdtext) return CDTEXT_LANGUAGE_BLOCK_UNUSED; return p_cdtext->block[p_cdtext->block_i].language_code; } /*! Returns the first track number. @param p_cdtext the CD-TEXT object */ track_t cdtext_get_first_track(const cdtext_t *p_cdtext) { if (NULL == p_cdtext) return 0; return p_cdtext->block[p_cdtext->block_i].first_track; } /*! Returns the last track number. @param p_cdtext the CD-TEXT object */ track_t cdtext_get_last_track(const cdtext_t *p_cdtext) { if (NULL == p_cdtext) return 0; return p_cdtext->block[p_cdtext->block_i].last_track; } /*! @deprecated Use cdtext_list_languages_v2() Returns a list of available languages or NULL. __WARNING__: The indices in the returned array _do not_ match the indexing as expected by cdtext_set_language_index(). Use cdtext_select_language with the values of array elements. Internally the list is stored in a static array. @param p_cdtext the CD-TEXT object @return NULL if p_cdtext is NULL. Else an array of 8 cdtext_lang_t elements: CDTEXT_LANGUAGE_UNKNOWN not only marks language code 0x00 but also invalid language codes and invalid language blocks. */ cdtext_lang_t *cdtext_list_languages(const cdtext_t *p_cdtext) { static cdtext_lang_t avail[CDTEXT_NUM_BLOCKS_MAX]; int i, j=0; if (NULL == p_cdtext) return NULL; for (i=0; iblock[i].language_code && CDTEXT_LANGUAGE_INVALID != p_cdtext->block[i].language_code && CDTEXT_LANGUAGE_BLOCK_UNUSED != p_cdtext->block[i].language_code) avail[j++] = p_cdtext->block[i].language_code; } return avail; } /*! Returns an array of available languages or NULL. The index of an array element may be used to select the corresponding language block by call cdtext_set_language_index(). The return value is a pointer into the memory range of *p_cdtext. Do not use it after having freed that memory range. @param p_cdtext the CD-TEXT object @return NULL if p_cdtext is NULL, or an array of 8 cdtext_lang_t elements. If an enumeration is CDTEXT_LANGUAGE_INVALID, then the language block has an invalid language code. If an enumeration is CDTEXT_LANGUAGE_BLOCK_UNUSED, then the block does not exist on CD or could not be read in CD-TEXT for some reason. Otherwise, the enumeration of element will be a value in CDTEXT_LANGUAGE_UNKNOWN to CDTEXT_LANGUAGE_AMHARIC, and is a block in that language. */ cdtext_lang_t *cdtext_list_languages_v2(cdtext_t *p_cdtext) { int i; if (NULL == p_cdtext) return NULL; for (i = 0; i < CDTEXT_NUM_BLOCKS_MAX; i++) { p_cdtext->languages[i] = p_cdtext->block[i].language_code; } return p_cdtext->languages; } /*! Select the given language by block index. See cdtext_list_languages_v2(). If the index is bad, or no language block with that index was read: select the default language at index 0 and return false. @param p_cdtext the CD-TEXT object @param idx the desired index: 0 to 7. @return true on success, false if no language block is associated to idx */ bool cdtext_set_language_index(cdtext_t *p_cdtext, int idx) { if (NULL == p_cdtext) return false; p_cdtext->block_i = 0; if (idx < 0 || idx > 7) return false; if (p_cdtext->block[idx].language_code == CDTEXT_LANGUAGE_BLOCK_UNUSED) return false; p_cdtext->block_i = idx; return true; } /*! Try to select the given language. Select default language if specified is not available or invalid and return false. @param p_cdtext the CD-TEXT object @param language language identifier @return true on success, false if language is not available */ bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language) { if(NULL == p_cdtext) return false; if (CDTEXT_LANGUAGE_BLOCK_UNUSED != language) { int i; for (i=0; iblock[i].language_code) { p_cdtext->block_i = i; return true; } } } p_cdtext->block_i = 0; return false; } /*! Initialize a new cdtext structure. When the structure is no longer needed, release the resources using cdtext_delete. */ cdtext_t *cdtext_init(void) { cdtext_field_t k; track_t j; int i; cdtext_t *p_cdtext; p_cdtext = (cdtext_t *) malloc(sizeof(struct cdtext_s)); if (p_cdtext == NULL) return NULL; for (i=0; iblock[i].track[j].field[k] = NULL; } } p_cdtext->block[i].genre_code = CDTEXT_GENRE_UNUSED; p_cdtext->block[i].language_code = CDTEXT_LANGUAGE_BLOCK_UNUSED; } p_cdtext->block_i = 0; return p_cdtext; } /*! Returns associated cdtext_field_t if field is a CD-TEXT keyword. Internal function. @param key key to test @return CDTEXT_INVALID if the given keyword is invalid */ cdtext_field_t cdtext_is_field (const char *key) { unsigned int i; for (i = 0; i < MAX_CDTEXT_FIELDS ; i++) if (0 == strcmp(cdtext_field[i], key)) { return i; } return CDTEXT_FIELD_INVALID; } /*! Return the language code of a given language string representation. This is the inverse of cdtext_lang2str(). @param lang language to look up @return if lang is among the possible results of cdtext_lang2str(): the cdtext_lang_t which is associated. else: CDTEXT_LANGUAGE_INVALID */ cdtext_lang_t cdtext_str2lang (const char *lang) { unsigned int i; if(0 == lang[0]) /* The empty texts in cdtext_language[] are invalid */ return CDTEXT_LANGUAGE_INVALID; for (i = 0; i <= MAX_CDTEXT_LANGUAGE_CODE; i++) if (0 == strcmp(cdtext_language[i], lang)) { return i; } return CDTEXT_LANGUAGE_INVALID; } /*! Sets the given field at the given track to the given value. Recodes to UTF-8 if charset is not NULL. @param p_cdtext the CD-TEXT object @param key field to set @param value value to set @param track track to work on @param charset charset to convert from */ void cdtext_set(cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset) { if (NULL == value || key == CDTEXT_FIELD_INVALID || CDIO_CD_MAX_TRACKS < track) return; /* free old memory */ if (p_cdtext->block[p_cdtext->block_i].track[track].field[key]) free(p_cdtext->block[p_cdtext->block_i].track[track].field[key]); /* recode to UTF-8 */ if (NULL != charset) { cdio_utf8_t *utf8_str = NULL; cdio_charset_to_utf8((const char*) value, strlen((const char*)value), &utf8_str, charset); p_cdtext->block[p_cdtext->block_i].track[track].field[key] = (char *)utf8_str; } else p_cdtext->block[p_cdtext->block_i].track[track].field[key] = strdup((const char *)value); } #define CDTEXT_COMPARE_CHAR(buf, c, db) ((buf)[0] == c && (! db || (buf)[1] == c) ) /*! Read a binary CD-TEXT and fill a cdtext struct. @param p_cdtext the CD-TEXT object @param wdata the data @param i_data size of wdata @returns 0 on success, non-zero on failure */ int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data) { uint8_t *p_data; int j; uint8_t buffer[256]; uint8_t tab_buffer[256]; int i_buf = 0; int i_block; int i_seq = 0; int i; cdtext_blocksize_t blocksize; char *charset = NULL; uint8_t cur_track; memset( buffer, 0, sizeof(buffer) ); memset( tab_buffer, 0, sizeof(buffer) ); p_data = wdata; if (i_data < CDTEXT_LEN_PACK || 0 != i_data % CDTEXT_LEN_PACK) { cdio_warn("CD-Text size is too small or not a multiple of pack size"); return -1; } #if 0 for(i=0; i < i_data; i++) printf("%0x%c", wdata[i], ((i+1) % 18 == 0 ? '\n' : ' ')); #endif /* Iterate over blocks */ i_block = -1; while(i_data > 0) { cdtext_pack_t pack; cdtext_read_pack(&pack, p_data); if (i_block != pack.block || i_seq != pack.seq) { cdtext_pack_t tpack; i_block = pack.block; if (i_block >= CDTEXT_NUM_BLOCKS_MAX) { cdio_warn("CD-TEXT: Invalid blocknumber %d.\n", i_block); return -1; } p_cdtext->block_i = i_block; i_seq = 0; memset( &blocksize, 0, CDTEXT_LEN_BLOCKSIZE); /* first read block size information for sanity checks and encoding */ for(i=0; i <= i_data-CDTEXT_LEN_PACK; i+=CDTEXT_LEN_PACK) { if (p_data[i+0] == CDTEXT_PACK_BLOCKSIZE) { cdtext_read_pack(&tpack, p_data+i); switch (tpack.i_track) { case 0: blocksize.charcode = tpack.text[0]; blocksize.i_first_track = tpack.text[1]; blocksize.i_last_track = tpack.text[2]; blocksize.copyright = tpack.text[3]; blocksize.i_packs[0] = tpack.text[4]; blocksize.i_packs[1] = tpack.text[5]; blocksize.i_packs[2] = tpack.text[6]; blocksize.i_packs[3] = tpack.text[7]; blocksize.i_packs[4] = tpack.text[8]; blocksize.i_packs[5] = tpack.text[9]; blocksize.i_packs[6] = tpack.text[10]; blocksize.i_packs[7] = tpack.text[11]; break; case 1: blocksize.i_packs[8] = tpack.text[0]; blocksize.i_packs[9] = tpack.text[1]; blocksize.i_packs[10] = tpack.text[2]; blocksize.i_packs[11] = tpack.text[3]; blocksize.i_packs[12] = tpack.text[4]; blocksize.i_packs[13] = tpack.text[5]; blocksize.i_packs[14] = tpack.text[6]; blocksize.i_packs[15] = tpack.text[7]; blocksize.lastseq[0] = tpack.text[8]; blocksize.lastseq[1] = tpack.text[9]; blocksize.lastseq[2] = tpack.text[10]; blocksize.lastseq[3] = tpack.text[11]; break; case 2: blocksize.lastseq[4] = tpack.text[0]; blocksize.lastseq[5] = tpack.text[1]; blocksize.lastseq[6] = tpack.text[2]; blocksize.lastseq[7] = tpack.text[3]; blocksize.langcode[0] = tpack.text[4]; blocksize.langcode[1] = tpack.text[5]; blocksize.langcode[2] = tpack.text[6]; blocksize.langcode[3] = tpack.text[7]; blocksize.langcode[4] = tpack.text[8]; blocksize.langcode[5] = tpack.text[9]; blocksize.langcode[6] = tpack.text[10]; blocksize.langcode[7] = tpack.text[11]; break; } } } if(blocksize.i_packs[15] == 3) { cdtext_lang_t lcode; /* if there were 3 BLOCKSIZE packs */ /* set copyright */ p_cdtext->block[i_block].copyright = (0x03 == (blocksize.copyright & 0x03)); /* set Language */ lcode = blocksize.langcode[i_block]; if(lcode <= CDTEXT_LANGUAGE_WALLON || (lcode >= CDTEXT_LANGUAGE_ZULU && lcode <= CDTEXT_LANGUAGE_AMHARIC) ) p_cdtext->block[i_block].language_code = lcode; else p_cdtext->block[i_block].language_code = CDTEXT_LANGUAGE_INVALID; /* determine encoding */ switch (blocksize.charcode){ case CDTEXT_CHARCODE_ISO_8859_1: charset = (char *) "ISO-8859-1"; break; case CDTEXT_CHARCODE_ASCII: /* ASCII is a subset of ISO-8859-1. Some CDs announce it but then * have 8-bit characters in their text. Trying ISO-8859-1 gives * more hope for a readable result than telling iconv to be picky. */ charset = (char *) "ISO-8859-1"; break; case CDTEXT_CHARCODE_SHIFT_JIS: charset = (char *) "SHIFT_JIS"; break; default: /* Do not let charset pass here as NULL */ cdio_warn("CD-TEXT: Unknown character set code %u.\n", (unsigned int) blocksize.charcode); charset = (char *) "ISO-8859-1"; } cdio_debug("CD-TEXT character set: code=%u , name=%s , chosen=%s\n", (unsigned int) blocksize.charcode, blocksize.charcode == 0 ? "ISO-8859-1" : blocksize.charcode == 1 ? "ASCII" : blocksize.charcode == 0x80 ? "SHIFT_JIS" : "", charset); /* set track numbers */ p_cdtext->block[i_block].first_track = blocksize.i_first_track; p_cdtext->block[i_block].last_track = blocksize.i_last_track; } else { cdio_warn("CD-TEXT: No blocksize information available for block %d.\n", i_block); return -1; } } cdtext_read_pack(&pack, p_data); #ifndef _CDTEXT_DBCC if ( pack.db_chars ) { cdio_warn("CD-TEXT: Double-byte characters not supported"); return -1; } #endif cur_track = pack.i_track; /* read text packs first */ j = 0; switch (pack.type) { case CDTEXT_PACK_GENRE: /* If pack.text starts with an unprintable character, it is likely to be the genre_code. * While the specification requires the first GENRE pack to start with the 2 byte genre code, * it is not specific about the following ones. */ if (pack.text[0] <= 31) { j = 2; if (CDTEXT_GENRE_UNUSED == p_cdtext->block[i_block].genre_code) p_cdtext->block[i_block].genre_code = CDTEXT_GET_LEN16(pack.text); } case CDTEXT_PACK_TITLE: case CDTEXT_PACK_PERFORMER: case CDTEXT_PACK_SONGWRITER: case CDTEXT_PACK_COMPOSER: case CDTEXT_PACK_ARRANGER: case CDTEXT_PACK_MESSAGE: case CDTEXT_PACK_DISCID: case CDTEXT_PACK_UPC: while (j < CDTEXT_LEN_TEXTDATA) { /* not terminated */ if ( i_buf+2 >= sizeof(buffer)) { cdio_warn("CD-TEXT: Field too long."); return -1; } /* if the first character is a TAB, copy the buffer */ if ( i_buf == 0 && CDTEXT_COMPARE_CHAR(&pack.text[j], '\t', pack.db_chars)) { memcpy(tab_buffer, buffer, sizeof(tab_buffer)); } if ( ! CDTEXT_COMPARE_CHAR(&pack.text[j], '\0', pack.db_chars)) { buffer[i_buf++] = pack.text[j]; if(pack.db_chars) buffer[i_buf++] = pack.text[j+1]; } else { /* if end of string */ /* check if the buffer contains only the Tab Indicator */ if ( CDTEXT_COMPARE_CHAR(buffer, '\t', pack.db_chars) ) { if ( cur_track <= blocksize.i_first_track ) { cdio_warn("CD-TEXT: Invalid use of Tab Indicator."); return -1; } memcpy(buffer, tab_buffer, sizeof(buffer)); } else { buffer[i_buf++] = 0; if(pack.db_chars) buffer[i_buf++] = 0; } if ( ! CDTEXT_COMPARE_CHAR(buffer, '\0', pack.db_chars)) { /* implies cur_track is in valid range */ switch (pack.type) { case CDTEXT_PACK_TITLE: cdtext_set(p_cdtext, CDTEXT_FIELD_TITLE, buffer, cur_track, charset); break; case CDTEXT_PACK_PERFORMER: cdtext_set(p_cdtext, CDTEXT_FIELD_PERFORMER, buffer, cur_track, charset); break; case CDTEXT_PACK_SONGWRITER: cdtext_set(p_cdtext, CDTEXT_FIELD_SONGWRITER, buffer, cur_track, charset); break; case CDTEXT_PACK_COMPOSER: cdtext_set(p_cdtext, CDTEXT_FIELD_COMPOSER, buffer, cur_track, charset); break; case CDTEXT_PACK_ARRANGER: cdtext_set(p_cdtext, CDTEXT_FIELD_ARRANGER, buffer, cur_track, charset); break; case CDTEXT_PACK_MESSAGE: cdtext_set(p_cdtext, CDTEXT_FIELD_MESSAGE, buffer, cur_track, charset); break; case CDTEXT_PACK_DISCID: if (cur_track == 0) cdtext_set(p_cdtext, CDTEXT_FIELD_DISCID, buffer, cur_track, NULL); break; case CDTEXT_PACK_GENRE: cdtext_set(p_cdtext, CDTEXT_FIELD_GENRE, buffer, cur_track, "ASCII"); break; case CDTEXT_PACK_UPC: if (cur_track == 0) cdtext_set(p_cdtext, CDTEXT_FIELD_UPC_EAN, buffer, cur_track, "ASCII"); else cdtext_set(p_cdtext, CDTEXT_FIELD_ISRC, buffer, cur_track, "ISO-8859-1"); break; } } i_buf = 0; ++cur_track; } if (pack.db_chars) j+=2; else j+=1; } break; } /* This would be the right place to parse TOC and TOC2 fields. */ i_seq++; i_data-=CDTEXT_LEN_PACK; p_data+=CDTEXT_LEN_PACK; } /* end of while loop */ p_cdtext->block_i = 0; return 0; } /*! Fills cdtext_pack_t with information read from p_data @param p_pack out @param p_data in */ int cdtext_read_pack(cdtext_pack_t *p_pack, const uint8_t *p_data) { p_pack->type = p_data[0]; p_pack->i_track = p_data[1]; p_pack->seq = p_data[2]; p_pack->char_pos = p_data[3] & 0x0F; p_pack->block = (p_data[3] >> 4) & 0x07; p_pack->db_chars = (p_data[3] >> 7) & 0x01; p_pack->text[0] = p_data[4]; p_pack->text[1] = p_data[5]; p_pack->text[2] = p_data[6]; p_pack->text[3] = p_data[7]; p_pack->text[4] = p_data[8]; p_pack->text[5] = p_data[9]; p_pack->text[6] = p_data[10]; p_pack->text[7] = p_data[11]; p_pack->text[8] = p_data[12]; p_pack->text[9] = p_data[13]; p_pack->text[10] = p_data[14]; p_pack->text[11] = p_data[15]; p_pack->crc[0] = p_data[16]; p_pack->crc[1] = p_data[17]; return 0; } libcdio-2.2.0/lib/driver/cdtext_private.h000066400000000000000000000123131474051130400203560ustar00rootroot00000000000000/* Copyright (C) 2004-2005, 2008, 2011-2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_DRIVER_CDTEXT_PRIVATE_H_ #define CDIO_DRIVER_CDTEXT_PRIVATE_H_ #include #ifndef CDIO_CD_MAX_TRACKS # define CDIO_CD_MAX_TRACKS 99 /* Largest CD track number */ #endif #define CDTEXT_GET_LEN16(p) (p[0]<<8) + p[1] typedef enum { CDTEXT_LEN_BINARY_MAX = 8 * 256 * 18, /* Maximum CD-TEXT payload: 8 blocks, 256 packs, 18 bytes */ CDTEXT_LEN_TEXTDATA = 12, CDTEXT_LEN_PACK = 18, CDTEXT_LEN_BLOCKSIZE = 36, CDTEXT_NUM_BLOCKS_MAX = 8, CDTEXT_NUM_TRACKS_MAX = CDIO_CD_MAX_TRACKS+1, /* +1 for 0th disk track */ CDTEXT_NUM_BLOCKPACKS_MAX = 255 } cdtext_format_enum_t; /** * From table J.2 - Pack Type Indicator Definitions from * Working Draft NCITS XXX T10/1364-D Revision 10G. November 12, 2001. */ typedef enum { CDTEXT_PACK_TITLE = 0x80, CDTEXT_PACK_PERFORMER = 0x81, CDTEXT_PACK_SONGWRITER = 0x82, CDTEXT_PACK_COMPOSER = 0x83, CDTEXT_PACK_ARRANGER = 0x84, CDTEXT_PACK_MESSAGE = 0x85, CDTEXT_PACK_DISCID = 0x86, CDTEXT_PACK_GENRE = 0x87, CDTEXT_PACK_TOC = 0x88, CDTEXT_PACK_TOC2 = 0x89, CDTEXT_PACK_UPC = 0x8E, CDTEXT_PACK_BLOCKSIZE = 0x8F } cdtext_packtype_enum_t; /** CD-Text character encodings */ typedef enum cdtext_charcode_enum_s { CDTEXT_CHARCODE_ISO_8859_1 = 0x00, /**< ISO-8859-1 (8 bit), Latin-1 */ CDTEXT_CHARCODE_ASCII = 0x01, /**< ASCII (7 bit) */ CDTEXT_CHARCODE_SHIFT_JIS = 0x80 /**< Shift_JIS (double byte), JIS X 0208 Appendix 1 */ ///* The following were proposed but never implemented anywhere. // * They are mentioned for completeness here // * CDTEXT_CHARCODE_KOREAN = 0x81, /**< Korean */ // * CDTEXT_CHARCODE_CHINESE = 0x82, /**< Mandarin Chinese */ // * CDTEXT_CHARCODE_UNDEFINED = 0xFF, /**< everything else */ // */ } cdtext_charcode_enum_t; /** Structure of CD-TEXT data Packs */ struct cdtext_pack_s { uint8_t type; uint8_t i_track; uint8_t seq; uint8_t char_pos; /* character position */ uint8_t block; /* block number 0..7 */ uint8_t db_chars; /* double byte character */ uint8_t text[CDTEXT_LEN_TEXTDATA]; uint8_t crc[2]; }; /** Structure of of block size information packs */ struct cdtext_blocksize_s { uint8_t charcode; /* character code */ uint8_t i_first_track; /* first track number */ uint8_t i_last_track; /* last track number */ uint8_t copyright; /* 3 CD-TEXT is copyrighted, 0 no copyright on CD-TEXT */ uint8_t i_packs[16]; /* number of packs of each type * 0 TITLE; 1 PERFORMER; 2 SONGWRITER; 3 COMPOSER; * 4 ARRANGER; 5 MESSAGE; 6 DISCID; 7 GENRE; * 8 TOC; 9 TOC2; 10-12 RESERVED; 13 CLOSED; * 14 UPC_ISRC; 15 BLOCKSIZE */ uint8_t lastseq[8]; /* last sequence for block 0..7 */ uint8_t langcode[8]; /* language code for block 0..7 */ }; typedef struct cdtext_pack_s cdtext_pack_t; typedef struct cdtext_blocksize_s cdtext_blocksize_t; /*! Structure for CD-TEXT of a track. */ struct cdtext_track_s { char *field[MAX_CDTEXT_FIELDS]; }; /*! Structure for CD-TEXT of a block. */ struct cdtext_block_s { struct cdtext_track_s track[CDTEXT_NUM_TRACKS_MAX]; /**< 0: disc; 1..99: tracks */ cdtext_genre_t genre_code; /**< genre code of the disc */ cdtext_lang_t language_code; /**< language of this block */ bool copyright; /**< CD-TEXT copyright */ track_t first_track; /**< first track number */ track_t last_track; /**< last track number */ }; /*! Structure for CD-TEXT of a disc. @see cdtext_init, cdtext_destroy, cdtext_get, and cdtext_set. */ struct cdtext_s { struct cdtext_block_s block[CDTEXT_NUM_BLOCKS_MAX]; /**< CD-TEXT for block 0..7 */ cdtext_lang_t languages[CDTEXT_NUM_BLOCKS_MAX]; /**< return value of cdtext_list_languages_v2() */ uint8_t block_i; /**< index of active block */ }; int cdtext_read_pack (cdtext_pack_t *pack, const uint8_t *data); /*! returns enum of field if key is a CD-Text keyword, returns CDTEXT_FIELD_INVALID otherwise. */ cdtext_field_t cdtext_is_field (const char *field); #endif /* CDIO_DRIVER_CDTEXT_PRIVATE_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/device.c000066400000000000000000000717401474051130400165740ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2011-2013, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! device- and driver-related routines. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include #include "cdio_private.h" #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif /* This probably will get moved to driver code, i.e _cdio_linux.c */ #ifdef HAVE_LINUX_MAJOR_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif /* The last valid entry of Cdio_driver. -1 or (CDIO_DRIVER_UNINIT) means uninitialzed. -2 means some sort of error. */ #define CDIO_DRIVER_UNINIT -1 int CdIo_last_driver = CDIO_DRIVER_UNINIT; #ifdef HAVE_AIX_CDROM const driver_id_t cdio_os_driver = DRIVER_AIX; #elif defined(HAVE_FREEBSD_CDROM) const driver_id_t cdio_os_driver = DRIVER_FREEBSD; #elif defined(HAVE_LINUX_CDROM) const driver_id_t cdio_os_driver = DRIVER_LINUX; #elif defined(HAVE_NETBSD_CDROM) const driver_id_t cdio_os_driver = DRIVER_NETBSD; #elif defined(HAVE_DARWIN_CDROM) const driver_id_t cdio_os_driver = DRIVER_OSX; #elif defined(HAVE_SOLARIS_CDROM) const driver_id_t cdio_os_driver = DRIVER_SOLARIS; #elif defined(HAVE_WIN32_CDROM) const driver_id_t cdio_os_driver = DRIVER_WIN32; #else const driver_id_t cdio_os_driver = DRIVER_UNKNOWN; #endif /** The below variables are trickery to force enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ cdio_drive_cap_misc_t debug_cdio_drive_cap_misc; cdio_drive_cap_read_t debug_cdio_drive_cap_read_t; cdio_drive_cap_write_t debug_drive_cap_write_t; cdio_mmc_hw_len_t debug_cdio_mmc_hw_len; cdio_src_category_mask_t debug_cdio_src_category_mask; static bool cdio_have_false(void) { return false; } /* The below array gives all drivers that can possibly appear. on a particular host. */ CdIo_driver_t CdIo_all_drivers[] = { {DRIVER_UNKNOWN, 0, "Unknown", "No driver", &cdio_have_false, NULL, NULL, NULL, NULL, NULL, NULL }, {DRIVER_AIX, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK, "AIX", "AIX SCSI driver", &cdio_have_aix, &cdio_open_aix, &cdio_open_am_aix, &cdio_get_default_device_aix, &cdio_is_device_generic, &cdio_get_devices_aix, NULL }, {DRIVER_FREEBSD, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK, "FreeBSD", "FreeBSD driver", &cdio_have_freebsd, &cdio_open_freebsd, &cdio_open_am_freebsd, &cdio_get_default_device_freebsd, &cdio_is_device_generic, &cdio_get_devices_freebsd, &close_tray_freebsd }, {DRIVER_NETBSD, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK, "NetBSD", "NetBSD driver", &cdio_have_netbsd, &cdio_open_netbsd, &cdio_open_am_netbsd, &cdio_get_default_device_netbsd, &cdio_is_device_generic, &cdio_get_devices_netbsd, &close_tray_netbsd }, {DRIVER_LINUX, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK, "GNU/Linux", "GNU/Linux ioctl and MMC driver", &cdio_have_linux, &cdio_open_linux, &cdio_open_am_linux, &cdio_get_default_device_linux, &cdio_is_device_generic, &cdio_get_devices_linux, &close_tray_linux }, {DRIVER_SOLARIS, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK, "Solaris", "Solaris ATAPI and SCSI driver", &cdio_have_solaris, &cdio_open_solaris, &cdio_open_am_solaris, &cdio_get_default_device_solaris, &cdio_is_device_generic, &cdio_get_devices_solaris, &close_tray_solaris }, {DRIVER_OSX, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK, "macOS", "Apple macOS driver", &cdio_have_osx, &cdio_open_osx, &cdio_open_am_osx, &cdio_get_default_device_osx, &cdio_is_device_generic, &cdio_get_devices_osx, &close_tray_osx }, {DRIVER_WIN32, CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK, "WIN32", "MS Windows ASPI and ioctl driver", &cdio_have_win32, &cdio_open_win32, &cdio_open_am_win32, &cdio_get_default_device_win32, &cdio_is_device_win32, &cdio_get_devices_win32, &close_tray_win32 }, {DRIVER_CDRDAO, CDIO_SRC_IS_DISK_IMAGE_MASK, "CDRDAO", "cdrdao (TOC) disk image driver", &cdio_have_cdrdao, &cdio_open_cdrdao, &cdio_open_am_cdrdao, &cdio_get_default_device_cdrdao, NULL, &cdio_get_devices_cdrdao, NULL }, {DRIVER_BINCUE, CDIO_SRC_IS_DISK_IMAGE_MASK, "BIN/CUE", "bin/cuesheet disk image driver", &cdio_have_bincue, &cdio_open_bincue, &cdio_open_am_bincue, &cdio_get_default_device_bincue, NULL, &cdio_get_devices_bincue, NULL }, {DRIVER_NRG, CDIO_SRC_IS_DISK_IMAGE_MASK, "NRG", "Nero NRG disk image driver", &cdio_have_nrg, &cdio_open_nrg, &cdio_open_am_nrg, &cdio_get_default_device_nrg, NULL, &cdio_get_devices_nrg, NULL } }; /* The below array gives of the drivers that are currently available for on a particular host. */ CdIo_driver_t CdIo_driver[sizeof(CdIo_all_drivers)/sizeof(CdIo_all_drivers[0])-1] = { {0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} }; const driver_id_t cdio_drivers[] = { DRIVER_AIX, DRIVER_FREEBSD, DRIVER_NETBSD, DRIVER_LINUX, DRIVER_SOLARIS, DRIVER_OSX, DRIVER_WIN32, DRIVER_CDRDAO, DRIVER_BINCUE, DRIVER_NRG, DRIVER_UNKNOWN }; const driver_id_t cdio_device_drivers[] = { DRIVER_AIX, DRIVER_FREEBSD, DRIVER_NETBSD, DRIVER_LINUX, DRIVER_SOLARIS, DRIVER_OSX, DRIVER_WIN32, DRIVER_UNKNOWN }; const char * cdio_driver_errmsg(driver_return_code_t drc) { switch(drc) { case DRIVER_OP_SUCCESS: return "driver operation was successful"; case DRIVER_OP_ERROR: return "driver I/O error"; case DRIVER_OP_UNSUPPORTED: return "driver operatation not supported"; case DRIVER_OP_UNINIT: return "driver not initialized"; case DRIVER_OP_NOT_PERMITTED: return "driver operatation not permitted"; case DRIVER_OP_BAD_PARAMETER: return "bad parameter passed"; case DRIVER_OP_BAD_POINTER: return "bad pointer to memory area"; case DRIVER_OP_NO_DRIVER: return "driver not available"; default: return "unknown or bad driver return status"; } } static CdIo * scan_for_driver(const driver_id_t drivers[], const char *psz_source, const char *access_mode) { const driver_id_t *p_driver_id; for (p_driver_id=drivers; *p_driver_id!=DRIVER_UNKNOWN; p_driver_id++) { cdio_debug("Trying driver %s", cdio_get_driver_name_from_id(*p_driver_id)); if ((*CdIo_all_drivers[*p_driver_id].have_driver)()) { CdIo *ret= (*CdIo_all_drivers[*p_driver_id].driver_open_am)(psz_source, access_mode); if (ret != NULL) { ret->driver_id = *p_driver_id; cdio_info("found driver %s", cdio_get_driver_name_from_id(*p_driver_id)); return ret; } } } return NULL; } const char * cdio_driver_describe(driver_id_t driver_id) { return CdIo_all_drivers[driver_id].describe; } /*! Initialize CD Reading and control routines. Should be called first. May be implicitly called by other routines if not called first. */ bool cdio_init(void) { CdIo_driver_t *all_dp; CdIo_driver_t *dp = CdIo_driver; const driver_id_t *p_driver_id; if (CdIo_last_driver != CDIO_DRIVER_UNINIT) { cdio_warn ("Init routine called more than once."); return false; } for (p_driver_id=cdio_drivers; *p_driver_id!=DRIVER_UNKNOWN; p_driver_id++) { all_dp = &CdIo_all_drivers[*p_driver_id]; if ((*CdIo_all_drivers[*p_driver_id].have_driver)()) { *dp++ = *all_dp; CdIo_last_driver++; } } return true; } /*! Free any resources associated with cdio. */ void cdio_destroy (CdIo_t *p_cdio) { CdIo_last_driver = CDIO_DRIVER_UNINIT; if (p_cdio == NULL) return; if (p_cdio->op.free != NULL && p_cdio->env) p_cdio->op.free (p_cdio->env); p_cdio->env = NULL; free (p_cdio); } /*! Close media tray in CD drive if there is a routine to do so. @param psz_drive the name of CD-ROM to be closed. If NULL, we will use the default device. @param p_driver_id is the driver to be used or that got used if it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't report back the driver used. */ driver_return_code_t cdio_close_tray (const char *psz_orig_drive, /*in/out*/ driver_id_t *p_driver_id) { driver_id_t temp_driver_id = DRIVER_DEVICE; char *psz_drive; driver_return_code_t drc; if (!p_driver_id) p_driver_id = &temp_driver_id; if (!psz_orig_drive || !*psz_orig_drive) psz_drive = cdio_get_default_device_driver(p_driver_id); else psz_drive = strdup(psz_orig_drive); if (DRIVER_UNKNOWN == *p_driver_id || DRIVER_DEVICE == *p_driver_id) { const driver_id_t *_p_driver_id = (DRIVER_DEVICE == *p_driver_id)?cdio_device_drivers:cdio_drivers; p_driver_id = (driver_id_t *)_p_driver_id; /* Scan for driver */ for ( ; *p_driver_id!=DRIVER_UNKNOWN; p_driver_id++) { if ( (*CdIo_all_drivers[*p_driver_id].have_driver)() && *CdIo_all_drivers[*p_driver_id].close_tray ) { drc = (*CdIo_all_drivers[*p_driver_id].close_tray)(psz_drive); free(psz_drive); return drc; } } free(psz_drive); return DRIVER_OP_UNSUPPORTED; } /* The driver id was specified. Use that. */ if ( (*CdIo_all_drivers[*p_driver_id].have_driver)() && *CdIo_all_drivers[*p_driver_id].close_tray ) { drc = (*CdIo_all_drivers[*p_driver_id].close_tray)(psz_drive); free(psz_drive); return drc; } free(psz_drive); return DRIVER_OP_UNSUPPORTED; } /*! Eject media in CD drive if there is a routine to do so. @param p_cdio the CD object to be acted upon. If the CD is ejected *p_cdio is freed and p_cdio set to NULL. */ driver_return_code_t cdio_eject_media (CdIo_t **pp_cdio) { if ((pp_cdio == NULL) || (*pp_cdio == NULL)) return DRIVER_OP_UNINIT; if ((*pp_cdio)->op.eject_media) { int ret = (*pp_cdio)->op.eject_media ((*pp_cdio)->env); if (0 == ret) { cdio_destroy(*pp_cdio); *pp_cdio = NULL; } return ret; } else { cdio_destroy(*pp_cdio); *pp_cdio = NULL; return DRIVER_OP_UNSUPPORTED; } } /*! Eject media in CD drive if there is a routine to do so. If you want to scan for any CD-ROM and eject that, pass NULL for psz_drive. @param psz_drive the CD object to be acted upon. If NULL is given as the drive, we'll use the default driver device. */ driver_return_code_t cdio_eject_media_drive (const char *psz_drive) { CdIo_t *p_cdio = cdio_open (psz_drive, DRIVER_DEVICE); if (p_cdio) { driver_return_code_t rc; rc = cdio_eject_media(&p_cdio); cdio_destroy(p_cdio); return rc; } else { return DRIVER_OP_UNINIT; } } /*! Free device list returned by cdio_get_devices or cdio_get_devices_with_cap. */ void cdio_free_device_list (char * ppsz_device_list[]) { char **ppsz_device_list_save=ppsz_device_list; if (!ppsz_device_list) return; for ( ; NULL != *ppsz_device_list ; ppsz_device_list++ ) { free(*ppsz_device_list); *ppsz_device_list = NULL; } CDIO_FREE_IF_NOT_NULL(ppsz_device_list_save); } /*! Return a string containing the default CD device if none is specified. if p_cdio is NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that. NULL is returned if we couldn't get a default device. */ char * cdio_get_default_device (const CdIo_t *p_cdio) { if (p_cdio == NULL) { const driver_id_t *p_driver_id; /* Scan for driver */ for (p_driver_id=cdio_drivers; *p_driver_id!=DRIVER_UNKNOWN; p_driver_id++) { if ( (*CdIo_all_drivers[*p_driver_id].have_driver)() && *CdIo_all_drivers[*p_driver_id].get_default_device ) { return (*CdIo_all_drivers[*p_driver_id].get_default_device)(); } } return NULL; } if (p_cdio->op.get_default_device) { return p_cdio->op.get_default_device (); } else { return NULL; } } /*! Return a string containing the default CD device if none is specified. if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable one set the default device for that. NULL is returned if we couldn't get a default device. */ char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id) { if (DRIVER_UNKNOWN == *p_driver_id || DRIVER_DEVICE == *p_driver_id) { const driver_id_t *p_driver_id_try = (DRIVER_DEVICE == *p_driver_id)?cdio_device_drivers:cdio_drivers; /* Scan for driver */ for ( ; *p_driver_id_try!=DRIVER_UNKNOWN; p_driver_id_try++) { if ( (*CdIo_all_drivers[*p_driver_id_try].have_driver)() && *CdIo_all_drivers[*p_driver_id_try].get_default_device ) { *p_driver_id = *p_driver_id_try; return (*CdIo_all_drivers[*p_driver_id].get_default_device)(); } } return NULL; } /* The driver id was specified. Use that. */ if ( (*CdIo_all_drivers[*p_driver_id].have_driver)() && *CdIo_all_drivers[*p_driver_id].get_default_device ) { return (*CdIo_all_drivers[*p_driver_id].get_default_device)(); } return NULL; } /*!Return an array of device names. If you want a specific devices, dor a driver give that device, if you want hardware devices, give DRIVER_DEVICE and if you want all possible devices, image drivers and hardware drivers give DRIVER_UNKNOWN. NULL is returned if we couldn't return a list of devices. */ char ** cdio_get_devices (driver_id_t driver_id) { /* Probably could get away with &driver_id below. */ driver_id_t driver_id_temp = driver_id; return cdio_get_devices_ret (&driver_id_temp); } char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id) { CdIo_t *p_cdio; switch (*p_driver_id) { /* FIXME: spit out unknown to give image drivers as well. */ case DRIVER_DEVICE: p_cdio = scan_for_driver(cdio_device_drivers, NULL, NULL); *p_driver_id = cdio_get_driver_id(p_cdio); break; case DRIVER_UNKNOWN: p_cdio = scan_for_driver(cdio_drivers, NULL, NULL); *p_driver_id = cdio_get_driver_id(p_cdio); break; default: return (*CdIo_all_drivers[*p_driver_id].get_devices)(); } if (p_cdio == NULL) return NULL; if (p_cdio->op.get_devices) { char **devices = p_cdio->op.get_devices (); cdio_destroy(p_cdio); return devices; } else { return NULL; } } /*! Return an array of device names in search_devices that have at least the capabilities listed by cap. If search_devices is NULL, then we'll search all possible CD drives. If "any" is set false then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If "any" is set true, then if any of the capabilities matches, we call that a success. To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL. NULL is returned if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found. */ char ** cdio_get_devices_with_cap (/*in*/ char* search_devices[], cdio_fs_anal_t capabilities, bool any) { driver_id_t p_driver_id; return cdio_get_devices_with_cap_ret (search_devices, capabilities, any, &p_driver_id); } char ** cdio_get_devices_with_cap_ret (/*in*/ char* search_devices[], cdio_fs_anal_t need_cap, bool b_any, /*out*/ driver_id_t *p_driver_id) { char **ppsz_drives=search_devices; char **ppsz_drives_ret=NULL; unsigned int i_drives=0; bool b_free_ppsz_drives = false; *p_driver_id = DRIVER_DEVICE; if (!ppsz_drives) { ppsz_drives=cdio_get_devices_ret(p_driver_id); b_free_ppsz_drives = true; } if (!ppsz_drives) return NULL; if (need_cap == CDIO_FS_MATCH_ALL) { /* Duplicate drives into drives_ret. */ char **d = ppsz_drives; for( ; *d != NULL; d++ ) { cdio_add_device_list(&ppsz_drives_ret, *d, &i_drives); } } else { const cdio_fs_anal_t need_fs = CDIO_FSTYPE(need_cap); char **d = ppsz_drives; for( ; *d != NULL; d++ ) { CdIo_t *p_cdio = cdio_open(*d, *p_driver_id); if (NULL != p_cdio) { track_t i_first_track = cdio_get_first_track_num(p_cdio); cdio_iso_analysis_t cdio_iso_analysis; if (CDIO_INVALID_TRACK != i_first_track) { const cdio_fs_anal_t got_cap = cdio_guess_cd_type(p_cdio, 0, i_first_track, &cdio_iso_analysis); /* Match on filesystem. Here either we don't know what the filesystem is - automatic match, or we no that the file system is in the set of those specified. We refine the logic further after this initial test. */ if ( CDIO_FS_UNKNOWN == need_fs || 0 == need_fs || (CDIO_FSTYPE(got_cap) == need_fs) ) { /* Match on analysis type. If we haven't set any analysis type, then an automatic match. Otherwise a match is determined by whether we need all analysis types or any of them. */ const cdio_fs_anal_t need_anal = need_cap & ~CDIO_FS_MASK; const cdio_fs_anal_t got_anal = got_cap & ~CDIO_FS_MASK; const bool b_match = !need_anal || (b_any ? (got_anal & need_anal) != 0 : (got_anal & need_anal) == need_anal); if (b_match) cdio_add_device_list(&ppsz_drives_ret, *d, &i_drives); } } cdio_destroy(p_cdio); } } } cdio_add_device_list(&ppsz_drives_ret, NULL, &i_drives); if (b_free_ppsz_drives) { cdio_free_device_list(ppsz_drives); } return ppsz_drives_ret; } /*! Return the the kind of drive capabilities of device. Note: string is malloc'd so caller should free() then returned string when done with it. */ void cdio_get_drive_cap (const CdIo_t *p_cdio, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap) { /* This seems like a safe bet. */ *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN; *p_write_cap = CDIO_DRIVE_CAP_UNKNOWN; *p_misc_cap = CDIO_DRIVE_CAP_UNKNOWN; if (p_cdio && p_cdio->op.get_drive_cap) { p_cdio->op.get_drive_cap(p_cdio->env, p_read_cap, p_write_cap, p_misc_cap); } } /*! Return the the kind of drive capabilities of device. Note: string is malloc'd so caller should free() then returned string when done with it. */ void cdio_get_drive_cap_dev (const char *device, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap) { /* This seems like a safe bet. */ CdIo_t *cdio=scan_for_driver(cdio_drivers, device, NULL); if (cdio) { cdio_get_drive_cap(cdio, p_read_cap, p_write_cap, p_misc_cap); cdio_destroy(cdio); } else { *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN; *p_write_cap = CDIO_DRIVE_CAP_UNKNOWN; *p_misc_cap = CDIO_DRIVE_CAP_UNKNOWN; } } /*! Return a string containing the name of the driver in use. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL. */ const char * cdio_get_driver_name (const CdIo_t *p_cdio) { if (NULL==p_cdio) return NULL; return cdio_get_driver_name_from_id(p_cdio->driver_id); } /*! Return a string containing the name of the driver in use from the driver_id. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL. */ const char * cdio_get_driver_name_from_id (driver_id_t driver_id) { return CdIo_all_drivers[driver_id].name; } /*! Return the driver id. if CdIo is NULL (we haven't initialized a specific device driver), then return DRIVER_UNKNOWN. */ driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio) { if (!p_cdio) return DRIVER_UNKNOWN; return p_cdio->driver_id; } /*! Return a string containing the name of the driver in use. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL. */ bool cdio_get_hwinfo (const CdIo_t *p_cdio, cdio_hwinfo_t *hw_info) { if (!p_cdio) return false; if (p_cdio->op.get_hwinfo) { return p_cdio->op.get_hwinfo (p_cdio, hw_info); } else { /* Perhaps driver forgot to initialize. We are no worse off Using mmc than returning false here. */ return mmc_get_hwinfo(p_cdio, hw_info); } } /*! Return the session number of the last on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, /*out*/ lsn_t *i_last_session) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.get_last_session) return p_cdio->op.get_last_session(p_cdio->env, i_last_session); return DRIVER_OP_UNSUPPORTED; } /*! Find out if media has changed since the last call. @param p_cdio the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ int cdio_get_media_changed(CdIo_t *p_cdio) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.get_media_changed) return p_cdio->op.get_media_changed(p_cdio->env); return DRIVER_OP_UNSUPPORTED; } bool_3way_t cdio_have_atapi(CdIo_t *p_cdio) { bool_3way_t i_status; if (!p_cdio) return nope; i_status = mmc_have_interface(p_cdio, CDIO_MMC_FEATURE_INTERFACE_ATAPI); if (dunno != i_status) return i_status; { /* cdparanoia seems to think that if we have a mode sense command we have an atapi drive or is atapi compatible. */ uint8_t buf[22]; if (DRIVER_OP_SUCCESS == mmc_mode_sense(p_cdio, buf, sizeof(buf), CDIO_MMC_CAPABILITIES_PAGE) ) { uint8_t *b = buf; b+=b[3]+4; if( CDIO_MMC_CAPABILITIES_PAGE == (b[0]&0x3F) ) { /* MMC style drive! */ return yep; } } } /* Put these in the various drivers? If we get more, yes! */ #ifdef HAVE_LINUX_MAJOR_H { /* This too is from cdparanoia. */ struct stat st; generic_img_private_t *p_env = p_cdio->env; if ( 0 == lstat(p_env->source_name, &st) ) { if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) { int drive_type=(int)(st.st_rdev>>8); switch (drive_type) { case IDE0_MAJOR: case IDE1_MAJOR: case IDE2_MAJOR: case IDE3_MAJOR: /* Yay, ATAPI... */ return yep; break; case CDU31A_CDROM_MAJOR: case CDU535_CDROM_MAJOR: case MATSUSHITA_CDROM_MAJOR: case MATSUSHITA_CDROM2_MAJOR: case MATSUSHITA_CDROM3_MAJOR: case MATSUSHITA_CDROM4_MAJOR: case SANYO_CDROM_MAJOR: case MITSUMI_CDROM_MAJOR: case MITSUMI_X_CDROM_MAJOR: case OPTICS_CDROM_MAJOR: case AZTECH_CDROM_MAJOR: case GOLDSTAR_CDROM_MAJOR: case CM206_CDROM_MAJOR: case SCSI_CDROM_MAJOR: case SCSI_GENERIC_MAJOR: return nope; break; default: return dunno; } } } } #endif /*HAVE_LINUX_MAJOR_H*/ return dunno; } bool cdio_have_driver(driver_id_t driver_id) { if (driver_id < 0 || driver_id >= sizeof(CdIo_all_drivers)/sizeof(CdIo_all_drivers[0])) return false; return (*CdIo_all_drivers[driver_id].have_driver)(); } bool cdio_is_device(const char *psz_source, driver_id_t driver_id) { if (DRIVER_UNKNOWN == driver_id || DRIVER_DEVICE == driver_id) { const driver_id_t *p_driver_id = (DRIVER_DEVICE == driver_id)?cdio_device_drivers:cdio_drivers; /* Scan for driver */ for ( ; *p_driver_id!=DRIVER_UNKNOWN; p_driver_id++) { if ( (*CdIo_all_drivers[*p_driver_id].have_driver)() && CdIo_all_drivers[*p_driver_id].is_device ) { return (*CdIo_all_drivers[*p_driver_id].is_device)(psz_source); } } } if (driver_id < DRIVER_UNKNOWN || driver_id >= DRIVER_DEVICE || CdIo_all_drivers[driver_id].is_device == NULL) return false; return (*CdIo_all_drivers[driver_id].is_device)(psz_source); } /*! Sets up to read from place specified by source_name and driver_id. This should be called before using any other routine, except cdio_init. This will call cdio_init, if that hasn't been done previously. NULL is returned on error. */ CdIo_t * cdio_open (const char *orig_source_name, driver_id_t driver_id) { return cdio_open_am(orig_source_name, driver_id, NULL); } /*! Sets up to read from place specified by source_name and driver_id. This should be called before using any other routine, except cdio_init. This will call cdio_init, if that hasn't been done previously. NULL is returned on error. */ CdIo_t * cdio_open_am (const char *psz_orig_source, driver_id_t driver_id, const char *psz_access_mode) { char *psz_source; if (CdIo_last_driver == -1) cdio_init(); if (!psz_orig_source || !*psz_orig_source) psz_source = cdio_get_default_device(NULL); else psz_source = strdup(psz_orig_source); switch (driver_id) { case DRIVER_UNKNOWN: { CdIo_t *p_cdio=scan_for_driver(cdio_drivers, psz_source, psz_access_mode); free(psz_source); return p_cdio; } case DRIVER_DEVICE: { /* Scan for a driver. */ CdIo_t *ret = cdio_open_am_cd(psz_source, psz_access_mode); free(psz_source); return ret; } break; case DRIVER_AIX: case DRIVER_FREEBSD: case DRIVER_LINUX: case DRIVER_NETBSD: case DRIVER_SOLARIS: case DRIVER_WIN32: case DRIVER_OSX: case DRIVER_NRG: case DRIVER_BINCUE: case DRIVER_CDRDAO: if ((*CdIo_all_drivers[driver_id].have_driver)()) { CdIo_t *ret = (*CdIo_all_drivers[driver_id].driver_open_am)(psz_source, psz_access_mode); if (ret) ret->driver_id = driver_id; free(psz_source); return ret; } } free(psz_source); return NULL; } /*! Set up CD-ROM for reading. The device_name is the some sort of device name. @return the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM. */ CdIo_t * cdio_open_cd (const char *psz_source) { return cdio_open_am_cd(psz_source, NULL); } /*! Set up CD-ROM for reading. The device_name is the some sort of device name. @return the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM. */ /* In the future we'll have more complicated code to allow selection of an I/O routine as well as code to find an appropriate default routine among the "registered" routines. Possibly classes too disk-based, SCSI-based, native-based, vendor (e.g. Sony, or Plextor) based For now though, we'll start more simply... */ CdIo_t * cdio_open_am_cd (const char *psz_source, const char *psz_access_mode) { if (CdIo_last_driver == -1) cdio_init(); /* Scan for a driver. */ return scan_for_driver(cdio_device_drivers, psz_source, psz_access_mode); } /*! Set the blocksize for subsequent reads. */ driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio, int i_blocksize ) { if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_cdio->op.set_blocksize) return DRIVER_OP_UNSUPPORTED; return p_cdio->op.set_blocksize(p_cdio->env, i_blocksize); } /*! Set the drive speed. @param p_cdio CD structure set by cdio_open(). @param i_drive_speed speed in CD-ROM speed units. Note this not Kbs as would be used in the MMC spec or in mmc_set_speed(). To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). On many CD-ROM drives, specifying a value too large will result in using the fastest speed. @see mmc_set_speed and mmc_set_drive_speed */ driver_return_code_t cdio_set_speed (const CdIo_t *p_cdio, int i_speed) { if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_cdio->op.set_speed) return DRIVER_OP_UNSUPPORTED; return p_cdio->op.set_speed(p_cdio->env, i_speed); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/disc.c000066400000000000000000000074061474051130400162550ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012, 2014 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include "cdio_private.h" /* Must match discmode enumeration */ const char *discmode2str[] = { "CD-DA", "CD-DATA (Mode 1)", "CD DATA (Mode 2)", "CD-ROM Mixed", "DVD-ROM", "DVD-RAM", "DVD-R", "DVD-RW", "HD DVD ROM", "HD_DVD RAM", "HD DVD-R", "DVD+R", "DVD+RW", "DVD+RW DL", "DVD+R DL", "Unknown/unclassified DVD", "No information", "Error in getting information", "CD-i" }; /*! Get cdtext information for a CdIo object . @param obj the CD object that may contain CD-TEXT information. @return the CD-TEXT object or NULL if obj is NULL or CD-TEXT information does not exist. */ cdtext_t * cdio_get_cdtext (CdIo *obj) { if (obj == NULL) return NULL; if (NULL != obj->op.get_cdtext) { return obj->op.get_cdtext (obj->env); } else { return NULL; } } /*! Get binary cdtext information for a CdIo object . @param obj the CD object that may contain CD-TEXT information. @return pointer to allocated memory area holding the raw CD-TEXT or NULL if obj is NULL or CD-TEXT does not exist. Return value must be freed with cdio_free() when done with it and not NULL. */ uint8_t * cdio_get_cdtext_raw (CdIo *obj) { if (obj == NULL) return NULL; if (NULL != obj->op.get_cdtext_raw) { return obj->op.get_cdtext_raw (obj->env); } else { return NULL; } } /*! Get the size of the CD in logical block address (LBA) units. @param p_cdio the CD object queried @return the lsn. On error 0 or CDIO_INVALD_LSN. */ lsn_t cdio_get_disc_last_lsn(const CdIo_t *p_cdio) { if (!p_cdio) return CDIO_INVALID_LSN; return p_cdio->op.get_disc_last_lsn (p_cdio->env); } /*! Get medium associated with cd_obj. */ discmode_t cdio_get_discmode (CdIo_t *cd_obj) { if (!cd_obj) return CDIO_DISC_MODE_ERROR; if (cd_obj->op.get_discmode) { return cd_obj->op.get_discmode (cd_obj->env); } else { return CDIO_DISC_MODE_NO_INFO; } } /*! Return a string containing the name of the driver in use. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL. */ char * cdio_get_mcn (const CdIo_t *p_cdio) { if (p_cdio && p_cdio->op.get_mcn) { return p_cdio->op.get_mcn (p_cdio->env); } else { return NULL; } } bool cdio_is_discmode_cdrom(discmode_t discmode) { switch (discmode) { case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_NO_INFO: return true; default: return false; } } bool cdio_is_discmode_dvd(discmode_t discmode) { switch (discmode) { case CDIO_DISC_MODE_DVD_ROM: case CDIO_DISC_MODE_DVD_RAM: case CDIO_DISC_MODE_DVD_R: case CDIO_DISC_MODE_DVD_RW: case CDIO_DISC_MODE_DVD_PR: case CDIO_DISC_MODE_DVD_PRW: case CDIO_DISC_MODE_DVD_OTHER: return true; default: return false; } } libcdio-2.2.0/lib/driver/ds.c000066400000000000000000000116371474051130400157420ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2011, 2016 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include "cdio_assert.h" struct _CdioList { unsigned length; CdioListNode_t *begin; CdioListNode_t *end; }; struct _CdioListNode { CdioList_t *list; CdioListNode_t *next; void *data; }; /* impl */ CdioList_t * _cdio_list_new (void) { CdioList_t *p_new_obj = calloc (1, sizeof (CdioList_t)); return p_new_obj; } void _cdio_list_free (CdioList_t *p_list, int free_data, CdioDataFree_t free_fn) { while (_cdio_list_length (p_list)) _cdio_list_node_free (_cdio_list_begin (p_list), free_data, free_fn); free (p_list); } unsigned _cdio_list_length (const CdioList_t *p_list) { cdio_assert (p_list != NULL); return p_list->length; } void _cdio_list_prepend (CdioList_t *p_list, void *p_data) { CdioListNode_t *p_new_node; cdio_assert (p_list != NULL); p_new_node = calloc (1, sizeof (CdioListNode_t)); cdio_assert (p_new_node != NULL); p_new_node->list = p_list; p_new_node->next = p_list->begin; p_new_node->data = p_data; p_list->begin = p_new_node; if (p_list->length == 0) p_list->end = p_new_node; p_list->length++; } void _cdio_list_append (CdioList_t *p_list, void *p_data) { cdio_assert (p_list != NULL); if (p_list->length == 0) { _cdio_list_prepend (p_list, p_data); } else { CdioListNode_t *p_new_node = calloc (1, sizeof (CdioListNode_t)); cdio_assert (p_new_node != NULL); p_new_node->list = p_list; p_new_node->next = NULL; p_new_node->data = p_data; p_list->end->next = p_new_node; p_list->end = p_new_node; p_list->length++; } } void _cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func, void *p_user_data) { CdioListNode_t *node; cdio_assert (p_list != NULL); cdio_assert (func != 0); for (node = _cdio_list_begin (p_list); node != NULL; node = _cdio_list_node_next (node)) func (_cdio_list_node_data (node), p_user_data); } CdioListNode_t * _cdio_list_find (CdioList_t *p_list, _cdio_list_iterfunc_t cmp_func, void *p_user_data) { CdioListNode_t *p_node; cdio_assert (p_list != NULL); cdio_assert (cmp_func != 0); for (p_node = _cdio_list_begin (p_list); p_node != NULL; p_node = _cdio_list_node_next (p_node)) if (cmp_func (_cdio_list_node_data (p_node), p_user_data)) break; return p_node; } CdioListNode_t * _cdio_list_begin (const CdioList_t *p_list) { cdio_assert (p_list != NULL); return p_list->begin; } CdioListNode_t * _cdio_list_end (CdioList_t *p_list) { cdio_assert (p_list != NULL); return p_list->end; } CdioListNode_t * _cdio_list_node_next (CdioListNode_t *p_node) { if (p_node) return p_node->next; return NULL; } void _cdio_list_node_free (CdioListNode_t *p_node, int free_data, CdioDataFree_t free_fn) { CdioList_t *p_list; CdioListNode_t *prev_node; cdio_assert (p_node != NULL); p_list = p_node->list; cdio_assert (_cdio_list_length (p_list) > 0); if (free_data && free_fn) free_fn (_cdio_list_node_data (p_node)); if (_cdio_list_length (p_list) == 1) { cdio_assert (p_list->begin == p_list->end); p_list->end = p_list->begin = NULL; p_list->length = 0; free (p_node); return; } cdio_assert (p_list->begin != p_list->end); if (p_list->begin == p_node) { p_list->begin = p_node->next; free (p_node); p_list->length--; return; } for (prev_node = p_list->begin; prev_node->next; prev_node = prev_node->next) if (prev_node->next == p_node) break; cdio_assert (prev_node->next != NULL); if (p_list->end == p_node) p_list->end = prev_node; prev_node->next = p_node->next; p_list->length--; free (p_node); } void * _cdio_list_node_data (CdioListNode_t *p_node) { if (p_node) return p_node->data; return NULL; } /* eof */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/filemode.h000066400000000000000000000063711474051130400171240ustar00rootroot00000000000000/* filemode.h -- file modes common definitions Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc. 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_DRIVER_FILEMODE_H_ #define CDIO_DRIVER_FILEMODE_H_ #ifdef HAVE_SYS_STAT_H #include #endif #ifndef S_IRUSR # ifdef S_IREAD # define S_IRUSR S_IREAD # else # define S_IRUSR 00400 # endif #endif #ifndef S_IWUSR # ifdef S_IWRITE # define S_IWUSR S_IWRITE # else # define S_IWUSR 00200 # endif #endif #ifndef S_IXUSR # ifdef S_IEXEC # define S_IXUSR S_IEXEC # else # define S_IXUSR 00100 # endif #endif #ifndef S_IRGRP # define S_IRGRP (S_IRUSR >> 3) #endif #ifndef S_IWGRP # define S_IWGRP (S_IWUSR >> 3) #endif #ifndef S_IXGRP # define S_IXGRP (S_IXUSR >> 3) #endif #ifndef S_IROTH # define S_IROTH (S_IRUSR >> 6) #endif #ifndef S_IWOTH # define S_IWOTH (S_IWUSR >> 6) #endif #ifndef 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_IFBLK && defined _WIN32 # define S_IFBLK 0x3000 #endif #if !defined S_IFIFO && defined _WIN32 # define S_IFIFO 0x1000 #endif #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 HAVE_S_ISLNK # if !defined S_ISLNK && defined S_IFLNK # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) # else # define S_ISLNK(m) ((void)m, 0) # endif #endif #if !defined HAVE_S_ISSOCK # if !defined S_ISSOCK && defined S_IFSOCK # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) # else # define S_ISSOCK(m) ((void)m, 0) # endif #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 #endif /* CDIO_DRIVER_FILEMODE_H_ */ libcdio-2.2.0/lib/driver/generic.h000066400000000000000000000174561474051130400167620ustar00rootroot00000000000000/* Copyright (C) 2004-2006, 2008-2009, 2012-2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Internal routines for CD I/O drivers. */ #ifndef CDIO_DRIVER_GENERIC_H_ #define CDIO_DRIVER_GENERIC_H_ #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) # include "config.h" #endif #include #include #include #ifdef HAVE_STDBOOL_H # include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! Things common to private device structures. Even though not all devices may have some of these fields, by listing common ones we facilitate writing generic routines and even cut-and-paste code. */ typedef struct { char *source_name; /**< Name used in open. */ bool init; /**< True if structure has been initialized */ bool toc_init; /**< True if TOC read in */ bool b_cdtext_error; /**< True if trouble reading CD-Text */ int ioctls_debugged; /**< for debugging */ /* Only one of data_source or fd is used; fd is for CD-ROM devices and the data_source for stream reading (bincue, nrg, toc, network). */ CdioDataSource_t *data_source; int fd; /**< File descriptor of device */ track_t i_first_track; /**< The starting track number. */ track_t i_tracks; /**< The number of tracks. */ uint8_t u_joliet_level; /**< 0 = no Joliet extensions. 1-3: Joliet level. */ iso9660_pvd_t pvd; iso9660_svd_t svd; CdIo_t *cdio; /**< a way to call general cdio routines. */ cdtext_t *cdtext; /**< CD-Text for disc. */ track_flags_t track_flags[CDIO_CD_MAX_TRACKS+1]; /* Memorized sense reply of the most recent SCSI command. Recorded by driver implementations of cdio_funcs_t.run_mmc_cmd(). Read by API function mmc_get_cmd_scsi_sense(). */ unsigned char scsi_mmc_sense[263]; /* See SPC-3 4.5.3 : 252 bytes legal but 263 bytes possible */ int scsi_mmc_sense_valid; /* Number of valid sense bytes */ /* Memorized eventual system specific SCSI address tuple text. Empty text means that there is no such text defined for the drive. NULL means that the driver does not support "scsi-tuple". To be read by cdio_get_arg("scsi-tuple"). System specific suffixes to the key may demand and eventually guarantee a further specified format. E.g. "scsi-tuple-linux" guarantees either "Bus,Host,Channel,Target,Lun", or empty text, or NULL. No other forms. */ char *scsi_tuple; } generic_img_private_t; /*! Bogus eject media when there is no ejectable media, e.g. a disk image We always return 2. Should we also free resources? */ driver_return_code_t cdio_generic_unimplemented_eject_media (void *p_env); /*! Set the blocksize for subsequent reads. @return -2 since it's not implemented. */ driver_return_code_t cdio_generic_unimplemented_set_blocksize (void *p_user_data, uint16_t i_blocksize); /*! Set the drive speed. @return -2 since it's not implemented. */ driver_return_code_t cdio_generic_unimplemented_set_speed (void *p_user_data, int i_speed); /*! Release and free resources associated with cd. */ void cdio_generic_free (void *p_env); /*! Initialize CD device. */ bool cdio_generic_init (void *p_env, int open_mode); /*! Reads into buf the next size bytes. Returns -1 on error. Is in fact libc's read(). */ off_t cdio_generic_lseek (void *p_env, off_t offset, int whence); /*! Reads into buf the next size bytes. Returns -1 on error. Is in fact libc's read(). */ ssize_t cdio_generic_read (void *p_env, void *p_buf, size_t size); /*! Reads a single form1 sector from cd device into data starting from lsn. Returns 0 if no error. */ int cdio_generic_read_form1_sector (void * user_data, void *data, lsn_t lsn); /*! Release and free resources associated with stream or disk image. */ void cdio_generic_stdio_free (void *env); /*! Return true if source_name could be a device containing a CD-ROM on Win32 */ bool cdio_is_device_win32(const char *source_name); /*! Return true if source_name could be a device containing a CD-ROM on OS/2 */ bool cdio_is_device_os2(const char *source_name); /*! Return true if source_name could be a device containing a CD-ROM on most Unix servers with block and character devices. */ bool cdio_is_device_generic(const char *source_name); /*! Like above, but don't give a warning device doesn't exist. */ bool cdio_is_device_quiet_generic(const char *source_name); /*! Get cdtext information for a CdIo object . @param obj the CD object that may contain CD-TEXT information. @return the CD-TEXT object or NULL if obj is NULL or CD-TEXT information does not exist. */ cdtext_t *get_cdtext_generic (void *p_user_data); /*! Return the number of of the first track. CDIO_INVALID_TRACK is returned on error. */ track_t get_first_track_num_generic(void *p_user_data); /*! Return the number of tracks in the current medium. */ track_t get_num_tracks_generic(void *p_user_data); /*! Get disc type associated with cd object. */ discmode_t get_discmode_generic (void *p_user_data ); /*! Same as above but only handles CD cases */ discmode_t get_discmode_cd_generic (void *p_user_data ); /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int get_track_channels_generic(const void *p_user_data, track_t i_track); /*! Return 1 if copy is permitted on the track, 0 if not, or -1 for error. Is this meaningful if not an audio track? */ track_flag_t get_track_copy_permit_generic(void *p_user_data, track_t i_track); /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error. Is this meaningful if not an audio track? pre-emphasis is a non linear frequency response. */ track_flag_t get_track_preemphasis_generic(const void *p_user_data, track_t i_track); /*! Read cdtext information for a CdIo object . return true on success, false on error or CD-Text information does not exist. */ uint8_t * read_cdtext_generic (void *p_env); void set_track_flags(track_flags_t *p_track_flag, uint8_t flag); /*! Read mode 1 or mode2 sectors (using cooked mode). */ driver_return_code_t read_data_sectors_generic (void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CDIO_DRIVER_GENERIC_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/gnu_linux.c000066400000000000000000001441541474051130400173450ustar00rootroot00000000000000/* Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002-2006, 2008-2013, 2017, 2022 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains Linux-specific code and implements low-level control of the CD drive. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include #include #include "cdio_assert.h" #include "cdio_private.h" #ifdef HAVE_LINUX_CDROM #include #include #include #if defined(HAVE_LINUX_VERSION_H) # include # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,16) # define __CDIO_LINUXCD_BUILD # else # error "You need a kernel greater than 2.2.16 to have CDROM support" # endif # if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0) # define __CDIO_LINUXCD_USE_TIMED_MEDIA_CHANGED # endif #else # error "You need to have CDROM support" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef PATH_MAX #define PATH_MAX 4096 #endif typedef enum { _AM_NONE, _AM_IOCTL, _AM_READ_CD, _AM_READ_10, _AM_MMC_RDWR, _AM_MMC_RDWR_EXCL, } access_mode_t; typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; access_mode_t access_mode; /* Some of the more OS specific things. */ /* Entry info for each track, add 1 for leadout. */ struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1]; struct cdrom_tochdr tochdr; #if defined(__CDIO_LINUXCD_USE_TIMED_MEDIA_CHANGED) /* The new TIMED_MEDIA_CHANGED ioctl requires us to store the timestamp of our last check. Since cdio_media_changed takes user data through a constant pointer, we cannot use a direct field, as that would not be writable in that method. Therefore, make this a pointer. */ __s64 *last_changed_timestamp; #endif } _img_private_t; /* Some ioctl() errno values which occur when the tray is empty */ #define ERRNO_TRAYEMPTY(errno) \ ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL)) /**** prototypes for static functions ****/ static bool is_cdrom_linux(const char *drive, char *mnttype); static bool read_toc_linux (void *p_user_data); static driver_return_code_t run_mmc_cmd_linux( void *p_user_data, unsigned int i_timeout, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); static access_mode_t str_to_access_mode_linux(const char *psz_access_mode) { const access_mode_t default_access_mode = _AM_IOCTL; if (NULL==psz_access_mode) return default_access_mode; if (!strcmp(psz_access_mode, "IOCTL")) return _AM_IOCTL; else if (!strcmp(psz_access_mode, "READ_CD")) return _AM_READ_CD; else if (!strcmp(psz_access_mode, "READ_10")) return _AM_READ_10; else if (!strcmp(psz_access_mode, "MMC_RDWR")) return _AM_MMC_RDWR; else if (!strcmp(psz_access_mode, "MMC_RDWR_EXCL")) return _AM_MMC_RDWR_EXCL; else { cdio_warn ("unknown access type: %s. Default IOCTL used.", psz_access_mode); return default_access_mode; } } static char * check_mounts_linux(const char *mtab) { FILE *mntfp; struct mntent *mntent; mntfp = setmntent(mtab, "r"); if ( mntfp != NULL ) { char *tmp; char *mnt_type; char *mnt_dev; unsigned int i_mnt_type; unsigned int i_mnt_dev; while ( (mntent=getmntent(mntfp)) != NULL ) { i_mnt_type = strlen(mntent->mnt_type) + 1; mnt_type = calloc(1, i_mnt_type); if (mnt_type == NULL) continue; /* maybe you'll get lucky next time. */ i_mnt_dev = strlen(mntent->mnt_fsname) + 1; mnt_dev = calloc(1, i_mnt_dev); if (mnt_dev == NULL) { free(mnt_type); continue; } strcpy(mnt_type, mntent->mnt_type); strcpy(mnt_dev, mntent->mnt_fsname); /* Handle "supermount" filesystem mounts */ if ( strcmp(mnt_type, "supermount") == 0 ) { tmp = strstr(mntent->mnt_opts, "fs="); if ( tmp ) { free(mnt_type); mnt_type = strdup(tmp + strlen("fs=")); if ( mnt_type ) { tmp = strchr(mnt_type, ','); if ( tmp ) { *tmp = '\0'; } } } tmp = strstr(mntent->mnt_opts, "dev="); if ( tmp ) { free(mnt_dev); mnt_dev = strdup(tmp + strlen("dev=")); if ( mnt_dev ) { tmp = strchr(mnt_dev, ','); if ( tmp ) { *tmp = '\0'; } } } } if ( mnt_type && mnt_dev ) { if ( strcmp(mnt_type, "iso9660") == 0 ) { if (is_cdrom_linux(mnt_dev, mnt_type) > 0) { free(mnt_type); endmntent(mntfp); return mnt_dev; } } } free(mnt_dev); free(mnt_type); } endmntent(mntfp); } return NULL; } /*! Get the volume of an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_get_volume_linux (void *p_user_data, /*out*/ cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMVOLREAD, p_volume); } /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_pause_linux (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMPAUSE); } /*! Playing starting at given MSF through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_play_msf_linux (void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf) { const _img_private_t *p_env = p_user_data; struct cdrom_msf cdrom_msf; cdrom_msf.cdmsf_min0 = cdio_from_bcd8(p_start_msf->m); cdrom_msf.cdmsf_sec0 = cdio_from_bcd8(p_start_msf->s); cdrom_msf.cdmsf_frame0 = cdio_from_bcd8(p_start_msf->f); cdrom_msf.cdmsf_min1 = cdio_from_bcd8(p_end_msf->m); cdrom_msf.cdmsf_sec1 = cdio_from_bcd8(p_end_msf->s); cdrom_msf.cdmsf_frame1 = cdio_from_bcd8(p_end_msf->f); return ioctl(p_env->gen.fd, CDROMPLAYMSF, &cdrom_msf); } /*! Playing CD through analog output at the desired track and index @param p_cdio the CD object to be acted upon. @param p_track_index location to start/end. */ static driver_return_code_t audio_play_track_index_linux (void *p_user_data, cdio_track_index_t *p_track_index) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMPLAYTRKIND, p_track_index); } /*! Read Audio Subchannel information @param p_user_data the CD object to be acted upon. @param p_subchannel returned information */ static driver_return_code_t audio_read_subchannel_linux (void *p_user_data, /*out*/ cdio_subchannel_t *p_subchannel) { const _img_private_t *p_env = p_user_data; struct cdrom_subchnl subchannel; int i_rc; subchannel.cdsc_format = CDIO_CDROM_MSF; i_rc = ioctl(p_env->gen.fd, CDROMSUBCHNL, &subchannel); if (0 == i_rc) { p_subchannel->control = subchannel.cdsc_ctrl; p_subchannel->track = subchannel.cdsc_trk; p_subchannel->index = subchannel.cdsc_ind; p_subchannel->abs_addr.m = cdio_to_bcd8(subchannel.cdsc_absaddr.msf.minute); p_subchannel->abs_addr.s = cdio_to_bcd8(subchannel.cdsc_absaddr.msf.second); p_subchannel->abs_addr.f = cdio_to_bcd8(subchannel.cdsc_absaddr.msf.frame); p_subchannel->rel_addr.m = cdio_to_bcd8(subchannel.cdsc_reladdr.msf.minute); p_subchannel->rel_addr.s = cdio_to_bcd8(subchannel.cdsc_reladdr.msf.second); p_subchannel->rel_addr.f = cdio_to_bcd8(subchannel.cdsc_reladdr.msf.frame); p_subchannel->audio_status = subchannel.cdsc_audiostatus; return DRIVER_OP_SUCCESS; } else { cdio_info ("ioctl CDROMSUBCHNL failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } } /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_resume_linux (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMRESUME, 0); } /*! Set the volume of an audio CD. @param p_user_data the CD object to be acted upon. */ static driver_return_code_t audio_set_volume_linux (void *p_user_data, cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMVOLCTRL, p_volume); } /*! Stop playing an audio CD. @param p_user_data the CD object to be acted upon. */ static driver_return_code_t audio_stop_linux (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMSTOP); } /*! Release and free resources associated with cd for linux driver. */ static void free_linux (void *p_user_data) { #ifdef __CDIO_LINUXCD_USE_TIMED_MEDIA_CHANGED _img_private_t *p_env = p_user_data; if (p_env->last_changed_timestamp) { free(p_env->last_changed_timestamp); p_env->last_changed_timestamp = 0; } #endif cdio_generic_free(p_user_data); } static bool is_mmc_supported(void *user_data) { _img_private_t *env = user_data; return (_AM_NONE == env->access_mode) ? false : true; } /*! Return the value associated with the key "arg". */ static const char * get_arg_linux (void *env, const char key[]) { _img_private_t *_obj = env; if (!strcmp (key, "source")) { return _obj->gen.source_name; } else if (!strcmp (key, "access-mode")) { switch (_obj->access_mode) { case _AM_IOCTL: return "IOCTL"; case _AM_READ_CD: return "READ_CD"; case _AM_READ_10: return "READ_10"; case _AM_MMC_RDWR: return "MMC_RDWR"; case _AM_MMC_RDWR_EXCL: return "MMC_RDWR_EXCL"; case _AM_NONE: return "no access method"; } } else if (!strcmp (key, "scsi-tuple")) { return _obj->gen.scsi_tuple; } else if (!strcmp (key, "mmc-supported?")) { return is_mmc_supported(env) ? "true" : "false"; } return NULL; } #undef USE_LINUX_CAP #ifdef USE_LINUX_CAP /*! Return the the kind of drive capabilities of device. Note: string is malloc'd so caller should free() then returned string when done with it. */ static void get_drive_cap_linux (const void *p_user_data, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) { const _img_private_t *p_env = p_user_data; int32_t i_drivetype; i_drivetype = ioctl (p_env->gen.fd, CDROM_GET_CAPABILITY, CDSL_CURRENT); if (i_drivetype < 0) { *p_read_cap = CDIO_DRIVE_CAP_ERROR; *p_write_cap = CDIO_DRIVE_CAP_ERROR; *p_misc_cap = CDIO_DRIVE_CAP_ERROR; return; } *p_read_cap = 0; *p_write_cap = 0; *p_misc_cap = 0; /* Reader */ if (i_drivetype & CDC_PLAY_AUDIO) *p_read_cap |= CDIO_DRIVE_CAP_READ_AUDIO; if (i_drivetype & CDC_CD_R) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_R; if (i_drivetype & CDC_CD_RW) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_RW; if (i_drivetype & CDC_DVD) *p_read_cap |= CDIO_DRIVE_CAP_READ_DVD_ROM; /* Writer */ if (i_drivetype & CDC_CD_RW) *p_read_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW; if (i_drivetype & CDC_DVD_R) *p_read_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R; if (i_drivetype & CDC_DVD_RAM) *p_read_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM; /* Misc */ if (i_drivetype & CDC_CLOSE_TRAY) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_CLOSE_TRAY; if (i_drivetype & CDC_OPEN_TRAY) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_EJECT; if (i_drivetype & CDC_LOCK) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_LOCK; if (i_drivetype & CDC_SELECT_SPEED) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_SELECT_SPEED; if (i_drivetype & CDC_SELECT_DISC) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_SELECT_DISC; if (i_drivetype & CDC_MULTI_SESSION) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MULTI_SESSION; if (i_drivetype & CDC_MEDIA_CHANGED) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED; if (i_drivetype & CDC_RESET) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_RESET; } #endif /*! Get the LSN of the first track of the last session of on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ static driver_return_code_t get_last_session_linux (void *p_user_data, /*out*/ lsn_t *i_last_session) { const _img_private_t *p_env = p_user_data; struct cdrom_multisession ms; int i_rc; ms.addr_format = CDROM_LBA; i_rc = ioctl(p_env->gen.fd, CDROMMULTISESSION, &ms); if (0 == i_rc) { *i_last_session = ms.addr.lba; return DRIVER_OP_SUCCESS; } else { cdio_warn ("ioctl CDROMMULTISESSION failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } } /*! Find out if media has changed since the last call. @param p_user_data the environment object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ static int get_media_changed_linux (const void *p_user_data) { const _img_private_t *p_env = p_user_data; #if defined(__CDIO_LINUXCD_USE_TIMED_MEDIA_CHANGED) struct cdrom_timed_media_change_info info = { .last_media_change = *(p_env->last_changed_timestamp), .media_flags = 0 }; if (ioctl(p_env->gen.fd, CDROM_TIMED_MEDIA_CHANGE, &info)) { return DRIVER_OP_ERROR; } *(p_env->last_changed_timestamp) = info.last_media_change; return info.media_flags & MEDIA_CHANGED_FLAG; #else return ioctl(p_env->gen.fd, CDROM_MEDIA_CHANGED, 0); #endif } /*! Return the media catalog number MCN. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * get_mcn_linux (const void *p_user_data) { struct cdrom_mcn mcn; const _img_private_t *p_env = p_user_data; memset(&mcn, 0, sizeof(mcn)); if (ioctl(p_env->gen.fd, CDROM_GET_MCN, &mcn) != 0) return NULL; return strdup((char *)mcn.medium_catalog_number); } /*! Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * get_track_isrc_linux (const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; return mmc_get_track_isrc( p_env->gen.cdio, i_track ); } /*! Get format of track. */ static track_format_t get_track_format_linux(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if ( !p_env ) return TRACK_FORMAT_ERROR; if (!p_env->gen.toc_init) read_toc_linux (p_user_data) ; if (i_track > (p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) return TRACK_FORMAT_ERROR; i_track -= p_env->gen.i_first_track; /* This is pretty much copied from the "badly broken" cdrom_count_tracks in linux/cdrom.c. */ if (p_env->tocent[i_track].cdte_ctrl & CDIO_CDROM_DATA_TRACK) { if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_CDI_TRACK) return TRACK_FORMAT_CDI; else if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_XA_TRACK) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool get_track_green_linux(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if (!p_env->gen.toc_init) read_toc_linux (p_user_data) ; if (i_track >= (p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) return false; i_track -= p_env->gen.i_first_track; /* FIXME: Dunno if this is the right way, but it's what I was using in cd-info for a while. */ return ((p_env->tocent[i_track].cdte_ctrl & 2) != 0); } /*! Return the starting MSF (minutes/secs/frames) for track number track_num in obj. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified either by using i_track LEADOUT_TRACK or the total tracks+1. False is returned if there is no track entry. */ static bool get_track_msf_linux(void *p_user_data, track_t i_track, msf_t *msf) { _img_private_t *p_env = p_user_data; if (NULL == msf || (i_track > CDIO_CD_MAX_TRACKS && i_track != CDIO_CDROM_LEADOUT_TRACK)) return false; if (!p_env->gen.toc_init) read_toc_linux (p_user_data) ; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks + p_env->gen.i_first_track; if (i_track > (p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) { return false; } else { struct cdrom_msf0 *msf0= &p_env->tocent[i_track-p_env->gen.i_first_track].cdte_addr.msf; msf->m = cdio_to_bcd8(msf0->minute); msf->s = cdio_to_bcd8(msf0->second); msf->f = cdio_to_bcd8(msf0->frame); return true; } } /*! Check, if a device is mounted and return the target (=mountpoint) needed for umounting (idea taken from libunieject). */ static int is_mounted (const char * device, char * target) { FILE * fp; char real_device_1[PATH_MAX]; char real_device_2[PATH_MAX]; struct mntent *fs; fp = setmntent("/proc/mounts", "r"); /* Older systems just have /etc/mtab */ if(!fp) fp = setmntent("/etc/mtab", "r"); /* Neither /proc/mounts nor /etc/mtab could be opened, give up here */ if(!fp) return 0; /* Get real device */ if (NULL == cdio_realpath(device, real_device_1)) { cdio_warn("Problems resolving device %s: %s\n", device, strerror(errno)); } /* Read entries */ while ((fs = getmntent(fp)) != NULL) { if (NULL == cdio_realpath(fs->mnt_fsname, real_device_2)) { cdio_debug("Problems resolving device %s: %s\n", fs->mnt_fsname, strerror(errno)); } if(!strcmp(real_device_1, real_device_2)) { strcpy(target, fs->mnt_dir); endmntent(fp); return 1; } } endmntent(fp); return 0; } /*! Umount a filesystem specified by it's mountpoint. We must do this by forking and calling the umount command, because the raw umount (or umount2) system calls will *always* trigger an EPERM even if we are allowed to umount the filesystem. The umount command is suid root. Code here is inspired by the standard linux eject command by Jeff Tranter and Frank Lichtenheld. */ static int do_umount(char * target) { int status; switch (fork()) { case 0: /* child */ execlp("pumount", "pumount", target, NULL); execlp("umount", "umount", target, NULL); return -1; case -1: return -1; default: /* parent */ wait(&status); if (WIFEXITED(status) == 0) { return -1; } if (WEXITSTATUS(status) != 0) { return -1; } break; } return 0; } /*! Eject media in CD-ROM drive. Return DRIVER_OP_SUCCESS if successful, DRIVER_OP_ERROR on error. */ static driver_return_code_t eject_media_linux (void *p_user_data) { _img_private_t *p_env = p_user_data; driver_return_code_t ret=DRIVER_OP_SUCCESS; int status; bool was_open = false; char mount_target[PATH_MAX]; /* Make sure the device is opened in read/write mode. */ if ( p_env->gen.fd >= 0 ) { close(p_env->gen.fd); was_open = true; } p_env->gen.fd = open (p_env->gen.source_name, O_RDWR|O_NONBLOCK); if ( p_env->gen.fd <= -1 ) return DRIVER_OP_ERROR; if ((status = ioctl(p_env->gen.fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) > 0) { switch(status) { case CDS_TRAY_OPEN: cdio_info ("Drive status reports that tray is open\n"); break; default: cdio_info ("Unknown state of CD-ROM (%d)\n", status); /* Fall through */ case CDS_DISC_OK: /* Some systems automount the drive, so we must umount it. We check if the drive is actually mounted */ if(is_mounted (p_env->gen.source_name, mount_target)) { /* Try to umount the drive */ if(do_umount(mount_target)) { cdio_log(CDIO_LOG_WARN, "Could not umount %s\n", p_env->gen.source_name); ret=DRIVER_OP_ERROR; break; } /* For some reason, we must close and reopen the device after it got umounted (at least the commandline eject program opens the device just after umounting it) */ close(p_env->gen.fd); p_env->gen.fd = open (p_env->gen.source_name, O_RDWR|O_NONBLOCK); } if((ret = ioctl(p_env->gen.fd, CDROMEJECT)) != 0) { int eject_error = errno; /* Try ejecting the MMC way... */ ret = mmc_eject_media(p_env->gen.cdio); if (0 != ret) { cdio_info("ioctl CDROMEJECT and MMC eject failed: %s", strerror(eject_error)); ret = DRIVER_OP_ERROR; } } /* force kernel to reread partition table when new disc inserted */ if (0 != ioctl(p_env->gen.fd, BLKRRPART)) { cdio_info ("BLKRRPART request failed: %s\n", strerror(errno)); } break; } } else { cdio_warn ("CDROM_DRIVE_STATUS failed: %s\n", strerror(errno)); ret=DRIVER_OP_ERROR; } if(!was_open) { close(p_env->gen.fd); p_env->gen.fd = -1; } return ret; } /*! Get disc type associated with cd object. */ static discmode_t dvd_discmode_linux (_img_private_t *p_env) { discmode_t discmode=CDIO_DISC_MODE_NO_INFO; /* See if this is a DVD. */ cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */ memset(&dvd, 0, sizeof(dvd)); dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL; dvd.physical.layer_num = 0; if (0 == ioctl (p_env->gen.fd, DVD_READ_STRUCT, &dvd)) { switch(dvd.physical.layer[0].book_type) { case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM; case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM; case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R; case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW; case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR; case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW; default: return CDIO_DISC_MODE_DVD_OTHER; } } return discmode; } /*! Get disc type associated with the cd object. */ static discmode_t get_discmode_linux (void *p_user_data) { _img_private_t *p_env = p_user_data; discmode_t discmode; if (!p_env) return CDIO_DISC_MODE_ERROR; /* Try DVD types first. See note below. */ discmode = dvd_discmode_linux(p_env); if (CDIO_DISC_MODE_NO_INFO != discmode) return discmode; /* Justin B Ruggles reports that the GNU/Linux ioctl(.., CDROM_DISC_STATUS) does not return "CD DATA Form 2" for SVCD's even though they are are form 2. In mmc_get_discmode we issue a SCSI MMC-2 TOC command first to try get more accurate information. But we took care above *not* to issue a FULL TOC on DVD media. */ discmode = mmc_get_discmode(p_env->gen.cdio); if (CDIO_DISC_MODE_NO_INFO != discmode) return discmode; else { int32_t i_discmode = ioctl (p_env->gen.fd, CDROM_DISC_STATUS); if (i_discmode < 0) return CDIO_DISC_MODE_ERROR; switch(i_discmode) { case CDS_AUDIO: return CDIO_DISC_MODE_CD_DA; case CDS_DATA_1: case CDS_DATA_2: /* Actually, recent GNU/Linux kernels don't return CDS_DATA_2, but just in case. */ return CDIO_DISC_MODE_CD_DATA; case CDS_MIXED: return CDIO_DISC_MODE_CD_MIXED; case CDS_XA_2_1: case CDS_XA_2_2: return CDIO_DISC_MODE_CD_XA; case CDS_NO_INFO: return CDIO_DISC_MODE_NO_INFO; default: return CDIO_DISC_MODE_ERROR; } } } /* Check a drive to see if it is a CD-ROM Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive and -1 if no device exists . */ static bool is_cdrom_linux(const char *drive, char *mnttype) { bool is_cd=false; int cdfd; /* If it doesn't exist, return -1 */ if ( !cdio_is_device_quiet_generic(drive) ) { return(false); } /* If it does exist, verify that it's an available CD-ROM */ cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0); if ( cdfd >= 0 ) { if ( ioctl(cdfd, CDROM_GET_CAPABILITY, 0) != -1 ) { is_cd = true; } close(cdfd); } /* Even if we can't read it, it might be mounted */ else if ( mnttype && (strcmp(mnttype, "iso9660") == 0) ) { is_cd = true; } return(is_cd); } /* MMC driver to read audio sectors. Can read only up to 25 blocks. */ static driver_return_code_t read_audio_sectors_linux (void *p_user_data, void *p_buf, lsn_t i_lsn, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; return mmc_read_sectors( p_env->gen.cdio, p_buf, i_lsn, CDIO_MMC_READ_TYPE_CDDA, i_blocks); } /* Packet driver to read mode2 sectors. Can read only up to 25 blocks. */ static driver_return_code_t _read_mode2_sectors_mmc (_img_private_t *p_env, void *p_buf, lba_t lba, uint32_t i_blocks, bool b_read_10) { mmc_cdb_t cdb = {{0, }}; CDIO_MMC_SET_READ_LBA(cdb.field, lba); if (b_read_10) { int retval; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_10); CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_blocks); if ((retval = mmc_set_blocksize (p_env->gen.cdio, M2RAW_SECTOR_SIZE))) return retval; if ((retval = run_mmc_cmd_linux (p_env, 0, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, M2RAW_SECTOR_SIZE * i_blocks, p_buf))) { mmc_set_blocksize (p_env->gen.cdio, CDIO_CD_FRAMESIZE); return retval; } /* Restore blocksize. */ retval = mmc_set_blocksize (p_env->gen.cdio, CDIO_CD_FRAMESIZE); return retval; } else { cdb.field[1] = 0; /* sector size mode2 */ cdb.field[9] = 0x58; /* 2336 mode2 */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_CD); CDIO_MMC_SET_READ_LENGTH24(cdb.field, i_blocks); return run_mmc_cmd_linux (p_env, 0, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, M2RAW_SECTOR_SIZE * i_blocks, p_buf); } } static driver_return_code_t _read_mode2_sectors (_img_private_t *p_env, void *p_buf, lba_t lba, uint32_t i_blocks, bool b_read_10) { unsigned int l = 0; int retval = 0; while (i_blocks > 0) { const unsigned i_blocks2 = (i_blocks > 25) ? 25 : i_blocks; void *p_buf2 = ((char *)p_buf ) + (l * M2RAW_SECTOR_SIZE); retval |= _read_mode2_sectors_mmc (p_env, p_buf2, lba + l, i_blocks2, b_read_10); if (retval) break; i_blocks -= i_blocks2; l += i_blocks2; } return retval; } /*! Reads a single mode1 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sector_linux (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2) { return cdio_generic_read_form1_sector(p_user_data, p_data, lsn); } /*! Reads i_blocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sectors_linux (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; unsigned int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < i_blocks; i++) { if ( (retval = _read_mode1_sector_linux (p_env, ((char *)p_data) + (blocksize*i), lsn + i, b_form2)) ) return retval; } return DRIVER_OP_SUCCESS; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sector_linux (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2) { char buf[M2RAW_SECTOR_SIZE] = { 0, }; struct cdrom_msf *msf = (struct cdrom_msf *) &buf; msf_t _msf; _img_private_t *p_env = p_user_data; cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf); msf->cdmsf_min0 = cdio_from_bcd8(_msf.m); msf->cdmsf_sec0 = cdio_from_bcd8(_msf.s); msf->cdmsf_frame0 = cdio_from_bcd8(_msf.f); retry: switch (p_env->access_mode) { case _AM_NONE: cdio_warn ("no way to read mode2"); return 1; break; case _AM_IOCTL: case _AM_MMC_RDWR: case _AM_MMC_RDWR_EXCL: if (ioctl (p_env->gen.fd, CDROMREADMODE2, &buf) == -1) { perror ("ioctl()"); return 1; /* exit (EXIT_FAILURE); */ } break; case _AM_READ_CD: case _AM_READ_10: if (_read_mode2_sectors (p_env, buf, lsn, 1, (p_env->access_mode == _AM_READ_10))) { perror ("ioctl()"); if (p_env->access_mode == _AM_READ_CD) { cdio_info ("READ_CD failed; switching to READ_10 mode..."); p_env->access_mode = _AM_READ_10; goto retry; } else { cdio_info ("READ_10 failed; switching to ioctl(CDROMREADMODE2) mode..."); p_env->access_mode = _AM_IOCTL; goto retry; } return 1; } break; } if (b_form2) memcpy (p_data, buf, M2RAW_SECTOR_SIZE); else memcpy (((char *)p_data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } /*! Reads i_blocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sectors_linux (void *p_user_data, void *data, lsn_t lsn, bool b_form2, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; unsigned int i; uint16_t i_blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; /* For each frame, pick out the data part we need */ for (i = 0; i < i_blocks; i++) { int retval; if ( (retval = _read_mode2_sector_linux (p_env, ((char *)data) + (i_blocksize*i), lsn + i, b_form2)) ) return retval; } return DRIVER_OP_SUCCESS; } /*! Read and cache the CD's Track Table of Contents and track info. Return false if successful or true if an error. */ static bool read_toc_linux (void *p_user_data) { _img_private_t *p_env = p_user_data; int i, i_last_track; unsigned int u_tracks; /* read TOC header */ if ( ioctl(p_env->gen.fd, CDROMREADTOCHDR, &p_env->tochdr) == -1 ) { cdio_warn("%s: %s\n", "error in ioctl CDROMREADTOCHDR", strerror(errno)); return false; } p_env->gen.i_first_track = p_env->tochdr.cdth_trk0; i_last_track = p_env->tochdr.cdth_trk1; p_env->gen.i_tracks = i_last_track - p_env->gen.i_first_track + 1; u_tracks = p_env->gen.i_tracks; if (u_tracks > CDIO_CD_MAX_TRACKS) { cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", u_tracks, CDIO_CD_MAX_TRACKS); p_env->gen.i_tracks = CDIO_CD_MAX_TRACKS; } /* read individual tracks */ for (i= p_env->gen.i_first_track; i <= i_last_track; i++) { struct cdrom_tocentry *p_toc = &(p_env->tocent[i-p_env->gen.i_first_track]); p_toc->cdte_track = i; p_toc->cdte_format = CDROM_MSF; if ( ioctl(p_env->gen.fd, CDROMREADTOCENTRY, p_toc) == -1 ) { cdio_warn("%s %d: %s\n", "error in ioctl CDROMREADTOCENTRY for track", i, strerror(errno)); return false; } set_track_flags(&(p_env->gen.track_flags[i]), p_toc->cdte_ctrl); /**** struct cdrom_msf0 *msf= &env->tocent[i-1].cdte_addr.msf; fprintf (stdout, "--- track# %d (msf %2.2x:%2.2x:%2.2x)\n", i, msf->minute, msf->second, msf->frame); ****/ } /* read the lead-out track */ p_env->tocent[p_env->gen.i_tracks].cdte_track = CDIO_CDROM_LEADOUT_TRACK; p_env->tocent[p_env->gen.i_tracks].cdte_format = CDROM_MSF; if (ioctl(p_env->gen.fd, CDROMREADTOCENTRY, &p_env->tocent[p_env->gen.i_tracks]) == -1 ) { cdio_warn("%s: %s\n", "error in ioctl CDROMREADTOCENTRY for lead-out", strerror(errno)); return false; } /* struct cdrom_msf0 *msf= &env->tocent[p_env->gen.i_tracks].cdte_addr.msf; fprintf (stdout, "--- track# %d (msf %2.2x:%2.2x:%2.2x)\n", i, msf->minute, msf->second, msf->frame); */ p_env->gen.toc_init = true; return true; } /*! Run a SCSI MMC command. cdio CD structure set by cdio_open(). i_timeout time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. We return true if command completed successfully and false if not. */ static driver_return_code_t run_mmc_cmd_linux(void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf) { _img_private_t *p_env = p_user_data; struct cdrom_generic_command cgc; cdio_mmc_request_sense_t sense; p_env->gen.scsi_mmc_sense_valid = 0; memset(&cgc, 0, sizeof (struct cdrom_generic_command)); memset(&sense, 0, sizeof (struct cdio_mmc_request_sense)); memcpy(&cgc.cmd, p_cdb, i_cdb); cgc.buflen = i_buf; cgc.buffer = p_buf; cgc.sense = (struct request_sense *) &sense; cgc.data_direction = (SCSI_MMC_DATA_READ == e_direction) ? CGC_DATA_READ : (SCSI_MMC_DATA_WRITE == e_direction) ? CGC_DATA_WRITE : CGC_DATA_NONE; #ifdef HAVE_LINUX_CDROM_TIMEOUT cgc.timeout = i_timeout_ms; #endif { int i_rc = ioctl (p_env->gen.fd, CDROM_SEND_PACKET, &cgc); /* Record SCSI sense reply for API call mmc_last_cmd_sense(). */ if (sense.additional_sense_len) { /* SCSI Primary Command standard SPC 4.5.3, Table 26: 252 bytes legal, 263 bytes possible */ int sense_size = sense.additional_sense_len + 8; if (sense_size > sizeof(sense)) sense_size = sizeof(sense); memcpy((void *) p_env->gen.scsi_mmc_sense, &sense, sense_size); p_env->gen.scsi_mmc_sense_valid = sense_size; } if (0 == i_rc) return DRIVER_OP_SUCCESS; if (-1 == i_rc) { cdio_info("ioctl CDROM_SEND_PACKET for command %s (0x%0x) failed:\n\t%s", mmc_cmd2str((uint8_t) p_cdb->field[0]), p_cdb->field[0], strerror(errno)); switch (errno) { case EPERM: return DRIVER_OP_NOT_PERMITTED; break; case EINVAL: return DRIVER_OP_BAD_PARAMETER; break; case EFAULT: return DRIVER_OP_BAD_POINTER; break; case EIO: default: return DRIVER_OP_ERROR; break; } } else if (i_rc < -1) return DRIVER_OP_ERROR; else /*Not sure if this the best thing, but we'll use anyway. */ return DRIVER_OP_SUCCESS; } } /*! Return the size of the CD in logical block address (LBA) units. @return the lsn. On error return CDIO_INVALID_LSN. As of GNU/Linux 2.6, CDROMTOCENTRY gives ioctl CDROMREADTOCENTRY failed: Invalid argument In some cases CDROMREADTOCHDR seems to fix this, but I haven't been able to find anything that documents this requirement or behavior. It's not the way CDROMREADTOCHDR works on other 'nixs. Also note that in one at least one test the corresponding MMC gives a different answer, so there may be some disagreement about what is in fact the last lsn. */ static lsn_t get_disc_last_lsn_linux (void *p_user_data) { _img_private_t *p_env = p_user_data; struct cdrom_tocentry tocent; uint32_t i_size; if (!p_env->gen.toc_init) read_toc_linux (p_user_data) ; tocent.cdte_track = CDIO_CDROM_LEADOUT_TRACK; tocent.cdte_format = CDROM_LBA; if (ioctl (p_env->gen.fd, CDROMREADTOCENTRY, &tocent) == -1) { cdio_warn ("ioctl CDROMREADTOCENTRY failed: %s\n", strerror(errno)); return CDIO_INVALID_LSN; } i_size = tocent.cdte_addr.lba; return i_size; } /*! Set the arg "key" with "value" in the source device. Currently "source" and "access-mode" are valid keys. "source" sets the source device in I/O operations "access-mode" sets the the method of CD access DRIVER_OP_SUCCESS is returned if no error was found, and nonzero if there as an error. */ static driver_return_code_t set_arg_linux (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return DRIVER_OP_ERROR; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { p_env->access_mode = str_to_access_mode_linux(key); } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } /* checklist: /dev/cdrom, /dev/dvd /dev/hd?, /dev/scd? /dev/sr? */ static const char checklist1[][40] = { {"cdrom"}, {"dvd"} }; static const int checklist1_size = sizeof(checklist1) / sizeof(checklist1[0]); static const struct { char format[22]; int num_min; int num_max; } checklist2[] = { { "/dev/hd%c", 'a', 'z' }, { "/dev/scd%d", 0, 27 }, { "/dev/sr%d", 0, 27 }, }; static const int checklist2_size = sizeof(checklist2) / sizeof(checklist2[0]); /* Set CD-ROM drive speed */ static driver_return_code_t set_speed_linux (void *p_user_data, int i_drive_speed) { const _img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return ioctl(p_env->gen.fd, CDROM_SELECT_SPEED, i_drive_speed); } #endif /* HAVE_LINUX_CDROM */ /*! Return an array of strings giving possible CD devices. */ char ** cdio_get_devices_linux (void) { #ifndef HAVE_LINUX_CDROM return NULL; #else unsigned int i; char drive[40]; char *ret_drive; char **drives = NULL; unsigned int num_drives=0; /* Scan the system for CD-ROM drives. */ for ( i=0; i < checklist1_size; ++i ) { if (snprintf(drive, sizeof(drive), "/dev/%s", checklist1[i]) < 0) continue; if ( is_cdrom_linux(drive, NULL) > 0 ) { cdio_add_device_list(&drives, drive, &num_drives); } } /* Now check the currently mounted CD drives */ if (NULL != (ret_drive = check_mounts_linux("/etc/mtab"))) { cdio_add_device_list(&drives, ret_drive, &num_drives); free(ret_drive); } /* Finally check possible mountable drives in /etc/fstab */ if (NULL != (ret_drive = check_mounts_linux("/etc/fstab"))) { cdio_add_device_list(&drives, ret_drive, &num_drives); free(ret_drive); } /* Scan the system for CD-ROM drives. Not always 100% reliable, so use the USE_MNTENT code above first. */ for ( i=0; i < checklist2_size; ++i ) { unsigned int j; for ( j=checklist2[i].num_min; j<=checklist2[i].num_max; ++j ) { if (snprintf(drive, sizeof(drive), checklist2[i].format, j) < 0) continue; if ( (is_cdrom_linux(drive, NULL)) > 0 ) { cdio_add_device_list(&drives, drive, &num_drives); } } } cdio_add_device_list(&drives, NULL, &num_drives); return drives; #endif /*HAVE_LINUX_CDROM*/ } /*! Return a string containing the default CD device. */ char * cdio_get_default_device_linux(void) { #ifndef HAVE_LINUX_CDROM return NULL; #else unsigned int i; char drive[40]; char *ret_drive; /* Scan the system for CD-ROM drives. */ for ( i=0; i < checklist1_size; ++i ) { if (snprintf(drive, sizeof(drive), "/dev/%s", checklist1[i]) < 0) continue; if ( is_cdrom_linux(drive, NULL) > 0 ) { return strdup(drive); } } /* Now check the currently mounted CD drives */ if (NULL != (ret_drive = check_mounts_linux("/etc/mtab"))) return ret_drive; /* Finally check possible mountable drives in /etc/fstab */ if (NULL != (ret_drive = check_mounts_linux("/etc/fstab"))) return ret_drive; /* Scan the system for CD-ROM drives. Not always 100% reliable, so use the USE_MNTENT code above first. */ for ( i=0; i < checklist2_size; ++i ) { unsigned int j; for ( j=checklist2[i].num_min; j<=checklist2[i].num_max; ++j ) { if (snprintf(drive, sizeof(drive), checklist2[i].format, j) < 0) continue; if ( is_cdrom_linux(drive, NULL) > 0 ) { return(strdup(drive)); } } } return NULL; #endif /*HAVE_LINUX_CDROM*/ } /*! Close tray on CD-ROM. @param psz_device the CD-ROM drive to be closed. */ driver_return_code_t close_tray_linux (const char *psz_device) { #ifdef HAVE_LINUX_CDROM int i_rc; int fd = open (psz_device, O_RDONLY|O_NONBLOCK); int status; if ( fd > -1 ) { if((status = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) > 0) { switch(status) { case CDS_TRAY_OPEN: goto try_anyway; break; case CDS_DISC_OK: cdio_info ("Tray already closed."); i_rc = DRIVER_OP_SUCCESS; break; default: cdio_info ("Unknown CD-ROM status (%d), trying anyway", status); goto try_anyway; } } else { cdio_info ("CDROM_DRIVE_STATUS failed: %s, trying anyway", strerror(errno)); try_anyway: if((i_rc = ioctl(fd, CDROMCLOSETRAY)) != 0) { cdio_warn ("ioctl CDROMCLOSETRAY failed: %s\n", strerror(errno)); i_rc = DRIVER_OP_ERROR; } } close(fd); } else i_rc = DRIVER_OP_ERROR; return i_rc; #else return DRIVER_OP_NO_DRIVER; #endif /*HAVE_LINUX_CDROM*/ } #ifdef HAVE_LINUX_CDROM /*! Produce a text composed from the system SCSI address tuple according to habits of Linux 2.4 and 2.6 : "Bus,Host,Channel,Target,Lun" and store it in generic_img_private_t.scsi_tuple. To be accessed via cdio_get_arg("scsi-tuple-linux") or ("scsi-tuple"). Drivers which implement this code have to return 5 valid decimal numbers separated by comma, or empty text if no such numbers are available. @return 1=success , 0=failure */ static int set_scsi_tuple_linux(_img_private_t *env) { int bus_no = -1, host_no = -1, channel_no = -1, target_no = -1, lun_no = -1; int ret, i; char tuple[160], hdx[10]; #ifdef SCSI_IOCTL_GET_IDLUN struct my_scsi_idlun { int x; int host_unique_id; }; struct my_scsi_idlun idlun; #endif struct stat stbuf, env_stbuf; /* Check whether this is a hdX and declare tuple unavailable. /dev/hdX is traditionally for IDE drives and the ioctls here traditionally return ok and all 0s for all IDE drives. So the tuples are no unique ids. */ if (fstat(env->gen.fd, &env_stbuf) == -1) goto no_tuple; strcpy(hdx, "/dev/hdX"); for (i = 'a'; i <= 'z'; i++) { hdx[7] = i; if (stat(hdx, &stbuf) == -1) continue; if (env_stbuf.st_dev == stbuf.st_dev && env_stbuf.st_ino == stbuf.st_ino) goto no_tuple; } #ifdef SCSI_IOCTL_GET_BUS_NUMBER if (ioctl(env->gen.fd, SCSI_IOCTL_GET_BUS_NUMBER, &bus_no) == -1) bus_no = -1; #endif #ifdef SCSI_IOCTL_GET_IDLUN /* http://www.tldp.org/HOWTO/SCSI-Generic-HOWTO/scsi_g_idlun.html */ ret = ioctl(env->gen.fd, SCSI_IOCTL_GET_IDLUN, &idlun); if (ret != -1) { host_no= (idlun.x >> 24) & 255; channel_no= (idlun.x >> 16) & 255; target_no= (idlun.x) & 255; lun_no= (idlun.x >> 8) & 255; } #endif if (env->gen.scsi_tuple != NULL) free (env->gen.scsi_tuple); env->gen.scsi_tuple = NULL; if (bus_no < 0 || host_no < 0 || channel_no < 0 || target_no < 0 || lun_no < 0) { no_tuple:; env->gen.scsi_tuple = strdup(""); return 0; } snprintf(tuple, sizeof(tuple)-1, "%d,%d,%d,%d,%d", bus_no, host_no, channel_no, target_no, lun_no); env->gen.scsi_tuple = strdup(tuple); return 1; } #endif /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_linux (const char *psz_source_name) { #ifdef HAVE_LINUX_CDROM return cdio_open_am_linux(psz_source_name, NULL); #else return NULL; #endif /*HAVE_LINUX_CDROM*/ } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_am_linux (const char *psz_orig_source, const char *access_mode) { #ifdef HAVE_LINUX_CDROM CdIo_t *ret; _img_private_t *_data; char *psz_source; int open_access_mode; /* Access mode passed to cdio_generic_init. */ cdio_funcs_t _funcs = { .audio_get_volume = audio_get_volume_linux, .audio_pause = audio_pause_linux, .audio_play_msf = audio_play_msf_linux, .audio_play_track_index= audio_play_track_index_linux, #ifdef USE_MMC_SUBCHANNEL .audio_read_subchannel = audio_read_subchannel_mmc, #else .audio_read_subchannel = audio_read_subchannel_linux, #endif .audio_resume = audio_resume_linux, .audio_set_volume = audio_set_volume_linux, .audio_stop = audio_stop_linux, .eject_media = eject_media_linux, .free = free_linux, .get_arg = get_arg_linux, .get_blocksize = get_blocksize_mmc, .get_cdtext = get_cdtext_generic, .get_cdtext_raw = read_cdtext_generic, .get_default_device = cdio_get_default_device_linux, .get_devices = cdio_get_devices_linux, .get_disc_last_lsn = get_disc_last_lsn_linux, .get_discmode = get_discmode_linux, #if defined(USE_LINUX_CAP) .get_drive_cap = get_drive_cap_linux, #else .get_drive_cap = get_drive_cap_mmc, #endif .get_first_track_num = get_first_track_num_generic, .get_hwinfo = NULL, .get_last_session = get_last_session_linux, .get_media_changed = get_media_changed_linux, .get_mcn = get_mcn_linux, .get_num_tracks = get_num_tracks_generic, .get_track_channels = get_track_channels_generic, .get_track_copy_permit = get_track_copy_permit_generic, .get_track_format = get_track_format_linux, .get_track_green = get_track_green_linux, .get_track_lba = NULL, /* This could be implemented if need be. */ .get_track_preemphasis = get_track_preemphasis_generic, .get_track_msf = get_track_msf_linux, .get_track_isrc = get_track_isrc_linux, .lseek = cdio_generic_lseek, .read = cdio_generic_read, .read_audio_sectors = read_audio_sectors_linux, #if 1 .read_data_sectors = read_data_sectors_generic, #else .read_data_sectors = read_data_sectors_mmc, #endif .read_mode1_sector = _read_mode1_sector_linux, .read_mode1_sectors = _read_mode1_sectors_linux, .read_mode2_sector = _read_mode2_sector_linux, .read_mode2_sectors = _read_mode2_sectors_linux, .read_toc = read_toc_linux, .run_mmc_cmd = run_mmc_cmd_linux, .set_arg = set_arg_linux, .set_blocksize = set_blocksize_mmc, #if 1 .set_speed = set_speed_linux, #else .set_speed = set_speed_mmc, #endif }; _data = calloc (1, sizeof (_img_private_t)); _data->access_mode = str_to_access_mode_linux(access_mode); _data->gen.init = false; _data->gen.toc_init = false; _data->gen.fd = -1; _data->gen.b_cdtext_error = false; #ifdef __CDIO_LINUXCD_USE_TIMED_MEDIA_CHANGED _data->last_changed_timestamp = calloc(1, sizeof (__s64)); *(_data->last_changed_timestamp) = 0; #endif if (NULL == psz_orig_source) { psz_source=cdio_get_default_device_linux(); if (NULL == psz_source) { goto err_exit; } set_arg_linux(_data, "source", psz_source); free(psz_source); } else { if (cdio_is_device_generic(psz_orig_source)) set_arg_linux(_data, "source", psz_orig_source); else { /* The below would be okay if all device drivers worked this way. */ #if 0 cdio_info ("source %s is not a device", psz_orig_source); #endif goto err_exit; } } ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) { goto err_exit; } ret->driver_id = DRIVER_LINUX; open_access_mode = O_NONBLOCK; if (_AM_MMC_RDWR == _data->access_mode) open_access_mode |= O_RDWR; else if (_AM_MMC_RDWR_EXCL == _data->access_mode) open_access_mode |= O_RDWR | O_EXCL; else open_access_mode |= O_RDONLY; if (cdio_generic_init(_data, open_access_mode)) { set_scsi_tuple_linux(_data); return ret; } free(ret); err_exit: free_linux(_data); return NULL; #else return NULL; #endif /* HAVE_LINUX_CDROM */ } bool cdio_have_linux (void) { #ifdef HAVE_LINUX_CDROM return true; #else return false; #endif /* HAVE_LINUX_CDROM */ } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/image.h000066400000000000000000000061711474051130400164200ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! Header for image drivers. In contrast to image_common.h which contains routines, this header like most C headers does not depend on anything defined before it is included. */ #ifndef CDIO_DRIVER_IMAGE_H_ #define CDIO_DRIVER_IMAGE_H_ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include "cdio_private.h" #include /*! The universal format for information about a track for CD image readers It may be that some fields can be derived from other fields. Over time this structure may get cleaned up. Possibly this can be expanded/reused for real CD formats. */ typedef struct { track_t track_num; /**< Probably is index+1 */ msf_t start_msf; lba_t start_lba; int start_index; lba_t pregap; /**< pre-gap */ lba_t silence; /**< pre-gap with zero audio data */ int sec_count; /**< Number of sectors in this track. Does not include pregap */ int num_indices; flag_t flags; /**< "[NO] COPY", "4CH", "[NO] PREMPAHSIS" */ char *isrc; /**< IRSC Code (5.22.4) exactly 12 bytes */ char *filename; CdioDataSource_t *data_source; off_t offset; /**< byte offset into data_start of track beginning. In cdrdao for example, one filename may cover many tracks and each track would then have a different offset. */ track_format_t track_format; bool track_green; trackmode_t mode; uint16_t datasize; /**< How much is in the portion we return back? */ uint16_t datastart; /**< Offset from begining of frame that data starts */ uint16_t endsize; /**< How much stuff at the end to skip over. This stuff may have error correction (EDC, or ECC).*/ uint16_t blocksize; /**< total block size = start + size + end */ } track_info_t; #endif /* CDIO_DRIVER_IMAGE_H_ */ libcdio-2.2.0/lib/driver/image/000077500000000000000000000000001474051130400162425ustar00rootroot00000000000000libcdio-2.2.0/lib/driver/image/.gitignore000066400000000000000000000000041474051130400202240ustar00rootroot00000000000000/*~ libcdio-2.2.0/lib/driver/image/Makefile000066400000000000000000000015511474051130400177040ustar00rootroot00000000000000# $Id: Makefile,v 1.2 2008/04/21 18:30:22 karl Exp $ # # Copyright (C) 2004, 2008 Rocky Bernstein # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # The make is done above. This boilerplate Makefile just transfers the call all install check clean: cd .. && $(MAKE) $@ libcdio-2.2.0/lib/driver/image/bincue.c000066400000000000000000001302131474051130400176530ustar00rootroot00000000000000/* Copyright (C) 2002-2006, 2008, 2011-2012, 2014, 2017 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel cue parsing routine adapted from cuetools Copyright (C) 2003 Svend Sanjay Sorensen 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This code implements low-level access functions for a CD images residing inside a disk file (*.bin) and its associated cue sheet. (*.cue). */ #include "portable.h" #include "image.h" #include "cdio_assert.h" #include "cdio_private.h" #include "cdtext_private.h" #include "_cdio_stdio.h" #include #include #include #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_GLOB_H #include #endif #ifdef HAVE_INTTYPES_H #include #else #define PRId64 "lld" #endif #ifdef HAVE_WINDOWS_H #include #endif #include #include #include #include #include #include "image.h" #include "cdio_assert.h" #include "cdio_private.h" #include "_cdio_stdio.h" /* reader */ #define DEFAULT_CDIO_DEVICE "videocd.bin" #define DEFAULT_CDIO_CUE "videocd.cue" #ifdef _WIN32 #define CDIO_FOPEN fopen_utf8 #else #define CDIO_FOPEN fopen #endif static lsn_t get_disc_last_lsn_bincue(void *p_user_data); #include "image_common.h" static bool parse_cuefile(_img_private_t *cd, const char *toc_name); /*! Initialize image structures. */ static bool _init_bincue(_img_private_t *p_env) { lsn_t lead_lsn; if (p_env->gen.init) return false; if (!(p_env->gen.data_source = cdio_stdio_new (p_env->gen.source_name))) { cdio_warn ("init failed"); return false; } /* Have to set init before calling get_disc_last_lsn_bincue() or we will get into infinite recursion calling passing right here. */ p_env->gen.init = true; p_env->gen.i_first_track = 1; p_env->psz_mcn = NULL; p_env->disc_mode = CDIO_DISC_MODE_NO_INFO; lead_lsn = get_disc_last_lsn_bincue( (_img_private_t *) p_env); if (-1 == lead_lsn) return false; if (NULL == p_env->psz_cue_name) return false; /* Read in CUE sheet. */ if ( !parse_cuefile(p_env, p_env->psz_cue_name) ) return false; /* Fake out leadout track and sector count for last track*/ cdio_lsn_to_msf (lead_lsn, &p_env->tocent[p_env->gen.i_tracks].start_msf); p_env->tocent[p_env->gen.i_tracks].start_lba = cdio_lsn_to_lba(lead_lsn); p_env->tocent[p_env->gen.i_tracks - p_env->gen.i_first_track].sec_count = cdio_lsn_to_lba(lead_lsn - p_env->tocent[p_env->gen.i_tracks - p_env->gen.i_first_track].start_lba); return true; } /*! Reads into buf the next size bytes. Returns -1 on error. Would be libc's seek() but we have to adjust for the extra track header information in each sector. */ static off_t _lseek_bincue (void *p_user_data, off_t offset, int whence) { _img_private_t *p_env = p_user_data; /* real_offset is the real byte offset inside the disk image The number below was determined empirically. I'm guessing the 1st 24 bytes of a bin file are used for something. */ off_t real_offset=0; unsigned int i; p_env->pos.lba = 0; for (i=0; igen.i_tracks; i++) { track_info_t *this_track=&(p_env->tocent[i]); p_env->pos.index = i; if ( (this_track->sec_count*this_track->datasize) >= offset) { int blocks = (int) (offset / this_track->datasize); int rem = (int) (offset % this_track->datasize); off_t block_offset = blocks * this_track->blocksize; real_offset += block_offset + rem; p_env->pos.buff_offset = rem; p_env->pos.lba += (lba_t) blocks; break; } real_offset += this_track->sec_count*this_track->blocksize; offset -= this_track->sec_count*this_track->datasize; p_env->pos.lba += this_track->sec_count; } if (i==p_env->gen.i_tracks) { cdio_warn ("seeking outside range of disk image"); return DRIVER_OP_ERROR; } else { real_offset += p_env->tocent[i].datastart; return cdio_stream_seek(p_env->gen.data_source, real_offset, whence); } } /*! Reads into buf the next size bytes. Returns -1 on error. FIXME: At present we assume a read doesn't cross sector or track boundaries. */ static ssize_t _read_bincue (void *p_user_data, void *data, size_t size) { _img_private_t *p_env = p_user_data; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; char *p = data; ssize_t final_size=0; ssize_t this_size; track_info_t *this_track=&(p_env->tocent[p_env->pos.index]); ssize_t skip_size = this_track->datastart + this_track->endsize; while (size > 0) { long int rem = (long int) (this_track->datasize - p_env->pos.buff_offset); if ((long int) size <= rem) { this_size = cdio_stream_read(p_env->gen.data_source, buf, size, 1); final_size += this_size; memcpy (p, buf, this_size); break; } /* Finish off reading this sector. */ cdio_warn ("Reading across block boundaries not finished"); size -= rem; this_size = cdio_stream_read(p_env->gen.data_source, buf, rem, 1); final_size += this_size; memcpy (p, buf, this_size); p += this_size; cdio_stream_read(p_env->gen.data_source, buf, rem, 1); /* Skip over stuff at end of this sector and the beginning of the next. */ cdio_stream_read(p_env->gen.data_source, buf, skip_size, 1); /* Get ready to read another sector. */ p_env->pos.buff_offset=0; p_env->pos.lba++; /* Have gone into next track. */ if (p_env->pos.lba >= p_env->tocent[p_env->pos.index+1].start_lba) { p_env->pos.index++; this_track=&(p_env->tocent[p_env->pos.index]); skip_size = this_track->datastart + this_track->endsize; } } return final_size; } /*! Return the size of the CD in logical block address (LBA) units. */ static lsn_t get_disc_last_lsn_bincue (void *p_user_data) { _img_private_t *p_env = p_user_data; off_t size; size = cdio_stream_stat (p_env->gen.data_source); if (size % CDIO_CD_FRAMESIZE_RAW) { cdio_warn ("image %s size (%" PRId64 ") not multiple of blocksize (%d)", p_env->gen.source_name, (int64_t)size, CDIO_CD_FRAMESIZE_RAW); if (size % M2RAW_SECTOR_SIZE == 0) cdio_warn ("this may be a 2336-type disc image"); else if (size % CDIO_CD_FRAMESIZE_RAW == 0) cdio_warn ("this may be a 2352-type disc image"); /* exit (EXIT_FAILURE); */ } size /= CDIO_CD_FRAMESIZE_RAW; return (lsn_t)size; } #define MAXLINE 4096 /* maximum line length + 1 */ static bool parse_cuefile (_img_private_t *cd, const char *psz_cue_name) { /* The below declarations may be common in other image-parse routines. */ FILE *fp; char psz_line[MAXLINE]; /* text of current line read in file fp. */ unsigned int i_line=0; /* line number in file of psz_line. */ int i = -1; /* Position in tocent. Same as cd->gen.i_tracks - 1 */ char *psz_keyword, *psz_field, *psz_cue_name_dup; cdio_log_level_t log_level = (NULL == cd) ? CDIO_LOG_INFO : CDIO_LOG_WARN; cdtext_field_t cdtext_key; /* The below declarations may be unique to this image-parse routine. */ int start_index; bool b_first_index_for_track=false; if (NULL == psz_cue_name) return false; psz_cue_name_dup = _cdio_strdup_fixpath(psz_cue_name); if (NULL == psz_cue_name_dup) return false; fp = CDIO_FOPEN (psz_cue_name_dup, "r"); cdio_free(psz_cue_name_dup); if (fp == NULL) { cdio_log(log_level, "error opening %s for reading: %s", psz_cue_name, strerror(errno)); return false; } if (cd) { cd->gen.i_tracks=0; cd->gen.i_first_track=1; cd->psz_mcn=NULL; } while ((fgets(psz_line, MAXLINE, fp)) != NULL) { i_line++; if (NULL != (psz_keyword = strtok (psz_line, " \t\n\r"))) { /* REM remarks ... */ if (0 == strcmp ("REM", psz_keyword)) { ; /* global section */ /* CATALOG ddddddddddddd */ } else if (0 == strcmp ("CATALOG", psz_keyword)) { if (-1 == i) { if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) { cdio_log(log_level, "%s line %d after word CATALOG: ", psz_cue_name, i_line); cdio_log(log_level, "expecting 13-digit media catalog number, got nothing."); goto err_exit; } if (strlen(psz_field) != 13) { cdio_log(log_level, "%s line %d after word CATALOG: ", psz_cue_name, i_line); cdio_log(log_level, "Token %s has length %ld. Should be 13 digits.", psz_field, (long int) strlen(psz_field)); goto err_exit; } else { /* Check that we have all digits*/ unsigned int j; for (j=0; j<13; j++) { if (!isdigit((unsigned char) psz_field[j])) { cdio_log(log_level, "%s line %d after word CATALOG:", psz_cue_name, i_line); cdio_log(log_level, "Character \"%c\" at postition %i of token \"%s\" " "is not all digits.", psz_field[j], j+1, psz_field); goto err_exit; } } } if (cd) cd->psz_mcn = strdup (psz_field); if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } } else { goto not_in_global_section; } /* CDTEXTFILE "" */ } else if (0 == strcmp ("CDTEXTFILE", psz_keyword)) { if(NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) { if (cd) { uint8_t *cdt_data = NULL, *cdt_packs; int size, mmc_len; CdioDataSource_t *source; char *dirname = cdio_dirname(psz_cue_name); char *psz_filename = cdio_abspath(dirname, psz_field); cdt_data = calloc(CDTEXT_LEN_BINARY_MAX + 4, 1); if (NULL == cdt_data) { cdio_log(log_level, "%s line %d: cannot allocate memory for CD-TEXT data buffer", psz_cue_name, i_line); free(psz_filename); free(dirname); goto err_exit; } if(NULL == (source = cdio_stdio_new(psz_filename))) { cdio_log(log_level, "%s line %d: can't open file `%s' for reading", psz_cue_name, i_line, psz_field); free(psz_filename); free(dirname); free(cdt_data); goto err_exit; } size = cdio_stream_read(source, cdt_data, CDTEXT_LEN_BINARY_MAX, 1); if (size < 5) { cdio_log(log_level, "%s line %d: file `%s' is too small to contain CD-TEXT", psz_cue_name, i_line, psz_filename); free(psz_filename); free(dirname); free(cdt_data); cdio_stdio_destroy (source); goto err_exit; } /* Check whether obviously a MMC header is prepended and if so,skip it. cdtext_data_init() wants to see only the text pack bytes. */ cdt_packs = cdt_data; if (cdt_data[0] < 0x80) { /* This cannot be a text pack start */ mmc_len = CDIO_MMC_GET_LEN16(cdt_data) + 2; if ((size == mmc_len || size == mmc_len + 1) && mmc_len % 18 == 4 && cdt_data[4] >= 0x80 && cdt_data[4] <= 0x8f) { /* It looks much like a MMC header followed by a text pack start */ size -= 4; cdt_packs = cdt_data + 4; cdio_log (CDIO_LOG_INFO, "%s line %d: skipped 4 bytes of apparent MMC header in CD-TEXT file `%s'\n", psz_cue_name, i_line, psz_filename); } } /* ignore trailing 0 */ if (1 == size % 18) size -= 1; /* init cdtext */ if (NULL == cd->gen.cdtext) { cd->gen.cdtext = cdtext_init (); } if(0 != cdtext_data_init(cd->gen.cdtext, cdt_packs, size)) cdio_log (log_level, "%s line %d: failed to parse CD-TEXT file `%s'", psz_cue_name, i_line, psz_filename); cdio_stdio_destroy (source); free(psz_filename); free(dirname); free(cdt_data); } } else { goto format_error; } /* FILE "" */ } else if (0 == strcmp ("FILE", psz_keyword)) { if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) { char *dirname = cdio_dirname(psz_cue_name); char *filename = cdio_abspath(dirname, psz_field); if (cd) cd->tocent[i + 1].filename = strdup(filename); free(filename); free(dirname); } else { goto format_error; } /* TRACK N */ } else if (0 == strcmp("TRACK", psz_keyword)) { int i_track; if (NULL != (psz_field = strtok(NULL, " \t\n\r"))) { if (1!=sscanf(psz_field, "%d", &i_track)) { cdio_log(log_level, "%s line %d after word TRACK:", psz_cue_name, i_line); cdio_log(log_level, "Expecting a track number, got %s", psz_field); goto err_exit; } if (i_track < 1 || i_track > 99) { cdio_log(log_level, "Track number out of range 1 to 99, got %s", psz_field); goto err_exit; } if(cd) { if (-1 == i) { cd->gen.i_first_track = i_track; } else if(cd->gen.i_first_track + i + 1 != i_track) { cdio_log(log_level, "Track number out of sequence. Expected %d, got %d", cd->gen.i_first_track + i + 1, i_track); } } } if (NULL != (psz_field = strtok(NULL, " \t\n\r"))) { track_info_t *this_track=NULL; if (cd) { this_track = &(cd->tocent[cd->gen.i_tracks]); this_track->track_num = cd->gen.i_tracks; this_track->num_indices = 0; b_first_index_for_track = false; cd->gen.i_tracks++; } i++; if (0 == strcmp("AUDIO", psz_field)) { if (cd) { this_track->mode = AUDIO; this_track->blocksize = CDIO_CD_FRAMESIZE_RAW; this_track->datasize = CDIO_CD_FRAMESIZE_RAW; this_track->datastart = 0; this_track->endsize = 0; this_track->track_format = TRACK_FORMAT_AUDIO; this_track->track_green = false; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE1/2048", psz_field)) { if (cd) { this_track->mode = MODE1; this_track->blocksize = 2048; this_track->track_format= TRACK_FORMAT_DATA; this_track->track_green = false; /* Is the below correct? */ this_track->datastart = 0; this_track->datasize = CDIO_CD_FRAMESIZE; this_track->endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE1/2352", psz_field)) { if (cd) { this_track->blocksize = 2352; this_track->track_format= TRACK_FORMAT_DATA; this_track->track_green = false; this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; this_track->datasize = CDIO_CD_FRAMESIZE; this_track->endsize = CDIO_CD_EDC_SIZE + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE; this_track->mode = MODE1_RAW; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE2/2336", psz_field)) { if (cd) { this_track->blocksize = 2336; this_track->track_format= TRACK_FORMAT_XA; this_track->track_green = true; this_track->mode = MODE2; this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; this_track->datasize = M2RAW_SECTOR_SIZE; this_track->endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE2/2048", psz_field)) { if (cd) { this_track->blocksize = 2048; this_track->track_format= TRACK_FORMAT_XA; this_track->track_green = true; this_track->mode = MODE2_FORM1; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE2/2324", psz_field)) { if (cd) { this_track->blocksize = 2324; this_track->track_format= TRACK_FORMAT_XA; this_track->track_green = true; this_track->mode = MODE2_FORM2; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE2/2336", psz_field)) { if (cd) { this_track->blocksize = 2336; this_track->track_format= TRACK_FORMAT_XA; this_track->track_green = true; this_track->mode = MODE2_FORM_MIX; this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; this_track->datasize = M2RAW_SECTOR_SIZE; this_track->endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp("MODE2/2352", psz_field)) { if (cd) { this_track->blocksize = 2352; this_track->track_format= TRACK_FORMAT_XA; this_track->track_green = true; this_track->mode = MODE2_RAW; this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE; this_track->datasize = CDIO_CD_FRAMESIZE; this_track->endsize = CDIO_CD_SYNC_SIZE + CDIO_CD_ECC_SIZE; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else { cdio_log(log_level, "%s line %d after word TRACK:", psz_cue_name, i_line); cdio_log(log_level, "Unknown track mode %s", psz_field); goto err_exit; } } else { goto format_error; } /* FLAGS flag1 flag2 ... */ } else if (0 == strcmp("FLAGS", psz_keyword)) { if (0 <= i) { while (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (0 == strcmp ("PRE", psz_field)) { if (cd) cd->tocent[i].flags |= PRE_EMPHASIS; } else if (0 == strcmp ("DCP", psz_field)) { if (cd) cd->tocent[i].flags |= COPY_PERMITTED; } else if (0 == strcmp ("4CH", psz_field)) { if (cd) cd->tocent[i].flags |= FOUR_CHANNEL_AUDIO; } else if (0 == strcmp ("SCMS", psz_field)) { if (cd) cd->tocent[i].flags |= SCMS; } else { goto format_error; } } } else { goto format_error; } /* ISRC CCOOOYYSSSSS */ } else if (0 == strcmp("ISRC", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (cd) cd->tocent[i].isrc = strdup (psz_field); } else { goto format_error; } } else { goto in_global_section; } /* PREGAP MM:SS:FF */ } else if (0 == strcmp("PREGAP", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok(NULL, " \t\n\r"))) { lba_t lba = cdio_lsn_to_lba(cdio_mmssff_to_lba (psz_field)); if (CDIO_INVALID_LBA == lba) { cdio_log(log_level, "%s line %d: after word PREGAP:", psz_cue_name, i_line); cdio_log(log_level, "Invalid MSF string %s", psz_field); goto err_exit; } if (cd) { cd->tocent[i].silence = lba; } } else { goto format_error; } if (NULL != strtok(NULL, " \t\n\r")) { goto format_error; } } else { goto in_global_section; } /* INDEX [##] MM:SS:FF */ } else if (0 == strcmp ("INDEX", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok(NULL, " \t\n\r"))) if (1!=sscanf(psz_field, "%d", &start_index)) { cdio_log(log_level, "%s line %d after word INDEX:", psz_cue_name, i_line); cdio_log(log_level, "expecting an index number, got %s", psz_field); goto err_exit; } if (NULL != (psz_field = strtok(NULL, " \t\n\r"))) { lba_t lba = cdio_mmssff_to_lba (psz_field); if (CDIO_INVALID_LBA == lba) { cdio_log(log_level, "%s line %d: after word INDEX:", psz_cue_name, i_line); cdio_log(log_level, "Invalid MSF string %s", psz_field); goto err_exit; } if (cd) { #ifdef FIXME cd->tocent[i].indexes[cd->tocent[i].nindex++] = lba; #else track_info_t *this_track= &(cd->tocent[cd->gen.i_tracks - 1]); switch (start_index) { case 0: lba += CDIO_PREGAP_SECTORS; this_track->pregap = lba; break; case 1: if (!b_first_index_for_track) { lba += CDIO_PREGAP_SECTORS; cdio_lba_to_msf(lba, &(this_track->start_msf)); b_first_index_for_track = true; this_track->start_lba = lba; } if (cd->gen.i_tracks > 1) { /* Figure out number of sectors for previous track */ track_info_t *prev_track=&(cd->tocent[cd->gen.i_tracks-2]); if ( this_track->start_lba < prev_track->start_lba ) { cdio_log (log_level, "track %d at LBA %lu starts before track %d at LBA %lu", cd->gen.i_tracks, (unsigned long int) this_track->start_lba, cd->gen.i_tracks, (unsigned long int) prev_track->start_lba); prev_track->sec_count = 0; } else if ( this_track->start_lba >= prev_track->start_lba + CDIO_PREGAP_SECTORS ) { prev_track->sec_count = this_track->start_lba - prev_track->start_lba - CDIO_PREGAP_SECTORS ; } else { cdio_log (log_level, "%lu fewer than pregap (%d) sectors in track %d", (long unsigned int) this_track->start_lba - prev_track->start_lba, CDIO_PREGAP_SECTORS, cd->gen.i_tracks); /* Include pregap portion in sec_count. Maybe the pregap was omitted. */ prev_track->sec_count = this_track->start_lba - prev_track->start_lba; } } this_track->num_indices++; break; default: break; } } #endif } else { goto format_error; } } else { goto in_global_section; } /* CD-Text */ } else if ( CDTEXT_FIELD_INVALID != (cdtext_key = cdtext_is_field (psz_keyword)) ) { if (cd) { if (NULL == cd->gen.cdtext) { cd->gen.cdtext = cdtext_init (); if (NULL == cd->gen.cdtext) goto err_exit; cd->gen.cdtext->block[cd->gen.cdtext->block_i].language_code = CDTEXT_LANGUAGE_ENGLISH; } cdtext_set (cd->gen.cdtext, cdtext_key, (uint8_t*) strtok(NULL, "\"\t\n\r"), (-1 == i ? 0 : cd->gen.i_first_track + i), "ISO-8859-1"); } /* unrecognized line */ } else { cdio_log(log_level, "%s line %d: warning: unrecognized keyword: %s", psz_cue_name, i_line, psz_keyword); goto err_exit; } } } if (NULL != cd) { cd->gen.toc_init = true; } fclose (fp); return true; format_error: cdio_log(log_level, "%s line %d after word %s", psz_cue_name, i_line, psz_keyword); goto err_exit; in_global_section: cdio_log(log_level, "%s line %d: word %s not allowed in global section", psz_cue_name, i_line, psz_keyword); goto err_exit; not_in_global_section: cdio_log(log_level, "%s line %d: word %s only allowed in global section", psz_cue_name, i_line, psz_keyword); err_exit: fclose (fp); return false; } /*! Reads a single audio sector from CD device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_audio_sectors_bincue (void *p_user_data, void *data, lsn_t lsn, unsigned int nblocks) { _img_private_t *p_env = p_user_data; int ret; ret = cdio_stream_seek (p_env->gen.data_source, lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (p_env->gen.data_source, data, CDIO_CD_FRAMESIZE_RAW, nblocks); /* ret is number of bytes if okay, but we need to return 0 okay. */ return ret == 0; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sector_bincue (void *p_user_data, void *data, lsn_t lsn, bool b_form2) { _img_private_t *p_env = p_user_data; int ret; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; int blocksize = CDIO_CD_FRAMESIZE_RAW; ret = cdio_stream_seek (p_env->gen.data_source, lsn * blocksize, SEEK_SET); if (ret!=0) return ret; /* FIXME: Not completely sure the below is correct. */ ret = cdio_stream_read (p_env->gen.data_source, buf, CDIO_CD_FRAMESIZE_RAW, 1); if (ret==0) return ret; memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } /*! Reads nblocks of mode1 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sectors_bincue (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *p_env = p_user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode1_sector_bincue (p_env, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return DRIVER_OP_SUCCESS; } /*! Reads a single mode1 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sector_bincue (void *p_user_data, void *data, lsn_t lsn, bool b_form2) { _img_private_t *p_env = p_user_data; int ret; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; /* NOTE: The logic below seems a bit wrong and convoluted to me, but passes the regression tests. (Perhaps it is why we get valgrind errors in vcdxrip). Leave it the way it was for now. Review this sector 2336 stuff later. */ int blocksize = CDIO_CD_FRAMESIZE_RAW; ret = cdio_stream_seek (p_env->gen.data_source, lsn * blocksize, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (p_env->gen.data_source, buf, CDIO_CD_FRAMESIZE_RAW, 1); if (ret==0) return ret; /* See NOTE above. */ if (b_form2) memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, M2RAW_SECTOR_SIZE); else memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sectors_bincue (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *p_env = p_user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode2_sector_bincue (p_env, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return 0; } #if !defined(HAVE_GLOB_H) && defined(_WIN32) static void Win32Glob(const char* pattern, const char* szCurPath, char ***drives, unsigned int *num_files) { char szPath[MAX_PATH]; WIN32_FIND_DATAA ffd; HANDLE hFind; BOOL bFound; SetCurrentDirectoryA(szCurPath); hFind = FindFirstFileA(pattern, &ffd); bFound = (hFind != INVALID_HANDLE_VALUE); while (bFound) { cdio_add_device_list(drives, ffd.cFileName, num_files); bFound = FindNextFileA(hFind, &ffd); } if (hFind != INVALID_HANDLE_VALUE) FindClose(hFind); hFind = FindFirstFileA("*", &ffd); bFound = (hFind != INVALID_HANDLE_VALUE); while (bFound) { if ( (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (strcmp(ffd.cFileName, ".") != 0) && (strcmp(ffd.cFileName, "..") != 0) ) { GetFullPathNameA(ffd.cFileName, sizeof(szPath), szPath, NULL); Win32Glob(pattern, szPath, drives, num_files); SetCurrentDirectoryA(szCurPath); } bFound = FindNextFileA(hFind, &ffd); } if (hFind != INVALID_HANDLE_VALUE) FindClose(hFind); } #endif /*! Return an array of strings giving possible BIN/CUE disk images. */ char ** cdio_get_devices_bincue (void) { char **drives = NULL; unsigned int num_files=0; #ifdef HAVE_GLOB_H unsigned int i; glob_t globbuf; globbuf.gl_offs = 0; glob("*.cue", GLOB_DOOFFS, NULL, &globbuf); for (i=0; ipsz_vendor, "libcdio", sizeof(hw_info->psz_vendor)-1); hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0'; strncpy(hw_info->psz_model, "CDRWIN", sizeof(hw_info->psz_model)-1); hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0'; strncpy(hw_info->psz_revision, CDIO_VERSION, sizeof(hw_info->psz_revision)-1); hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0'; return true; } /*! Return the number of tracks in the current medium. CDIO_INVALID_TRACK is returned on error. */ static track_format_t _get_track_format_bincue(void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; if (!p_env->gen.init) return TRACK_FORMAT_ERROR; if (i_track > p_env->gen.i_first_track + p_env->gen.i_tracks - 1 || i_track < p_env->gen.i_first_track) return TRACK_FORMAT_ERROR; return p_env->tocent[i_track-p_env->gen.i_first_track].track_format; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool _get_track_green_bincue(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if ( NULL == p_env || ( i_track < p_env->gen.i_first_track || i_track >= p_env->gen.i_tracks + p_env->gen.i_first_track ) ) return false; return p_env->tocent[i_track-p_env->gen.i_first_track].track_green; } /*! Return the starting LSN track number i_track in obj. Track numbers start at 1. The "leadout" track is specified either by using i_track LEADOUT_TRACK or the total tracks+1. False is returned if there is no track entry. */ static lba_t _get_lba_track_bincue(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks + p_env->gen.i_first_track; if (i_track <= p_env->gen.i_tracks + p_env->gen.i_first_track && i_track >= p_env->gen.i_first_track) { return p_env->tocent[i_track-p_env->gen.i_first_track].start_lba; } else return CDIO_INVALID_LBA; } /*! Return corresponding BIN file if psz_cue_name is a cue file or NULL if not a CUE file. */ char * cdio_is_cuefile(const char *psz_cue_name) { int i; char *psz_bin_name; if (psz_cue_name == NULL) return NULL; /* FIXME? Now that we have cue parsing, should we really force the filename extension requirement or is it enough just to parse the cuefile? */ psz_bin_name=strdup(psz_cue_name); i=strlen(psz_bin_name)-strlen("cue"); if (i>0) { if (psz_cue_name[i]=='c' && psz_cue_name[i+1]=='u' && psz_cue_name[i+2]=='e') { psz_bin_name[i++]='b'; psz_bin_name[i++]='i'; psz_bin_name[i++]='n'; if (parse_cuefile(NULL, psz_cue_name)) return psz_bin_name; else goto error; } else if (psz_cue_name[i]=='C' && psz_cue_name[i+1]=='U' && psz_cue_name[i+2]=='E') { psz_bin_name[i++]='B'; psz_bin_name[i++]='I'; psz_bin_name[i++]='N'; if (parse_cuefile(NULL, psz_cue_name)) return psz_bin_name; else goto error; } } error: free(psz_bin_name); return NULL; } /*! Return corresponding CUE file if psz_bin_name is a bin file or NULL if not a BIN file. */ char * cdio_is_binfile(const char *psz_bin_name) { int i; char *psz_cue_name; if (psz_bin_name == NULL) return NULL; psz_cue_name=strdup(psz_bin_name); i=strlen(psz_bin_name)-strlen("bin"); if (i>0) { if (psz_bin_name[i]=='b' && psz_bin_name[i+1]=='i' && psz_bin_name[i+2]=='n') { psz_cue_name[i++]='c'; psz_cue_name[i++]='u'; psz_cue_name[i++]='e'; return psz_cue_name; } else if (psz_bin_name[i]=='B' && psz_bin_name[i+1]=='I' && psz_bin_name[i+2]=='N') { psz_cue_name[i++]='C'; psz_cue_name[i++]='U'; psz_cue_name[i++]='E'; return psz_cue_name; } } free(psz_cue_name); return NULL; } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_am_bincue (const char *psz_source_name, const char *psz_access_mode) { if (psz_access_mode != NULL) cdio_warn ("there is only one access mode for bincue. Arg %s ignored", psz_access_mode); return cdio_open_bincue(psz_source_name); } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_bincue (const char *psz_source) { char *psz_bin_name = cdio_is_cuefile(psz_source); if (NULL != psz_bin_name) { free(psz_bin_name); return cdio_open_cue(psz_source); } else { char *psz_cue_name = cdio_is_binfile(psz_source); CdIo_t *cdio = cdio_open_cue(psz_cue_name); free(psz_cue_name); return cdio; } } CdIo_t * cdio_open_cue (const char *psz_cue_name) { CdIo_t *ret; _img_private_t *p_data; char *psz_bin_name; cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); _funcs.eject_media = _eject_media_image; _funcs.free = _free_image; _funcs.get_arg = _get_arg_image; _funcs.get_cdtext = _get_cdtext_image; _funcs.get_cdtext_raw = NULL; _funcs.get_devices = cdio_get_devices_bincue; _funcs.get_default_device = cdio_get_default_device_bincue; _funcs.get_disc_last_lsn = get_disc_last_lsn_bincue; _funcs.get_discmode = _get_discmode_image; _funcs.get_drive_cap = _get_drive_cap_image; _funcs.get_first_track_num = _get_first_track_num_image; _funcs.get_hwinfo = get_hwinfo_bincue; _funcs.get_media_changed = get_media_changed_image; _funcs.get_mcn = _get_mcn_image; _funcs.get_num_tracks = _get_num_tracks_image; _funcs.get_track_channels = get_track_channels_image; _funcs.get_track_copy_permit = get_track_copy_permit_image; _funcs.get_track_format = _get_track_format_bincue; _funcs.get_track_green = _get_track_green_bincue; _funcs.get_track_lba = _get_lba_track_bincue; _funcs.get_track_msf = _get_track_msf_image; _funcs.get_track_preemphasis = get_track_preemphasis_image; _funcs.get_track_pregap_lba = get_track_pregap_lba_image; _funcs.get_track_isrc = get_track_isrc_image; _funcs.lseek = _lseek_bincue; _funcs.read = _read_bincue; _funcs.read_audio_sectors = _read_audio_sectors_bincue; _funcs.read_data_sectors = read_data_sectors_image; _funcs.read_mode1_sector = _read_mode1_sector_bincue; _funcs.read_mode1_sectors = _read_mode1_sectors_bincue; _funcs.read_mode2_sector = _read_mode2_sector_bincue; _funcs.read_mode2_sectors = _read_mode2_sectors_bincue; _funcs.run_mmc_cmd = NULL; _funcs.set_arg = _set_arg_image; _funcs.set_speed = cdio_generic_unimplemented_set_speed; _funcs.set_blocksize = cdio_generic_unimplemented_set_blocksize; if (NULL == psz_cue_name) return NULL; p_data = calloc(1, sizeof (_img_private_t)); if (NULL == p_data) return NULL; p_data->gen.init = false; p_data->psz_cue_name = NULL; ret = cdio_new ((void *)p_data, &_funcs); if (ret == NULL) { free(p_data); return NULL; } ret->driver_id = DRIVER_BINCUE; psz_bin_name = cdio_is_cuefile(psz_cue_name); if (NULL == psz_bin_name) { cdio_error ("source name %s is not recognized as a CUE file", psz_cue_name); } _set_arg_image (p_data, "cue", psz_cue_name); _set_arg_image (p_data, "source", psz_bin_name); _set_arg_image (p_data, "access-mode", "bincue"); free(psz_bin_name); if (_init_bincue(p_data)) { return ret; } else { _free_image(p_data); free(ret); return NULL; } } bool cdio_have_bincue (void) { return true; } libcdio-2.2.0/lib/driver/image/cdrdao.c000066400000000000000000001176351474051130400176570ustar00rootroot00000000000000/* Copyright (C) 2004-2008, 2011-2012, 2014, 2017 Rocky Bernstein toc reading routine adapted from cuetools Copyright (C) 2003 Svend Sanjay Sorensen 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This code implements low-level access functions for a CD images residing inside a disk file (*.bin) and its associated cue sheet. (*.cue). */ #include "portable.h" #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_GLOB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_INTTYPES_H #include #else #define PRId64 "lld" #endif #include #include #include #include #include #include #include #include "image.h" #include "cdio_assert.h" #include "_cdio_stdio.h" /* reader */ #define DEFAULT_CDIO_DEVICE "videocd.bin" #define DEFAULT_CDIO_CDRDAO "videocd.toc" #ifdef _WIN32 #define CDIO_FOPEN fopen_utf8 #else #define CDIO_FOPEN fopen #endif #include "image_common.h" #include "cdtext_private.h" static lsn_t get_disc_last_lsn_cdrdao (void *p_user_data); static bool parse_tocfile (_img_private_t *cd, const char *p_toc_name); static bool check_track_is_blocksize_multiple(const char *psz_fname, track_t i_track, off_t i_size, uint16_t i_blocksize) { if (i_size % i_blocksize) { cdio_info ("image %s track %d size (%" PRId64 ") not a multiple" " of the blocksize (%ld)", psz_fname ? psz_fname : "unknown??", i_track, (int64_t)i_size, (long int) i_blocksize); if (i_size % M2RAW_SECTOR_SIZE == 0) cdio_info ("this may be a 2336-type disc image"); else if (i_size % CDIO_CD_FRAMESIZE_RAW == 0) cdio_info ("this may be a 2352-type disc image"); return false; } return true; } /*! Initialize image structures. */ static bool _init_cdrdao (_img_private_t *env) { lsn_t lead_lsn; if (env->gen.init) return false; /* Have to set init before calling get_disc_last_lsn_cdrdao() or we will get into infinite recursion calling passing right here. */ env->gen.init = true; env->gen.i_first_track = 1; env->psz_mcn = NULL; env->disc_mode = CDIO_DISC_MODE_NO_INFO; /* Read in TOC sheet. */ if ( !parse_tocfile(env, env->psz_cue_name) ) return false; lead_lsn = get_disc_last_lsn_cdrdao( (_img_private_t *) env); if (-1 == lead_lsn) return false; /* Fake out leadout track and sector count for last track*/ cdio_lsn_to_msf (lead_lsn, &env->tocent[env->gen.i_tracks].start_msf); env->tocent[env->gen.i_tracks].start_lba = cdio_lsn_to_lba(lead_lsn); env->tocent[env->gen.i_tracks-env->gen.i_first_track].sec_count = cdio_lsn_to_lba(lead_lsn - env->tocent[env->gen.i_tracks-1].start_lba); return true; } /*! Reads into buf the next size bytes. Returns -1 on error. Would be libc's seek() but we have to adjust for the extra track header information in each sector. */ static off_t _lseek_cdrdao (void *user_data, off_t offset, int whence) { _img_private_t *env = user_data; /* real_offset is the real byte offset inside the disk image The number below was determined empirically. I'm guessing the 1st 24 bytes of a bin file are used for something. */ off_t real_offset=0; unsigned int i; env->pos.lba = 0; for (i=0; igen.i_tracks; i++) { track_info_t *this_track=&(env->tocent[i]); env->pos.index = i; if ( (this_track->sec_count*this_track->datasize) >= offset) { int blocks = (int) (offset / this_track->datasize); int rem = (int) (offset % this_track->datasize); off_t block_offset = blocks * this_track->blocksize; real_offset += block_offset + rem; env->pos.buff_offset = rem; env->pos.lba += (lba_t)blocks; break; } real_offset += this_track->sec_count*this_track->blocksize; offset -= this_track->sec_count*this_track->datasize; env->pos.lba += this_track->sec_count; } if (i==env->gen.i_tracks) { cdio_warn ("seeking outside range of disk image"); return -1; } else { real_offset += env->tocent[i].datastart; return cdio_stream_seek(env->tocent[i].data_source, real_offset, whence); } } /*! Reads into buf the next size bytes. Returns -1 on error. FIXME: At present we assume a read doesn't cross sector or track boundaries. */ static ssize_t _read_cdrdao (void *user_data, void *data, size_t size) { _img_private_t *env = user_data; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; char *p = data; ssize_t final_size=0; ssize_t this_size; track_info_t *this_track=&(env->tocent[env->pos.index]); ssize_t skip_size = this_track->datastart + this_track->endsize; while (size > 0) { int rem = (int) (this_track->datasize - env->pos.buff_offset); if (size <= rem) { this_size = cdio_stream_read(this_track->data_source, buf, size, 1); final_size += this_size; memcpy (p, buf, this_size); break; } /* Finish off reading this sector. */ cdio_warn ("Reading across block boundaries not finished"); size -= rem; this_size = cdio_stream_read(this_track->data_source, buf, rem, 1); final_size += this_size; memcpy (p, buf, this_size); p += this_size; cdio_stream_read(this_track->data_source, buf, rem, 1); /* Skip over stuff at end of this sector and the beginning of the next. */ cdio_stream_read(this_track->data_source, buf, skip_size, 1); /* Get ready to read another sector. */ env->pos.buff_offset=0; env->pos.lba++; /* Have gone into next track. */ if (env->pos.lba >= env->tocent[env->pos.index+1].start_lba) { env->pos.index++; this_track=&(env->tocent[env->pos.index]); skip_size = this_track->datastart + this_track->endsize; } } return final_size; } /*! Return the size of the CD in logical block address (LBA) units. FIXME: this assumes there is only one source for data or one track of silence. */ static lsn_t get_disc_last_lsn_cdrdao (void *p_user_data) { _img_private_t *p_env = p_user_data; track_t i_leadout = p_env->gen.i_tracks; uint16_t i_blocksize = p_env->tocent[i_leadout-1].blocksize; off_t i_size; if (p_env->tocent[i_leadout-1].sec_count) { i_size = p_env->tocent[i_leadout-1].sec_count; } else { if (NULL == p_env->tocent[i_leadout-1].data_source) { if (!p_env->tocent[i_leadout-1].silence) { cdio_warn ("Data source for image %s is null", p_env->gen.source_name); return -1; } /* FIXME: this is only correct if there is one track of silence. */ i_size = p_env->tocent[i_leadout-1].silence; } else { /* FIXME: this is only correct if there is one data source. */ i_size = cdio_stream_stat(p_env->tocent[i_leadout-1].data_source) - p_env->tocent[i_leadout-1].offset; } if (i_size < 0) { cdio_error ("Disc data size too small for track specification in image %s", p_env->gen.source_name); return (lsn_t)i_size; } if (check_track_is_blocksize_multiple(p_env->tocent[i_leadout-1].filename, i_leadout-1, i_size, i_blocksize)) { i_size /= i_blocksize; } else { /* Round up */ i_size = (i_size / i_blocksize) + 1; } } i_size += p_env->tocent[i_leadout-1].start_lba; i_size -= CDIO_PREGAP_SECTORS; return (lsn_t)i_size; } #define MAXLINE 512 #define UNIMPLIMENTED_MSG \ cdio_log(log_level, "%s line %d: unimplimented keyword: %s", \ psz_cue_name, i_line, psz_keyword) static bool parse_tocfile (_img_private_t *cd, const char *psz_cue_name) { /* The below declarations may be common in other image-parse routines. */ FILE *fp; char psz_line[MAXLINE]; /* text of current line read in file fp. */ unsigned int i_line=0; /* line number in file of psz_line. */ int i = -1; /* Position in tocent. Same as cd->gen.i_tracks - 1 */ char *psz_keyword, *psz_field, *psz_cue_name_dup; cdio_log_level_t log_level = (cd) ? CDIO_LOG_WARN : CDIO_LOG_INFO ; cdtext_field_t cdtext_key; /* The below declaration(s) may be unique to this image-parse routine. */ unsigned int i_cdtext_nest = 0; if (NULL == psz_cue_name) return false; psz_cue_name_dup = _cdio_strdup_fixpath(psz_cue_name); if (NULL == psz_cue_name_dup) return false; fp = CDIO_FOPEN (psz_cue_name_dup, "r"); cdio_free(psz_cue_name_dup); if (fp == NULL) { cdio_log(log_level, "error opening %s for reading: %s", psz_cue_name, strerror(errno)); return false; } if (cd) { cd->gen.b_cdtext_error = false; } while (fgets(psz_line, MAXLINE, fp)) { i_line++; /* strip comment from line */ /* todo: // in quoted strings? */ /* //comment */ if ((psz_field = strstr (psz_line, "//"))) *psz_field = '\0'; if ((psz_keyword = strtok (psz_line, " \t\n\r"))) { /* CATALOG "ddddddddddddd" */ if (0 == strcmp ("CATALOG", psz_keyword)) { if (-1 == i) { if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) { if (13 != strlen(psz_field)) { cdio_log(log_level, "%s line %d after word CATALOG:", psz_cue_name, i_line); cdio_log(log_level, "Token %s has length %ld. Should be 13 digits.", psz_field, (long int) strlen(psz_field)); goto err_exit; } else { /* Check that we have all digits*/ unsigned int j; for (j=0; j<13; j++) { if (!isdigit((unsigned char) psz_field[j])) { cdio_log(log_level, "%s line %d after word CATALOG:", psz_cue_name, i_line); cdio_log(log_level, "Character \"%c\" at postition %i of token \"%s\"" " is not all digits.", psz_field[j], j+1, psz_field); goto err_exit; } } if (NULL != cd) cd->psz_mcn = strdup (psz_field); } } else { cdio_log(log_level, "%s line %d after word CATALOG:", psz_cue_name, i_line); cdio_log(log_level, "Expecting 13 digits; nothing seen."); goto err_exit; } } else { goto err_exit; } /* CD_DA | CD_ROM | CD_ROM_XA */ } else if (0 == strcmp ("CD_DA", psz_keyword)) { if (-1 == i) { if (NULL != cd) cd->disc_mode = CDIO_DISC_MODE_CD_DA; } else { goto not_in_global_section; } } else if (0 == strcmp ("CD_ROM", psz_keyword)) { if (-1 == i) { if (NULL != cd) cd->disc_mode = CDIO_DISC_MODE_CD_DATA; } else { goto not_in_global_section; } } else if (0 == strcmp ("CD_ROM_XA", psz_keyword)) { if (-1 == i) { if (NULL != cd) cd->disc_mode = CDIO_DISC_MODE_CD_XA; } else { goto not_in_global_section; } /* TRACK [] */ } else if (0 == strcmp ("TRACK", psz_keyword)) { i++; if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (0 == strcmp ("AUDIO", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_AUDIO; cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].datasize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].datastart = 0; cd->tocent[i].endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE1", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_DATA; cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; cd->tocent[i].datasize = CDIO_CD_FRAMESIZE; cd->tocent[i].endsize = CDIO_CD_EDC_SIZE + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE1_RAW", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_DATA; cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; cd->tocent[i].datasize = CDIO_CD_FRAMESIZE; cd->tocent[i].endsize = CDIO_CD_EDC_SIZE + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_XA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE2", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_XA; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; cd->tocent[i].datasize = M2RAW_SECTOR_SIZE; cd->tocent[i].endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE2_FORM1", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_XA; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; cd->tocent[i].datasize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE2_FORM2", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_XA; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE; cd->tocent[i].datasize = CDIO_CD_FRAMESIZE; cd->tocent[i].endsize = CDIO_CD_SYNC_SIZE + CDIO_CD_ECC_SIZE; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE2_FORM_MIX", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_XA; cd->tocent[i].datasize = M2RAW_SECTOR_SIZE; cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE; cd->tocent[i].track_green = true; cd->tocent[i].endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else if (0 == strcmp ("MODE2_RAW", psz_field)) { if (NULL != cd) { cd->tocent[i].track_format = TRACK_FORMAT_XA; cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW; cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE; cd->tocent[i].datasize = CDIO_CD_FRAMESIZE; cd->tocent[i].track_green = true; cd->tocent[i].endsize = 0; switch(cd->disc_mode) { case CDIO_DISC_MODE_NO_INFO: cd->disc_mode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* Disc type stays the same. */ break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_DATA: cd->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; default: cd->disc_mode = CDIO_DISC_MODE_ERROR; } } } else { cdio_log(log_level, "%s line %d after TRACK:", psz_cue_name, i_line); cdio_log(log_level, "'%s' not a valid mode.", psz_field); goto err_exit; } } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { /* \todo: set sub-channel-mode */ #ifdef TODO if (0 == strcmp ("RW", psz_field)) ; else if (0 == strcmp ("RW_RAW", psz_field)) ; #endif } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } /* track flags */ /* [NO] COPY | [NO] PRE_EMPHASIS */ } else if (0 == strcmp ("NO", psz_keyword)) { if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (0 == strcmp ("COPY", psz_field)) { if (NULL != cd) cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_COPY_PERMITTED; } else if (0 == strcmp ("PRE_EMPHASIS", psz_field)) if (NULL != cd) { cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_PRE_EMPHASIS; } } else { goto format_error; } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } } else if (0 == strcmp ("COPY", psz_keyword)) { if (NULL != cd && i >= 0) cd->tocent[i].flags |= CDIO_TRACK_FLAG_COPY_PERMITTED; } else if (0 == strcmp ("PRE_EMPHASIS", psz_keyword)) { if (NULL != cd && i >= 0) cd->tocent[i].flags |= CDIO_TRACK_FLAG_PRE_EMPHASIS; /* TWO_CHANNEL_AUDIO */ } else if (0 == strcmp ("TWO_CHANNEL_AUDIO", psz_keyword)) { if (NULL != cd && i >= 0) cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO; /* FOUR_CHANNEL_AUDIO */ } else if (0 == strcmp ("FOUR_CHANNEL_AUDIO", psz_keyword)) { if (NULL != cd && i >= 0) cd->tocent[i].flags |= CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO; /* ISRC "CCOOOYYSSSSS" */ } else if (0 == strcmp ("ISRC", psz_keyword)) { if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) { if (NULL != cd) cd->tocent[i].isrc = strdup(psz_field); } else { goto format_error; } /* SILENCE */ } else if (0 == strcmp ("SILENCE", psz_keyword)) { if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (NULL != cd) cd->tocent[i].silence = cdio_mmssff_to_lba (psz_field); } else { goto format_error; } cdio_log(log_level, "%s line %d: SILENCE not fully implimented", psz_cue_name, i_line); /* ZERO */ } else if (0 == strcmp ("ZERO", psz_keyword)) { UNIMPLIMENTED_MSG; /* [FILE|AUDIOFILE] "" [] */ } else if (0 == strcmp ("FILE", psz_keyword) || 0 == strcmp ("AUDIOFILE", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) { /* Handle "" */ if (cd) { char *psz_dirname = cdio_dirname(psz_cue_name); char *psz_filename = cdio_abspath(psz_dirname, psz_field); cd->tocent[i].filename = strdup (psz_filename); free(psz_filename); free(psz_dirname); /* To do: do something about reusing existing files. */ if (!(cd->tocent[i].data_source = cdio_stdio_new (psz_field))) { cdio_log (log_level, "%s line %d: can't open file `%s' for reading", psz_cue_name, i_line, psz_field); goto err_exit; } } else { CdioDataSource_t *s = cdio_stdio_new (psz_field); if (!s) { cdio_log (log_level, "%s line %d: can't open file `%s' for reading", psz_cue_name, i_line, psz_field); cdio_stdio_destroy (s); goto err_exit; } cdio_stdio_destroy (s); } } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { /* Handle */ lba_t i_start_lba = cdio_lsn_to_lba(cdio_mmssff_to_lba (psz_field)); if (CDIO_INVALID_LBA == i_start_lba) { cdio_log(log_level, "%s line %d: invalid MSF string %s", psz_cue_name, i_line, psz_field); goto err_exit; } if (NULL != cd) { cd->tocent[i].start_lba = i_start_lba; cdio_lba_to_msf(i_start_lba, &(cd->tocent[i].start_msf)); } } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { /* Handle */ lba_t lba = cdio_mmssff_to_lba (psz_field); if (CDIO_INVALID_LBA == lba) { cdio_log(log_level, "%s line %d: invalid MSF string %s", psz_cue_name, i_line, psz_field); goto err_exit; } if (cd) { off_t i_size = cdio_stream_stat(cd->tocent[i].data_source); if (lba) { if ( (lba * cd->tocent[i].datasize) > i_size) { cdio_log(log_level, "%s line %d: MSF length %s exceeds end of file", psz_cue_name, i_line, psz_field); goto err_exit; } } else { lba = (lba_t) (i_size / cd->tocent[i].blocksize); } cd->tocent[i].sec_count = lba; } } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } } else { goto not_in_global_section; } /* DATAFILE "" #byte-offset */ } else if (0 == strcmp ("DATAFILE", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) { /* Handle */ char *psz_dirname = cdio_dirname(psz_cue_name); char *psz_filename = cdio_abspath(psz_dirname, psz_field); if (cd) { cd->tocent[i].filename = strdup(psz_filename); /* To do: do something about reusing existing files. */ if (!(cd->tocent[i].data_source = cdio_stdio_new (psz_field))) { cdio_log (log_level, "%s line %d: can't open file `%s' for reading", psz_cue_name, i_line, psz_field); free(psz_filename); free(psz_dirname); goto err_exit; } } else { CdioDataSource_t *s = cdio_stdio_new (psz_filename); if (!s) { cdio_log (log_level, "%s line %d: can't open file `%s' for reading", psz_cue_name, i_line, psz_field); free(psz_filename); free(psz_dirname); goto err_exit; } cdio_stdio_destroy (s); } free(psz_filename); free(psz_dirname); } psz_field = strtok (NULL, " \t\n\r"); if (psz_field) { /* Handle optional #byte-offset */ if ( psz_field[0] == '#') { long int offset; psz_field++; errno = 0; offset = strtol(psz_field, (char **)NULL, 10); if ( (LONG_MIN == offset || LONG_MAX == offset) && 0 != errno ) { cdio_log (log_level, "%s line %d: can't convert `%s' to byte offset", psz_cue_name, i_line, psz_field); goto err_exit; } else { if (NULL != cd) { cd->tocent[i].offset = offset; } } psz_field = strtok (NULL, " \t\n\r"); } } if (psz_field) { /* Handle start-msf */ lba_t lba = cdio_mmssff_to_lba (psz_field); if (CDIO_INVALID_LBA == lba) { cdio_log(log_level, "%s line %d: invalid MSF string %s", psz_cue_name, i_line, psz_field); goto err_exit; } if (cd) { cd->tocent[i].start_lba = lba; cdio_lba_to_msf(cd->tocent[i].start_lba, &(cd->tocent[i].start_msf)); } } else { /* No start-msf. */ if (cd) { if (i) { uint16_t i_blocksize = cd->tocent[i-1].blocksize; off_t i_size = cdio_stream_stat(cd->tocent[i-1].data_source); check_track_is_blocksize_multiple(cd->tocent[i-1].filename, i-1, i_size, i_blocksize); /* Append size of previous datafile. */ cd->tocent[i].start_lba = (lba_t) (cd->tocent[i-1].start_lba + (i_size / i_blocksize)); } cd->tocent[i].offset = 0; cd->tocent[i].start_lba += CDIO_PREGAP_SECTORS; cdio_lba_to_msf(cd->tocent[i].start_lba, &(cd->tocent[i].start_msf)); } } } else { goto not_in_global_section; } /* FIFO "" [] */ } else if (0 == strcmp ("FIFO", psz_keyword)) { goto unimplimented_error; /* START MM:SS:FF */ } else if (0 == strcmp ("START", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { /* todo: line is too long! */ if (NULL != cd) { cd->tocent[i].pregap = cd->tocent[i].start_lba; cd->tocent[i].start_lba += cdio_mmssff_to_lba (psz_field); cdio_lba_to_msf(cd->tocent[i].start_lba, &(cd->tocent[i].start_msf)); } } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } } else { goto not_in_global_section; } /* PREGAP MM:SS:FF */ } else if (0 == strcmp ("PREGAP", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (NULL != cd) cd->tocent[i].pregap = cdio_mmssff_to_lba (psz_field); } else { goto format_error; } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } } else { goto not_in_global_section; } /* INDEX MM:SS:FF */ } else if (0 == strcmp ("INDEX", psz_keyword)) { if (0 <= i) { if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) { if (NULL != cd) { #if 0 if (1 == cd->tocent[i].nindex) { cd->tocent[i].indexes[1] = cd->tocent[i].indexes[0]; cd->tocent[i].nindex++; } cd->tocent[i].indexes[cd->tocent[i].nindex++] = cdio_mmssff_to_lba (psz_field) + cd->tocent[i].indexes[0]; #else ; #endif } } else { goto format_error; } if (NULL != strtok (NULL, " \t\n\r")) { goto format_error; } } else { goto not_in_global_section; } /* CD_TEXT { ... } */ /* todo: opening { must be on same line as CD_TEXT */ } else if (0 == strcmp ("CD_TEXT", psz_keyword)) { if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } if ( 0 == strcmp( "{", psz_field ) ) { i_cdtext_nest++; } else { cdio_log (log_level, "%s line %d: expecting '{'", psz_cue_name, i_line); goto err_exit; } // TODO: implement language mapping } else if (0 == strcmp ("LANGUAGE_MAP", psz_keyword)) { /* LANGUAGE d { ... } */ } else if (0 == strcmp ("LANGUAGE", psz_keyword)) { /* Language number */ if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) { goto format_error; } if ( 0 == strcmp( "{", psz_field ) ) { i_cdtext_nest++; } } else if (0 == strcmp ("{", psz_keyword)) { i_cdtext_nest++; } else if (0 == strcmp ("}", psz_keyword)) { if (i_cdtext_nest > 0) i_cdtext_nest--; } else if ( CDTEXT_FIELD_INVALID != (cdtext_key = cdtext_is_field (psz_keyword)) ) { if (NULL != cd) { if (NULL == cd->gen.cdtext) { cd->gen.cdtext = cdtext_init (); /* until language mapping is implemented ...*/ cd->gen.cdtext->block[cd->gen.cdtext->block_i].language_code = CDTEXT_LANGUAGE_ENGLISH; } cdtext_set (cd->gen.cdtext, cdtext_key, (uint8_t*) strtok (NULL, "\"\t\n\r"), (-1 == i ? 0 : cd->gen.i_first_track + i), "ISO-8859-1"); } /* unrecognized line */ } else { cdio_log(log_level, "%s line %d: warning: unrecognized word: %s", psz_cue_name, i_line, psz_keyword); goto err_exit; } } } if (NULL != cd) { cd->gen.i_tracks = i+1; cd->gen.toc_init = true; } fclose (fp); return true; unimplimented_error: UNIMPLIMENTED_MSG; goto err_exit; format_error: cdio_log(log_level, "%s line %d after word %s", psz_cue_name, i_line, psz_keyword); goto err_exit; not_in_global_section: cdio_log(log_level, "%s line %d: word %s only allowed in global section", psz_cue_name, i_line, psz_keyword); err_exit: fclose (fp); return false; } /*! Reads a single audio sector from CD device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_audio_sectors_cdrdao (void *user_data, void *data, lsn_t lsn, unsigned int nblocks) { _img_private_t *env = user_data; int ret; ret = cdio_stream_seek (env->tocent[0].data_source, lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (env->tocent[0].data_source, data, CDIO_CD_FRAMESIZE_RAW, nblocks); /* ret is number of bytes if okay, but we need to return 0 okay. */ return ret == 0; } /*! Reads a single mode2 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sector_cdrdao (void *user_data, void *data, lsn_t lsn, bool b_form2) { _img_private_t *env = user_data; int ret; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; ret = cdio_stream_seek (env->tocent[0].data_source, lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET); if (ret!=0) return ret; /* FIXME: Not completely sure the below is correct. */ ret = cdio_stream_read (env->tocent[0].data_source, buf, CDIO_CD_FRAMESIZE_RAW, 1); if (ret==0) return ret; memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } /*! Reads nblocks of mode1 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static int _read_mode1_sectors_cdrdao (void *user_data, void *data, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *env = user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode1_sector_cdrdao (env, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return DRIVER_OP_SUCCESS; } /*! Reads a single mode1 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sector_cdrdao (void *user_data, void *data, lsn_t lsn, bool b_form2) { _img_private_t *env = user_data; int ret; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; long unsigned int i_off = lsn * CDIO_CD_FRAMESIZE_RAW; /* For sms's VCD's (mwc1.toc) it is more like this: if (i_off > 272) i_off -= 272; There is that magic 272 that we find in read_audio_sectors_cdrdao again. */ /* NOTE: The logic below seems a bit wrong and convoluted to me, but passes the regression tests. (Perhaps it is why we get valgrind errors in vcdxrip). Leave it the way it was for now. Review this sector 2336 stuff later. */ ret = cdio_stream_seek (env->tocent[0].data_source, i_off, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (env->tocent[0].data_source, buf, CDIO_CD_FRAMESIZE_RAW, 1); if (ret==0) return ret; /* See NOTE above. */ if (b_form2) memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, M2RAW_SECTOR_SIZE); else memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sectors_cdrdao (void *user_data, void *data, lsn_t lsn, bool b_form2, unsigned int nblocks) { _img_private_t *env = user_data; int i; int retval; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode2_sector_cdrdao (env, ((char *)data) + (CDIO_CD_FRAMESIZE * i), lsn + i, b_form2)) ) return retval; } return 0; } /*! Return an array of strings giving possible TOC disk images. */ char ** cdio_get_devices_cdrdao (void) { char **drives = NULL; unsigned int num_files=0; #ifdef HAVE_GLOB_H unsigned int i; glob_t globbuf; globbuf.gl_offs = 0; glob("*.toc", GLOB_DOOFFS, NULL, &globbuf); for (i=0; ipsz_vendor, "libcdio", sizeof(hw_info->psz_vendor)-1); hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0'; strncpy(hw_info->psz_model, "cdrdao", sizeof(hw_info->psz_model)-1); hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0'; strncpy(hw_info->psz_revision, CDIO_VERSION, sizeof(hw_info->psz_revision)-1); hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0'; return true; } /*! Return the number of tracks in the current medium. CDIO_INVALID_TRACK is returned on error. */ static track_format_t _get_track_format_cdrdao(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if (!p_env->gen.init) return TRACK_FORMAT_ERROR; if (i_track > p_env->gen.i_tracks || i_track == 0) return TRACK_FORMAT_ERROR; return p_env->tocent[i_track-p_env->gen.i_first_track].track_format; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool _get_track_green_cdrdao(void *user_data, track_t i_track) { _img_private_t *env = user_data; if (!env->gen.init) _init_cdrdao(env); if (i_track > env->gen.i_tracks || i_track == 0) return false; return env->tocent[i_track-env->gen.i_first_track].track_green; } /*! Return the starting LSN track number i_track in obj. Track numbers start at 1. The "leadout" track is specified either by using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. False is returned if there is no track entry. */ static lba_t _get_lba_track_cdrdao(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; _init_cdrdao (p_env); if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks+1; if (i_track <= p_env->gen.i_tracks+1 && i_track != 0) { return p_env->tocent[i_track-1].start_lba; } else return CDIO_INVALID_LBA; } /*! Check that a TOC file is valid. We parse the entire file. */ bool cdio_is_tocfile(const char *psz_cue_name) { int i; if (psz_cue_name == NULL) return false; i=strlen(psz_cue_name)-strlen("toc"); if (i>0) { if ( (psz_cue_name[i]=='t' && psz_cue_name[i+1]=='o' && psz_cue_name[i+2]=='c') || (psz_cue_name[i]=='T' && psz_cue_name[i+1]=='O' && psz_cue_name[i+2]=='C') ) { return parse_tocfile(NULL, psz_cue_name); } } return false; } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_am_cdrdao (const char *psz_source_name, const char *psz_access_mode) { if (psz_access_mode != NULL && strcmp(psz_access_mode, "image")) cdio_warn ("there is only one access mode, 'image' for cdrdao. Arg %s ignored", psz_access_mode); return cdio_open_cdrdao(psz_source_name); } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_cdrdao (const char *psz_cue_name) { CdIo_t *ret; _img_private_t *p_data; cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); _funcs.eject_media = _eject_media_image; _funcs.free = _free_image; _funcs.get_arg = _get_arg_image; _funcs.get_cdtext = _get_cdtext_image; _funcs.get_cdtext_raw = NULL; _funcs.get_devices = cdio_get_devices_cdrdao; _funcs.get_default_device = cdio_get_default_device_cdrdao; _funcs.get_disc_last_lsn = get_disc_last_lsn_cdrdao; _funcs.get_discmode = _get_discmode_image; _funcs.get_drive_cap = _get_drive_cap_image; _funcs.get_first_track_num = _get_first_track_num_image; _funcs.get_hwinfo = get_hwinfo_cdrdao; _funcs.get_media_changed = get_media_changed_image; _funcs.get_mcn = _get_mcn_image; _funcs.get_num_tracks = _get_num_tracks_image; _funcs.get_track_channels = get_track_channels_image; _funcs.get_track_copy_permit = get_track_copy_permit_image; _funcs.get_track_format = _get_track_format_cdrdao; _funcs.get_track_green = _get_track_green_cdrdao; _funcs.get_track_lba = _get_lba_track_cdrdao; _funcs.get_track_msf = _get_track_msf_image; _funcs.get_track_preemphasis = get_track_preemphasis_image; _funcs.get_track_pregap_lba = get_track_pregap_lba_image; _funcs.get_track_isrc = get_track_isrc_image; _funcs.lseek = _lseek_cdrdao; _funcs.read = _read_cdrdao; _funcs.read_audio_sectors = _read_audio_sectors_cdrdao; _funcs.read_data_sectors = read_data_sectors_image; _funcs.read_mode1_sector = _read_mode1_sector_cdrdao; _funcs.read_mode1_sectors = _read_mode1_sectors_cdrdao; _funcs.read_mode2_sector = _read_mode2_sector_cdrdao; _funcs.read_mode2_sectors = _read_mode2_sectors_cdrdao; _funcs.run_mmc_cmd = NULL; _funcs.set_arg = _set_arg_image; _funcs.set_speed = cdio_generic_unimplemented_set_speed; _funcs.set_blocksize = cdio_generic_unimplemented_set_blocksize; if (NULL == psz_cue_name) return NULL; p_data = calloc(1, sizeof (_img_private_t)); if (NULL == p_data) return NULL; p_data->gen.init = false; p_data->psz_cue_name = NULL; p_data->gen.data_source = NULL; p_data->gen.source_name = NULL; ret = cdio_new ((void *)p_data, &_funcs); if (ret == NULL) { free(p_data); return NULL; } ret->driver_id = DRIVER_CDRDAO; if (!cdio_is_tocfile(psz_cue_name)) { cdio_debug ("source name %s is not recognized as a TOC file", psz_cue_name); free(p_data); free(ret); return NULL; } _set_arg_image (p_data, "cue", psz_cue_name); _set_arg_image (p_data, "source", psz_cue_name); _set_arg_image (p_data, "access-mode", "cdrdao"); if (_init_cdrdao(p_data)) { return ret; } else { _free_image(p_data); free(ret); return NULL; } } bool cdio_have_cdrdao (void) { return true; } libcdio-2.2.0/lib/driver/image/nrg.c000066400000000000000000001177171474051130400172120ustar00rootroot00000000000000/* Copyright (C) 2003-2006, 2008-2009, 2011-2012, 2014, 2017 Rocky Bernstein Copyright (C) 2001, 2003 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! This code implements low-level access functions for the Nero native CD-image format residing inside a disk file (*.nrg). */ #include "image.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_GLOB_H #include #endif #ifdef HAVE_WINDOWS_H #include #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include #include #include #include "cdio_assert.h" #include "_cdio_stdio.h" #include "nrg.h" #include "cdtext_private.h" nero_id_t nero_id; nero_dtype_t nero_dtype; /* reader */ #define DEFAULT_CDIO_DEVICE "image.nrg" /* Link element of track structure as a linked list. Possibly redundant with above track_info_t */ typedef struct { uint32_t start_lsn; uint32_t sec_count; /* Number of sectors in track. Does not include pregap before next entry. */ uint64_t img_offset; /* Bytes offset from beginning of disk image file.*/ uint32_t blocksize; /* Number of bytes in a block */ } _mapping_t; #define NEED_NERO_STRUCT #include "image_common.h" static bool parse_nrg (_img_private_t *env, const char *psz_cue_name, const cdio_log_level_t log_level); static lsn_t get_disc_last_lsn_nrg (void *p_user_data); /* Updates internal track TOC, so we can later simulate ioctl(CDROMREADTOCENTRY). */ static void _register_mapping (_img_private_t *env, lsn_t start_lsn, uint32_t sec_count, uint64_t img_offset, uint32_t blocksize, track_format_t track_format, bool track_green) { const int track_num=env->gen.i_tracks; track_info_t *this_track=&(env->tocent[env->gen.i_tracks]); _mapping_t *_map = calloc(1, sizeof (_mapping_t)); if (_map == NULL) return; _map->start_lsn = start_lsn; _map->sec_count = sec_count; _map->img_offset = img_offset; _map->blocksize = blocksize; if (!env->mapping) env->mapping = _cdio_list_new (); _cdio_list_append (env->mapping, _map); env->size = MAX (env->size, (start_lsn + sec_count)); /* Update *this_track and track_num. These structures are in a sense redundant witht the obj->mapping list. Perhaps one or the other can be eliminated. */ cdio_lba_to_msf (cdio_lsn_to_lba(start_lsn), &(this_track->start_msf)); this_track->start_lba = cdio_msf_to_lba(&this_track->start_msf); this_track->track_num = track_num+1; this_track->blocksize = blocksize; if (env->is_cues) this_track->datastart = img_offset; else this_track->datastart = 0; if (track_green) this_track->datastart += CDIO_CD_SUBHEADER_SIZE; this_track->sec_count = sec_count; this_track->track_format= track_format; this_track->track_green = track_green; switch (this_track->track_format) { case TRACK_FORMAT_AUDIO: this_track->blocksize = CDIO_CD_FRAMESIZE_RAW; this_track->datasize = CDIO_CD_FRAMESIZE_RAW; /*this_track->datastart = 0;*/ this_track->endsize = 0; break; case TRACK_FORMAT_CDI: this_track->datasize=CDIO_CD_FRAMESIZE; break; case TRACK_FORMAT_XA: if (track_green) { this_track->blocksize = CDIO_CD_FRAMESIZE; /*this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE;*/ this_track->datasize = M2RAW_SECTOR_SIZE; this_track->endsize = 0; } else { /*this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;*/ this_track->datasize = CDIO_CD_FRAMESIZE; this_track->endsize = CDIO_CD_SYNC_SIZE + CDIO_CD_ECC_SIZE; } break; case TRACK_FORMAT_DATA: if (track_green) { /*this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE;*/ this_track->datasize = CDIO_CD_FRAMESIZE; this_track->endsize = CDIO_CD_EDC_SIZE + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE; } else { /* Is the below correct? */ /*this_track->datastart = 0;*/ this_track->datasize = CDIO_CD_FRAMESIZE; this_track->endsize = 0; } break; default: /*this_track->datasize=CDIO_CD_FRAMESIZE_RAW;*/ cdio_warn ("track %d has unknown format %d", env->gen.i_tracks, this_track->track_format); } env->gen.i_tracks++; cdio_debug ("start lsn: %lu sector count: %0lu -> %8ld (%08lx)", (long unsigned int) start_lsn, (long unsigned int) sec_count, (long unsigned int) img_offset, (long unsigned int) img_offset); } /* Disk and track information for a Nero file are located at the end of the file. This routine extracts that information. FIXME: right now psz_nrg_name is not used. It will be in the future. */ static bool parse_nrg (_img_private_t *p_env, const char *psz_nrg_name, const cdio_log_level_t log_level) { off_t footer_start; off_t size; char *footer_buf = NULL; if (!p_env) return false; size = cdio_stream_stat (p_env->gen.data_source); if (-1 == size) return false; { _footer_t buf; cdio_assert (sizeof (buf) == 12); cdio_stream_seek (p_env->gen.data_source, size - sizeof (buf), SEEK_SET); cdio_stream_read (p_env->gen.data_source, (void *) &buf, sizeof (buf), 1); if (buf.v50.ID == UINT32_TO_BE (NERO_ID)) { cdio_debug ("detected Nero version 5.0 (32-bit offsets) NRG magic"); footer_start = uint32_to_be (buf.v50.footer_ofs); } else if (buf.v55.ID == UINT32_TO_BE (NER5_ID)) { cdio_debug ("detected Nero version 5.5.x (64-bit offsets) NRG magic"); footer_start = uint64_from_be (buf.v55.footer_ofs); } else { cdio_log (log_level, "Image not recognized as either version 5.0 or " "version 5.5.x-6.x type NRG"); return false; } cdio_debug (".NRG footer start = %ld, length = %ld", (long) footer_start, (long) (size - footer_start)); cdio_assert ((size - footer_start) <= 4096); footer_buf = calloc(1, (size_t)(size - footer_start)); cdio_stream_seek (p_env->gen.data_source, footer_start, SEEK_SET); cdio_stream_read (p_env->gen.data_source, footer_buf, (size_t)(size - footer_start), 1); } { int pos = 0; while (pos < size - footer_start) { _chunk_t *chunk = (void *) (footer_buf + pos); uint32_t opcode = UINT32_FROM_BE (chunk->id); bool break_out = false; switch (opcode) { case CUES_ID: /* "CUES" Seems to have sector size 2336 and 150 sector pregap seems to be included at beginning of image. */ case CUEX_ID: /* "CUEX" */ { unsigned entries = UINT32_FROM_BE (chunk->len); _cuex_array_t *_entries = (void *) chunk->data; cdio_assert (p_env->mapping == NULL); cdio_assert ( sizeof (_cuex_array_t) == 8 ); cdio_assert ( UINT32_FROM_BE (chunk->len) % sizeof(_cuex_array_t) == 0 ); entries /= sizeof (_cuex_array_t); if (CUES_ID == opcode) { unsigned int idx; unsigned int i = 0; lsn_t lsn; /* = UINT32_FROM_BE (_entries[0].lsn); */ /* CUES LSN has 150 pregap include at beginning? -/ cdio_assert (lsn == 0?); */ cdio_debug ("CUES type image detected" ); p_env->is_cues = true; /* HACK alert. */ p_env->gen.i_tracks = 0; p_env->gen.i_first_track = 1; for (idx = 1; idx < entries-1; idx += 2, i++) { lsn_t sec_count; int cdte_format = _entries[idx].addr_ctrl / 16; int cdte_ctrl = _entries[idx].type >> 4; if ( COPY_PERMITTED & cdte_ctrl ) { if (p_env) p_env->tocent[i].flags |= COPY_PERMITTED; } else { if (p_env) p_env->tocent[i].flags &= ~COPY_PERMITTED; } if ( PRE_EMPHASIS & cdte_ctrl ) { if (p_env) p_env->tocent[i].flags |= PRE_EMPHASIS; } else { if (p_env) p_env->tocent[i].flags &= ~PRE_EMPHASIS; } if ( FOUR_CHANNEL_AUDIO & cdte_ctrl ) { if (p_env) p_env->tocent[i].flags |= FOUR_CHANNEL_AUDIO; } else { if (p_env) p_env->tocent[i].flags &= ~FOUR_CHANNEL_AUDIO; } cdio_assert (_entries[idx].track == _entries[idx + 1].track); /* lsn and sec_count*2 aren't correct, but it comes closer on the single example I have: svcdgs.nrg We are picking up the wrong fields and/or not interpreting them correctly. */ switch (cdte_format) { case 0: lsn = UINT32_FROM_BE (_entries[idx].lsn); break; case 1: { #if 0 msf_t msf = (msf_t) _entries[idx].lsn; lsn = cdio_msf_to_lsn(&msf); #else lsn = CDIO_INVALID_LSN; #endif cdio_log (log_level, "untested (i.e. probably wrong) CUE MSF code"); break; } default: lsn = CDIO_INVALID_LSN; cdio_log(log_level, "unknown cdte_format %d", cdte_format); } sec_count = UINT32_FROM_BE (_entries[idx + 1].lsn); _register_mapping (p_env, lsn, sec_count*2, (lsn+CDIO_PREGAP_SECTORS) * M2RAW_SECTOR_SIZE, M2RAW_SECTOR_SIZE, TRACK_FORMAT_XA, true); } } else { lsn_t lsn = UINT32_FROM_BE (_entries[0].lsn); unsigned int idx; unsigned int i = 0; cdio_debug ("CUEX type image detected"); /* LSN must start at -150 (LBA 0)? */ cdio_assert (lsn == -150); for (idx = 2; idx < entries; idx += 2, i++) { lsn_t sec_count; int cdte_format = _entries[idx].addr_ctrl >> 4; int cdte_ctrl = _entries[idx].type >> 4; if ( COPY_PERMITTED & cdte_ctrl ) { if (p_env) p_env->tocent[i].flags |= COPY_PERMITTED; } else { if (p_env) p_env->tocent[i].flags &= ~COPY_PERMITTED; } if ( PRE_EMPHASIS & cdte_ctrl ) { if (p_env) p_env->tocent[i].flags |= PRE_EMPHASIS; } else { if (p_env) p_env->tocent[i].flags &= ~PRE_EMPHASIS; } if ( FOUR_CHANNEL_AUDIO & cdte_ctrl ) { if (p_env) p_env->tocent[i].flags |= FOUR_CHANNEL_AUDIO; } else { if (p_env) p_env->tocent[i].flags &= ~FOUR_CHANNEL_AUDIO; } /* extractnrg.pl has cdte_format for LBA's 0, and for MSF 1. ??? FIXME: Should decode as appropriate for cdte_format. */ cdio_assert ( cdte_format == 0 || cdte_format == 1 ); cdio_assert (_entries[idx].track != _entries[idx + 1].track); lsn = UINT32_FROM_BE (_entries[idx].lsn); sec_count = UINT32_FROM_BE (_entries[idx + 1].lsn); _register_mapping (p_env, lsn, sec_count - lsn, (lsn + CDIO_PREGAP_SECTORS)*M2RAW_SECTOR_SIZE, M2RAW_SECTOR_SIZE, TRACK_FORMAT_XA, true); } } break; } case DAOX_ID: /* "DAOX" */ case DAOI_ID: /* "DAOI" */ { _daox_t *_xentries = NULL; _daoi_t *_ientries = NULL; _dao_array_common_t *_dao_array_common = NULL; _dao_common_t *_dao_common = (void *) chunk->data; int disc_mode = _dao_common->unknown[1]; track_format_t track_format; int i; /* We include an extra 0 byte so these can be used as C strings.*/ p_env->psz_mcn = calloc(1, CDIO_MCN_SIZE+1); if (p_env->psz_mcn == NULL) return false; memcpy(p_env->psz_mcn, &(_dao_common->psz_mcn), CDIO_MCN_SIZE); p_env->psz_mcn[CDIO_MCN_SIZE] = '\0'; if (DAOX_ID == opcode) { _xentries = (void *) chunk->data; p_env->dtyp = _xentries->track_info[0].common.unknown[2]; } else { _ientries = (void *) chunk->data; p_env->dtyp = _ientries->track_info[0].common.unknown[2]; } p_env->is_dao = true; cdio_debug ("DAO%c tag detected, track format %d, mode %x\n", opcode==DAOX_ID ? 'X': 'I', p_env->dtyp, disc_mode); switch (p_env->dtyp) { case 0: /* Mode 1 */ track_format = TRACK_FORMAT_DATA; p_env->disc_mode = CDIO_DISC_MODE_CD_DATA; break; case 2: /* Mode 2 form 1 */ disc_mode = 0; track_format = TRACK_FORMAT_XA; p_env->disc_mode = CDIO_DISC_MODE_CD_XA; break; case 3: /* Mode 2 */ track_format = TRACK_FORMAT_XA; p_env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ?? */ break; case 0x6: /* Mode2 form mix */ track_format = TRACK_FORMAT_XA; p_env->disc_mode = CDIO_DISC_MODE_CD_MIXED; break; case 0x20: /* ??? Mode2 form 2, Mode2 raw?? */ track_format = TRACK_FORMAT_XA; p_env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ??. */ break; case 0x7: track_format = TRACK_FORMAT_AUDIO; p_env->disc_mode = CDIO_DISC_MODE_CD_DA; break; default: cdio_log (log_level, "Unknown track format %x\n", p_env->dtyp); track_format = TRACK_FORMAT_AUDIO; } if (0 == disc_mode) { for (i=0; igen.i_tracks; i++) { p_env->tocent[i].track_format= track_format; p_env->tocent[i].datastart = 0; p_env->tocent[i].track_green = false; if (TRACK_FORMAT_AUDIO == track_format) { p_env->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW; p_env->tocent[i].datasize = CDIO_CD_FRAMESIZE_RAW; p_env->tocent[i].endsize = 0; } else { p_env->tocent[i].datasize = CDIO_CD_FRAMESIZE; p_env->tocent[i].datastart = 0; } } } else if (2 == disc_mode) { for (i=0; igen.i_tracks; i++) { p_env->tocent[i].track_green = true; p_env->tocent[i].track_format= track_format; p_env->tocent[i].datasize = CDIO_CD_FRAMESIZE; if (TRACK_FORMAT_XA == track_format) { p_env->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE; p_env->tocent[i].endsize = CDIO_CD_SYNC_SIZE + CDIO_CD_ECC_SIZE; } else { p_env->tocent[i].datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE; p_env->tocent[i].endsize = CDIO_CD_EDC_SIZE + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE; } } } else if (0x20 == disc_mode) { cdio_debug ("Mixed mode CD?\n"); } else { /* Mixed mode CD */ cdio_log (log_level, "Don't know if mode 1, mode 2 or mixed: %x\n", disc_mode); } for (i=0; igen.i_tracks; i++) { if (DAOX_ID == opcode) { _dao_array_common = &_xentries->track_info[i].common; } else { _dao_array_common = &_ientries->track_info[i].common; } p_env->tocent[i].isrc = calloc(1, CDIO_ISRC_SIZE+1); memcpy(p_env->tocent[i].isrc, _dao_array_common->psz_isrc, CDIO_ISRC_SIZE); p_env->tocent[i].isrc[CDIO_ISRC_SIZE] = '\0'; if (p_env->tocent[i].isrc[0]) { cdio_info("nrg isrc has value \"%s\"", p_env->tocent[i].isrc); } if (!p_env->tocent[i].datasize) { continue; } if (DAOX_ID == opcode) { p_env->tocent[i].pregap = (uint64_from_be (_xentries->track_info[i].index0)) / (p_env->tocent[i].datasize); } else { p_env->tocent[i].pregap = (uint32_from_be (_ientries->track_info[i].index0)) / (p_env->tocent[i].datasize); } } break; } case NERO_ID: case NER5_ID: cdio_error ("unexpected nrg magic ID NER%c detected", opcode==NERO_ID ? 'O': '5'); free(footer_buf); return false; case END1_ID: /* "END!" */ cdio_debug ("nrg end tag detected"); break_out = true; break; case ETNF_ID: /* "ETNF" */ { unsigned entries = UINT32_FROM_BE (chunk->len); _etnf_array_t *_entries = (void *) chunk->data; cdio_assert (p_env->mapping == NULL); cdio_assert ( sizeof (_etnf_array_t) == 20 ); cdio_assert ( UINT32_FROM_BE(chunk->len) % sizeof(_etnf_array_t) == 0 ); entries /= sizeof (_etnf_array_t); cdio_debug ("SAO type image (ETNF) detected"); { int idx; for (idx = 0; idx < entries; idx++) { uint32_t _len = UINT32_FROM_BE (_entries[idx].length); uint32_t _start = UINT32_FROM_BE (_entries[idx].start_lsn); uint32_t _start2 = UINT32_FROM_BE (_entries[idx].start); uint32_t track_mode= uint32_from_be (_entries[idx].type); bool track_green = true; track_format_t track_format = TRACK_FORMAT_XA; uint16_t blocksize; switch (track_mode) { case 0: /* Mode 1 */ track_format = TRACK_FORMAT_DATA; track_green = false; /* ?? */ blocksize = CDIO_CD_FRAMESIZE; p_env->disc_mode = CDIO_DISC_MODE_CD_DATA; cdio_debug ("Format DATA, blocksize %u", CDIO_CD_FRAMESIZE); break; case 2: /* Mode 2 form 1 */ track_format = TRACK_FORMAT_XA; track_green = false; /* ?? */ blocksize = CDIO_CD_FRAMESIZE; p_env->disc_mode = CDIO_DISC_MODE_CD_XA; cdio_debug ("Format XA, blocksize %u", CDIO_CD_FRAMESIZE); break; case 3: /* Mode 2 */ track_format = TRACK_FORMAT_XA; track_green = true; blocksize = M2RAW_SECTOR_SIZE; p_env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ?? */ cdio_debug ("Format XA, blocksize %u", M2RAW_SECTOR_SIZE); break; case 06: /* Mode2 form mix */ track_format = TRACK_FORMAT_XA; track_green = true; blocksize = M2RAW_SECTOR_SIZE; p_env->disc_mode = CDIO_DISC_MODE_CD_MIXED; cdio_debug ("Format MIXED CD, blocksize %u", M2RAW_SECTOR_SIZE); break; case 0x20: /* ??? Mode2 form 2, Mode2 raw?? */ track_format = TRACK_FORMAT_XA; track_green = true; blocksize = M2RAW_SECTOR_SIZE; p_env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ??. */ cdio_debug ("Format MIXED CD, blocksize %u", M2RAW_SECTOR_SIZE); break; case 7: track_format = TRACK_FORMAT_AUDIO; track_green = false; blocksize = CDIO_CD_FRAMESIZE_RAW; p_env->disc_mode = CDIO_DISC_MODE_CD_DA; cdio_debug ("Format CD_DA, blocksize %u", CDIO_CD_FRAMESIZE_RAW); break; default: cdio_log (log_level, "Don't know how to handle track mode (%lu)?", (long unsigned int) track_mode); free(footer_buf); return false; } cdio_assert (_len % blocksize == 0); _len /= blocksize; cdio_assert (_start * blocksize == _start2); _start += idx * CDIO_PREGAP_SECTORS; _register_mapping (p_env, _start, _len, _start2, blocksize, track_format, track_green); } } break; } case ETN2_ID: { /* "ETN2", same as above, but with 64bit stuff instead */ unsigned entries = uint32_from_be (chunk->len); _etn2_array_t *_entries = (void *) chunk->data; cdio_assert (p_env->mapping == NULL); cdio_assert (sizeof (_etn2_array_t) == 32); cdio_assert (uint32_from_be (chunk->len) % sizeof (_etn2_array_t) == 0); entries /= sizeof (_etn2_array_t); cdio_debug ("SAO type image (ETN2) detected"); { int idx; for (idx = 0; idx < entries; idx++) { uint32_t _len = uint64_from_be (_entries[idx].length); uint32_t _start = uint32_from_be (_entries[idx].start_lsn); uint32_t _start2 = uint64_from_be (_entries[idx].start); uint32_t track_mode= uint32_from_be (_entries[idx].type); bool track_green = true; track_format_t track_format = TRACK_FORMAT_XA; uint16_t blocksize; switch (track_mode) { case 0: track_format = TRACK_FORMAT_DATA; track_green = false; /* ?? */ blocksize = CDIO_CD_FRAMESIZE; break; case 2: track_format = TRACK_FORMAT_XA; track_green = false; /* ?? */ blocksize = CDIO_CD_FRAMESIZE; break; case 3: track_format = TRACK_FORMAT_XA; track_green = true; blocksize = M2RAW_SECTOR_SIZE; break; case 7: track_format = TRACK_FORMAT_AUDIO; track_green = false; blocksize = CDIO_CD_FRAMESIZE_RAW; break; default: cdio_log (log_level, "Don't know how to handle track mode (%lu)?", (long unsigned int) track_mode); free(footer_buf); return false; } if (_len % blocksize != 0) { cdio_log (log_level, "length is not a multiple of blocksize " "len %lu, size %d, rem %lu", (long unsigned int) _len, blocksize, (long unsigned int) _len % blocksize); if (0 == _len % CDIO_CD_FRAMESIZE) { cdio_log(log_level, "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE); blocksize = CDIO_CD_FRAMESIZE; } else if (0 == _len % M2RAW_SECTOR_SIZE) { cdio_log(log_level, "Adjusting blocksize to %d", M2RAW_SECTOR_SIZE); blocksize = M2RAW_SECTOR_SIZE; } else if (0 == _len % CDIO_CD_FRAMESIZE_RAW) { cdio_log(log_level, "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE_RAW); blocksize = CDIO_CD_FRAMESIZE_RAW; } } _len /= blocksize; if (_start * blocksize != _start2) { cdio_log (log_level, "%lu * %d != %lu", (long unsigned int) _start, blocksize, (long unsigned int) _start2); if (_start * CDIO_CD_FRAMESIZE == _start2) { cdio_log(log_level, "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE); blocksize = CDIO_CD_FRAMESIZE; } else if (_start * M2RAW_SECTOR_SIZE == _start2) { cdio_log(log_level, "Adjusting blocksize to %d", M2RAW_SECTOR_SIZE); blocksize = M2RAW_SECTOR_SIZE; } else if (_start * CDIO_CD_FRAMESIZE_RAW == _start2) { cdio_log(log_level, "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE_RAW); blocksize = CDIO_CD_FRAMESIZE_RAW; } } _start += idx * CDIO_PREGAP_SECTORS; _register_mapping (p_env, _start, _len, _start2, blocksize, track_format, track_green); } } break; } case SINF_ID: { /* "SINF" */ uint32_t _sessions; cdio_assert (UINT32_FROM_BE (chunk->len) == 4); memcpy(&_sessions, chunk->data, 4); cdio_debug ("SINF: %lu sessions", (long unsigned int) UINT32_FROM_BE (_sessions)); } break; case MTYP_ID: { /* "MTYP" */ uint32_t mtyp_be; uint32_t mtyp; cdio_assert (UINT32_FROM_BE (chunk->len) == 4); memcpy(&mtyp_be, chunk->data, 4); mtyp = UINT32_FROM_BE (mtyp_be); cdio_debug ("MTYP: %lu", (long unsigned int) mtyp); if (mtyp != MTYP_AUDIO_CD) { cdio_log (log_level, "Unknown MTYP value: %u", (unsigned int) mtyp); } p_env->mtyp = mtyp; } break; case CDTX_ID: { /* "CD TEXT" */ uint8_t *wdata = (uint8_t *) chunk->data; int len = UINT32_FROM_BE (chunk->len); cdio_assert (len % CDTEXT_LEN_PACK == 0); p_env->gen.cdtext = cdtext_init (); if(0 !=cdtext_data_init (p_env->gen.cdtext, wdata, len)) { cdtext_destroy(p_env->gen.cdtext); free(p_env->gen.cdtext); p_env->gen.cdtext = NULL; } break; } default: cdio_log (log_level, "unknown tag %8.8x seen", (unsigned int) UINT32_FROM_BE (chunk->id)); break; } if (break_out) break; pos += 8; pos += UINT32_FROM_BE (chunk->len); } } /* Fake out leadout track. */ /* Don't use get_disc_last_lsn_nrg since that will lead to recursion since we haven't fully initialized things yet. */ cdio_lsn_to_msf (p_env->size, &p_env->tocent[p_env->gen.i_tracks].start_msf); p_env->tocent[p_env->gen.i_tracks].start_lba = cdio_lsn_to_lba(p_env->size); p_env->tocent[p_env->gen.i_tracks-1].sec_count = cdio_lsn_to_lba(p_env->size - p_env->tocent[p_env->gen.i_tracks-1].start_lba); p_env->gen.b_cdtext_error = false; p_env->gen.toc_init = true; free(footer_buf); return true; } /*! Initialize image structures. */ static bool _init_nrg (_img_private_t *p_env) { if (p_env->gen.init) { cdio_error ("init called more than once"); return false; } if (!(p_env->gen.data_source = cdio_stdio_new (p_env->gen.source_name))) { cdio_warn ("can't open nrg image file %s for reading", p_env->gen.source_name); return false; } p_env->psz_mcn = NULL; p_env->disc_mode = CDIO_DISC_MODE_NO_INFO; if ( !parse_nrg (p_env, p_env->gen.source_name, CDIO_LOG_WARN) ) { cdio_warn ("image file %s is not a Nero image", p_env->gen.source_name); return false; } p_env->gen.init = true; return true; } /*! Reads into buf the next size bytes. Returns -1 on error. Would be libc's seek() but we have to adjust for the extra track header information in each sector. */ static off_t _lseek_nrg (void *p_user_data, off_t offset, int whence) { _img_private_t *p_env = p_user_data; /* real_offset is the real byte offset inside the disk image The number below was determined empirically. */ off_t real_offset= p_env->is_dao ? 0x4b000 : 0; unsigned int i; p_env->pos.lba = 0; for (i=0; igen.i_tracks; i++) { track_info_t *this_track=&(p_env->tocent[i]); p_env->pos.index = i; if ( (this_track->sec_count*this_track->datasize) >= offset) { int blocks = (int) (offset / this_track->datasize); int rem = (int) (offset % this_track->datasize); off_t block_offset = blocks * this_track->blocksize; real_offset += block_offset + rem; p_env->pos.buff_offset = rem; p_env->pos.lba += blocks; break; } real_offset += this_track->sec_count*this_track->blocksize; offset -= this_track->sec_count*this_track->datasize; p_env->pos.lba += this_track->sec_count; } if (i==p_env->gen.i_tracks) { cdio_warn ("seeking outside range of disk image"); return -1; } else real_offset += p_env->tocent[i].datastart; return cdio_stream_seek(p_env->gen.data_source, real_offset, whence); } /*! Reads into buf the next size bytes. Returns -1 on error. FIXME: At present we assume a read doesn't cross sector or track boundaries. */ static ssize_t _read_nrg (void *p_user_data, void *buf, size_t size) { _img_private_t *p_env = p_user_data; return cdio_stream_read(p_env->gen.data_source, buf, size, 1); } /*! Get the size of the CD in logical block address (LBA) units. @param p_cdio the CD object queried @return the lsn. On error 0 or CDIO_INVALD_LSN. */ static lsn_t get_disc_last_lsn_nrg (void *p_user_data) { _img_private_t *p_env = p_user_data; return p_env->size; } /*! Reads a single audio sector from CD device into data starting from LSN. */ static driver_return_code_t _read_audio_sectors_nrg (void *p_user_data, void *data, lsn_t lsn, unsigned int nblocks) { _img_private_t *p_env = p_user_data; CdioListNode_t *node; if (lsn >= p_env->size) { cdio_warn ("trying to read beyond image size (%lu >= %lu)", (long unsigned int) lsn, (long unsigned int) p_env->size); return -1; } if (p_env->is_dao) { int ret; ret = cdio_stream_seek (p_env->gen.data_source, (lsn + CDIO_PREGAP_SECTORS) * CDIO_CD_FRAMESIZE_RAW, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (p_env->gen.data_source, data, CDIO_CD_FRAMESIZE_RAW, nblocks); /* ret is number of bytes if okay, but we need to return 0 okay. */ return ret == 0; } _CDIO_LIST_FOREACH (node, p_env->mapping) { _mapping_t *_map = _cdio_list_node_data (node); if (IN (lsn, _map->start_lsn, (_map->start_lsn + _map->sec_count - 1))) { int ret; long int img_offset = _map->img_offset; img_offset += (lsn - _map->start_lsn) * CDIO_CD_FRAMESIZE_RAW; ret = cdio_stream_seek (p_env->gen.data_source, img_offset, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (p_env->gen.data_source, data, CDIO_CD_FRAMESIZE_RAW, nblocks); if (ret==0) return ret; break; } } if (!node) cdio_warn ("reading into pre gap (lsn %lu)", (long unsigned int) lsn); return 0; } static driver_return_code_t _read_mode1_sector_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2) { _img_private_t *p_env = p_user_data; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; CdioListNode_t *node; if (lsn >= p_env->size) { cdio_warn ("trying to read beyond image size (%lu >= %lu)", (long unsigned int) lsn, (long unsigned int) p_env->size); return -1; } _CDIO_LIST_FOREACH (node, p_env->mapping) { _mapping_t *_map = _cdio_list_node_data (node); if (IN (lsn, _map->start_lsn, (_map->start_lsn + _map->sec_count - 1))) { int ret; long int img_offset = _map->img_offset; img_offset += (lsn - _map->start_lsn) * _map->blocksize; ret = cdio_stream_seek (p_env->gen.data_source, img_offset, SEEK_SET); if (ret!=0) return ret; /* FIXME: Not completely sure the below is correct. */ ret = cdio_stream_read (p_env->gen.data_source, (M2RAW_SECTOR_SIZE == _map->blocksize) ? (buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE) : buf, _map->blocksize, 1); if (ret==0) return ret; break; } } if (!node) cdio_warn ("reading into pre gap (lsn %lu)", (long unsigned int) lsn); memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE); return 0; } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. */ static driver_return_code_t _read_mode1_sectors_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned nblocks) { _img_private_t *p_env = p_user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode1_sector_nrg (p_env, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return 0; } static driver_return_code_t _read_mode2_sector_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2) { _img_private_t *p_env = p_user_data; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; CdioListNode_t *node; if (lsn >= p_env->size) { cdio_warn ("trying to read beyond image size (%lu >= %lu)", (long unsigned int) lsn, (long unsigned int) p_env->size); return -1; } _CDIO_LIST_FOREACH (node, p_env->mapping) { _mapping_t *_map = _cdio_list_node_data (node); if (IN (lsn, _map->start_lsn, (_map->start_lsn + _map->sec_count - 1))) { int ret; long int img_offset = _map->img_offset; img_offset += (lsn - _map->start_lsn) * _map->blocksize; ret = cdio_stream_seek (p_env->gen.data_source, img_offset, SEEK_SET); if (ret!=0) return ret; ret = cdio_stream_read (p_env->gen.data_source, (M2RAW_SECTOR_SIZE == _map->blocksize) ? (buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE) : buf, _map->blocksize, 1); if (ret==0) return ret; break; } } if (!node) cdio_warn ("reading into pre gap (lsn %lu)", (long unsigned int) lsn); if (b_form2) memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, M2RAW_SECTOR_SIZE); else memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE); return 0; } /*! Reads nblocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode2_sectors_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned nblocks) { _img_private_t *p_env = p_user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < nblocks; i++) { if ( (retval = _read_mode2_sector_nrg (p_env, ((char *)data) + (blocksize * i), lsn + i, b_form2)) ) return retval; } return 0; } /* Free memory resources associated with NRG object. */ static void _free_nrg (void *p_user_data) { _img_private_t *p_env = p_user_data; if (NULL == p_env) return; if (NULL != p_env->mapping) _cdio_list_free (p_env->mapping, true, free); /* The remaining part of the image is like the other image drivers, so free that in the same way. */ _free_image(p_user_data); } /*! Eject media -- there's nothing to do here except free resources. We always return 2. */ static driver_return_code_t _eject_media_nrg(void *obj) { _free_nrg (obj); return DRIVER_OP_UNSUPPORTED; } #if !defined(HAVE_GLOB_H) && defined(_WIN32) static void Win32Glob(const char* pattern, const char* szCurPath, char ***drives, unsigned int *num_files) { char szPath[MAX_PATH]; WIN32_FIND_DATAA ffd; HANDLE hFind; BOOL bFound; SetCurrentDirectoryA(szCurPath); hFind = FindFirstFileA(pattern, &ffd); bFound = (hFind != INVALID_HANDLE_VALUE); while (bFound) { cdio_add_device_list(drives, ffd.cFileName, num_files); bFound = FindNextFileA(hFind, &ffd); } if (hFind != INVALID_HANDLE_VALUE) FindClose(hFind); hFind = FindFirstFileA("*", &ffd); bFound = (hFind != INVALID_HANDLE_VALUE); while (bFound) { if ( (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (strcmp(ffd.cFileName, ".") != 0) && (strcmp(ffd.cFileName, "..") != 0) ) { GetFullPathNameA(ffd.cFileName, sizeof(szPath), szPath, NULL); Win32Glob(pattern, szPath, drives, num_files); SetCurrentDirectoryA(szCurPath); } bFound = FindNextFileA(hFind, &ffd); } if (hFind != INVALID_HANDLE_VALUE) FindClose(hFind); } #endif /*! Return an array of strings giving possible NRG disk images. */ char ** cdio_get_devices_nrg (void) { char **drives = NULL; unsigned int num_files=0; #ifdef HAVE_GLOB_H unsigned int i; glob_t globbuf; globbuf.gl_offs = 0; glob("*.nrg", GLOB_DOOFFS, NULL, &globbuf); for (i=0; ipsz_vendor, "libcdio", sizeof(hw_info->psz_vendor)-1); hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0'; strncpy(hw_info->psz_model, "Nero", sizeof(hw_info->psz_model)-1); hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0'; strncpy(hw_info->psz_revision, CDIO_VERSION, sizeof(hw_info->psz_revision)-1); hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0'; return true; } /*! Return the number of tracks in the current medium. CDIO_INVALID_TRACK is returned on error. */ static track_format_t get_track_format_nrg(void *p_user_data, track_t track_num) { _img_private_t *p_env = p_user_data; if (track_num > p_env->gen.i_tracks || track_num == 0) return TRACK_FORMAT_ERROR; if ( p_env->dtyp != DTYP_INVALID) { switch (p_env->dtyp) { case DTYP_MODE2_XA: return TRACK_FORMAT_XA; case DTYP_MODE1: return TRACK_FORMAT_DATA; default: ; } } /*if ( MTYP_AUDIO_CD == p_env->mtyp) return TRACK_FORMAT_AUDIO; */ return p_env->tocent[track_num-1].track_format; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool _get_track_green_nrg(void *p_user_data, track_t track_num) { _img_private_t *p_env = p_user_data; if (track_num > p_env->gen.i_tracks || track_num == 0) return false; if ( MTYP_AUDIO_CD == p_env->mtyp) return false; return p_env->tocent[track_num-1].track_green; } /*! Check that a NRG file is valid. */ bool cdio_is_nrg(const char *psz_nrg) { _img_private_t *p_env = calloc(1, sizeof (_img_private_t)); bool is_nrg = false; if (p_env == NULL || psz_nrg == NULL) { is_nrg = false; goto exit; } if (!(p_env->gen.data_source = cdio_stdio_new (psz_nrg))) { cdio_warn ("can't open nrg image file %s for reading", psz_nrg); is_nrg = false; goto exit; } if (parse_nrg(p_env, psz_nrg, CDIO_LOG_INFO)) { is_nrg = true; #ifdef ALSO_TEST_NAME size_t psz_len; psz_len = strlen(psz_nrg); /* At least 4 characters needed for .nrg extension */ if ( psz_len < 4 ) { is_nrg = false; goto exit; } is_nrg = strncasecmp( psz_nrg+(psz_len-3), "nrg", 3 ) == 0; #endif } exit: _free_nrg(p_env); return is_nrg; } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo * cdio_open_am_nrg (const char *psz_source_name, const char *psz_access_mode) { if (psz_access_mode != NULL && strcmp(psz_access_mode, "image")) cdio_warn ("there is only one access mode for nrg. Arg %s ignored", psz_access_mode); return cdio_open_nrg(psz_source_name); } CdIo * cdio_open_nrg (const char *psz_source) { CdIo *ret; _img_private_t *_data; cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); _funcs.eject_media = _eject_media_nrg; _funcs.free = _free_nrg; _funcs.get_arg = _get_arg_image; _funcs.get_cdtext = _get_cdtext_image; _funcs.get_cdtext_raw = NULL; _funcs.get_devices = cdio_get_devices_nrg; _funcs.get_default_device = cdio_get_default_device_nrg; _funcs.get_disc_last_lsn = get_disc_last_lsn_nrg; _funcs.get_discmode = _get_discmode_image; _funcs.get_drive_cap = _get_drive_cap_image; _funcs.get_first_track_num = _get_first_track_num_image; _funcs.get_hwinfo = get_hwinfo_nrg; _funcs.get_media_changed = get_media_changed_image; _funcs.get_mcn = _get_mcn_image; _funcs.get_num_tracks = _get_num_tracks_image; _funcs.get_track_channels = get_track_channels_generic; _funcs.get_track_copy_permit = get_track_copy_permit_image; _funcs.get_track_format = get_track_format_nrg; _funcs.get_track_green = _get_track_green_nrg; _funcs.get_track_lba = NULL; /* Will use generic routine via msf */ _funcs.get_track_msf = _get_track_msf_image; _funcs.get_track_preemphasis = get_track_preemphasis_generic; _funcs.get_track_pregap_lba = get_track_pregap_lba_image; _funcs.get_track_isrc = get_track_isrc_image; _funcs.lseek = _lseek_nrg; _funcs.read = _read_nrg; _funcs.read_audio_sectors = _read_audio_sectors_nrg; _funcs.read_data_sectors = read_data_sectors_image; _funcs.read_mode1_sector = _read_mode1_sector_nrg; _funcs.read_mode1_sectors = _read_mode1_sectors_nrg; _funcs.read_mode2_sector = _read_mode2_sector_nrg; _funcs.read_mode2_sectors = _read_mode2_sectors_nrg; _funcs.run_mmc_cmd = NULL; _funcs.set_arg = _set_arg_image; _data = calloc(1, sizeof (_img_private_t)); if (_data == NULL) { return NULL; } _data->gen.init = false; _data->gen.i_tracks = 0; _data->mtyp = 0; _data->dtyp = DTYP_INVALID; _data->gen.i_first_track= 1; _data->is_dao = false; _data->is_cues = false; /* FIXME: remove is_cues. */ ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) { free(_data); return NULL; } ret->driver_id = DRIVER_NRG; _set_arg_image(_data, "source", (NULL == psz_source) ? DEFAULT_CDIO_DEVICE: psz_source); _set_arg_image (_data, "access-mode", "Nero"); _data->psz_cue_name = strdup(_get_arg_image(_data, "source")); if (!cdio_is_nrg(_data->psz_cue_name)) { cdio_debug ("source name %s is not recognized as a NRG image", _data->psz_cue_name); _free_nrg(_data); free(ret); return NULL; } if (_init_nrg(_data)) return ret; else { _free_nrg(_data); free(ret); return NULL; } } bool cdio_have_nrg (void) { return true; } libcdio-2.2.0/lib/driver/image/nrg.h000066400000000000000000000114661474051130400172110ustar00rootroot00000000000000/* $Id: nrg.h,v 1.7 2008/06/10 00:45:08 pjcreath Exp $ Copyright (C) 2004, 2006, 2008 Rocky Bernstein Copyright (C) 2001, 2003 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* NERO (NRG) file format structures. */ /* this ugly image format is typical for lazy win32 programmers... at least structure were set big endian, so at reverse engineering wasn't such a big headache... */ PRAGMA_BEGIN_PACKED typedef union { struct { uint32_t __x GNUC_PACKED; uint32_t ID GNUC_PACKED; uint32_t footer_ofs GNUC_PACKED; } v50; struct { uint32_t ID GNUC_PACKED; uint64_t footer_ofs GNUC_PACKED; } v55; } _footer_t; typedef struct { uint32_t start GNUC_PACKED; uint32_t length GNUC_PACKED; uint32_t type GNUC_PACKED; /* 0x0 -> MODE1, 0x2 -> MODE2 form1, 0x3 -> MIXED_MODE2 2336 blocksize */ uint32_t start_lsn GNUC_PACKED; /* does not include any pre-gaps! */ uint32_t _unknown GNUC_PACKED; /* wtf is this for? -- always zero... */ } _etnf_array_t; /* Finally they realized that 32-bit offsets are a bit outdated for IA64 *eg* */ typedef struct { uint64_t start GNUC_PACKED; uint64_t length GNUC_PACKED; uint32_t type GNUC_PACKED; /* 0x0 -> MODE1, 0x2 -> MODE2 form1, 0x3 -> MIXED_MODE2 2336 blocksize */ uint32_t start_lsn GNUC_PACKED; uint64_t _unknown GNUC_PACKED; /* wtf is this for? -- always zero... */ } _etn2_array_t; typedef struct { uint8_t type; /* has track copy bit and whether audiofile or datafile. Is often 0x41 == 'A' */ uint8_t track; /* binary or BCD?? */ uint8_t addr_ctrl; /* addresstype: MSF or LBA in lower 4 bits control in upper 4 bits. makes 0->1 transitions */ uint8_t res; /* ?? */ uint32_t lsn GNUC_PACKED; } _cuex_array_t; /* New DAO[XI] Information from http://en.wikipedia.org/wiki/NRG_(file_format) */ typedef struct { char psz_isrc[CDIO_ISRC_SIZE]; uint8_t unknown[6]; } _dao_array_common_t; typedef struct { _dao_array_common_t common; uint64_t index0 GNUC_PACKED; uint64_t index1 GNUC_PACKED; uint64_t end_of_track GNUC_PACKED; } _daox_array_t; typedef struct { _dao_array_common_t common; uint32_t index0 GNUC_PACKED; uint32_t index1 GNUC_PACKED; uint32_t end_of_track GNUC_PACKED; } _daoi_array_t; typedef struct GNUC_PACKED { uint32_t chunk_size_le GNUC_PACKED; char psz_mcn[CDIO_MCN_SIZE]; uint8_t unknown[3]; uint8_t first_track; uint8_t last_track; } _dao_common_t; typedef struct { _dao_common_t common; _daox_array_t track_info[EMPTY_ARRAY_SIZE]; } _daox_t; typedef struct { _dao_common_t common; _daoi_array_t track_info[EMPTY_ARRAY_SIZE]; } _daoi_t; typedef struct { uint32_t id GNUC_PACKED; uint32_t len GNUC_PACKED; char data[EMPTY_ARRAY_SIZE]; } _chunk_t; PRAGMA_END_PACKED /* Nero images are Big Endian. */ typedef enum { CDTX_ID = 0x43445458, /* CD TEXT */ CUEX_ID = 0x43554558, /* Nero version 5.5.x-6.x */ CUES_ID = 0x43554553, /* Nero pre version 5.5.x-6.x */ DAOX_ID = 0x44414f58, /* Nero version 5.5.x-6.x */ DAOI_ID = 0x44414f49, END1_ID = 0x454e4421, ETN2_ID = 0x45544e32, ETNF_ID = 0x45544e46, NER5_ID = 0x4e455235, /* Nero version 5.5.x */ NERO_ID = 0x4e45524f, /* Nero pre 5.5.x */ SINF_ID = 0x53494e46, /* Session information */ MTYP_ID = 0x4d545950, /* Disc Media type? */ } nero_id_t; #define MTYP_AUDIO_CD 1 /* This isn't correct. But I don't know the the right thing is and it sometimes works (and sometimes is wrong). */ /* Disk track type Values gleaned from DAOX */ typedef enum { DTYP_MODE1 = 0, DTYP_MODE2_XA = 2, DTYP_INVALID = 255 } nero_dtype_t; /** The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ extern nero_id_t nero_id; extern nero_dtype_t nero_dtype; libcdio-2.2.0/lib/driver/image_common.c000066400000000000000000000243471474051130400177700ustar00rootroot00000000000000/* Copyright (C) 2004-2005, 2008, 2010-2011, 2013, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! Common image routines. Because _img_private_t may vary over image formats, the routines are included into the image drivers after _img_private_t is defined. In order for the below routines to work, there is a large part of _img_private_t that is common among image drivers. For example, see image.h */ #include "image.h" #include "image_common.h" #include #include "_cdio_stdio.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif /*! Eject media -- there's nothing to do here except free resources. We always return DRIVER_OP_UNSUPPORTED. */ driver_return_code_t _eject_media_image(void *p_user_data) { _free_image (p_user_data); return DRIVER_OP_UNSUPPORTED; } /*! We don't need the image any more. Free all memory associated with it. */ void _free_image (void *p_user_data) { _img_private_t *p_env = p_user_data; track_t i_track; if (NULL == p_env) return; for (i_track=0; i_track < p_env->gen.i_tracks; i_track++) { track_info_t *p_tocent = &(p_env->tocent[i_track]); CDIO_FREE_IF_NOT_NULL(p_tocent->filename); CDIO_FREE_IF_NOT_NULL(p_tocent->isrc); if (p_tocent->data_source) cdio_stdio_destroy(p_tocent->data_source); } CDIO_FREE_IF_NOT_NULL(p_env->psz_mcn); CDIO_FREE_IF_NOT_NULL(p_env->psz_cue_name); CDIO_FREE_IF_NOT_NULL(p_env->psz_access_mode); cdtext_destroy(p_env->gen.cdtext); cdio_generic_stdio_free(p_env); free(p_env); } /*! Return the value associated with the key "arg". */ const char * _get_arg_image (void *user_data, const char key[]) { _img_private_t *p_env = user_data; if (!strcmp (key, "source")) { return p_env->gen.source_name; } else if (!strcmp (key, "cue")) { return p_env->psz_cue_name; } else if (!strcmp(key, "access-mode")) { return "image"; } else if (!strcmp (key, "mmc-supported?")) { return "false"; } return NULL; } /*! Return CD-Text object */ cdtext_t * _get_cdtext_image (void *user_data) { generic_img_private_t *p_env = user_data; if(!p_env) return NULL; return p_env->cdtext; } /*! Get disc type associated with cd_obj. */ discmode_t _get_discmode_image (void *p_user_data) { _img_private_t *p_env = p_user_data; return p_env->disc_mode; } /*! Return the the kind of drive capabilities of device. */ void _get_drive_cap_image (const void *user_data, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap) { *p_read_cap = CDIO_DRIVE_CAP_READ_CD_DA | CDIO_DRIVE_CAP_READ_CD_G | CDIO_DRIVE_CAP_READ_CD_R | CDIO_DRIVE_CAP_READ_CD_RW | CDIO_DRIVE_CAP_READ_MODE2_FORM1 | CDIO_DRIVE_CAP_READ_MODE2_FORM2 | CDIO_DRIVE_CAP_READ_MCN ; *p_write_cap = 0; /* In the future we may want to simulate LOCK, OPEN_TRAY, CLOSE_TRAY, SELECT_SPEED, etc. */ *p_misc_cap = CDIO_DRIVE_CAP_MISC_FILE; } /*! Return the number of of the first track. CDIO_INVALID_TRACK is returned on error. */ track_t _get_first_track_num_image(void *p_user_data) { _img_private_t *p_env = p_user_data; if (!p_env->gen.toc_init) p_env->gen.cdio->op.read_toc (p_user_data); return p_env->gen.toc_init ? p_env->gen.i_first_track : CDIO_INVALID_TRACK; } /*! Find out if media has changed since the last call. @param p_user_data the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t There is no such thing as changing a media image so we will always return 0 - no change. */ int get_media_changed_image(const void *p_user_data) { return 0; } /*! Return the media catalog number (MCN) from the CD or NULL if there is none or we don't have the ability to get it. Note: string is malloc'd so caller has to free() the returned string when done with it. */ char * _get_mcn_image(const void *p_user_data) { const _img_private_t *p_env = p_user_data; if (!p_env || !p_env->psz_mcn) return NULL; return strdup(p_env->psz_mcn); } /*! Return the number of tracks. */ track_t _get_num_tracks_image(void *p_user_data) { _img_private_t *p_env = p_user_data; return p_env->gen.i_tracks; } /*! Return the starting MSF (minutes/secs/frames) for the track number track_num in obj. Tracks numbers start at 1. The "leadout" track is specified either by using track_num LEADOUT_TRACK or the total tracks+1. */ bool _get_track_msf_image(void *p_user_data, track_t i_track, msf_t *msf) { const _img_private_t *p_env = p_user_data; if (NULL == msf) return false; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks + p_env->gen.i_first_track; if (i_track >= p_env->gen.i_first_track && i_track <= p_env->gen.i_tracks + p_env->gen.i_first_track) { *msf = p_env->tocent[i_track-p_env->gen.i_first_track].start_msf; return true; } else return false; } /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int get_track_channels_image(const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; return ( p_env->tocent[i_track-p_env->gen.i_first_track].flags & FOUR_CHANNEL_AUDIO ) ? 4 : 2; } /*! Return 1 if copy is permitted on the track, 0 if not, or -1 for error. Is this meaningful if not an audio track? */ track_flag_t get_track_copy_permit_image(void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; return ( p_env->tocent[i_track-p_env->gen.i_first_track].flags & COPY_PERMITTED ) ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; } /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error. Is this meaningful if not an audio track? pre-emphasis is a non linear frequency response. */ track_flag_t get_track_preemphasis_image(const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; return ( p_env->tocent[i_track-p_env->gen.i_first_track].flags & PRE_EMPHASIS ) ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; } /*! Return the starting LBA for the pregap for track number i_track. Track numbers start at 1. CDIO_INVALID_LBA is returned on error. */ lba_t get_track_pregap_lba_image(const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; lba_t pregap, start_lba; pregap = p_env->tocent[i_track-p_env->gen.i_first_track].pregap; start_lba = p_env->tocent[i_track-p_env->gen.i_first_track].start_lba; /* avoid initializing pregap to CDIO_INVALID_LBA by letting calloc do the work. also, nero files have the pregap set equal to the start of the track when there is no pregap */ if (!pregap || pregap == start_lba) { pregap = CDIO_INVALID_LBA; } return pregap; } /*! Return the International Standard Recording Code (ISRC) for track number i_track in p_cdio. Track numbers start at 1. Note: string is malloc'd so caller has to free() the returned string when done with it. */ char * get_track_isrc_image(const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; char *isrc = p_env->tocent[i_track-p_env->gen.i_first_track].isrc; if (isrc && isrc[0]) { return strdup(isrc); } else { return NULL; } } /*! Read a data sector @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least ISO_BLOCKSIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of block. Should be either ISO_BLOCKSIZE M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. */ driver_return_code_t read_data_sectors_image ( void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ) { const _img_private_t *p_env = p_user_data; if (!p_env || !p_env->gen.cdio) return DRIVER_OP_UNINIT; { CdIo_t *p_cdio = p_env->gen.cdio; track_t i_track = cdio_get_track(p_cdio, i_lsn); track_format_t e_track_format = cdio_get_track_format(p_cdio, i_track); switch(e_track_format) { case TRACK_FORMAT_PSX: case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: return DRIVER_OP_ERROR; case TRACK_FORMAT_DATA: return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, false, i_blocks); case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, false, i_blocks); } } return DRIVER_OP_ERROR; } /*! Set the arg "key" with "value" in the source device. Currently "source" to set the source device in I/O operations is the only valid key. */ driver_return_code_t _set_arg_image (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { CDIO_FREE_IF_NOT_NULL(p_env->gen.source_name); if (!value) return DRIVER_OP_ERROR; p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "cue")) { CDIO_FREE_IF_NOT_NULL(p_env->psz_cue_name); if (!value) return DRIVER_OP_ERROR; p_env->psz_cue_name = strdup (value); } else if (!strcmp (key, "access-mode")) { CDIO_FREE_IF_NOT_NULL(p_env->psz_access_mode); if (!value) return DRIVER_OP_ERROR; p_env->psz_access_mode = strdup (value); } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } libcdio-2.2.0/lib/driver/image_common.h000066400000000000000000000151771474051130400177760ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2008, 2012, 2024 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! Common image routines. Because _img_private_t may vary over image formats, the routines are included into the image drivers after _img_private_t is defined. In order for the below routines to work, there is a large part of _img_private_t that is common among image drivers. For example, see image.h */ #ifndef CDIO_DRIVER_IMAGE_COMMON_H_ #define CDIO_DRIVER_IMAGE_COMMON_H_ typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; internal_position_t pos; char *psz_cue_name; char *psz_access_mode; /* Just the name of the driver. We add this for regularity with other real CD drivers which has an access mode. */ char *psz_mcn; /* Media Catalog Number (5.22.3) exactly 13 bytes */ track_info_t tocent[CDIO_CD_MAX_TRACKS+1]; /* entry info for each track add 1 for leadout. */ discmode_t disc_mode; #ifdef NEED_NERO_STRUCT /* Nero Specific stuff. Note: for the image_free to work, this *must* be last. */ bool is_dao; /* True if some of disk at once. False if some sort of track at once. */ uint32_t mtyp; /* Value of MTYP (media type?) tag */ uint8_t dtyp; /* Value of DAOX media type tag */ /* This is a hack because I don't really understnad NERO better. */ bool is_cues; CdioList_t *mapping; /* List of track information */ uint32_t size; #endif } _img_private_t; /*! We don't need the image any more. Free all memory associated with it. */ void _free_image (void *p_user_data); driver_return_code_t _eject_media_image(void *p_user_data); /*! Return the value associated with the key "arg". */ const char * _get_arg_image (void *user_data, const char key[]); /*! Return CD-Text object or NULL */ cdtext_t * _get_cdtext_image(void *p_user_data); /*! Get disc type associated with cd_obj. */ discmode_t _get_discmode_image (void *p_user_data); /*! Return the the kind of drive capabilities of device. */ void _get_drive_cap_image (const void *user_data, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); /*! Return the number of of the first track. CDIO_INVALID_TRACK is returned on error. */ track_t _get_first_track_num_image(void *p_user_data); /*! Find out if media has changed since the last call. @param p_user_data the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t We always return DRIVER_OP_UNSUPPORTED. */ int get_media_changed_image(const void *p_user_data); /*! Return the media catalog number (MCN) from the CD or NULL if there is none or we don't have the ability to get it. Note: string is malloc'd so caller has to free() the returned string when done with it. */ char * _get_mcn_image(const void *p_user_data); /*! Return the number of tracks. */ track_t _get_num_tracks_image(void *p_user_data); /*! Return the starting MSF (minutes/secs/frames) for the track number track_num in obj. Tracks numbers start at 1. The "leadout" track is specified either by using track_num LEADOUT_TRACK or the total tracks+1. */ bool _get_track_msf_image(void *p_user_data, track_t i_track, msf_t *msf); /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int get_track_channels_image(const void *p_user_data, track_t i_track); /*! Return 1 if copy is permitted on the track, 0 if not, or -1 for error. Is this meaningful if not an audio track? */ track_flag_t get_track_copy_permit_image(void *p_user_data, track_t i_track); /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error. Is this meaningful if not an audio track? pre-emphasis is a non linear frequency response. */ track_flag_t get_track_preemphasis_image(const void *p_user_data, track_t i_track); /*! Return the starting LBA for the pregap for track number i_track. Track numbers start at 1. CDIO_INVALID_LBA is returned on error. */ lba_t get_track_pregap_lba_image(const void *p_user_data, track_t i_track); /*! Return the International Standard Recording Code (ISRC) for track number i_track in p_cdio. Track numbers start at 1. Note: string is malloc'd so caller has to free() the returned string when done with it. */ char *get_track_isrc_image(const void *p_user_data, track_t i_track); /*! Read a data sector @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least ISO_BLOCKSIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of block. Should be either ISO_BLOCKSIZE M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. @param i_blocks number of blocks to read. */ driver_return_code_t read_data_sectors_image ( void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ); /*! Set the arg "key" with "value" in the source device. Currently "source" to set the source device in I/O operations is the only valid key. 0 is returned if no error was found, and nonzero if there as an error. */ driver_return_code_t _set_arg_image (void *user_data, const char key[], const char value[]); #endif /* CDIO_DRIVER_IMAGE_COMMON_H_ */ libcdio-2.2.0/lib/driver/libcdio.sym000066400000000000000000000114141474051130400173200ustar00rootroot00000000000000CDIO_SECTOR_SYNC_HEADER _cdio_list_append _cdio_list_begin _cdio_list_end _cdio_list_find _cdio_list_foreach _cdio_list_free _cdio_list_length _cdio_list_new _cdio_list_node_data _cdio_list_node_free _cdio_list_node_next _cdio_list_prepend _cdio_strfreev _cdio_strsplit cdio_abspath cdio_audio_get_msf_seconds cdio_audio_get_volume cdio_audio_pause cdio_audio_play_msf cdio_audio_play_track_index cdio_audio_read_subchannel cdio_audio_resume cdio_audio_set_volume cdio_audio_stop cdio_charset_convert cdio_charset_converter_create cdio_charset_converter_destroy cdio_charset_from_utf8 cdio_charset_to_utf8 cdio_close_tray cdio_debug cdio_default_log_handler cdio_destroy cdio_device_drivers cdio_dirname cdio_driver_describe cdio_driver_errmsg cdio_drivers cdio_eject_media cdio_eject_media_drive cdio_error cdio_free cdio_free_device_list cdio_from_bcd8 cdio_get_arg cdio_get_cdtext cdio_get_cdtext_raw cdio_get_default_device cdio_get_default_device_bincue cdio_get_default_device_cdrdao cdio_get_default_device_driver cdio_get_default_device_freebsd cdio_get_default_device_linux cdio_get_default_device_nrg cdio_get_default_device_osx cdio_get_default_device_solaris cdio_get_default_device_win32 cdio_get_devices cdio_get_devices_bincue cdio_get_devices_cdrdao cdio_get_devices_freebsd cdio_get_devices_linux cdio_get_devices_nrg cdio_get_devices_osx cdio_get_devices_ret cdio_get_devices_solaris cdio_get_devices_win32 cdio_get_devices_with_cap cdio_get_devices_with_cap_ret cdio_get_disc_last_lsn cdio_get_discmode cdio_get_drive_cap cdio_get_drive_cap_dev cdio_get_driver_id cdio_get_driver_name cdio_get_first_track_num cdio_get_hwinfo cdio_get_joliet_level cdio_get_last_session cdio_get_last_track_num cdio_get_mcn cdio_get_media_changed cdio_get_num_tracks cdio_get_track cdio_get_track_channels cdio_get_track_copy_permit cdio_get_track_format cdio_get_track_green cdio_get_track_isrc cdio_get_track_last_lsn cdio_get_track_lba cdio_get_track_lsn cdio_get_track_msf cdio_get_track_preemphasis cdio_get_track_pregap_lba cdio_get_track_pregap_lsn cdio_get_track_sec_count cdio_guess_cd_type cdio_have_atapi cdio_have_bincue cdio_have_cdrdao cdio_have_driver cdio_have_freebsd cdio_have_linux cdio_have_netbsd cdio_have_nrg cdio_have_osx cdio_have_solaris cdio_have_win32 cdio_info cdio_init cdio_is_binfile cdio_is_cuefile cdio_is_device cdio_is_discmode_cdrom cdio_is_discmode_dvd cdio_is_nrg cdio_is_tocfile cdio_lba_to_lsn cdio_lba_to_msf cdio_lba_to_msf_str cdio_log cdio_log_set_handler cdio_loglevel_default cdio_lseek cdio_lsn_to_lba cdio_lsn_to_msf cdio_msf_to_lba cdio_msf_to_lsn cdio_msf_to_str cdio_open cdio_open_am cdio_open_am_bincue cdio_open_am_cd cdio_open_am_cdrdao cdio_open_am_freebsd cdio_open_am_linux cdio_open_am_netbsd cdio_open_am_nrg cdio_open_am_osx cdio_open_am_solaris cdio_open_am_win32 cdio_open_bincue cdio_open_cd cdio_open_cdrdao cdio_open_cue cdio_open_freebsd cdio_open_linux cdio_open_netbsd cdio_open_nrg cdio_open_osx cdio_open_solaris cdio_open_win32 cdio_os_driver cdio_read cdio_read_audio_sector cdio_read_audio_sectors cdio_read_data_sectors cdio_read_mode1_sector cdio_read_mode1_sectors cdio_read_mode2_sector cdio_read_mode2_sectors cdio_read_sector cdio_read_sectors cdio_realpath cdio_set_arg cdio_set_blocksize cdio_set_speed cdio_stdio_destroy cdio_stdio_new cdio_stream_getpos cdio_stream_read cdio_stream_seek cdio_to_bcd8 cdio_version_string cdio_warn cdtext_destroy cdtext_field2str cdtext_genre2str cdtext_lang2str cdtext_str2lang cdtext_get cdtext_get_const cdtext_get_genre cdtext_get_language cdtext_get_first_track cdtext_get_last_track cdtext_init cdtext_data_init cdtext_list_languages cdtext_list_languages_v2 cdtext_set cdtext_select_language cdtext_set_language_index debug_cdio_mmc_feature debug_cdio_mmc_feature_interface debug_cdio_mmc_feature_profile debug_cdio_mmc_get_conf debug_cdio_mmc_gpcmd debug_cdio_mmc_read_sub_state discmode2str libcdio_version_num mmc_audio_read_subchannel mmc_audio_state2str mmc_close_tray mmc_cmd2str mmc_eject_media mmc_feature2str mmc_feature_profile2str mmc_get_blocksize mmc_get_cmd_len mmc_get_configuration mmc_get_discmode mmc_get_disctype mmc_get_disc_erasable mmc_get_drive_mmc_cap mmc_get_dvd_struct_physical mmc_get_event_status mmc_get_hwinfo mmc_get_mcn mmc_get_media_changed mmc_get_track_isrc mmc_read_cdtext mmc_get_tray_status mmc_have_interface mmc_is_disctype_bd mmc_is_disctype_cdrom mmc_is_disctype_dvd mmc_is_disctype_hd_dvd mmc_is_disctype_overwritable mmc_last_cmd_sense mmc_mode_select_10 mmc_mode_sense mmc_mode_sense_10 mmc_mode_sense_6 mmc_prevent_allow_medium_removal mmc_read_cd mmc_read_data_sectors mmc_read_disc_information mmc_read_sectors mmc_read_timeout_ms mmc_run_cmd mmc_run_cmd_len mmc_sense_key2str mmc_set_blocksize mmc_set_speed mmc_start_stop_unit mmc_test_unit_ready mmc_timeout_ms mmc_test_unit_ready track_format2str libcdio-2.2.0/lib/driver/logging.c000066400000000000000000000075311474051130400167600ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2008, 2011, 2012, 2015 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDARG_H #include #endif #ifdef HAVE_STDIO_H #include #endif #include #include "cdio_assert.h" #include "portable.h" #include cdio_log_level_t cdio_loglevel_default = CDIO_LOG_WARN; extern void cdio_default_log_handler(cdio_log_level_t level, const char message[]) { switch (level) { case CDIO_LOG_ERROR: if (level >= cdio_loglevel_default) { fprintf (stderr, "**ERROR: %s\n", message); fflush (stderr); } exit (EXIT_FAILURE); break; case CDIO_LOG_DEBUG: if (level >= cdio_loglevel_default) { fprintf (stdout, "--DEBUG: %s\n", message); } break; case CDIO_LOG_WARN: if (level >= cdio_loglevel_default) { fprintf (stdout, "++ WARN: %s\n", message); } break; case CDIO_LOG_INFO: if (level >= cdio_loglevel_default) { fprintf (stdout, " INFO: %s\n", message); } break; case CDIO_LOG_ASSERT: if (level >= cdio_loglevel_default) { fprintf (stderr, "!ASSERT: %s\n", message); fflush (stderr); } abort (); break; default: cdio_assert_not_reached (); break; } fflush (stdout); } cdio_log_handler_t _handler = cdio_default_log_handler; cdio_log_handler_t cdio_log_set_handler(cdio_log_handler_t new_handler) { cdio_log_handler_t old_handler = _handler; _handler = new_handler; return old_handler; } static void cdio_logv(cdio_log_level_t level, const char format[], va_list args) { char buf[1024] = { 0, }; /* _handler() is user defined and we want to make sure _handler() doesn't call us, cdio_logv. in_recursion is used for that, however it has a problem in multi-threaded programs. I'm not sure how to handle multi-threading and recursion checking both. For now, we'll leave in the recursion checking, at the expense of handling multi-threaded log calls. To ameliorate this, we'll check the log level and handle calls where there is no output, before the recursion check. */ static int in_recursion = 0; if (level < cdio_loglevel_default) return; if (in_recursion) { /* Can't use cdio_assert_not_reached() as that may call cdio_logv */ assert(0); } in_recursion = 1; vsnprintf(buf, sizeof(buf)-1, format, args); _handler(level, buf); in_recursion = 0; } void cdio_log(cdio_log_level_t level, const char format[], ...) { va_list args; va_start (args, format); cdio_logv (level, format, args); va_end (args); } #define CDIO_LOG_TEMPLATE(level, LEVEL) \ void \ cdio_ ## level (const char format[], ...) \ { \ va_list args; \ va_start (args, format); \ cdio_logv (CDIO_LOG_ ## LEVEL, format, args); \ va_end (args); \ } CDIO_LOG_TEMPLATE(debug, DEBUG) CDIO_LOG_TEMPLATE(info, INFO) CDIO_LOG_TEMPLATE(warn, WARN) CDIO_LOG_TEMPLATE(error, ERROR) #undef CDIO_LOG_TEMPLATE /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/memory.c000066400000000000000000000020621474051130400166340ustar00rootroot00000000000000/* Copyright (C) 2014-2015 Robert Kausch 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDLIB_H #include #endif #include #include /*! Free the passed pointer. @param p_memory a pointer to memory allocated by a libcdio funtion. */ void cdio_free (void *p_memory) { if (p_memory != NULL) free(p_memory); } libcdio-2.2.0/lib/driver/mmc/000077500000000000000000000000001474051130400157345ustar00rootroot00000000000000libcdio-2.2.0/lib/driver/mmc/.gitignore000066400000000000000000000000041474051130400177160ustar00rootroot00000000000000/*~ libcdio-2.2.0/lib/driver/mmc/Makefile000066400000000000000000000015531474051130400174000ustar00rootroot00000000000000# $Id: Makefile,v 1.2 2008/04/21 18:30:21 karl Exp $ # # Copyright (C) 2004, 2008 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # The make is done above. This boilerplate Makefile just transfers the call all install check clean: cd .. && $(MAKE) $@ libcdio-2.2.0/lib/driver/mmc/mmc.c000066400000000000000000001056021474051130400166600ustar00rootroot00000000000000/* Common Multimedia Command (MMC) routines. Copyright (C) 2004-2008, 2010-2012, 2014 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include #include #include #include "cdio_private.h" #include "cdtext_private.h" #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_ERRNO_H # include #endif const char *mmc_cmd2str(uint8_t command) { switch( command ) { case CDIO_MMC_GPCMD_TEST_UNIT_READY: return "TEST UNIT READY"; case CDIO_MMC_GPCMD_REQUEST_SENSE: return "REQUEST SENSE"; case CDIO_MMC_GPCMD_FORMAT_UNIT: return "FORMAT UNIT"; case CDIO_MMC_GPCMD_INQUIRY: return "INQUIRY"; case CDIO_MMC_GPCMD_MODE_SELECT_6: return "MODE SELECT (6)"; case CDIO_MMC_GPCMD_MODE_SENSE_6: return "MODE SENSE (6)"; case CDIO_MMC_GPCMD_START_STOP_UNIT: return "START STOP UNIT"; case CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL: return "PREVENT ALLOW MEDIUM REMOVAL"; case CDIO_MMC_GPCMD_READ_FORMAT_CAPACITIES: return "READ FORMAT CAPACITIES"; case CDIO_MMC_GPCMD_READ_CAPACITIY: return "READ_CAPACITIY"; case CDIO_MMC_GPCMD_READ_10: return "READ (10)"; case CDIO_MMC_GPCMD_WRITE_10: return "WRITE (10)"; case CDIO_MMC_GPCMD_SEEK_10: return "SEEK (10)"; case CDIO_MMC_GPCMD_ERASE_10: return "ERASE (10)"; case CDIO_MMC_GPCMD_WRITE_AND_VERIFY_10: return "WRITE AND VERIFY (10)"; case CDIO_MMC_GPCMD_VERIFY_10: return "VERIFY (10)"; case CDIO_MMC_GPCMD_SYNCHRONIZE_CACHE: return "SYNCHRONIZE CACHE"; case CDIO_MMC_GPCMD_WRITE_BUFFER: return "WRITE BUFFER"; case CDIO_MMC_GPCMD_READ_BUFFER: return "READ_BUFFER"; case CDIO_MMC_GPCMD_READ_SUBCHANNEL: return "READ_SUBCHANNEL"; case CDIO_MMC_GPCMD_READ_TOC: return "READ TOC"; case CDIO_MMC_GPCMD_READ_HEADER: return "READ_HEADER"; case CDIO_MMC_GPCMD_PLAY_AUDIO_10: return "PLAY AUDIO (10)"; case CDIO_MMC_GPCMD_GET_CONFIGURATION: return "GET_CONFIGURATION"; case CDIO_MMC_GPCMD_PLAY_AUDIO_MSF: return "PLAY AUDIO MSF"; case CDIO_MMC_GPCMD_PLAY_AUDIO_TI: return "PLAY_AUDIO TI"; case CDIO_MMC_GPCMD_PLAY_TRACK_REL_10: return "PLAY TRACK REL (10)"; case CDIO_MMC_GPCMD_GET_EVENT_STATUS: return "GET EVENT STATUS"; case CDIO_MMC_GPCMD_PAUSE_RESUME: return "PAUSE RESUME"; case CDIO_MMC_GPCMD_READ_DISC_INFORMATION: return "READ DISC INFORMATION"; case CDIO_MMC_GPCMD_READ_TRACK_INFORMATION: return "READ TRACK INFORMATION"; case CDIO_MMC_GPCMD_RESERVE_TRACK: return "RESERVE TRACK"; case CDIO_MMC_GPCMD_SEND_OPC_INFORMATION: return "SEND OPC INFORMATION"; case CDIO_MMC_GPCMD_MODE_SELECT_10: return "MODE SELECT (10)"; case CDIO_MMC_GPCMD_REPAIR_TRACK: return "REPAIR_TRACK"; case CDIO_MMC_GPCMD_MODE_SENSE_10: return "MODE SENSE (10)"; case CDIO_MMC_GPCMD_CLOSE_TRACK_SESSION: return "CLOSE TRACK SESSION"; case CDIO_MMC_GPCMD_READ_BUFFER_CAPACITY: return "READ_BUFFER CAPACITY"; case CDIO_MMC_GPCMD_SEND_CUE_SHEET: return "SEND_CUE SHEET"; case CDIO_MMC_GPCMD_REPORT_LUNS: return "REPORT LUNS"; case CDIO_MMC_GPCMD_BLANK: return "BLANK"; case CDIO_MMC_GPCMD_SECURITY_PROTOCOL_IN: return "SECURITY PROTOCOL IN"; case CDIO_MMC_GPCMD_SEND_KEY: return "SEND KEY"; case CDIO_MMC_GPCMD_REPORT_KEY: return "REPORT KEY"; case CDIO_MMC_GPCMD_PLAY_AUDIO_12: return "PLAY_AUDIO (12)"; case CDIO_MMC_GPCMD_LOAD_UNLOAD: return "LOAD UNLOAD"; case CDIO_MMC_GPCMD_SET_READ_AHEAD: return "SET READ AHEAD"; case CDIO_MMC_GPCMD_READ_12: return "READ (12)"; case CDIO_MMC_GPCMD_PLAY_TRACK_REL_12: return "PLAY_TRACK REL (12)"; case CDIO_MMC_GPCMD_WRITE_12: return "WRITE (12)"; case CDIO_MMC_GPCMD_READ_MEDIA_SERIAL_12: return "READ MEDIA SERIAL (12)"; case CDIO_MMC_GPCMD_GET_PERFORMANCE: return "GET PERFORMANCE"; case CDIO_MMC_GPCMD_READ_DVD_STRUCTURE: return "READ DVD STRUCTURE"; case CDIO_MMC_GPCMD_SECURITY_PROTOCOL_OUT: return "SECURITY PROTOCOL_OUT"; case CDIO_MMC_GPCMD_SET_STREAMING: return "SET STREAMING"; case CDIO_MMC_GPCMD_READ_MSF: return "READ MSF"; case CDIO_MMC_GPCMD_SET_SPEED: return "SET SPEED"; case CDIO_MMC_GPCMD_MECHANISM_STATUS: return "MECHANISM STATUS"; case CDIO_MMC_GPCMD_READ_CD: return "READ CD"; case CDIO_MMC_GPCMD_SEND_DISC_STRUCTURE: return "SEND DISC STRUCTURE"; case CDIO_MMC_GPCMD_CD_PLAYBACK_STATUS: return "CD PLAYBACK STATUS"; case CDIO_MMC_GPCMD_PLAYBACK_CONTROL: return "PLAYBACK CONTROL"; case CDIO_MMC_GPCMD_READ_CDDA: return "READ CDDA"; case CDIO_MMC_GPCMD_READ_CDXA: return "READ CDXA"; case CDIO_MMC_GPCMD_READ_ALL_SUBCODES: return "READ ALL SUBCODES"; default: { char buf[30]; snprintf(buf, sizeof(buf), "Unknown 0x%x", command); return strdup(buf); } } } /************************************************************************* MMC CdIo Operations which a driver may use. These are not accessible directly. Most of these routines just pick out the cdio pointer and call the corresponding publically-accessible routine. *************************************************************************/ /** Read Audio Subchannel information @param p_user_data the CD object to be acted upon. */ driver_return_code_t audio_read_subchannel_mmc ( void *p_user_data, cdio_subchannel_t *p_subchannel) { generic_img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return mmc_audio_read_subchannel(p_env->cdio, p_subchannel); } /** Get the block size for subsequest read requests, via MMC. @return the blocksize if > 0; error if <= 0 */ int get_blocksize_mmc (void *p_user_data) { generic_img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return mmc_get_blocksize(p_env->cdio); } /** Get the lsn of the end of the CD (via MMC). */ lsn_t get_disc_last_lsn_mmc (void *p_user_data) { generic_img_private_t *p_env = p_user_data; if (!p_env) return CDIO_INVALID_LSN; return mmc_get_disc_last_lsn(p_env->cdio); } void get_drive_cap_mmc (const void *p_user_data, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) { const generic_img_private_t *p_env = p_user_data; mmc_get_drive_cap( p_env->cdio, p_read_cap, p_write_cap, p_misc_cap ); } /** Find out if media has changed since the last call. @param p_user_data the environment of the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ int get_media_changed_mmc (const void *p_user_data) { const generic_img_private_t *p_env = p_user_data; return mmc_get_media_changed( p_env->cdio ); } char * get_mcn_mmc (const void *p_user_data) { const generic_img_private_t *p_env = p_user_data; return mmc_get_mcn( p_env->cdio ); } driver_return_code_t get_tray_status (const void *p_user_data) { const generic_img_private_t *p_env = p_user_data; return mmc_get_tray_status( p_env->cdio ); } /** Read sectors using SCSI-MMC GPCMD_READ_CD. */ driver_return_code_t mmc_read_data_sectors ( CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ) { return mmc_read_cd(p_cdio, p_buf, /* place to store data */ i_lsn, /* lsn */ 0, /* read_sector_type */ false, /* digital audio play */ false, /* return sync header */ 0, /* header codes */ true, /* return user data */ false, /* return EDC ECC */ false, /* return C2 Error information */ 0, /* subchannel selection bits */ ISO_BLOCKSIZE, /* blocksize*/ i_blocks /* Number of blocks. */); } /** Read sectors using SCSI-MMC GPCMD_READ_CD. Can read only up to 25 blocks. */ driver_return_code_t read_data_sectors_mmc ( void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ) { const generic_img_private_t *p_env = p_user_data; return mmc_read_data_sectors( p_env->cdio, p_buf, i_lsn, i_blocksize, i_blocks ); } /** Set read blocksize (via MMC) */ driver_return_code_t set_blocksize_mmc (void *p_user_data, uint16_t i_blocksize) { generic_img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return mmc_set_blocksize(p_env->cdio, i_blocksize); } /** Set the drive speed Set the drive speed in K bytes per second. (via MMC). */ driver_return_code_t set_speed_mmc (void *p_user_data, int i_speed) { generic_img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return mmc_set_speed( p_env->cdio, i_speed, 0); } /** Set the drive speed in CD-ROM speed units (via MMC). */ driver_return_code_t set_drive_speed_mmc (void *p_user_data, int i_Kbs_speed) { generic_img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return mmc_set_drive_speed( p_env->cdio, i_Kbs_speed ); } /** Get the output port volumes and port selections used on AUDIO PLAY commands via a MMC MODE SENSE command using the CD Audio Control Page. */ driver_return_code_t mmc_audio_get_volume( CdIo_t *p_cdio, /*out*/ mmc_audio_volume_t *p_volume ) { uint8_t buf[16]; int i_rc = mmc_mode_sense(p_cdio, buf, sizeof(buf), CDIO_MMC_AUDIO_CTL_PAGE); if ( DRIVER_OP_SUCCESS == i_rc ) { p_volume->port[0].selection = 0xF & buf[8]; p_volume->port[0].volume = buf[9]; p_volume->port[1].selection = 0xF & buf[10]; p_volume->port[1].volume = buf[11]; p_volume->port[2].selection = 0xF & buf[12]; p_volume->port[2].volume = buf[13]; p_volume->port[3].selection = 0xF & buf[14]; p_volume->port[3].volume = buf[15]; return DRIVER_OP_SUCCESS; } return i_rc; } /** Get the DVD type associated with cd object. */ discmode_t mmc_get_dvd_struct_physical_private ( void *p_env, mmc_run_cmd_fn_t run_mmc_cmd, cdio_dvd_struct_t *s) { mmc_cdb_t cdb = {{0, }}; unsigned char buf[4 + 4 * 20], *base; int i_status; uint8_t layer_num = s->physical.layer_num; cdio_dvd_layer_t *layer; if (!p_env) return DRIVER_OP_UNINIT; if (!run_mmc_cmd) return DRIVER_OP_UNSUPPORTED; if (layer_num >= CDIO_DVD_MAX_LAYERS) return -EINVAL; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_DVD_STRUCTURE); cdb.field[6] = layer_num; cdb.field[7] = CDIO_DVD_STRUCT_PHYSICAL; cdb.field[9] = sizeof(buf) & 0xff; i_status = run_mmc_cmd(p_env, mmc_timeout_ms, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (0 != i_status) return CDIO_DISC_MODE_ERROR; base = &buf[4]; layer = &s->physical.layer[layer_num]; /* * place the data... really ugly, but at least we won't have to * worry about endianess in userspace. */ memset(layer, 0, sizeof(*layer)); layer->book_version = base[0] & 0xf; layer->book_type = base[0] >> 4; layer->min_rate = base[1] & 0xf; layer->disc_size = base[1] >> 4; layer->layer_type = base[2] & 0xf; layer->track_path = (base[2] >> 4) & 1; layer->nlayers = (base[2] >> 5) & 3; layer->track_density = base[3] & 0xf; layer->linear_density = base[3] >> 4; layer->start_sector = base[5] << 16 | base[6] << 8 | base[7]; layer->end_sector = base[9] << 16 | base[10] << 8 | base[11]; layer->end_sector_l0 = base[13] << 16 | base[14] << 8 | base[15]; layer->bca = base[16] >> 7; return (discmode_t) DRIVER_OP_SUCCESS; } /** Get the media catalog number (MCN) or the ISRC Note: string is malloc'd so caller should free() then returned string when done with it. @param p_cdio @param i_track track number @param sub_chan_param 2 for MCN, 3 for ISRC @return malloc'd string holding the MCN or ISRC on success or NULL on failure */ char * mmc_get_mcn_isrc_private ( const CdIo_t *p_cdio, track_t i_track, unsigned char sub_chan_param ) { char buf[24]; /* 4 header + 20 data (MMC-4 tables 424, 431, 432) */ unsigned int num_data; size_t length; driver_return_code_t i_rc; switch(sub_chan_param) { case CDIO_SUBCHANNEL_MEDIA_CATALOG: /* MCN */ length = CDIO_MCN_SIZE; break; case CDIO_SUBCHANNEL_TRACK_ISRC: /* ISRC */ length = CDIO_ISRC_SIZE; break; default: return NULL; } /* inquire number of available reply bytes workaround for bad device drivers */ num_data = 4; /* header only */ i_rc = mmc_read_subchannel (p_cdio, i_track, sub_chan_param, &num_data, buf, 0); if (i_rc != DRIVER_OP_SUCCESS) return NULL; if (num_data > sizeof(buf)) num_data = sizeof(buf); if (num_data < 9 + length) return NULL; /* Not enough data available */ i_rc = mmc_read_subchannel (p_cdio, i_track, sub_chan_param, &num_data, buf, 0); if (i_rc != DRIVER_OP_SUCCESS) return NULL; if (num_data < 9 + length) return NULL; /* Not enough data returned */ if ( ! (buf[8] & 0x80) ) /* MCVAL / TCVAL bit indicates a valid response */ return NULL; /* MCN/ISRC not valid */ return strndup(&buf[9], length); } driver_return_code_t mmc_set_blocksize_private ( void *p_env, const mmc_run_cmd_fn_t run_mmc_cmd, uint16_t i_blocksize) { mmc_cdb_t cdb = {{0, }}; struct { uint8_t reserved1; uint8_t medium; uint8_t reserved2; uint8_t block_desc_length; uint8_t density; uint8_t number_of_blocks_hi; uint8_t number_of_blocks_med; uint8_t number_of_blocks_lo; uint8_t reserved3; uint8_t block_length_hi; uint8_t block_length_med; uint8_t block_length_lo; } mh; if ( ! p_env ) return DRIVER_OP_UNINIT; if ( ! run_mmc_cmd ) return DRIVER_OP_UNSUPPORTED; memset (&mh, 0, sizeof (mh)); mh.block_desc_length = 0x08; /* while i_blocksize is uint16_t, this expression is always 0 */ mh.block_length_hi = (i_blocksize >> 16) & 0xff; mh.block_length_med = (i_blocksize >> 8) & 0xff; mh.block_length_lo = (i_blocksize >> 0) & 0xff; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_MODE_SELECT_6); cdb.field[1] = 1 << 4; cdb.field[4] = 12; return run_mmc_cmd (p_env, mmc_timeout_ms, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_WRITE, sizeof(mh), &mh); } /*********************************************************** User-accessible Operations. ************************************************************/ /** Read Audio Subchannel information @param p_cdio the CD object to be acted upon. */ driver_return_code_t mmc_audio_read_subchannel (CdIo_t *p_cdio, cdio_subchannel_t *p_subchannel) { mmc_cdb_t cdb; driver_return_code_t i_rc; cdio_mmc_subchannel_t mmc_subchannel; if (!p_cdio) return DRIVER_OP_UNINIT; memset(&mmc_subchannel, 0, sizeof(mmc_subchannel)); mmc_subchannel.format = CDIO_CDROM_MSF; memset(&cdb, 0, sizeof(mmc_cdb_t)); CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_SUBCHANNEL); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(cdio_mmc_subchannel_t)); cdb.field[1] = CDIO_CDROM_MSF; cdb.field[2] = 0x40; /* subq */ cdb.field[3] = CDIO_SUBCHANNEL_CURRENT_POSITION; cdb.field[6] = 0; /* track number (only in isrc mode, ignored) */ i_rc = mmc_run_cmd(p_cdio, mmc_timeout_ms, &cdb, SCSI_MMC_DATA_READ, sizeof(cdio_mmc_subchannel_t), &mmc_subchannel); if (DRIVER_OP_SUCCESS == i_rc) { p_subchannel->format = mmc_subchannel.format; p_subchannel->audio_status = mmc_subchannel.audio_status; p_subchannel->address = mmc_subchannel.address; p_subchannel->control = mmc_subchannel.control; p_subchannel->track = mmc_subchannel.track; p_subchannel->index = mmc_subchannel.index; p_subchannel->abs_addr.m = cdio_to_bcd8(mmc_subchannel.abs_addr[1]); p_subchannel->abs_addr.s = cdio_to_bcd8(mmc_subchannel.abs_addr[2]); p_subchannel->abs_addr.f = cdio_to_bcd8(mmc_subchannel.abs_addr[3]); p_subchannel->rel_addr.m = cdio_to_bcd8(mmc_subchannel.rel_addr[1]); p_subchannel->rel_addr.s = cdio_to_bcd8(mmc_subchannel.rel_addr[2]); p_subchannel->rel_addr.f = cdio_to_bcd8(mmc_subchannel.rel_addr[3]); } return i_rc; } /** Get the block size used in read requests, via MMC (e.g. READ_10, READ_MSF, ...) @param p_cdio the CD object to be acted upon. @return the blocksize if > 0; error if <= 0 */ int mmc_get_blocksize ( CdIo_t *p_cdio) { int i_status; uint8_t buf[255] = { 0, }; uint8_t *p; /* First try using the 6-byte MODE SENSE command. */ i_status = mmc_mode_sense_6(p_cdio, buf, sizeof(buf), CDIO_MMC_R_W_ERROR_PAGE); if (DRIVER_OP_SUCCESS == i_status && buf[3]>=8) { p = &buf[4+5]; return CDIO_MMC_GET_LEN16(p); } /* Next try using the 10-byte MODE SENSE command. */ i_status = mmc_mode_sense_10(p_cdio, buf, sizeof(buf), CDIO_MMC_R_W_ERROR_PAGE); p = &buf[6]; if (DRIVER_OP_SUCCESS == i_status && CDIO_MMC_GET_LEN16(p)>=8) { return CDIO_MMC_GET_LEN16(p); } #ifdef IS_THIS_CORRECT /* Lastly try using the READ CAPACITY command. */ { lba_t lba = 0; uint16_t i_blocksize; i_status = mmc_read_capacity(p_cdio, &lba, &i_blocksize); if ( DRIVER_OP_SUCCESS == i_status ) return i_blocksize; #endif return DRIVER_OP_UNSUPPORTED; } /** Return the number of length in bytes of the Command Descriptor buffer (CDB) for a given MMC command. The length will be either 6, 10, or 12. */ uint8_t mmc_get_cmd_len(uint8_t scsi_cmd) { static const uint8_t scsi_cdblen[8] = {6, 10, 10, 12, 12, 12, 10, 10}; return scsi_cdblen[((scsi_cmd >> 5) & 7)]; } /** Return the size of the CD in logical block address (LBA) units. @param p_cdio the CD object to be acted upon. @return the lsn. On error 0 or CDIO_INVALD_LSN. */ lsn_t mmc_get_disc_last_lsn ( const CdIo_t *p_cdio ) { mmc_cdb_t cdb = {{0, }}; uint8_t buf[12] = { 0, }; lsn_t retval = 0; int i_status; /* Operation code */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC); cdb.field[1] = 0; /* lba; msf: 0x2 */ /* Format */ cdb.field[2] = CDIO_MMC_READTOC_FMT_TOC; CDIO_MMC_SET_START_TRACK(cdb.field, CDIO_CDROM_LEADOUT_TRACK); CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(buf)); i_status = mmc_run_cmd(p_cdio, mmc_timeout_ms, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), buf); if (i_status) return CDIO_INVALID_LSN; { int i; for (i = 8; i < 12; i++) { retval <<= 8; retval += buf[i]; } } return retval; } /** Return the discmode as reported by the SCSI-MMC Read (FULL) TOC command. Information was obtained from Section 5.1.13 (Read TOC/PMA/ATIP) pages 56-62 from the MMC draft specification, revision 10a at http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf See especially tables 72, 73 and 75. */ discmode_t mmc_get_discmode( const CdIo_t *p_cdio ) { uint8_t buf[14] = { 0, }; mmc_cdb_t cdb; memset(&cdb, 0, sizeof(mmc_cdb_t)); CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); cdb.field[1] = CDIO_CDROM_MSF; /* The MMC-5 spec may require this. */ cdb.field[2] = CDIO_MMC_READTOC_FMT_FULTOC; mmc_run_cmd(p_cdio, 2000, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), buf); if (buf[7] == 0xA0) { if (buf[13] == 0x00) { if (buf[5] & 0x04) return CDIO_DISC_MODE_CD_DATA; else return CDIO_DISC_MODE_CD_DA; } else if (buf[13] == 0x10) return CDIO_DISC_MODE_CD_I; else if (buf[13] == 0x20) return CDIO_DISC_MODE_CD_XA; } return CDIO_DISC_MODE_NO_INFO; } /** Get drive capabilities for a device. @param p_cdio the CD object to be acted upon. @return the drive capabilities. */ void mmc_get_drive_cap (CdIo_t *p_cdio, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) { /* Largest buffer size we use. */ #define BUF_MAX 2048 uint8_t buf[BUF_MAX+2] = { 0, }; int i_status; uint16_t i_data = BUF_MAX; int page = CDIO_MMC_ALL_PAGES; if ( ! p_cdio ) return; retry: /* In the first run we run MODE SENSE 10 we are trying to get the length of the data features. */ i_status = mmc_mode_sense_10(p_cdio, buf, 8, CDIO_MMC_ALL_PAGES); if (DRIVER_OP_SUCCESS == i_status) { uint16_t i_data_try = (uint16_t) CDIO_MMC_GET_LEN16(buf); if (i_data_try < BUF_MAX) i_data = i_data_try; } /* Now try getting all features with length set above, possibly truncated or the default length if we couldn't get the proper length. */ i_status = mmc_mode_sense_10(p_cdio, buf, i_data, CDIO_MMC_ALL_PAGES); if (0 != i_status && CDIO_MMC_CAPABILITIES_PAGE != page) { page = CDIO_MMC_CAPABILITIES_PAGE; goto retry; } if (DRIVER_OP_SUCCESS == i_status) { uint8_t *p; uint8_t *p_max = buf + 256; *p_read_cap = 0; *p_write_cap = 0; *p_misc_cap = 0; /* set to first sense mask, and then walk through the masks */ p = buf + 8; while( (p < &(buf[2+i_data])) && (p < p_max) ) { uint8_t which_page; which_page = p[0] & 0x3F; switch( which_page ) { case CDIO_MMC_AUDIO_CTL_PAGE: case CDIO_MMC_R_W_ERROR_PAGE: case CDIO_MMC_CDR_PARMS_PAGE: /* Don't handle these yet. */ break; case CDIO_MMC_CAPABILITIES_PAGE: mmc_get_drive_cap_buf(p, p_read_cap, p_write_cap, p_misc_cap); break; default: ; } p += (p[1] + 2); } } else { cdio_info("%s: %s\n", "error in MODE_SELECT", strerror(errno)); *p_read_cap = CDIO_DRIVE_CAP_ERROR; *p_write_cap = CDIO_DRIVE_CAP_ERROR; *p_misc_cap = CDIO_DRIVE_CAP_ERROR; } return; } /** Get the MMC level supported by the device. */ cdio_mmc_level_t mmc_get_drive_mmc_cap(CdIo_t *p_cdio) { uint8_t buf[256] = { 0, }; uint8_t len; int rc = mmc_mode_sense(p_cdio, buf, sizeof(buf), CDIO_MMC_CAPABILITIES_PAGE); if (DRIVER_OP_SUCCESS != rc) { return CDIO_MMC_LEVEL_NONE; } len = buf[1]; if (16 > len) { return CDIO_MMC_LEVEL_WEIRD; } else if (28 <= len) { return CDIO_MMC_LEVEL_3; } else if (24 <= len) { return CDIO_MMC_LEVEL_2; } else if (20 <= len) { return CDIO_MMC_LEVEL_1; } else { return CDIO_MMC_LEVEL_WEIRD; } } /** Get the DVD type associated with cd object. @param p_cdio the CD object to be acted upon. @return the DVD discmode. */ discmode_t mmc_get_dvd_struct_physical ( const CdIo_t *p_cdio, cdio_dvd_struct_t *s) { if ( ! p_cdio ) return -2; return mmc_get_dvd_struct_physical_private (p_cdio->env, p_cdio->op.run_mmc_cmd, s); } /** Get the CD-ROM hardware info via a MMC INQUIRY command. False is returned if we had an error getting the information. @param p_cdio the CD object to be acted upon. @return true if we were able to get hardware info, false if we had an error. */ bool mmc_get_hwinfo ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info ) { int i_status; /* Result of MMC command */ char buf[36] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Block */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); if (! p_cdio || ! hw_info ) return false; i_status = mmc_run_cmd(p_cdio, mmc_timeout_ms, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { memcpy(hw_info->psz_vendor, buf + 8, sizeof(hw_info->psz_vendor)-1); hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0'; memcpy(hw_info->psz_model, buf + 8 + CDIO_MMC_HW_VENDOR_LEN, sizeof(hw_info->psz_model)-1); hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0'; memcpy(hw_info->psz_revision, buf + 8 + CDIO_MMC_HW_VENDOR_LEN + CDIO_MMC_HW_MODEL_LEN, sizeof(hw_info->psz_revision)-1); hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0'; return true; } return false; } /** Find out if media has changed since the last call. @param p_cdio the CD object to be acted upon. @return 1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t */ int mmc_get_media_changed(const CdIo_t *p_cdio) { uint8_t status_buf[2]; int i_status; i_status = mmc_get_event_status(p_cdio, status_buf); if (i_status != DRIVER_OP_SUCCESS) return i_status; return (status_buf[0] & 0x02) ? 1 : 0; } /** Get the media catalog number (MCN) from the CD via MMC. @param p_cdio the CD object to be acted upon. @return the media catalog number r NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * mmc_get_mcn ( const CdIo_t *p_cdio ) { if ( ! p_cdio ) return NULL; return mmc_get_mcn_isrc_private (p_cdio, 0, CDIO_SUBCHANNEL_MEDIA_CATALOG ); } /** Get the international standard recording code (ISRC) of the track via MMC. @param p_cdio the CD object to be acted upon. @param i_track the track to get the ISRC info for. @return the international standard recording code or NULL if there is none or we don't have the ability to get it. Note: The caller must free the returned string with cdio_free() when done with it. */ char * mmc_get_track_isrc ( const CdIo_t *p_cdio, track_t i_track ) { if ( ! p_cdio ) return NULL; return mmc_get_mcn_isrc_private (p_cdio, i_track, CDIO_SUBCHANNEL_TRACK_ISRC ); } /** Read cdtext information for a CdIo_t object . @return pointer to data on success, NULL on error or CD-Text information does not exist. Note: the caller must free the returned memory */ uint8_t * mmc_read_cdtext (const CdIo_t *p_cdio) { unsigned char buf[4]; unsigned char * wdata; int i_status; unsigned int i_cdtext; if ( ! p_cdio ) return NULL; /* We may need to give CD-Text a little more time to complete. */ /* First off, just try and read the size */ i_cdtext = 4; i_status = mmc_read_toc_cdtext(p_cdio, &i_cdtext, buf, 0); if (i_status != DRIVER_OP_SUCCESS) { return NULL; } if (i_cdtext > CDTEXT_LEN_BINARY_MAX + 2) i_cdtext = CDTEXT_LEN_BINARY_MAX + 4; else i_cdtext += 2; /* data length does not include the data length field */ wdata = malloc(i_cdtext); /* is zeroed in mmc_toc_read_cdtext */ /* Read all of it */ i_status = mmc_read_toc_cdtext(p_cdio, &i_cdtext, wdata, 0); if (i_status != DRIVER_OP_SUCCESS) { free(wdata); return NULL; } return wdata; } /** Find out if media tray is open or closed. @param p_cdio the CD object to be acted upon. @return 1 if media is open, 0 if closed. Error return codes are the same as driver_return_code_t */ int mmc_get_tray_status(const CdIo_t *p_cdio) { uint8_t status_buf[2]; int i_status; i_status = mmc_get_event_status(p_cdio, status_buf); if (i_status != DRIVER_OP_SUCCESS) return i_status; return (status_buf[1] & 0x01) ? 1 : 0; } /* Added in version 0.83 by scdbackup */ /** Obtain the SCSI sense reply of the most-recently-performed MMC command. These bytes give an indication of possible problems which occured in the drive while the command was performed. With some commands they tell about the current state of the drive (e.g. 00h TEST UNIT READY). @param p_cdio CD structure set by cdio_open(). @param sense returns the sense bytes received from the drive. This is allocated memory or NULL if no sense bytes are available. Dispose non-NULL pointers by cdio_free() when no longer needed. See SPC-3 4.5.3 Fixed format sense data. SCSI error codes as of SPC-3 Annex D, MMC-5 Annex F: sense[2]&15 = Key , sense[12] = ASC , sense[13] = ASCQ @return number of valid bytes in sense, 0 in case of no sense bytes available, <0 in case of internal error. */ int mmc_last_cmd_sense(const CdIo_t *p_cdio, cdio_mmc_request_sense_t **pp_sense) { generic_img_private_t *gen; if (!p_cdio) return DRIVER_OP_UNINIT; gen = p_cdio->env; *pp_sense = NULL; if (gen->scsi_mmc_sense_valid <= 0) return 0; *pp_sense = calloc(1, gen->scsi_mmc_sense_valid); if (*pp_sense == NULL) return DRIVER_OP_ERROR; memcpy(*pp_sense, gen->scsi_mmc_sense, gen->scsi_mmc_sense_valid); return gen->scsi_mmc_sense_valid; } /** Run a MMC command. @param cdio CD structure set by cdio_open(). @param i_timeout time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. @param buf Buffer for data, both sending and receiving @param len Size of buffer @param e_direction direction the transfer is to go @param cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. */ driver_return_code_t mmc_run_cmd( const CdIo_t *p_cdio, unsigned int i_timeout_ms, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_cdio->op.run_mmc_cmd) return DRIVER_OP_UNSUPPORTED; return p_cdio->op.run_mmc_cmd(p_cdio->env, i_timeout_ms, mmc_get_cmd_len(p_cdb->field[0]), p_cdb, e_direction, i_buf, p_buf); } /* Added by SukkoPera to allow CDB length to be specified manually */ /** Run a Multimedia command (MMC) specifying the CDB length. The motivation here is for example ot use in is an undocumented debug command for LG drives (namely E7), whose length is being miscalculated by mmc_get_cmd_len(); it doesn't follow the usual code number to length conventions. Patch supplied by SukkoPera. @param p_cdio CD structure set by cdio_open(). @param i_timeout_ms time in milliseconds we will wait for the command to complete. @param p_cdb CDB bytes. All values that are needed should be set on input. @param i_cdb number of CDB bytes. @param e_direction direction the transfer is to go. @param i_buf Size of buffer @param p_buf Buffer for data, both sending and receiving. @return 0 if command completed successfully. */ driver_return_code_t mmc_run_cmd_len( const CdIo_t *p_cdio, unsigned int i_timeout_ms, const mmc_cdb_t *p_cdb, unsigned int i_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_cdio->op.run_mmc_cmd) return DRIVER_OP_UNSUPPORTED; return p_cdio->op.run_mmc_cmd(p_cdio->env, i_timeout_ms, i_cdb, p_cdb, e_direction, i_buf, p_buf); } /** See if CD-ROM has feature with value value @return true if we have the feature and false if not. */ bool_3way_t mmc_have_interface( CdIo_t *p_cdio, cdio_mmc_feature_interface_t e_interface ) { int i_status; /* Result of MMC command */ uint8_t buf[65530] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ if (!p_cdio || !p_cdio->op.run_mmc_cmd) return nope; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); cdb.field[1] = CDIO_MMC_GET_CONF_NAMED_FEATURE; cdb.field[3] = CDIO_MMC_FEATURE_CORE; i_status = mmc_run_cmd(p_cdio, 0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (DRIVER_OP_SUCCESS == i_status) { uint8_t *p; uint32_t i_data; uint8_t *p_max = buf + 65530; i_data = (unsigned int) CDIO_MMC_GET_LEN32(buf); /* set to first sense feature code, and then walk through the masks */ p = buf + 8; while( (p < &(buf[i_data])) && (p < p_max) ) { uint16_t i_feature; uint8_t i_feature_additional = p[3]; i_feature = CDIO_MMC_GET_LEN16(p); if (CDIO_MMC_FEATURE_CORE == i_feature) { uint8_t *q = p+4; uint32_t i_interface_standard = CDIO_MMC_GET_LEN32(q); if (e_interface == i_interface_standard) return yep; } p += i_feature_additional + 4; } return nope; } else return dunno; } /** Read sectors using SCSI-MMC GPCMD_READ_CD. Can read only up to 25 blocks. */ driver_return_code_t mmc_read_sectors ( const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, int sector_type, uint32_t i_blocks ) { mmc_cdb_t cdb = {{0, }}; mmc_run_cmd_fn_t run_mmc_cmd; if (!p_cdio) return DRIVER_OP_UNINIT; if (!p_cdio->op.run_mmc_cmd ) return DRIVER_OP_UNSUPPORTED; run_mmc_cmd = p_cdio->op.run_mmc_cmd; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_CD); CDIO_MMC_SET_READ_TYPE (cdb.field, sector_type); CDIO_MMC_SET_READ_LBA (cdb.field, i_lsn); CDIO_MMC_SET_READ_LENGTH24(cdb.field, i_blocks); CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cdb.field, CDIO_MMC_MCSB_ALL_HEADERS); return run_mmc_cmd (p_cdio->env, mmc_timeout_ms, mmc_get_cmd_len(cdb.field[0]), &cdb, SCSI_MMC_DATA_READ, CDIO_CD_FRAMESIZE_RAW * i_blocks, p_buf); } driver_return_code_t mmc_set_blocksize ( const CdIo_t *p_cdio, uint16_t i_blocksize) { if ( ! p_cdio ) return DRIVER_OP_UNINIT; return mmc_set_blocksize_private (p_cdio->env, p_cdio->op.run_mmc_cmd, i_blocksize); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/mmc/mmc_cmd_helper.h000066400000000000000000000054221474051130400210460ustar00rootroot00000000000000/* Copyright (C) 2010, 2012, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_DRIVER_MMC_CMD_HELPER_H_ #define CDIO_DRIVER_MMC_CMD_HELPER_H_ /* Boilerplate initialization code to setup running MMC command. We assume variables 'p_cdio', 'p_buf', and 'i_size' are previously defined. It does the following: 1. Defines a cdb variable, 2. zeros cdb variable 3 Checks to see if we have a cdio object and can run an MMC command 4. Sets up the command field of cdb to passed in value mmc_cmd. */ #define MMC_CMD_SETUP(mmc_cmd) \ mmc_cdb_t cdb = {{0, }}; \ \ if ( ! p_cdio ) return DRIVER_OP_UNINIT; \ if ( ! p_cdio->op.run_mmc_cmd ) return DRIVER_OP_UNSUPPORTED; \ \ CDIO_MMC_SET_COMMAND(cdb.field, mmc_cmd) /* Boilerplate initialization code to setup running MMC read command needs to set the cdb 16-bit length field. See above comment for MMC_CMD_SETUP. */ #define MMC_CMD_SETUP_READ16(mmc_cmd) \ MMC_CMD_SETUP(mmc_cmd); \ \ /* Setup to read header, to get length of data */ \ CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_size) /* Boilerplate code to run a MMC command. We assume variables 'p_cdio', 'mmc_timeout_ms', 'cdb', 'i_size' and 'p_buf' are defined previously. 'direction' is the SCSI direction (read, write, none) of the command. */ #define MMC_RUN_CMD(direction, i_timeout) \ p_cdio->op.run_mmc_cmd(p_cdio->env, \ i_timeout, \ mmc_get_cmd_len(cdb.field[0]), \ &cdb, \ direction, i_size, p_buf) #endif /* CDIO_DRIVER_MMC_CMD_HELPER_H_ */ libcdio-2.2.0/lib/driver/mmc/mmc_hl_cmds.c000066400000000000000000000156771474051130400203650ustar00rootroot00000000000000/* "Higher-level" Multimedia Command (MMC) commands which build on the "lower-level" commands. Copyright (C) 2010-2011, 2014 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include /** Close tray using a MMC START STOP UNIT command. @param p_cdio the CD object to be acted upon. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_close_tray(CdIo_t *p_cdio) { return mmc_start_stop_unit(p_cdio, false, false, 0, 0); } /** Eject using MMC commands. If CD-ROM is "locked" we'll unlock it. Command is not "immediate" -- we'll wait for the command to complete. For a more general (and lower-level) routine, @see mmc_start_stop_media. @param p_cdio the CD object to be acted upon. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_eject_media( const CdIo_t *p_cdio ) { int i_status = 0; i_status = mmc_prevent_allow_medium_removal(p_cdio, false, false, 0); if (0 != i_status) return i_status; return mmc_start_stop_unit(p_cdio, true, false, 0, 0); } /** Detects if a disc (CD or DVD) is erasable or not. @param p_user_data the CD object to be acted upon. @param b_erasable, if not NULL, on return will be set indicate whether the operation was a success (DRIVER_OP_SUCCESS) or if not to some other value. @return true if the disc is detected as erasable (rewritable), false otherwise. */ /* From Frank Endres: */ driver_return_code_t mmc_get_disc_erasable(const CdIo_t *p_cdio, bool *b_erasable) { uint8_t buf[42] = { 0, }; driver_return_code_t i_status; i_status = mmc_read_disc_information(p_cdio, buf, sizeof(buf), CDIO_MMC_READ_DISC_INFO_STANDARD, 0); if (DRIVER_OP_SUCCESS == i_status) *b_erasable = ((buf[2] & 0x10) ? true : false); else *b_erasable = false; return i_status; } /* From Frank Endres: */ /** Detects the disc type using the SCSI-MMC GET CONFIGURATION command. @param p_cdio the CD object to be acted upon. @param i_status, if not NULL, on return will be set indicate whether the operation was a success (DRIVER_OP_SUCCESS) or if not to some other value. @param p_disctype the disc type set on success. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_get_disctype( const CdIo_t *p_cdio, unsigned int i_timeout_ms, cdio_mmc_feature_profile_t *p_disctype) { uint8_t buf[500] = { 0, }; driver_return_code_t i_status; if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; i_status = mmc_get_configuration(p_cdio, &buf, sizeof(buf), CDIO_MMC_GET_CONF_ALL_FEATURES, 0, i_timeout_ms); if (DRIVER_OP_SUCCESS == i_status) { uint8_t *p, *q; uint8_t profiles_list_length; uint16_t profile_number; bool profile_active; /* there is always a profile list feature listed at the first place of the features list */ p = buf + 8; profiles_list_length = p[3]; q = p+4; *p_disctype = CDIO_MMC_FEATURE_PROF_NON_CONFORM; while ((CDIO_MMC_FEATURE_PROF_NON_CONFORM == *p_disctype) && (q < p + profiles_list_length)) { profile_number = CDIO_MMC_GET_LEN16(q); profile_active = q[2] & 0x01; if (profile_active) switch (profile_number) { case CDIO_MMC_FEATURE_PROF_CD_ROM: case CDIO_MMC_FEATURE_PROF_CD_R: case CDIO_MMC_FEATURE_PROF_CD_RW: case CDIO_MMC_FEATURE_PROF_DVD_ROM: case CDIO_MMC_FEATURE_PROF_DVD_R_SEQ: case CDIO_MMC_FEATURE_PROF_DVD_RAM: case CDIO_MMC_FEATURE_PROF_DVD_RW_RO: case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ: case CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ: case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR: case CDIO_MMC_FEATURE_PROF_DVD_PRW: case CDIO_MMC_FEATURE_PROF_DVD_PR: case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL: case CDIO_MMC_FEATURE_PROF_DVD_PR_DL: case CDIO_MMC_FEATURE_PROF_BD_ROM: case CDIO_MMC_FEATURE_PROF_BD_SEQ: case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM: case CDIO_MMC_FEATURE_PROF_BD_RE: case CDIO_MMC_FEATURE_PROF_HD_DVD_ROM: case CDIO_MMC_FEATURE_PROF_HD_DVD_R: case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM: *p_disctype = (cdio_mmc_feature_profile_t) profile_number; break; } q += 4; } } return i_status; } /** Run a SCSI-MMC MMC MODE SENSE command (6- or 10-byte version) and put the results in p_buf @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_sense(CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, int page) { /* We used to make a choice as to which routine we'd use based cdio_have_atapi(). But since that calls this in its determination, we had an infinite recursion. So we can't use cdio_have_atapi() (until we put in better capability checks.) */ if ( DRIVER_OP_SUCCESS == mmc_mode_sense_6(p_cdio, p_buf, i_size, page) ) return DRIVER_OP_SUCCESS; return mmc_mode_sense_10(p_cdio, p_buf, i_size, page); } /** Set the drive speed in CD-ROM speed units. @param p_cdio CD structure set by cdio_open(). @param i_drive_speed speed in CD-ROM speed units. Note this not Kbytes/sec as would be used in the MMC spec or in mmc_set_speed(). To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). On many CD-ROM drives, specifying a value too large will result in using the fastest speed. GNU/Linux ioctl treats <= 0 as max speed, so we'll do that here as well. @return the drive speed if greater than 0. -1 if we had an error. is -2 returned if this is not implemented for the current driver. @see cdio_set_speed and mmc_set_speed */ driver_return_code_t mmc_set_drive_speed( const CdIo_t *p_cdio, int i_drive_speed ) { if (i_drive_speed <= 0) i_drive_speed = 0xffff; else i_drive_speed *= 176; return mmc_set_speed(p_cdio, i_drive_speed, 0); } libcdio-2.2.0/lib/driver/mmc/mmc_ll_cmds.c000066400000000000000000000460641474051130400203630ustar00rootroot00000000000000/* Wrappers for specific Multimedia Command (MMC) commands e.g., READ DISC, START/STOP UNIT. Copyright (C) 2010-2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include "cdio_private.h" #include "mmc_cmd_helper.h" #ifdef HAVE_STRING_H #include #endif /** Get drive capabilities vis SCSI-MMC GET CONFIGURATION @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param i_return_type value in range 0..2 giving what kind of configuration to return: : 0 Full Header and Full Descriptors; : 1 Feature Headers and those with their Current Bit. : 2 One Feature header and zero or one Feature Descriptors. @param i_starting_feature_number feature number from which to start getting information. @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_get_configuration(const CdIo_t *p_cdio, void *p_buf, unsigned int i_size, unsigned int i_return_type, unsigned int i_starting_feature_number, unsigned int i_timeout_ms) { MMC_CMD_SETUP(CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, i_size); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; cdb.field[1] = i_return_type & 0x3; CDIO_MMC_SET_LEN16(cdb.field, 2, i_starting_feature_number); return MMC_RUN_CMD(SCSI_MMC_DATA_READ, i_timeout_ms); } /** Return results of media event status via SCSI-MMC GET EVENT STATUS @param p_cdio the CD object to be acted upon. @param out_buf media status code from operation @return DRIVER_OP_SUCCESS (0) if we got the status. Return codes are the same as driver_return_code_t */ driver_return_code_t mmc_get_event_status(const CdIo_t *p_cdio, uint8_t out_buf[2]) { uint8_t buf[8] = { 0, }; void *p_buf = &buf; const unsigned int i_size = sizeof(buf); driver_return_code_t i_status; MMC_CMD_SETUP_READ16(CDIO_MMC_GPCMD_GET_EVENT_STATUS); cdb.field[1] = 1; /* We poll for info */ cdb.field[4] = 1 << 4; /* We want Media events */ i_status = MMC_RUN_CMD(SCSI_MMC_DATA_READ, mmc_timeout_ms); if (i_status == DRIVER_OP_SUCCESS) { out_buf[0] = buf[4]; out_buf[1] = buf[5]; } return i_status; } /** Run a SCSI-MMC MODE SELECT (10-byte) command and put the results in p_buf. @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @param i_timeout_ms value in milliseconds to use on timeout. Setting to 0 uses the default time-out value stored in mmc_timeout_ms. @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_select_10(CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, int page, unsigned int i_timeout_ms) { MMC_CMD_SETUP_READ16(CDIO_MMC_GPCMD_MODE_SELECT_10); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; cdb.field[1] = page; return MMC_RUN_CMD(SCSI_MMC_DATA_WRITE, i_timeout_ms); } /** Run a SCSI-MMC MODE SENSE command (10-byte version) and put the results in p_buf @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_sense_10(CdIo_t *p_cdio, void *p_buf, unsigned int i_size, unsigned int page) { MMC_CMD_SETUP_READ16(CDIO_MMC_GPCMD_MODE_SENSE_10); cdb.field[2] = CDIO_MMC_ALL_PAGES & page; return MMC_RUN_CMD(SCSI_MMC_DATA_READ, mmc_timeout_ms); } /** Run a SCSI-MMC MODE SENSE command (6-byte version) and put the results in p_buf @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param page which "page" of the mode sense command we are interested in @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_mode_sense_6(CdIo_t *p_cdio, void *p_buf, unsigned int i_size, int page) { MMC_CMD_SETUP(CDIO_MMC_GPCMD_MODE_SENSE_6); cdb.field[4] = i_size; cdb.field[2] = CDIO_MMC_ALL_PAGES & page; return MMC_RUN_CMD(SCSI_MMC_DATA_READ, mmc_timeout_ms); } /** Request preventing/allowing medium removal on a drive via SCSI-MMC PREVENT/ALLOW MEDIUM REMOVAL. @param p_cdio the CD object to be acted upon. @param b_prevent true of drive locked and false if unlocked @param b_persisent make b_prevent state persistent @return DRIVER_OP_SUCCESS (0) if we got the status. return codes are the same as driver_return_code_t */ driver_return_code_t mmc_prevent_allow_medium_removal(const CdIo_t *p_cdio, bool b_persistent, bool b_prevent, unsigned int i_timeout_ms) { uint8_t buf[8] = { 0, }; void *p_buf = &buf; const unsigned int i_size = 0; MMC_CMD_SETUP(CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; if (b_prevent) cdb.field[4] |= 1; if (b_persistent) cdb.field[4] |= 2; return MMC_RUN_CMD(SCSI_MMC_DATA_WRITE, i_timeout_ms); } /* Maximum blocks to retrieve. Would be nice to customize this based on drive capabilities. */ #define MAX_CD_READ_BLOCKS 16 /** Issue a MMC READ_CD command. @param p_cdio object to read from @param p_buf1 Place to store data. The caller should ensure that p_buf1 can hold at least i_blocksize * i_blocks bytes. @param i_lsn sector to read @param expected_sector_type restricts reading to a specific CD sector type. Only 3 bits with values 1-5 are used: 0 all sector types 1 CD-DA sectors only 2 Mode 1 sectors only 3 Mode 2 formless sectors only. Note in contrast to all other values an MMC CD-ROM is not required to support this mode. 4 Mode 2 Form 1 sectors only 5 Mode 2 Form 2 sectors only @param b_digital_audio_play Control error concealment when the data being read is CD-DA. If the data being read is not CD-DA, this parameter is ignored. If the data being read is CD-DA and DAP is false zero, then the user data returned should not be modified by flaw obscuring mechanisms such as audio data mute and interpolate. If the data being read is CD-DA and DAP is true, then the user data returned should be modified by flaw obscuring mechanisms such as audio data mute and interpolate. b_sync_header return the sync header (which will probably have the same value as CDIO_SECTOR_SYNC_HEADER of size CDIO_CD_SYNC_SIZE). @param header_codes Header Codes refer to the sector header and the sub-header that is present in mode 2 formed sectors: 0 No header information is returned. 1 The 4-byte sector header of data sectors is be returned, 2 The 8-byte sector sub-header of mode 2 formed sectors is returned. 3 Both sector header and sub-header (12 bytes) is returned. The Header preceeds the rest of the bytes (e.g. user-data bytes) that might get returned. @param b_user_data Return user data if true. For CD-DA, the User Data is CDIO_CD_FRAMESIZE_RAW bytes. For Mode 1, The User Data is ISO_BLOCKSIZE bytes beginning at offset CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE. For Mode 2 formless, The User Data is M2RAW_SECTOR_SIZE bytes beginning at offset CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE. For data Mode 2, form 1, User Data is ISO_BLOCKSIZE bytes beginning at offset CDIO_CD_XA_SYNC_HEADER. For data Mode 2, form 2, User Data is 2 324 bytes beginning at offset CDIO_CD_XA_SYNC_HEADER. @param b_sync @param b_edc_ecc true if we return EDC/ECC error detection/correction bits. The presence and size of EDC redundancy or ECC parity is defined according to sector type: CD-DA sectors have neither EDC redundancy nor ECC parity. Data Mode 1 sectors have 288 bytes of EDC redundancy, Pad, and ECC parity beginning at offset 2064. Data Mode 2 formless sectors have neither EDC redundancy nor ECC parity Data Mode 2 form 1 sectors have 280 bytes of EDC redundancy and ECC parity beginning at offset 2072 Data Mode 2 form 2 sectors optionally have 4 bytes of EDC redundancy beginning at offset 2348. @param c2_error_information If true associate a bit with each sector for C2 error The resulting bit field is ordered exactly as the main channel bytes. Each 8-bit boundary defines a byte of flag bits. @param subchannel_selection subchannel-selection bits 0 No Sub-channel data shall be returned. (0 bytes) 1 RAW P-W Sub-channel data shall be returned. (96 byte) 2 Formatted Q sub-channel data shall be transferred (16 bytes) 3 Reserved 4 Corrected and de-interleaved R-W sub-channel (96 bytes) 5-7 Reserved @param i_blocksize size of the a block expected to be returned @param i_blocks number of blocks expected to be returned. @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_read_cd(const CdIo_t *p_cdio, void *p_buf1, lsn_t i_lsn, int read_sector_type, bool b_digital_audio_play, bool b_sync, uint8_t header_codes, bool b_user_data, bool b_edc_ecc, uint8_t c2_error_information, uint8_t subchannel_selection, uint16_t i_blocksize, uint32_t i_blocks) { void *p_buf = p_buf1; uint8_t cdb9 = 0; const unsigned int i_timeout = mmc_timeout_ms * (MAX_CD_READ_BLOCKS/2); MMC_CMD_SETUP(CDIO_MMC_GPCMD_READ_CD); /* Catch what may be a common bug. */ if (NULL == p_buf) return DRIVER_OP_BAD_POINTER; CDIO_MMC_SET_READ_TYPE(cdb.field, read_sector_type); if (b_digital_audio_play) cdb.field[1] |= 0x2; if (b_sync) cdb9 |= 128; if (b_user_data) cdb9 |= 16; if (b_edc_ecc) cdb9 |= 8; cdb9 |= (header_codes & 3) << 5; cdb9 |= (c2_error_information & 3) << 1; cdb.field[9] = cdb9; cdb.field[10] = (subchannel_selection & 7); { unsigned int j = 0; int i_status = DRIVER_OP_SUCCESS; while (i_blocks > 0) { const unsigned i_blocks2 = (i_blocks > MAX_CD_READ_BLOCKS) ? MAX_CD_READ_BLOCKS : i_blocks; const unsigned int i_size = i_blocksize * i_blocks2; p_buf = ((char *)p_buf1 ) + (j * i_blocksize); CDIO_MMC_SET_READ_LBA (cdb.field, (i_lsn+j)); CDIO_MMC_SET_READ_LENGTH24(cdb.field, i_blocks2); i_status = MMC_RUN_CMD(SCSI_MMC_DATA_READ, i_timeout); if (i_status) return i_status; i_blocks -= i_blocks2; j += i_blocks2; } return i_status; } } /** Request information about et drive capabilities vis SCSI-MMC READ DISC INFORMATION @param p_cdio the CD object to be acted upon. @param p_buf pointer to location to store mode sense information @param i_size number of bytes allocated to p_buf @param data_type kind of information to retrieve. @return DRIVER_OP_SUCCESS (0) if we got the status. */ driver_return_code_t mmc_read_disc_information(const CdIo_t *p_cdio, /*out*/ void *p_buf, unsigned int i_size, cdio_mmc_read_disc_info_datatype_t data_type, unsigned int i_timeout_ms) { MMC_CMD_SETUP(CDIO_MMC_GPCMD_READ_DISC_INFO); CDIO_MMC_SET_READ_LENGTH8(cdb.field, i_size); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; cdb.field[1] = data_type & 0x7; return MMC_RUN_CMD(SCSI_MMC_DATA_READ, i_timeout_ms); } /** Set the drive speed in K bytes per second using SCSI-MMC SET SPEED. . @param p_cdio CD structure set by cdio_open(). @param i_Kbs_speed speed in K bytes per second. Note this is not in standard CD-ROM speed units, e.g. 1x, 4x, 16x as it is in cdio_set_speed. To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). Also note that ATAPI specs say that a value less than 176 will result in an error. On many CD-ROM drives, specifying a value too large will result in using the fastest speed. @return the drive speed if greater than 0. -1 if we had an error. is -2 returned if this is not implemented for the current driver. @see cdio_set_speed and mmc_set_drive_speed @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_set_speed(const CdIo_t *p_cdio, int i_Kbs_speed, unsigned int i_timeout_ms) { uint8_t buf[14] = { 0, }; void * p_buf = &buf; const unsigned int i_size = sizeof(buf); MMC_CMD_SETUP(CDIO_MMC_GPCMD_SET_SPEED); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; /* If the requested speed is less than 1x 176 kb/s this command will return an error - it's part of the ATAPI specs. Therefore, test and stop early. */ if ( i_Kbs_speed < 176 ) return -1; CDIO_MMC_SET_LEN16(cdb.field, 2, i_Kbs_speed); /* Some drives like the Creative 24x CDRW require one to set a nonzero write speed or else one gets an error back. Some specifications have setting the value 0xfffff indicate setting to the maximum allowable speed. */ CDIO_MMC_SET_LEN16(cdb.field, 4, 0xffff); return MMC_RUN_CMD(SCSI_MMC_DATA_WRITE, i_timeout_ms); } /** Load or Unload media using a SCSI-MMC START/STOP UNIT command. @param p_cdio the CD object to be acted upon. @param b_eject eject if true and close tray if false @param b_immediate wait or don't wait for operation to complete @param power_condition Set CD-ROM to idle/standby/sleep. If nonzero, eject/load is ignored, so set to 0 if you want to eject or load. @see mmc_eject_media or mmc_close_tray */ driver_return_code_t mmc_start_stop_unit(const CdIo_t *p_cdio, bool b_eject, bool b_immediate, uint8_t power_condition, unsigned int i_timeout_ms) { uint8_t buf[1]; void * p_buf = &buf; const unsigned int i_size = 0; MMC_CMD_SETUP_READ16(CDIO_MMC_GPCMD_START_STOP_UNIT); if (b_immediate) cdb.field[1] |= 1; if (power_condition) cdb.field[4] = power_condition << 4; else { if (b_eject) cdb.field[4] = 2; /* eject */ else cdb.field[4] = 3; /* close tray for tray-type */ } return MMC_RUN_CMD(SCSI_MMC_DATA_WRITE, mmc_timeout_ms); } /** Check if drive is ready using SCSI-MMC TEST UNIT READY command. @param p_cdio the CD object to be acted upon. @return DRIVER_OP_SUCCESS if we ran the command ok. */ driver_return_code_t mmc_test_unit_ready(const CdIo_t *p_cdio, unsigned int i_timeout_ms) { const unsigned int i_size = 0; void * p_buf = NULL; MMC_CMD_SETUP_READ16(CDIO_MMC_GPCMD_TEST_UNIT_READY); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; return MMC_RUN_CMD(SCSI_MMC_DATA_NONE, i_timeout_ms); } /** Issue a READ SUB-CHANNEL command to read current position, ISRC or MCN from subchannel Q. Note: READ SUB-CHANNEL is deprecated as of MMC-5 but the alternative requires manual parsing of the subchannel. @param p_cdio the CD object to be acted upon. @param i_track track number (only for ISRC) @param sub_chan_param 2 for MCN, 3 for ISRC @param i_length pointer to number of bytes to request. Will be overwritten by the number of bytes available. @param p_buf pointer to the location for the returned data @return DRIVER_OP_SUCCESS on success */ driver_return_code_t mmc_read_subchannel ( const CdIo_t *p_cdio, track_t i_track, unsigned char sub_chan_param, unsigned int *i_length, char *p_buf, unsigned int i_timeout_ms ) { unsigned int i_size = *i_length; mmc_cdb_t cdb = {{0, }}; driver_return_code_t i_status; if (i_size < 4) return DRIVER_OP_BAD_PARAMETER; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_SUBCHANNEL); CDIO_MMC_SET_READ_LENGTH8(cdb.field, i_size); if(CDIO_SUBCHANNEL_CURRENT_POSITION == sub_chan_param) cdb.field[1] = CDIO_CDROM_MSF; else cdb.field[1] = 0x0; cdb.field[2] = 0x40; cdb.field[3] = sub_chan_param; if(CDIO_SUBCHANNEL_TRACK_ISRC == sub_chan_param) cdb.field[6] = i_track; else cdb.field[6] = 0; memset(p_buf, 0, i_size); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; i_status = MMC_RUN_CMD(SCSI_MMC_DATA_READ, i_timeout_ms); if(i_status == DRIVER_OP_SUCCESS) { *i_length = CDIO_MMC_GET_LEN16((p_buf+2)) + 4; } return i_status; } /** Issue a READ TOC/PMA/ATIP command to read the CD-TEXT from R-W sub-channel. @param p_cdio the CD object to be acted upon. @param i_length pointer to number of bytes to request. Will be overwritten by the number of bytes available. @param p_buf pointer to the location for the returned data @return DRIVER_OP_SUCCESS on success */ driver_return_code_t mmc_read_toc_cdtext ( const CdIo_t *p_cdio, unsigned int *i_length, unsigned char *p_buf, unsigned int i_timeout_ms ) { unsigned int i_size = *i_length; mmc_cdb_t cdb = {{0, }}; driver_return_code_t i_status; if (i_size < 4) return DRIVER_OP_BAD_PARAMETER; CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC); CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_size); memset(p_buf, 0, i_size); if (0 == i_timeout_ms) i_timeout_ms = mmc_timeout_ms; cdb.field[1] = CDIO_CDROM_MSF; cdb.field[2] = CDIO_MMC_READTOC_FMT_CDTEXT; i_status = MMC_RUN_CMD(SCSI_MMC_DATA_READ, i_timeout_ms); if(i_status == DRIVER_OP_SUCCESS) { *i_length = CDIO_MMC_GET_LEN16(p_buf) + 4; } return i_status; } libcdio-2.2.0/lib/driver/mmc/mmc_private.h000066400000000000000000000121041474051130400204110ustar00rootroot00000000000000/* private MMC helper routines. Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include /*! Convert milliseconds to seconds taking the ceiling value, i.e. 1002 milliseconds gets rounded to 2 seconds. */ #define SECS2MSECS 1000 static inline unsigned int msecs2secs(unsigned int msecs) { return (msecs+(SECS2MSECS-1)) / SECS2MSECS; } #undef SECS2MSECS /*********************************************************** MMC CdIo Operations which a driver may use. These are not directly user-accessible. ************************************************************/ /*! Read Audio Subchannel information @param p_user_data the CD object to be acted upon. */ driver_return_code_t audio_read_subchannel_mmc ( void *p_user_data, cdio_subchannel_t *p_subchannel); /*! Get the block size for subsequest read requests, via a SCSI MMC MODE_SENSE 6 command. */ int get_blocksize_mmc (void *p_user_data); /*! Get the lsn of the end of the CD @return the lsn. On error return CDIO_INVALID_LSN. */ lsn_t get_disc_last_lsn_mmc( void *p_user_data ); void get_drive_cap_mmc (const void *p_user_data, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap); int get_media_changed_mmc (const void *p_user_data); char *get_mcn_mmc (const void *p_user_data); char *get_track_isrc_mmc (const void *p_user_data, track_t i_track); driver_return_code_t get_tray_status (const void *p_user_data); /*! Read just the user data part of some sort of data sector (via mmc_read_cd). @param p_user_data object to read from @param p_buf place to read data into. The caller should make sure this location can store at least CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum, M2RAW_SECTOR_SIZE. @param i_lsn sector to read @param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE, M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. */ driver_return_code_t read_data_sectors_mmc ( void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks ); char *get_mcn_mmc (const void *p_user_data); /* Set read blocksize (via MMC) */ driver_return_code_t set_blocksize_mmc (void *p_user_data, uint16_t i_blocksize); /* Set the drive speed in CD-ROM speed units (via MMC). */ driver_return_code_t set_drive_speed_mmc (void *p_user_data, int i_speed); /* Set CD-ROM drive speed in K bytes per second. (via MMC) */ driver_return_code_t set_speed_mmc (void *p_user_data, int i_Kbs_speed); /*********************************************************** Miscellaenous other "private" routines. Probably need to better classify these. ************************************************************/ typedef driver_return_code_t (*mmc_run_cmd_fn_t) ( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); int mmc_set_blocksize_mmc_private ( const void *p_env, const mmc_run_cmd_fn_t run_mmc_cmd, uint16_t i_blocksize ); /*! Get the DVD type associated with cd object. */ discmode_t mmc_get_dvd_struct_physical_private ( void *p_env, mmc_run_cmd_fn_t run_mmc_cmd, cdio_dvd_struct_t *s ); /*! On input a MODE_SENSE command was issued and we have the results in p. We interpret this and return a bit mask set according to the capabilities. */ void mmc_get_drive_cap_buf(const uint8_t *p, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap); driver_return_code_t mmc_set_blocksize_private ( void *p_env, const mmc_run_cmd_fn_t run_mmc_cmd, uint16_t i_blocksize); /** Get the media catalog number (MCN) or the ISRC Note: string is malloc'd so caller should free() then returned string when done with it. */ char * mmc_get_mcn_isrc_private ( const CdIo_t *p_cdio, track_t i_track, unsigned char sub_chan_param ); libcdio-2.2.0/lib/driver/mmc/mmc_util.c000066400000000000000000000323121474051130400177120ustar00rootroot00000000000000/* Multimedia Command (MMC) "helper" routines that don't depend on anything other than headers. Copyright (C) 2010, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #include #include "mmc_private.h" /** The below variables are trickery to force enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions */ cdio_mmc_feature_t debug_cdio_mmc_feature; cdio_mmc_feature_interface_t debug_cdio_mmc_feature_interface; cdio_mmc_feature_profile_t debug_cdio_mmc_feature_profile; cdio_mmc_get_conf_t debug_cdio_mmc_get_conf; cdio_mmc_gpcmd_t debug_cdio_mmc_gpcmd; cdio_mmc_read_sub_state_t debug_cdio_mmc_read_sub_state; cdio_mmc_read_cd_type_t debug_cdio_mmc_read_cd_type; cdio_mmc_readtoc_t debug_cdio_mmc_readtoc; cdio_mmc_mode_page_t debug_cdio_mmc_mode_page; /** Maps a mmc_sense_key_t into a string name. */ const char mmc_sense_key2str[16][40] = { "No Sense", /**< 0 No specific Sense Key info reported */ "Recovered Error", /**< 1 Completed ok with recovery */ "Not Ready", /**< 2 */ "Medium Error", /**< 3 */ "Hardware Error", /**< 4 */ "Illegal Request", /**< 5 */ "Unit Attention", /**< 6 */ "Data Protect", /**< 7 */ "Blank Check", /**< 8 */ "Vendor Specific", /**< 9 */ "Copy aborted", /**< A */ "Aborted Command", /**< B */ "Obsolete", /**< C */ "Unknown - 13", /**< D */ "Unknown - 14", /**< E */ "Unknown - 15", /**< F */ }; /** The maximum value in milliseconds that we will wait on an MMC command. */ uint32_t mmc_timeout_ms = MMC_TIMEOUT_DEFAULT; /** The maximum value in milliseconds that we will wait on an MMC read command. */ uint32_t mmc_read_timeout_ms = MMC_READ_TIMEOUT_DEFAULT; /*! Return a string containing the name of the audio state as returned from the Q_SUBCHANNEL. */ const char * mmc_audio_state2str( uint8_t i_audio_state ) { switch(i_audio_state) { case CDIO_MMC_READ_SUB_ST_INVALID: return "invalid"; case CDIO_MMC_READ_SUB_ST_PLAY: return "playing"; case CDIO_MMC_READ_SUB_ST_PAUSED: return "paused"; case CDIO_MMC_READ_SUB_ST_COMPLETED: return "completed"; case CDIO_MMC_READ_SUB_ST_ERROR: return "error"; case CDIO_MMC_READ_SUB_ST_NO_STATUS: return "no status"; default: return "unknown"; } } /** On input a MODE_SENSE command was issued and we have the results in p. We interpret this and return a bit mask set according to the capabilities. */ void mmc_get_drive_cap_buf(const uint8_t *p, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) { /* Reader */ if (p[2] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_R; if (p[2] & 0x02) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_RW; if (p[2] & 0x08) *p_read_cap |= CDIO_DRIVE_CAP_READ_DVD_ROM; if (p[4] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_AUDIO; if (p[4] & 0x10) *p_read_cap |= CDIO_DRIVE_CAP_READ_MODE2_FORM1; if (p[4] & 0x20) *p_read_cap |= CDIO_DRIVE_CAP_READ_MODE2_FORM2; if (p[5] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_DA; if (p[5] & 0x10) *p_read_cap |= CDIO_DRIVE_CAP_READ_C2_ERRS; if (p[5] & 0x20) *p_read_cap |= CDIO_DRIVE_CAP_READ_ISRC; if (p[5] & 0x40) *p_read_cap |= CDIO_DRIVE_CAP_READ_MCN; /* Writer */ if (p[3] & 0x01) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_R; if (p[3] & 0x02) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW; if (p[3] & 0x10) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R; if (p[3] & 0x20) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM; if (p[4] & 0x80) *p_misc_cap |= CDIO_DRIVE_CAP_WRITE_BURN_PROOF; /* Misc */ if (p[4] & 0x40) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MULTI_SESSION; if (p[6] & 0x01) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_LOCK; if (p[6] & 0x08) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_EJECT; if (p[6] >> 5 != 0) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_CLOSE_TRAY; } /** Return a string containing the name of the given feature */ const char * mmc_feature2str( int i_feature ) { switch(i_feature) { case CDIO_MMC_FEATURE_PROFILE_LIST: return "Profile List"; case CDIO_MMC_FEATURE_CORE: return "Core"; case CDIO_MMC_FEATURE_MORPHING: return "Morphing" ; case CDIO_MMC_FEATURE_REMOVABLE_MEDIUM: return "Removable Medium"; case CDIO_MMC_FEATURE_WRITE_PROTECT: return "Write Protect"; case CDIO_MMC_FEATURE_RANDOM_READABLE: return "Random Readable"; case CDIO_MMC_FEATURE_MULTI_READ: return "Multi-Read"; case CDIO_MMC_FEATURE_CD_READ: return "CD Read"; case CDIO_MMC_FEATURE_DVD_READ: return "DVD Read"; case CDIO_MMC_FEATURE_RANDOM_WRITABLE: return "Random Writable"; case CDIO_MMC_FEATURE_INCR_WRITE: return "Incremental Streaming Writable"; case CDIO_MMC_FEATURE_SECTOR_ERASE: return "Sector Erasable"; case CDIO_MMC_FEATURE_FORMATABLE: return "Formattable"; case CDIO_MMC_FEATURE_DEFECT_MGMT: return "Management Ability of the Logical Unit/media system " "to provide an apparently defect-free space."; case CDIO_MMC_FEATURE_WRITE_ONCE: return "Write Once"; case CDIO_MMC_FEATURE_RESTRICT_OVERW: return "Restricted Overwrite"; case CDIO_MMC_FEATURE_CD_RW_CAV: return "CD-RW CAV Write"; case CDIO_MMC_FEATURE_MRW: return "MRW"; case CDIO_MMC_FEATURE_ENHANCED_DEFECT: return "Enhanced Defect Reporting"; case CDIO_MMC_FEATURE_DVD_PRW: return "DVD+RW"; case CDIO_MMC_FEATURE_DVD_PR: return "DVD+R"; case CDIO_MMC_FEATURE_RIGID_RES_OVERW: return "Rigid Restricted Overwrite"; case CDIO_MMC_FEATURE_CD_TAO: return "CD Track at Once"; case CDIO_MMC_FEATURE_CD_SAO: return "CD Mastering (Session at Once)"; case CDIO_MMC_FEATURE_DVD_R_RW_WRITE: return "DVD-R/RW Write"; case CDIO_MMC_FEATURE_CD_RW_MEDIA_WRITE: return "CD-RW Media Write Support"; case CDIO_MMC_FEATURE_DVD_PR_2_LAYER: return "DVD+R Double Layer"; case CDIO_MMC_FEATURE_POWER_MGMT: return "Initiator- and Device-directed Power Management"; case CDIO_MMC_FEATURE_CDDA_EXT_PLAY: return "CD Audio External Play"; case CDIO_MMC_FEATURE_MCODE_UPGRADE: return "Ability for the device to accept new microcode via the interface"; case CDIO_MMC_FEATURE_TIME_OUT: return "Ability to respond to all commands within a specific time"; case CDIO_MMC_FEATURE_DVD_CSS: return "Ability to perform DVD CSS/CPPM authentication via RPC"; case CDIO_MMC_FEATURE_RT_STREAMING: return "Ability to read and write using Initiator requested performance" " parameters"; case CDIO_MMC_FEATURE_LU_SN: return "The Logical Unit Unique Identifier"; default: { static char buf[100]; if ( 0 != (i_feature & 0xFF00) ) { snprintf( buf, sizeof(buf), "Vendor-specific code %x", i_feature ); } else { snprintf( buf, sizeof(buf), "Unknown code %x", i_feature ); } return buf; } } } /** Return a string containing the name of the given feature profile. */ const char * mmc_feature_profile2str( int i_feature_profile ) { switch(i_feature_profile) { case CDIO_MMC_FEATURE_PROF_NON_REMOVABLE: return "Non-removable"; case CDIO_MMC_FEATURE_PROF_REMOVABLE: return "disk Re-writable; with removable media"; case CDIO_MMC_FEATURE_PROF_MO_ERASABLE: return "Erasable Magneto-Optical disk with sector erase capability"; case CDIO_MMC_FEATURE_PROF_MO_WRITE_ONCE: return "Write Once Magneto-Optical write once"; case CDIO_MMC_FEATURE_PROF_AS_MO: return "Advance Storage Magneto-Optical"; case CDIO_MMC_FEATURE_PROF_CD_ROM: return "Read only Compact Disc capable"; case CDIO_MMC_FEATURE_PROF_CD_R: return "Write once Compact Disc capable"; case CDIO_MMC_FEATURE_PROF_CD_RW: return "CD-RW Re-writable Compact Disc capable"; case CDIO_MMC_FEATURE_PROF_DVD_ROM: return "Read only DVD"; case CDIO_MMC_FEATURE_PROF_DVD_R_SEQ: return "Re-recordable DVD using Sequential recording"; case CDIO_MMC_FEATURE_PROF_DVD_RAM: return "Re-writable DVD"; case CDIO_MMC_FEATURE_PROF_DVD_RW_RO: return "Re-recordable DVD using Restricted Overwrite"; case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ: return "Re-recordable DVD using Sequential Recording"; case CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ: return "DVD-R - Double-Layer Sequential Recording"; case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR: return "DVD-R - Double-layer Jump Recording"; case CDIO_MMC_FEATURE_PROF_DVD_PRW: return "DVD+RW - DVD Rewritable"; case CDIO_MMC_FEATURE_RIGID_RES_OVERW: return "Rigid Restricted Overwrite"; case CDIO_MMC_FEATURE_PROF_DVD_PR: return "DVD+R - DVD Recordable"; case CDIO_MMC_FEATURE_PROF_DDCD_ROM: return "Read only DDCD"; case CDIO_MMC_FEATURE_PROF_DDCD_R: return "DDCD-R Write only DDCD"; case CDIO_MMC_FEATURE_PROF_DDCD_RW: return "Re-Write only DDCD"; case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL: return "DVD+RW - Double Layer"; case CDIO_MMC_FEATURE_PROF_DVD_PR_DL: return "DVD+R Double Layer - DVD Recordable Double Layer"; case CDIO_MMC_FEATURE_PROF_BD_ROM: return "Blu Ray BD-ROM"; case CDIO_MMC_FEATURE_PROF_BD_SEQ: return "Blu Ray BD-R sequential recording"; case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM: return "Blu Ray BD-R random recording"; case CDIO_MMC_FEATURE_PROF_BD_RE: return "Blu Ray BD-RE"; case CDIO_MMC_FEATURE_PROF_HD_DVD_ROM: return "HD-DVD-ROM"; case CDIO_MMC_FEATURE_PROF_HD_DVD_R: return "HD-DVD-R"; case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM: return "HD-DVD-RAM"; case CDIO_MMC_FEATURE_PROF_NON_CONFORM: return "The Logical Unit does not conform to any Profile"; default: { static char buf[100]; snprintf(buf, sizeof(buf), "Unknown Profile %x", i_feature_profile); return buf; } } } bool mmc_is_disctype_bd (cdio_mmc_feature_profile_t disctype) { switch (disctype) { case CDIO_MMC_FEATURE_PROF_BD_ROM: case CDIO_MMC_FEATURE_PROF_BD_SEQ: case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM: case CDIO_MMC_FEATURE_PROF_BD_RE: return true; default: return false; } } bool mmc_is_disctype_cdrom (cdio_mmc_feature_profile_t disctype) { switch (disctype) { case CDIO_MMC_FEATURE_PROF_CD_ROM: case CDIO_MMC_FEATURE_PROF_CD_R: case CDIO_MMC_FEATURE_PROF_CD_RW: return true; default: return false; } } bool mmc_is_disctype_dvd (cdio_mmc_feature_profile_t disctype) { switch (disctype) { case CDIO_MMC_FEATURE_PROF_DVD_ROM: case CDIO_MMC_FEATURE_PROF_DVD_RAM: case CDIO_MMC_FEATURE_PROF_DVD_R_SEQ: case CDIO_MMC_FEATURE_PROF_DVD_RW_RO: case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ: case CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ: case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR: case CDIO_MMC_FEATURE_PROF_DVD_PRW: case CDIO_MMC_FEATURE_PROF_DVD_PR: case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL: case CDIO_MMC_FEATURE_PROF_DVD_PR_DL: return true; default: return false; } } bool mmc_is_disctype_hd_dvd (cdio_mmc_feature_profile_t disctype) { switch (disctype) { case CDIO_MMC_FEATURE_PROF_HD_DVD_ROM: case CDIO_MMC_FEATURE_PROF_HD_DVD_R: case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM: return true; default: return false; } } bool mmc_is_disctype_overwritable (cdio_mmc_feature_profile_t disctype) { switch (disctype) { case CDIO_MMC_FEATURE_PROF_DVD_RW_RO: case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR: case CDIO_MMC_FEATURE_PROF_DVD_PRW: case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL: case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM: /* pseudo-overwritable */ case CDIO_MMC_FEATURE_PROF_BD_RE: case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM: return true; default: return false; } } bool mmc_is_disctype_rewritable (cdio_mmc_feature_profile_t disctype) { /* discs that need blanking before re-use */ if (mmc_is_disctype_overwritable (disctype)) return true; switch (disctype) { case CDIO_MMC_FEATURE_PROF_CD_RW: case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ: case CDIO_MMC_FEATURE_PROF_BD_SEQ: return true; default: return false; } } libcdio-2.2.0/lib/driver/netbsd.c000066400000000000000000000647161474051130400166210ustar00rootroot00000000000000/* Copyright (C) 2008, 2010-2012, 2017, 2018 Rocky Bernstein Copyright (C) 2014 Robert Kausch 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Changes up to version 0.76 */ /* * Copyright (c) 2003 * Matthias Drochner. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * NetBSD and OpenBSD support for libcdio. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include "cdio_assert.h" #include "cdio_private.h" #ifndef USE_MMC_SUBCHANNEL #define USE_MMC_SUBCHANNEL 0 #endif #if defined(__NetBSD__) && (defined(__i386__) || defined(__amd64__)) #define DEFAULT_CDIO_DEVICE "/dev/rcd0d" #else #define DEFAULT_CDIO_DEVICE "/dev/rcd0c" #endif #define MAX_CD_DEVICES 64 #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_NETBSD_CDROM #include #include #include #include #include #include #include #include #include #include #include #include #define TOTAL_TRACKS (_obj->tochdr.ending_track \ - _obj->tochdr.starting_track + 1) #define FIRST_TRACK_NUM (_obj->tochdr.starting_track) typedef enum { _AM_NONE, _AM_IOCTL, _AM_READ_CD, _AM_MMC_RDWR, _AM_MMC_RDWR_EXCL, } access_mode_t; typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; access_mode_t access_mode; bool toc_valid; struct ioc_toc_header tochdr; struct cd_toc_entry tocent[100]; bool sessionformat_valid; int sessionformat[100]; /* format of the session the track is in */ } _img_private_t; static driver_return_code_t run_scsi_cmd_netbsd(void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, void *p_buf ) { const _img_private_t *_obj = p_user_data; scsireq_t req; memset(&req, 0, sizeof(req)); memcpy(&req.cmd[0], p_cdb, i_cdb); req.cmdlen = i_cdb; req.datalen = i_buf; req.databuf = p_buf; req.timeout = i_timeout_ms; req.flags = e_direction == SCSI_MMC_DATA_READ ? SCCMD_READ : SCCMD_WRITE; if (ioctl(_obj->gen.fd, SCIOCCOMMAND, &req) < 0) { cdio_info("SCIOCCOMMAND: %s", strerror(errno)); return -1; } if (req.retsts != SCCMD_OK) { cdio_info("SCIOCCOMMAND cmd 0x%02x sts %d\n", req.cmd[0], req.retsts); return -1; } return 0; } static access_mode_t str_to_access_mode_netbsd(const char *psz_access_mode) { const access_mode_t default_access_mode = _AM_IOCTL; if (NULL==psz_access_mode) return default_access_mode; if (!strcmp(psz_access_mode, "IOCTL")) return _AM_IOCTL; else if (!strcmp(psz_access_mode, "READ_CD")) return _AM_READ_CD; else if (!strcmp(psz_access_mode, "MMC_RDWR")) return _AM_MMC_RDWR; else if (!strcmp(psz_access_mode, "MMC_RDWR_EXCL")) return _AM_MMC_RDWR_EXCL; else { cdio_warn ("unknown access type: %s. Default IOCTL used.", psz_access_mode); return default_access_mode; } } static int read_audio_sectors_netbsd(void *user_data, void *data, lsn_t lsn, unsigned int nblocks) { scsireq_t req; _img_private_t *_obj = user_data; memset(&req, 0, sizeof(req)); req.cmd[0] = 0xbe; req.cmd[1] = 0; req.cmd[2] = (lsn >> 24) & 0xff; req.cmd[3] = (lsn >> 16) & 0xff; req.cmd[4] = (lsn >> 8) & 0xff; req.cmd[5] = (lsn >> 0) & 0xff; req.cmd[6] = (nblocks >> 16) & 0xff; req.cmd[7] = (nblocks >> 8) & 0xff; req.cmd[8] = (nblocks >> 0) & 0xff; req.cmd[9] = 0x78; req.cmdlen = 10; req.datalen = nblocks * CDIO_CD_FRAMESIZE_RAW; req.databuf = data; req.timeout = 10000; req.flags = SCCMD_READ; if (ioctl(_obj->gen.fd, SCIOCCOMMAND, &req) < 0) { cdio_info("SCIOCCOMMAND: %s", strerror(errno)); return 1; } if (req.retsts != SCCMD_OK) { cdio_info("SCIOCCOMMAND cmd 0xbe sts %d\n", req.retsts); return 1; } return 0; } /*! Reads a single mode1 sector from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sector_netbsd (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2) { return cdio_generic_read_form1_sector(p_user_data, p_data, lsn); } /*! Reads i_blocks of mode2 sectors from cd device into data starting from lsn. Returns 0 if no error. */ static driver_return_code_t _read_mode1_sectors_netbsd (void *p_user_data, void *p_data, lsn_t lsn, bool b_form2, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; unsigned int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < i_blocks; i++) { if ( (retval = _read_mode1_sector_netbsd (p_env, ((char *)p_data) + (blocksize*i), lsn + i, b_form2)) ) return retval; } return DRIVER_OP_SUCCESS; } static int read_mode2_sector_netbsd(void *user_data, void *data, lsn_t lsn, bool mode2_form2) { scsireq_t req; _img_private_t *_obj = user_data; char buf[M2RAW_SECTOR_SIZE] = { 0, }; memset(&req, 0, sizeof(req)); req.cmd[0] = 0xbe; req.cmd[1] = 0; req.cmd[2] = (lsn >> 24) & 0xff; req.cmd[3] = (lsn >> 16) & 0xff; req.cmd[4] = (lsn >> 8) & 0xff; req.cmd[5] = (lsn >> 0) & 0xff; req.cmd[6] = 0; req.cmd[7] = 0; req.cmd[8] = 1; req.cmd[9] = 0x58; /* subheader + userdata + ECC */ req.cmdlen = 10; req.datalen = M2RAW_SECTOR_SIZE; req.databuf = buf; req.timeout = 10000; req.flags = SCCMD_READ; if (ioctl(_obj->gen.fd, SCIOCCOMMAND, &req) < 0) { cdio_info("SCIOCCOMMAND: %s", strerror(errno)); return 1; } if (req.retsts != SCCMD_OK) { cdio_info("SCIOCCOMMAND cmd 0xbe sts %d\n", req.retsts); return 1; } if (mode2_form2) memcpy(data, buf, M2RAW_SECTOR_SIZE); else memcpy(data, buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE); return 0; } static int read_mode2_sectors_netbsd(void *user_data, void *data, lsn_t lsn, bool mode2_form2, unsigned int nblocks) { int i, res; char *buf = data; for (i = 0; i < nblocks; i++) { res = read_mode2_sector_netbsd(user_data, buf, lsn, mode2_form2); if (res) return res; buf += (mode2_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE); lsn++; } return 0; } static int set_arg_netbsd(void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return DRIVER_OP_ERROR; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { p_env->access_mode = str_to_access_mode_netbsd(key); } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } static bool _cdio_read_toc(_img_private_t *_obj) { int res; struct ioc_read_toc_entry req; res = ioctl(_obj->gen.fd, CDIOREADTOCHEADER, &_obj->tochdr); if (res < 0) { cdio_warn("error in ioctl(CDIOREADTOCHEADER): %s\n", strerror(errno)); return false; } req.address_format = CD_MSF_FORMAT; req.starting_track = FIRST_TRACK_NUM; req.data_len = (TOTAL_TRACKS + 1) /* leadout! */ * sizeof(struct cd_toc_entry); req.data = _obj->tocent; res = ioctl(_obj->gen.fd, CDIOREADTOCENTRIES, &req); if (res < 0) { cdio_warn("error in ioctl(CDROMREADTOCENTRIES): %s\n", strerror(errno)); return false; } _obj->toc_valid = 1; _obj->gen.i_first_track = FIRST_TRACK_NUM; _obj->gen.i_tracks = TOTAL_TRACKS; _obj->gen.toc_init = true; return true; } static bool read_toc_netbsd (void *p_user_data) { return _cdio_read_toc(p_user_data); } static int _cdio_read_discinfo(_img_private_t *_obj) { scsireq_t req; #define FULLTOCBUF (4 + 1000*11) unsigned char buf[FULLTOCBUF] = { 0, }; int i, j; memset(&req, 0, sizeof(req)); req.cmd[0] = 0x43; /* READ TOC/PMA/ATIP */ req.cmd[1] = 0x02; req.cmd[2] = 0x02; /* full TOC */ req.cmd[3] = 0; req.cmd[4] = 0; req.cmd[5] = 0; req.cmd[6] = 0; req.cmd[7] = FULLTOCBUF / 256; req.cmd[8] = FULLTOCBUF % 256; req.cmd[9] = 0; req.cmdlen = 10; req.datalen = FULLTOCBUF; req.databuf = buf; req.timeout = 10000; req.flags = SCCMD_READ; if (ioctl(_obj->gen.fd, SCIOCCOMMAND, &req) < 0) { cdio_info("SCIOCCOMMAND: %s", strerror(errno)); return 1; } if (req.retsts != SCCMD_OK) { cdio_info("SCIOCCOMMAND cmd 0x43 sts %d\n", req.retsts); return 1; } #if 1 printf("discinfo:"); for (i = 0; i < 4; i++) printf(" %02x", buf[i]); printf("\n"); for (i = 0; i < buf[1] - 2; i++) { printf(" %02x", buf[i + 4]); if (!((i + 1) % 11)) printf("\n"); } #endif for (i = 4; i < req.datalen_used; i += 11) { if (buf[i + 3] == 0xa0) { /* POINT */ /* XXX: assume entry 0xa1 follows */ for (j = buf[i + 8] - 1; j <= buf[i + 11 + 8] - 1; j++) _obj->sessionformat[j] = buf[i + 9]; } } _obj->sessionformat_valid = true; return 0; } static int eject_media_netbsd(void *user_data) { _img_private_t *_obj = user_data; int fd, res, ret = 0; fd = open(_obj->gen.source_name, O_RDONLY|O_NONBLOCK); if (fd < 0) return 2; res = ioctl(fd, CDIOCALLOW); if (res < 0) { cdio_warn("ioctl(fd, CDIOCALLOW) failed: %s\n", strerror(errno)); /* go on... */ } res = ioctl(fd, CDIOCEJECT); if (res < 0) { cdio_warn("ioctl(CDIOCEJECT) failed: %s\n", strerror(errno)); ret = 1; } close(fd); return ret; } static bool is_mmc_supported(void *user_data) { _img_private_t *env = user_data; return (_AM_NONE == env->access_mode) ? false : true; } /*! Return the value associated with the key "arg". */ static const char * get_arg_netbsd(void *env, const char key[]) { _img_private_t *_obj = env; if (!strcmp(key, "source")) { return _obj->gen.source_name; } else if (!strcmp(key, "access-mode")) { switch (_obj->access_mode) { case _AM_IOCTL: return "IOCTL"; case _AM_READ_CD: return "READ_CD"; case _AM_MMC_RDWR: return "MMC_RDWR"; case _AM_MMC_RDWR_EXCL: return "MMC_RDWR_EXCL"; case _AM_NONE: return "no access method"; } } else if (!strcmp (key, "mmc-supported?")) { return is_mmc_supported(env) ? "true" : "false"; } return NULL; } static track_t get_first_track_num_netbsd(void *user_data) { _img_private_t *_obj = user_data; int res; if (!_obj->toc_valid) { res = _cdio_read_toc(_obj); if (!res) return CDIO_INVALID_TRACK; } return FIRST_TRACK_NUM; } static track_t get_num_tracks_netbsd(void *user_data) { _img_private_t *_obj = user_data; int res; if (!_obj->toc_valid) { res = _cdio_read_toc(_obj); if (!res) return CDIO_INVALID_TRACK; } return TOTAL_TRACKS; } /*! Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * get_track_isrc_netbsd (const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; return mmc_get_track_isrc( p_env->gen.cdio, i_track ); } static driver_return_code_t audio_get_volume_netbsd(void *p_user_data, cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return (ioctl(p_env->gen.fd, CDIOCGETVOL, p_volume)); } static driver_return_code_t audio_pause_netbsd(void *p_user_data) { const _img_private_t *p_env = p_user_data; return (ioctl(p_env->gen.fd, CDIOCPAUSE)); } static driver_return_code_t audio_stop_netbsd(void *p_user_data) { const _img_private_t *p_env = p_user_data; return (ioctl(p_env->gen.fd, CDIOCSTOP)); } static driver_return_code_t audio_resume_netbsd(void *p_user_data) { const _img_private_t *p_env = p_user_data; return (ioctl(p_env->gen.fd, CDIOCRESUME)); } static driver_return_code_t audio_set_volume_netbsd(void *p_user_data, cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return (ioctl(p_env->gen.fd, CDIOCSETVOL, p_volume)); } /*! Get format of track. */ static track_format_t get_track_format_netbsd(void *user_data, track_t track_num) { _img_private_t *_obj = user_data; int res, first_track = 0, track_idx = 0; if (!_obj->toc_valid) { res = _cdio_read_toc(_obj); if (!res) return TRACK_FORMAT_ERROR; } first_track = _obj->gen.i_first_track; if (!_obj->gen.toc_init || track_num > (first_track + _obj->gen.i_tracks) || track_num < first_track) return (CDIO_INVALID_TRACK); track_idx = track_num - first_track; if (_obj->tocent[track_idx].control & 0x04) { if (!_obj->sessionformat_valid) { res = _cdio_read_discinfo(_obj); if (res) return TRACK_FORMAT_ERROR; } if (_obj->sessionformat[track_idx] == 0x10) return TRACK_FORMAT_CDI; else if (_obj->sessionformat[track_idx] == 0x20) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool get_track_green_netbsd(void *user_data, track_t track_num) { return (get_track_format_netbsd(user_data, track_num) == TRACK_FORMAT_XA); } /*! Return the starting MSF (minutes/secs/frames) for track number track_num in obj. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified by passing i_track as either LEADOUT_TRACK or the track number of the last audio track plus one. False is returned if there is no track entry. */ static bool get_track_msf_netbsd(void *user_data, track_t track_num, msf_t *msf) { _img_private_t *_obj = user_data; int res, first_track = 0, track_idx = 0; if (!msf) return false; if (!_obj->toc_valid) { res = _cdio_read_toc(_obj); if (!res) return false; } if (track_num == CDIO_CDROM_LEADOUT_TRACK) track_num = _obj->gen.i_tracks + _obj->gen.i_first_track; first_track = _obj->gen.i_first_track; if (!_obj->gen.toc_init || track_num > (first_track + _obj->gen.i_tracks) || track_num < first_track) return (CDIO_INVALID_TRACK); track_idx = track_num - first_track; msf->m = cdio_to_bcd8(_obj->tocent[track_idx].addr.msf.minute); msf->s = cdio_to_bcd8(_obj->tocent[track_idx].addr.msf.second); msf->f = cdio_to_bcd8(_obj->tocent[track_idx].addr.msf.frame); return true; } /*! Return the size of the CD in logical block address (LBA) units. @return the lsn. On error return CDIO_INVALID_LSN. Also note that in one at least one test the corresponding MMC gives a different answer, so there may be some disagreement about what is in fact the last lsn. */ static lsn_t get_disc_last_lsn_netbsd(void *user_data) { msf_t msf; get_track_msf_netbsd(user_data, CDIO_CDROM_LEADOUT_TRACK, &msf); return (((msf.m * 60) + msf.s) * CDIO_CD_FRAMES_PER_SEC + msf.f); } static driver_return_code_t get_last_session_netbsd(void *p_user_data, lsn_t *i_last_session) { const _img_private_t *p_env = p_user_data; int addr = 0; if (ioctl(p_env->gen.fd, CDIOREADMSADDR, &addr) == 0) { *i_last_session = addr; return (DRIVER_OP_SUCCESS); } else { cdio_warn("ioctl CDIOREADMSADDR failed: %s\n", strerror(errno)); return (DRIVER_OP_ERROR); } } #endif /* HAVE_NETBSD_CDROM */ char ** cdio_get_devices_netbsd (void) { #ifndef HAVE_NETBSD_CDROM return NULL; #else char drive[16]; char **drives = NULL; unsigned int num_drives = 0; int cdfd; int n; /* Search for open(2)able /dev/rcd* devices */ for (n = 0; n <= MAX_CD_DEVICES; n++) { snprintf(drive, sizeof(drive), "/dev/rcd%d%c", n, 'a' + RAW_PART); if (!cdio_is_device_quiet_generic(drive)) continue; if ((cdfd = open(drive, O_RDONLY|O_NONBLOCK, 0)) == -1) continue; close(cdfd); cdio_add_device_list(&drives, drive, &num_drives); } cdio_add_device_list(&drives, NULL, &num_drives); return (drives); #endif /* HAVE_NETBSD_CDROM */ } #ifdef HAVE_NETBSD_CDROM static driver_return_code_t audio_play_msf_netbsd(void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf) { const _img_private_t *p_env = p_user_data; struct ioc_play_msf a; a.start_m = cdio_from_bcd8(p_start_msf->m); a.start_s = cdio_from_bcd8(p_start_msf->s); a.start_f = cdio_from_bcd8(p_start_msf->f); a.end_m = cdio_from_bcd8(p_end_msf->m); a.end_s = cdio_from_bcd8(p_end_msf->s); a.end_f = cdio_from_bcd8(p_end_msf->f); return (ioctl(p_env->gen.fd, CDIOCPLAYMSF, (char *)&a)); } #if !USE_MMC_SUBCHANNEL static driver_return_code_t audio_read_subchannel_netbsd(void *p_user_data, cdio_subchannel_t *subchannel) { const _img_private_t *p_env = p_user_data; struct ioc_read_subchannel s; struct cd_sub_channel_info data; bzero(&s, sizeof(s)); s.data = &data; s.data_len = sizeof(data); s.address_format = CD_MSF_FORMAT; s.data_format = CD_CURRENT_POSITION; if (ioctl(p_env->gen.fd, CDIOCREADSUBCHANNEL, &s) != -1) { subchannel->control = s.data->what.position.control; subchannel->track = s.data->what.position.track_number; subchannel->index = s.data->what.position.index_number; subchannel->abs_addr.m = cdio_to_bcd8(s.data->what.position.absaddr.msf.minute); subchannel->abs_addr.s = cdio_to_bcd8(s.data->what.position.absaddr.msf.second); subchannel->abs_addr.f = cdio_to_bcd8(s.data->what.position.absaddr.msf.frame); subchannel->rel_addr.m = cdio_to_bcd8(s.data->what.position.reladdr.msf.minute); subchannel->rel_addr.s = cdio_to_bcd8(s.data->what.position.reladdr.msf.second); subchannel->rel_addr.f = cdio_to_bcd8(s.data->what.position.reladdr.msf.frame); subchannel->audio_status = s.data->header.audio_status; return (DRIVER_OP_SUCCESS); } else { cdio_warn("ioctl CDIOCREADSUBCHANNEL failed: %s\n", strerror(errno)); return (DRIVER_OP_ERROR); } } #endif #endif /* HAVE_NETBSD_CDROM */ /*! Return a string containing the default CD device. */ char * cdio_get_default_device_netbsd(void) { return strdup(DEFAULT_CDIO_DEVICE); } /*! Close tray on CD-ROM. @param psz_device the CD-ROM drive to be closed. */ driver_return_code_t close_tray_netbsd (const char *psz_device) { #ifdef HAVE_NETBSD_CDROM return DRIVER_OP_UNSUPPORTED; #else return DRIVER_OP_NO_DRIVER; #endif } #ifdef HAVE_NETBSD_CDROM static cdio_funcs_t _funcs = { .audio_get_volume = audio_get_volume_netbsd, .audio_pause = audio_pause_netbsd, .audio_play_msf = audio_play_msf_netbsd, .audio_play_track_index= NULL, #if USE_MMC_SUBCHANNEL .audio_read_subchannel = audio_read_subchannel_mmc, #else .audio_read_subchannel = audio_read_subchannel_netbsd, #endif .audio_stop = audio_stop_netbsd, .audio_resume = audio_resume_netbsd, .audio_set_volume = audio_set_volume_netbsd, .eject_media = eject_media_netbsd, .free = cdio_generic_free, .get_arg = get_arg_netbsd, .get_blocksize = get_blocksize_mmc, .get_cdtext = get_cdtext_generic, .get_cdtext_raw = read_cdtext_generic, .get_default_device = cdio_get_default_device_netbsd, .get_devices = cdio_get_devices_netbsd, .get_disc_last_lsn = get_disc_last_lsn_netbsd, .get_last_session = get_last_session_netbsd, .get_media_changed = get_media_changed_mmc, .get_discmode = get_discmode_generic, .get_drive_cap = get_drive_cap_mmc, .get_first_track_num = get_first_track_num_netbsd, .get_hwinfo = NULL, .get_mcn = get_mcn_mmc, .get_num_tracks = get_num_tracks_netbsd, .get_track_channels = get_track_channels_generic, .get_track_copy_permit = get_track_copy_permit_generic, .get_track_format = get_track_format_netbsd, .get_track_green = get_track_green_netbsd, /* Not because we can't talk LBA, but the driver assumes MSF throughout */ .get_track_lba = NULL, .get_track_preemphasis = get_track_preemphasis_generic, .get_track_msf = get_track_msf_netbsd, .get_track_isrc = get_track_isrc_netbsd, .lseek = cdio_generic_lseek, .read = cdio_generic_read, .read_audio_sectors = read_audio_sectors_netbsd, .read_data_sectors = read_data_sectors_generic, .read_mode1_sector = _read_mode1_sector_netbsd, .read_mode1_sectors = _read_mode1_sectors_netbsd, .read_mode2_sector = read_mode2_sector_netbsd, .read_mode2_sectors = read_mode2_sectors_netbsd, .read_toc = read_toc_netbsd, .run_mmc_cmd = run_scsi_cmd_netbsd, .set_arg = set_arg_netbsd, }; #endif /*HAVE_NETBSD_CDROM*/ /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_netbsd(const char *source_name) { #ifdef HAVE_NETBSD_CDROM CdIo_t *ret; _img_private_t *_data; int open_access_mode; /* Access mode passed to cdio_generic_init. */ _data = calloc(1, sizeof(_img_private_t)); _data->gen.init = false; _data->toc_valid = false; _data->sessionformat_valid = false; _data->gen.fd = -1; _data->gen.b_cdtext_error = false; set_arg_netbsd(_data, "source", (source_name ? source_name : DEFAULT_CDIO_DEVICE)); if (source_name && !cdio_is_device_generic(source_name)) goto err_exit; ret = cdio_new(&_data->gen, &_funcs); if (ret == NULL) { goto err_exit; } ret->driver_id = DRIVER_NETBSD; open_access_mode = O_NONBLOCK; if (_AM_MMC_RDWR == _data->access_mode) open_access_mode |= O_RDWR; else if (_AM_MMC_RDWR_EXCL == _data->access_mode) open_access_mode |= O_RDWR | O_EXCL; else open_access_mode |= O_RDONLY; if (cdio_generic_init(_data, open_access_mode)) { return ret; } free(ret); err_exit: cdio_generic_free(_data); return NULL; #else return NULL; #endif /* HAVE_NETBSD_CDROM */ } /*! Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_am_netbsd(const char *source_name, const char *am) { return (cdio_open_netbsd(source_name)); } bool cdio_have_netbsd (void) { #ifdef HAVE_NETBSD_CDROM return true; #else return false; #endif /* HAVE_NETBSD_CDROM */ } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/osx.c000066400000000000000000001736701474051130400161530ustar00rootroot00000000000000/* Copyright (C) 2003-2006, 2008, 2010-2012, 2014-2015, 2017 Rocky Bernstein from vcdimager code: Copyright (C) 2001 Herbert Valerio Riedel and VideoLAN code Copyright (C) 1998-2001 VideoLAN Authors: Johan Bilien Gildas Bazin Jon Lech Johansen Derk-Jan Hartman Justin F. Hallett 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains OSX-specific code and implements low-level control of the CD drive. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include /* For SCSI TR_* enumerations */ typedef enum { TR_OK = 0, TR_EWRITE = 1 /**< Error writing packet command (transport) */, TR_EREAD = 2 /**< Error reading packet data (transport) */, TR_UNDERRUN = 3 /**< Read underrun */, TR_OVERRUN = 4 /**< Read overrun */, TR_ILLEGAL = 5 /**< Illegal/rejected request */, TR_MEDIUM = 6 /**< Medium error */, TR_BUSY = 7 /**< Device busy */, TR_NOTREADY = 8 /**< Device not ready */, TR_FAULT = 9 /**< Device failure */, TR_UNKNOWN = 10 /**< Unspecified error */, TR_STREAMING = 11 /**< loss of streaming */, } transport_error_t; #include "cdio_assert.h" #include "cdio_private.h" #include "cdtext_private.h" #include #ifdef HAVE_DARWIN_CDROM #undef VERSION #include #include #include #include #include #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1030 # include #else # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1030 # include #else # include #endif #include #include #include #include #include #include #include #include #include #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 #include #include #include #else #define kIOBDMediaClass "IOBDMedia" // It does not hurt, simplyfies rest of code #endif #ifdef HAVE_DISKARBITRATION #include #endif /* FIXME */ #define MAX_BIG_BUFF_SIZE 65535 #define kIOCDBlockStorageDeviceClassString "IOCDBlockStorageDevice" /* Note leadout is normally defined 0xAA, But on OSX 0xA0 is "lead in" while 0xA2 is "lead out". I don't understand the distinction, and therefore something could be wrong. */ #define OSX_CDROM_LEADOUT_TRACK 0xA2 #define TOTAL_TRACKS (p_env->i_last_track - p_env->gen.i_first_track + 1) #define CDROM_CDI_TRACK 0x1 #define CDROM_XA_TRACK 0x2 typedef enum { _AM_NONE, _AM_OSX, } access_mode_t; #define MAX_SERVICE_NAME 1000 typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; access_mode_t access_mode; /* Track information */ CDTOC *pTOC; int i_descriptors; track_t i_last_track; /* highest track number */ track_t i_last_session; /* highest session number */ track_t i_first_session; /* first session number */ lsn_t *pp_lba; io_service_t MediaClass_service; char psz_MediaClass_service[MAX_SERVICE_NAME]; SCSITaskDeviceInterface **pp_scsiTaskDeviceInterface; // io_service_t obj; // SCSITaskDeviceInterface **scsi; SCSITaskInterface **scsi_task; MMCDeviceInterface **mmc; IOCFPlugInInterface **plugin; SCSI_Sense_Data sense; SCSITaskStatus status; UInt64 realized_len; } _img_private_t; static bool read_toc_osx (void *p_user_data); static track_format_t get_track_format_osx(void *p_user_data, track_t i_track); /** * GetRegistryEntryProperties - Gets the registry entry properties for * an io_service_t. */ static CFMutableDictionaryRef GetRegistryEntryProperties ( io_service_t service ) { IOReturn err = kIOReturnSuccess; CFMutableDictionaryRef dict = 0; err = IORegistryEntryCreateCFProperties (service, &dict, kCFAllocatorDefault, 0); if ( err != kIOReturnSuccess ) cdio_warn( "IORegistryEntryCreateCFProperties: 0x%08x", err ); return dict; } /** * ProbeStorageDevices - Probe devices to detect changes. */ static bool ProbeStorageDevices(void) { io_service_t next_service; mach_port_t master_port; kern_return_t kern_result; io_iterator_t service_iterator; CFMutableDictionaryRef classes_to_match; kern_result = IOMasterPort( MACH_PORT_NULL, &master_port ); if( kern_result != KERN_SUCCESS ) { return false; } classes_to_match = IOServiceMatching( kIOBlockStorageDeviceClass ); if( classes_to_match == NULL ) { return false; } kern_result = IOServiceGetMatchingServices( master_port, classes_to_match, &service_iterator ); if( kern_result != KERN_SUCCESS ) { return false; } next_service = IOIteratorNext( service_iterator ); if( next_service != 0 ) { do { IOServiceRequestProbe( next_service, 0 ); IOObjectRelease( next_service ); } while( ( next_service = IOIteratorNext( service_iterator ) ) != 0 ); } IOObjectRelease( service_iterator ); return true; } #ifdef GET_SCSI_FIXED static bool get_scsi(_img_private_t *p_env) { SInt32 score; kern_return_t err; HRESULT herr; err = IOCreatePlugInInterfaceForService(p_env->MediaClass_service, kIOMMCDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &p_env->plugin, &score); if (err != noErr) { fprintf(stderr, "Error %x accessing MMC plugin.\n", err); return false; } herr = (*p_env->plugin) -> QueryInterface(p_env->plugin, CFUUIDGetUUIDBytes(kIOMMCDeviceInterfaceID), (void *)&p_env->mmc); if (herr != S_OK) { fprintf(stderr, "Error %x accessing MMC interface.\n", (int) herr); IODestroyPlugInInterface(p_env->plugin); return false; } p_env->pp_scsiTaskDeviceInterface = (*p_env->mmc)->GetSCSITaskDeviceInterface(p_env->mmc); if (!p_env->pp_scsiTaskDeviceInterface) { fprintf(stderr, "Could not get SCSITaskkDevice interface from MMC interface.\n"); (*p_env->mmc)->Release(p_env->mmc); IODestroyPlugInInterface(p_env->plugin); return false; } err = (*p_env->pp_scsiTaskDeviceInterface)-> ObtainExclusiveAccess(p_env->pp_scsiTaskDeviceInterface); if (err != kIOReturnSuccess) { fprintf(stderr, "Could not obtain exclusive access to the device (%x).\n", err); if (err == kIOReturnBusy) fprintf(stderr, "The volume is already mounted.\n"); else if (err == kIOReturnExclusiveAccess) fprintf(stderr, "Another application already has exclusive access " "to this device.\n"); else fprintf(stderr, "I don't know why.\n"); (*p_env->pp_scsiTaskDeviceInterface)-> Release(p_env->pp_scsiTaskDeviceInterface); (*p_env->mmc)->Release(p_env->mmc); IODestroyPlugInInterface(p_env->plugin); return false; } p_env->scsi_task = (*p_env->pp_scsiTaskDeviceInterface) -> CreateSCSITask(p_env->pp_scsiTaskDeviceInterface); if (!p_env->scsi_task) { fprintf(stderr, "Could not create a SCSITask interface.\n"); (*p_env->pp_scsiTaskDeviceInterface)-> ReleaseExclusiveAccess(p_env->pp_scsiTaskDeviceInterface); (*p_env->pp_scsiTaskDeviceInterface)-> Release(p_env->pp_scsiTaskDeviceInterface); (*p_env->mmc)->Release(p_env->mmc); IODestroyPlugInInterface(p_env->plugin); return false; } return true; } #endif static bool init_osx(_img_private_t *p_env) { char *psz_devname; kern_return_t ret; io_iterator_t iterator; /* Only open if not already opened. Otherwise, too many descriptors are holding the device busy. */ if (-1 == p_env->gen.fd) p_env->gen.fd = open( p_env->gen.source_name, O_RDONLY | O_NONBLOCK ); if (-1 == p_env->gen.fd) { cdio_warn("Failed to open %s: %s", p_env->gen.source_name, strerror(errno)); return false; } /* Get the device name. */ psz_devname = strrchr( p_env->gen.source_name, '/'); if( NULL != psz_devname ) ++psz_devname; else psz_devname = p_env->gen.source_name; /* Unraw the device name. */ if( *psz_devname == 'r' ) ++psz_devname; ret = IOServiceGetMatchingServices( kIOMasterPortDefault, IOBSDNameMatching(kIOMasterPortDefault, 0, psz_devname), &iterator ); /* Get service iterator for the device. */ if( ret != KERN_SUCCESS ) { cdio_warn( "IOServiceGetMatchingServices: 0x%08x", ret ); return false; } /* first service */ p_env->MediaClass_service = IOIteratorNext( iterator ); IOObjectRelease( iterator ); /* search for kIOCDMediaClass or kIODVDMediaClass or kIOBDMediaClass */ while( p_env->MediaClass_service && (!IOObjectConformsTo(p_env->MediaClass_service, kIOCDMediaClass)) && (!IOObjectConformsTo(p_env->MediaClass_service, kIODVDMediaClass)) && (!IOObjectConformsTo(p_env->MediaClass_service, kIOBDMediaClass)) ) { ret = IORegistryEntryGetParentIterator( p_env->MediaClass_service, kIOServicePlane, &iterator ); if( ret != KERN_SUCCESS ) { cdio_warn( "IORegistryEntryGetParentIterator: 0x%08x", ret ); IOObjectRelease( p_env->MediaClass_service ); return false; } IOObjectRelease( p_env->MediaClass_service ); p_env->MediaClass_service = IOIteratorNext( iterator ); IOObjectRelease( iterator ); } if ( 0 == p_env->MediaClass_service ) { cdio_warn( "search for kIOCDMediaClass/kIODVDMediaClass/kIOBDMediaClass came up empty" ); return false; } /* Save the name so we can compare against this in case we have to do another scan. FIXME: this is hoaky and there's got to be a better variable to test or way to do. */ IORegistryEntryGetPath(p_env->MediaClass_service, kIOServicePlane, p_env->psz_MediaClass_service); #ifdef GET_SCSI_FIXED return get_scsi(p_env); #else return true; #endif } /** Run a SCSI MMC command. cdio CD structure set by cdio_open(). i_timeout time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. We return true if command completed successfully and false if not. */ #if 1 /* process a complete scsi command. */ static int run_mmc_cmd_osx( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { _img_private_t *p_env = p_user_data; uint8_t cmdbuf[16]; UInt8 dir; IOVirtualRange buf; IOReturn ret; if (!p_env->scsi_task) return DRIVER_OP_UNSUPPORTED; p_env->gen.scsi_mmc_sense_valid = 0; memcpy(cmdbuf, p_cdb, i_cdb); dir = (SCSI_MMC_DATA_READ == e_direction) ? kSCSIDataTransfer_FromTargetToInitiator : (SCSI_MMC_DATA_WRITE == e_direction) ? kSCSIDataTransfer_FromInitiatorToTarget : kSCSIDataTransfer_NoDataTransfer; if (!i_buf) dir = kSCSIDataTransfer_NoDataTransfer; if (i_buf > MAX_BIG_BUFF_SIZE) { fprintf(stderr, "Excessive request size: %d bytes\n", i_buf); return TR_ILLEGAL; } buf.address = (IOVirtualAddress)p_buf; buf.length = i_buf; ret = (*p_env->scsi_task)->SetCommandDescriptorBlock(p_env->scsi_task, cmdbuf, i_cdb); if (ret != kIOReturnSuccess) { fprintf(stderr, "SetCommandDescriptorBlock: %x\n", ret); return TR_UNKNOWN; } ret = (*p_env->scsi_task)->SetScatterGatherEntries(p_env->scsi_task, &buf, 1, i_buf, dir); if (ret != kIOReturnSuccess) { fprintf(stderr, "SetScatterGatherEntries: %x\n", ret); return TR_UNKNOWN; } ret = (*p_env->scsi_task)->ExecuteTaskSync(p_env->scsi_task, &p_env->sense, &p_env->status, &p_env->realized_len); if (ret != kIOReturnSuccess) { fprintf(stderr, "ExecuteTaskSync: %x\n", ret); return TR_UNKNOWN; } if (p_env->status != kSCSITaskStatus_GOOD) { int i; fprintf(stderr, "SCSI status: %x\n", p_env->status); fprintf(stderr, "Sense: %x %x %x\n", p_env->sense.SENSE_KEY, p_env->sense.ADDITIONAL_SENSE_CODE, p_env->sense.ADDITIONAL_SENSE_CODE_QUALIFIER); for (i = 0; i < i_cdb; i++) fprintf(stderr, "%02x ", cmdbuf[i]); fprintf(stderr, "\n"); memcpy((void *) p_env->gen.scsi_mmc_sense, &p_env->sense, kSenseDefaultSize); return TR_UNKNOWN; } if (p_env->sense.VALID_RESPONSE_CODE) { char key = p_env->sense.SENSE_KEY & 0xf; char ASC = p_env->sense.ADDITIONAL_SENSE_CODE; char ASCQ = p_env->sense.ADDITIONAL_SENSE_CODE_QUALIFIER; switch (key) { case 0: if (errno == 0) errno = EIO; return (TR_UNKNOWN); case 1: break; case 2: if (errno == 0) errno = EBUSY; return (TR_BUSY); case 3: if (ASC == 0x0C && ASCQ == 0x09) { /* loss of streaming */ if (errno == 0) errno = EIO; return (TR_STREAMING); } else { if (errno == 0) errno = EIO; return (TR_MEDIUM); } case 4: if (errno == 0) errno = EIO; return (TR_FAULT); case 5: if (errno == 0) errno = EINVAL; return (TR_ILLEGAL); default: if (errno == 0) errno = EIO; return (TR_UNKNOWN); } } errno = 0; return (0); } #endif #if 0 /** Run a SCSI MMC command. cdio CD structure set by cdio_open(). i_timeout time in milliseconds we will wait for the command to complete. If this value is -1, use the default time-out value. p_buf Buffer for data, both sending and receiving i_buf Size of buffer e_direction direction the transfer is to go. cdb CDB bytes. All values that are needed should be set on input. We'll figure out what the right CDB length should be. We return true if command completed successfully and false if not. */ static int run_mmc_cmd_osx( const void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) { #ifndef SCSI_MMC_FIXED return DRIVER_OP_UNSUPPORTED; #else const _img_private_t *p_env = p_user_data; SCSITaskDeviceInterface **sc; SCSITaskInterface **cmd = NULL; IOVirtualRange iov; SCSI_Sense_Data senseData; SCSITaskStatus status; UInt64 bytesTransferred; IOReturn ioReturnValue; int ret = 0; if (NULL == p_user_data) return 2; /* Make sure pp_scsiTaskDeviceInterface is initialized. FIXME: The code should probably be reorganized better for this. */ if (!p_env->gen.toc_init) read_toc_osx (p_user_data) ; sc = p_env->pp_scsiTaskDeviceInterface; if (NULL == sc) return 3; cmd = (*sc)->CreateSCSITask(sc); if (cmd == NULL) { cdio_warn("Failed to create SCSI task"); return -1; } iov.address = (IOVirtualAddress) p_buf; iov.length = i_buf; ioReturnValue = (*cmd)->SetCommandDescriptorBlock(cmd, (UInt8 *) p_cdb, i_cdb); if (ioReturnValue != kIOReturnSuccess) { cdio_warn("SetCommandDescriptorBlock failed with status %x", ioReturnValue); return -1; } ioReturnValue = (*cmd)->SetScatterGatherEntries(cmd, &iov, 1, i_buf, (SCSI_MMC_DATA_READ == e_direction ) ? kSCSIDataTransfer_FromTargetToInitiator : kSCSIDataTransfer_FromInitiatorToTarget); if (ioReturnValue != kIOReturnSuccess) { cdio_warn("SetScatterGatherEntries failed with status %x", ioReturnValue); return -1; } ioReturnValue = (*cmd)->SetTimeoutDuration(cmd, i_timeout_ms ); if (ioReturnValue != kIOReturnSuccess) { cdio_warn("SetTimeoutDuration failed with status %x", ioReturnValue); return -1; } memset(&senseData, 0, sizeof(senseData)); ioReturnValue = (*cmd)->ExecuteTaskSync(cmd,&senseData, &status, & bytesTransferred); if (ioReturnValue != kIOReturnSuccess) { cdio_warn("Command execution failed with status %x", ioReturnValue); return -1; } if (cmd != NULL) { (*cmd)->Release(cmd); } return (ret); #endif } #endif /* 0*/ /*************************************************************************** * GetDeviceIterator - Gets an io_iterator_t for our class type ***************************************************************************/ static io_iterator_t GetDeviceIterator ( const char * deviceClass ) { IOReturn err = kIOReturnSuccess; io_iterator_t iterator = MACH_PORT_NULL; err = IOServiceGetMatchingServices ( kIOMasterPortDefault, IOServiceMatching ( deviceClass ), &iterator ); cdio_assert ( err == kIOReturnSuccess ); return iterator; } /*************************************************************************** * GetFeaturesFlagsForDrive -Gets the bitfield which represents the * features flags. ***************************************************************************/ static bool GetFeaturesFlagsForDrive ( CFDictionaryRef dict, uint32_t *i_cdFlags, uint32_t *i_dvdFlags ) { CFDictionaryRef propertiesDict = 0; CFNumberRef flagsNumberRef = 0; *i_cdFlags = 0; *i_dvdFlags= 0; propertiesDict = ( CFDictionaryRef ) CFDictionaryGetValue ( dict, CFSTR ( kIOPropertyDeviceCharacteristicsKey ) ); if ( propertiesDict == 0 ) return false; /* Get the CD features */ flagsNumberRef = ( CFNumberRef ) CFDictionaryGetValue ( propertiesDict, CFSTR ( kIOPropertySupportedCDFeatures ) ); if ( flagsNumberRef != 0 ) { CFNumberGetValue ( flagsNumberRef, kCFNumberLongType, i_cdFlags ); } /* Get the DVD features */ flagsNumberRef = ( CFNumberRef ) CFDictionaryGetValue ( propertiesDict, CFSTR ( kIOPropertySupportedDVDFeatures ) ); if ( flagsNumberRef != 0 ) { CFNumberGetValue ( flagsNumberRef, kCFNumberLongType, i_dvdFlags ); } return true; } /** Get disc type associated with the cd object. */ static discmode_t get_discmode_osx (void *p_user_data) { _img_private_t *p_env = p_user_data; char str[10]; int32_t i_discmode = CDIO_DISC_MODE_ERROR; CFDictionaryRef propertiesDict = 0; CFStringRef data; propertiesDict = GetRegistryEntryProperties ( p_env->MediaClass_service ); if ( propertiesDict == 0 ) return i_discmode; data = ( CFStringRef ) CFDictionaryGetValue ( propertiesDict, CFSTR ( kIODVDMediaTypeKey ) ); if( CFStringGetCString( data, str, sizeof(str), kCFStringEncodingASCII ) ) { if (0 == strncmp(str, "DVD+R", strlen(str)) ) i_discmode = CDIO_DISC_MODE_DVD_PR; else if (0 == strncmp(str, "DVD+RW", strlen(str)) ) i_discmode = CDIO_DISC_MODE_DVD_PRW; else if (0 == strncmp(str, "DVD-R", strlen(str)) ) i_discmode = CDIO_DISC_MODE_DVD_R; else if (0 == strncmp(str, "DVD-RW", strlen(str)) ) i_discmode = CDIO_DISC_MODE_DVD_RW; else if (0 == strncmp(str, "DVD-ROM", strlen(str)) ) i_discmode = CDIO_DISC_MODE_DVD_ROM; else if (0 == strncmp(str, "DVD-RAM", strlen(str)) ) i_discmode = CDIO_DISC_MODE_DVD_RAM; else if (0 == strncmp(str, "CD-ROM", strlen(str)) ) i_discmode = CDIO_DISC_MODE_CD_DATA; else if (0 == strncmp(str, "CDR", strlen(str)) ) i_discmode = CDIO_DISC_MODE_CD_DATA; else if (0 == strncmp(str, "CDRW", strlen(str)) ) i_discmode = CDIO_DISC_MODE_CD_DATA; //?? Handled by below? CFRelease( data ); } CFRelease( propertiesDict ); if (CDIO_DISC_MODE_CD_DATA == i_discmode) { /* Need to do more classification */ return get_discmode_cd_generic(p_user_data); } return i_discmode; } static io_service_t get_drive_service_osx(const _img_private_t *p_env) { io_service_t service; io_iterator_t service_iterator; service_iterator = GetDeviceIterator ( kIOCDBlockStorageDeviceClassString ); if( service_iterator == MACH_PORT_NULL ) return 0; service = IOIteratorNext( service_iterator ); if( service == 0 ) return 0; do { char psz_service[MAX_SERVICE_NAME]; IORegistryEntryGetPath(service, kIOServicePlane, psz_service); psz_service[MAX_SERVICE_NAME-1] = '\0'; /* FIXME: This is all hoaky. Here we need info from a parent class, psz_service of what we opened above. We are relying on the fact that the name will be a substring of the name we openned with. */ if (0 == strncmp(psz_service, p_env->psz_MediaClass_service, strlen(psz_service))) { /* Found our device */ IOObjectRelease( service_iterator ); return service; } IOObjectRelease( service ); } while( ( service = IOIteratorNext( service_iterator ) ) != 0 ); IOObjectRelease( service_iterator ); return service; } static void get_drive_cap_osx(const void *p_user_data, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) { const _img_private_t *p_env = p_user_data; uint32_t i_cdFlags; uint32_t i_dvdFlags; io_service_t service = get_drive_service_osx(p_env); if( service == 0 ) goto err_exit; /* Found our device */ { CFDictionaryRef properties = GetRegistryEntryProperties ( service ); if (! GetFeaturesFlagsForDrive ( properties, &i_cdFlags, &i_dvdFlags ) ) { IOObjectRelease( service ); goto err_exit; } /* Reader */ if ( 0 != (i_cdFlags & kCDFeaturesAnalogAudioMask) ) *p_read_cap |= CDIO_DRIVE_CAP_READ_AUDIO; if ( 0 != (i_cdFlags & kCDFeaturesWriteOnceMask) ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_R; if ( 0 != (i_cdFlags & kCDFeaturesCDDAStreamAccurateMask) ) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_DA; if ( 0 != (i_dvdFlags & kDVDFeaturesReadStructuresMask) ) *p_read_cap |= CDIO_DRIVE_CAP_READ_DVD_ROM; if ( 0 != (i_cdFlags & kCDFeaturesReWriteableMask) ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW; if ( 0 != (i_dvdFlags & kDVDFeaturesWriteOnceMask) ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R; if ( 0 != (i_dvdFlags & kDVDFeaturesRandomWriteableMask) ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM; if ( 0 != (i_dvdFlags & kDVDFeaturesReWriteableMask) ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RW; /*** if ( 0 != (i_dvdFlags & kDVDFeaturesPlusRMask) ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_PR; if ( 0 != (i_dvdFlags & kDVDFeaturesPlusRWMask ) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_PRW; ***/ /* FIXME: fill out. For now assume CD-ROM is relatively modern. */ *p_misc_cap = ( CDIO_DRIVE_CAP_MISC_CLOSE_TRAY | CDIO_DRIVE_CAP_MISC_EJECT | CDIO_DRIVE_CAP_MISC_LOCK | CDIO_DRIVE_CAP_MISC_SELECT_SPEED | CDIO_DRIVE_CAP_MISC_MULTI_SESSION | CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED | CDIO_DRIVE_CAP_MISC_RESET | CDIO_DRIVE_CAP_READ_MCN | CDIO_DRIVE_CAP_READ_ISRC ); IOObjectRelease( service ); } return; err_exit: *p_misc_cap = *p_write_cap = *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN; return; } #if 1 /**************************************************************************** * GetDriveDescription - Gets drive description. ****************************************************************************/ static bool get_hwinfo_osx ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info) { _img_private_t *p_env = (_img_private_t *) p_cdio->env; io_service_t service = get_drive_service_osx(p_env); if ( service == 0 ) return false; /* Found our device */ { CFStringRef vendor = NULL; CFStringRef product = NULL; CFStringRef revision = NULL; CFDictionaryRef properties = GetRegistryEntryProperties ( service ); CFDictionaryRef deviceDict = ( CFDictionaryRef ) CFDictionaryGetValue ( properties, CFSTR ( kIOPropertyDeviceCharacteristicsKey ) ); if ( deviceDict == 0 ) return false; vendor = ( CFStringRef ) CFDictionaryGetValue ( deviceDict, CFSTR ( kIOPropertyVendorNameKey ) ); if ( CFStringGetCString( vendor, (char *) &(hw_info->psz_vendor), sizeof(hw_info->psz_vendor), kCFStringEncodingASCII ) ) CFRelease( vendor ); product = ( CFStringRef ) CFDictionaryGetValue ( deviceDict, CFSTR ( kIOPropertyProductNameKey ) ); if ( CFStringGetCString( product, (char *) &(hw_info->psz_model), sizeof(hw_info->psz_model), kCFStringEncodingASCII ) ) CFRelease( product ); revision = ( CFStringRef ) CFDictionaryGetValue ( deviceDict, CFSTR ( kIOPropertyProductRevisionLevelKey ) ); if ( CFStringGetCString( revision, (char *) &(hw_info->psz_revision), sizeof(hw_info->psz_revision), kCFStringEncodingASCII ) ) CFRelease( revision ); } return true; } #endif static void _free_osx (void *p_user_data) { _img_private_t *p_env = p_user_data; if (NULL == p_env) return; if (p_env->gen.fd != -1) close(p_env->gen.fd); if (p_env->MediaClass_service) IOObjectRelease( p_env->MediaClass_service ); cdio_generic_free(p_env); if (NULL != p_env->pp_lba) free((void *) p_env->pp_lba); if (NULL != p_env->pTOC) free((void *) p_env->pTOC); if (p_env->scsi_task) (*p_env->scsi_task)->Release(p_env->scsi_task); if (p_env->pp_scsiTaskDeviceInterface) (*p_env->pp_scsiTaskDeviceInterface) -> ReleaseExclusiveAccess(p_env->pp_scsiTaskDeviceInterface); if (p_env->pp_scsiTaskDeviceInterface) (*p_env->pp_scsiTaskDeviceInterface) -> Release ( p_env->pp_scsiTaskDeviceInterface ); if (p_env->mmc) (*p_env->mmc)->Release(p_env->mmc); if (p_env->plugin) IODestroyPlugInInterface(p_env->plugin); } /** Reads i_blocks of data sectors from cd device into p_data starting from i_lsn. Returns DRIVER_OP_SUCCESS if no error. */ static driver_return_code_t read_data_sectors_osx (void *p_user_data, void *p_data, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; if (!p_user_data) return DRIVER_OP_UNINIT; { dk_cd_read_t cd_read; track_t i_track = cdio_get_track(p_env->gen.cdio, i_lsn); memset( &cd_read, 0, sizeof(cd_read) ); cd_read.sectorArea = kCDSectorAreaUser; cd_read.buffer = p_data; /* FIXME: Do I have to put use get_track_green_osx? */ switch(get_track_format_osx(p_user_data, i_track)) { case TRACK_FORMAT_CDI: case TRACK_FORMAT_DATA: cd_read.sectorType = kCDSectorTypeMode1; cd_read.offset = i_lsn * kCDSectorSizeMode1; break; case TRACK_FORMAT_XA: cd_read.sectorType = kCDSectorTypeMode2; cd_read.offset = i_lsn * kCDSectorSizeMode2; break; default: return DRIVER_OP_ERROR; } cd_read.bufferLength = i_blocksize * i_blocks; if( ioctl( p_env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 ) { cdio_info( "could not read block %d, %s", i_lsn, strerror(errno) ); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } } /** Reads i_blocks of mode2 form2 sectors from cd device into data starting from i_lsn. Returns 0 if no error. */ static driver_return_code_t read_mode1_sectors_osx (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; dk_cd_read_t cd_read; memset( &cd_read, 0, sizeof(cd_read) ); cd_read.sectorArea = kCDSectorAreaUser; cd_read.buffer = p_data; cd_read.sectorType = kCDSectorTypeMode1; if (b_form2) { cd_read.offset = i_lsn * kCDSectorSizeMode2; cd_read.bufferLength = kCDSectorSizeMode2 * i_blocks; } else { cd_read.offset = i_lsn * kCDSectorSizeMode1; cd_read.bufferLength = kCDSectorSizeMode1 * i_blocks; } if( ioctl( p_env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 ) { cdio_info( "could not read block %d, %s", i_lsn, strerror(errno) ); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Reads i_blocks of mode2 form2 sectors from cd device into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error. */ static driver_return_code_t read_mode2_sectors_osx (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2, uint32_t i_blocks) { _img_private_t *p_env = p_user_data; dk_cd_read_t cd_read; memset( &cd_read, 0, sizeof(cd_read) ); cd_read.sectorArea = kCDSectorAreaUser; cd_read.buffer = p_data; if (b_form2) { cd_read.offset = i_lsn * kCDSectorSizeMode2Form2; cd_read.sectorType = kCDSectorTypeMode2Form2; cd_read.bufferLength = kCDSectorSizeMode2Form2 * i_blocks; } else { cd_read.offset = i_lsn * kCDSectorSizeMode2Form1; cd_read.sectorType = kCDSectorTypeMode2Form1; cd_read.bufferLength = kCDSectorSizeMode2Form1 * i_blocks; } if( ioctl( p_env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 ) { cdio_info( "could not read block %d, %s", i_lsn, strerror(errno) ); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Reads a single audio sector from CD device into p_data starting from lsn. Returns 0 if no error. */ static int read_audio_sectors_osx (void *user_data, void *p_data, lsn_t lsn, unsigned int i_blocks) { _img_private_t *env = user_data; dk_cd_read_t cd_read; memset( &cd_read, 0, sizeof(cd_read) ); cd_read.offset = lsn * kCDSectorSizeCDDA; cd_read.sectorArea = kCDSectorAreaUser; cd_read.sectorType = kCDSectorTypeCDDA; cd_read.buffer = p_data; cd_read.bufferLength = kCDSectorSizeCDDA * i_blocks; if( ioctl( env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 ) { cdio_info( "could not read block %d\n%s", lsn, strerror(errno)); return DRIVER_OP_ERROR; } return DRIVER_OP_SUCCESS; } /** Reads a single mode2 sector from cd device into p_data starting from lsn. Returns 0 if no error. */ static driver_return_code_t read_mode1_sector_osx (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2) { return read_mode1_sectors_osx(p_user_data, p_data, i_lsn, b_form2, 1); } /** Reads a single mode2 sector from cd device into p_data starting from lsn. Returns 0 if no error. */ static driver_return_code_t read_mode2_sector_osx (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2) { return read_mode2_sectors_osx(p_user_data, p_data, i_lsn, b_form2, 1); } /** Set the key "arg" to "value" in source device. */ static driver_return_code_t _set_arg_osx (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return DRIVER_OP_ERROR; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { if (!strcmp(value, "OSX")) p_env->access_mode = _AM_OSX; else cdio_warn ("unknown access type: %s. ignored.", value); } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } #if 0 static void TestDevice(_img_private_t *p_env, io_service_t service) { SInt32 score; HRESULT herr; kern_return_t err; IOCFPlugInInterface **plugInInterface = NULL; MMCDeviceInterface **mmcInterface = NULL; /* Create the IOCFPlugIn interface so we can query it. */ err = IOCreatePlugInInterfaceForService ( service, kIOMMCDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score ); if ( err != noErr ) { printf("IOCreatePlugInInterfaceForService returned %d\n", err); return; } /* Query the interface for the MMCDeviceInterface. */ herr = ( *plugInInterface )->QueryInterface ( plugInInterface, CFUUIDGetUUIDBytes ( kIOMMCDeviceInterfaceID ), ( LPVOID ) &mmcInterface ); if ( herr != S_OK ) { printf("QueryInterface returned %ld\n", herr); return; } p_env->pp_scsiTaskDeviceInterface = ( *mmcInterface )->GetSCSITaskDeviceInterface ( mmcInterface ); if ( NULL == p_env->pp_scsiTaskDeviceInterface ) { printf("GetSCSITaskDeviceInterface returned NULL\n"); return; } ( *mmcInterface )->Release ( mmcInterface ); IODestroyPlugInInterface ( plugInInterface ); } #endif /** Read and cache the CD's Track Table of Contents and track info. Return false if successful or true if an error. */ static bool read_toc_osx (void *p_user_data) { _img_private_t *p_env = p_user_data; CFDictionaryRef propertiesDict = 0; CFDataRef data; /* create a CF dictionary containing the TOC */ propertiesDict = GetRegistryEntryProperties( p_env->MediaClass_service ); if ( 0 == propertiesDict ) { return false; } /* get the TOC from the dictionary */ data = (CFDataRef) CFDictionaryGetValue( propertiesDict, CFSTR(kIOCDMediaTOCKey) ); if ( data != NULL ) { CFRange range; CFIndex buf_len; buf_len = CFDataGetLength( data ); range = CFRangeMake( 0, buf_len ); if( ( p_env->pTOC = (CDTOC *)malloc( buf_len ) ) != NULL ) { CFDataGetBytes( data, range, (u_char *) p_env->pTOC ); } else { cdio_warn( "Trouble allocating CDROM TOC" ); CFRelease( propertiesDict ); return false; } } else { cdio_warn( "Trouble reading TOC" ); CFRelease( propertiesDict ); return false; } /* TestDevice(p_env, service); */ CFRelease( propertiesDict ); p_env->i_descriptors = CDTOCGetDescriptorCount ( p_env->pTOC ); /* Read in starting sectors. There may be non-tracks mixed in with the real tracks. So find the first and last track number by scanning. Also find the lead-out track position. */ { int i, i_leadout = -1; CDTOCDescriptor *pTrackDescriptors; p_env->pp_lba = malloc( p_env->i_descriptors * sizeof(int) ); if( p_env->pp_lba == NULL ) { cdio_warn("Out of memory in allocating track starting LSNs" ); free( p_env->pTOC ); return false; } pTrackDescriptors = p_env->pTOC->descriptors; p_env->gen.i_first_track = CDIO_CD_MAX_TRACKS+1; p_env->i_last_track = CDIO_CD_MIN_TRACK_NO; p_env->i_first_session = CDIO_CD_MAX_TRACKS+1; p_env->i_last_session = CDIO_CD_MIN_TRACK_NO; for( i = 0; i < p_env->i_descriptors; i++ ) { track_t i_track = pTrackDescriptors[i].point; session_t i_session = pTrackDescriptors[i].session; cdio_debug( "point: %d, tno: %d, session: %d, adr: %d, control:%d, " "address: %d:%d:%d, p: %d:%d:%d", i_track, pTrackDescriptors[i].tno, i_session, pTrackDescriptors[i].adr, pTrackDescriptors[i].control, pTrackDescriptors[i].address.minute, pTrackDescriptors[i].address.second, pTrackDescriptors[i].address.frame, pTrackDescriptors[i].p.minute, pTrackDescriptors[i].p.second, pTrackDescriptors[i].p.frame ); /* track information has adr = 1 */ if ( 0x01 != pTrackDescriptors[i].adr ) continue; if( i_track == OSX_CDROM_LEADOUT_TRACK ) i_leadout = i; if( i_track > CDIO_CD_MAX_TRACKS || i_track < CDIO_CD_MIN_TRACK_NO ) continue; if (p_env->gen.i_first_track > i_track) p_env->gen.i_first_track = i_track; if (p_env->i_last_track < i_track) p_env->i_last_track = i_track; if (p_env->i_first_session > i_session) p_env->i_first_session = i_session; if (p_env->i_last_session < i_session) p_env->i_last_session = i_session; } /* Now that we know what the first track number is, we can make sure index positions are ordered starting at 0. */ for( i = 0; i < p_env->i_descriptors; i++ ) { track_t i_track = pTrackDescriptors[i].point; if( i_track > CDIO_CD_MAX_TRACKS || i_track < CDIO_CD_MIN_TRACK_NO ) continue; /* Note what OSX calls a LBA we call an LSN. So below re we really have have MSF -> LSN -> LBA. */ p_env->pp_lba[i_track - p_env->gen.i_first_track] = cdio_lsn_to_lba(CDConvertMSFToLBA( pTrackDescriptors[i].p )); set_track_flags(&(p_env->gen.track_flags[i_track]), pTrackDescriptors[i].control); } if( i_leadout == -1 ) { cdio_warn( "CD leadout not found" ); free( p_env->pp_lba ); free( (void *) p_env->pTOC ); return false; } /* Set leadout sector. Note what OSX calls a LBA we call an LSN. So below re we really have have MSF -> LSN -> LBA. */ p_env->pp_lba[TOTAL_TRACKS] = cdio_lsn_to_lba(CDConvertMSFToLBA( pTrackDescriptors[i_leadout].p )); p_env->gen.i_tracks = TOTAL_TRACKS; } p_env->gen.toc_init = true; return( true ); } /** Return the starting LSN track number i_track in obj. Track numbers start at 1. The "leadout" track is specified either by using i_track LEADOUT_TRACK or the total tracks+1. False is returned if there is no track entry. */ static lsn_t get_track_lba_osx(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if (!p_env->gen.toc_init) read_toc_osx (p_env) ; if (!p_env->gen.toc_init) return CDIO_INVALID_LSN; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->i_last_track+1; if (i_track > p_env->i_last_track + 1 || i_track < p_env->gen.i_first_track) { return CDIO_INVALID_LSN; } else { return p_env->pp_lba[i_track - p_env->gen.i_first_track]; } } /** Eject media . Return DRIVER_OP_SUCCESS if successful. The only way to cleanly unmount the disc under MacOS X (before Tiger) is to use the 'disktool' command line utility. It uses the non-public DiskArbitration API, which can not be used by Cocoa or Carbon applications. Since Tiger (MacOS X 10.4), DiskArbitration is a public framework and we can use it as needed. */ #ifndef HAVE_DISKARBITRATION static driver_return_code_t _eject_media_osx (void *user_data) { _img_private_t *p_env = user_data; FILE *p_file; char *psz_drive; char sz_cmd[32]; if( ( psz_drive = (char *)strstr( p_env->gen.source_name, "disk" ) ) != NULL && strlen( psz_drive ) > 4 ) { #define EJECT_CMD "/usr/sbin/hdiutil eject %s" snprintf( sz_cmd, sizeof(sz_cmd), EJECT_CMD, psz_drive ); #undef EJECT_CMD if( ( p_file = popen( sz_cmd, "r" ) ) != NULL ) { char psz_result[0x200]; int i_ret = fread( psz_result, 1, sizeof(psz_result) - 1, p_file ); if( i_ret == 0 && ferror( p_file ) != 0 ) { pclose( p_file ); return DRIVER_OP_ERROR; } pclose( p_file ); psz_result[ i_ret ] = 0; if( strstr( psz_result, "Disk Ejected" ) != NULL ) { return DRIVER_OP_SUCCESS; } } } return DRIVER_OP_ERROR; } #else /* HAVE_DISKARBITRATION */ typedef struct dacontext_s { int result; Boolean completed; DASessionRef session; CFRunLoopRef runloop; CFRunLoopSourceRef cancel; } dacontext_t; static void cancel_runloop(void *info) { /* do nothing */ } static CFRunLoopSourceContext cancelRunLoopSourceContext = { .perform = cancel_runloop }; static void media_eject_callback(DADiskRef disk, DADissenterRef dissenter, void *context) { dacontext_t *dacontext = (dacontext_t *)context; if ( dissenter ) { CFStringRef status = DADissenterGetStatusString(dissenter); if (status) { size_t cstr_size = CFStringGetLength(status); char *cstr = malloc(cstr_size); if ( CFStringGetCString( status, cstr, cstr_size, kCFStringEncodingASCII ) ) CFRelease( status ); cdio_warn("%s", cstr); free(cstr); } } dacontext->result = (dissenter ? DRIVER_OP_ERROR : DRIVER_OP_SUCCESS); dacontext->completed = TRUE; CFRunLoopSourceSignal(dacontext->cancel); CFRunLoopWakeUp(dacontext->runloop); } static void media_unmount_callback(DADiskRef disk, DADissenterRef dissenter, void *context) { dacontext_t *dacontext = (dacontext_t *)context; if (!dissenter) { DADiskEject(disk, kDADiskEjectOptionDefault, media_eject_callback, context); dacontext->result = dacontext->result == DRIVER_OP_UNINIT ? DRIVER_OP_SUCCESS : dacontext->result; } else { dacontext->result = DRIVER_OP_ERROR; dacontext->completed = TRUE; CFRunLoopSourceSignal(dacontext->cancel); CFRunLoopWakeUp(dacontext->runloop); } } static driver_return_code_t _eject_media_osx (void *user_data) { _img_private_t *p_env = user_data; char *psz_drive; DADiskRef disk; dacontext_t dacontext; CFDictionaryRef description; if( ( psz_drive = (char *)strstr( p_env->gen.source_name, "disk" ) ) == NULL || strlen( psz_drive ) <= 4 ) { return DRIVER_OP_ERROR; } if (p_env->gen.fd != -1) close(p_env->gen.fd); p_env->gen.fd = -1; dacontext.result = DRIVER_OP_UNINIT; dacontext.completed = FALSE; dacontext.runloop = CFRunLoopGetCurrent(); dacontext.cancel = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &cancelRunLoopSourceContext); if (!dacontext.cancel) { return DRIVER_OP_ERROR; } if (!(dacontext.session = DASessionCreate(kCFAllocatorDefault))) { CFRelease(dacontext.cancel); return DRIVER_OP_ERROR; } if ((disk = DADiskCreateFromBSDName(kCFAllocatorDefault, dacontext.session, psz_drive)) != NULL) { if ((description = DADiskCopyDescription(disk)) != NULL) { /* Does the device need to be unmounted first? */ DASessionScheduleWithRunLoop(dacontext.session, dacontext.runloop, kCFRunLoopDefaultMode); CFRunLoopAddSource(dacontext.runloop, dacontext.cancel, kCFRunLoopDefaultMode); if (CFDictionaryGetValueIfPresent(description, kDADiskDescriptionVolumePathKey, NULL)) { DADiskUnmount(disk, kDADiskUnmountOptionWhole, media_unmount_callback, &dacontext); } else { DADiskEject(disk, kDADiskEjectOptionDefault, media_eject_callback, &dacontext); dacontext.result = dacontext.result == DRIVER_OP_UNINIT ? DRIVER_OP_SUCCESS : dacontext.result; } while (!dacontext.completed) { if (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 30.0, TRUE) == kCFRunLoopRunTimedOut) break; /* timeout after 30 seconds */ } CFRunLoopRemoveSource(dacontext.runloop, dacontext.cancel, kCFRunLoopDefaultMode); DASessionUnscheduleFromRunLoop(dacontext.session, dacontext.runloop, kCFRunLoopDefaultMode); CFRelease(description); } CFRelease(disk); } CFRunLoopSourceInvalidate(dacontext.cancel); CFRelease(dacontext.cancel); CFRelease(dacontext.session); return dacontext.result; } #endif /** Return the size of the CD in logical block address (LBA) units. */ static lsn_t get_disc_last_lsn_osx (void *user_data) { return get_track_lba_osx(user_data, CDIO_CDROM_LEADOUT_TRACK); } /** Return the value associated with the key "arg". */ static const char * _get_arg_osx (void *user_data, const char key[]) { _img_private_t *p_env = user_data; if (!strcmp (key, "source")) { return p_env->gen.source_name; } else if (!strcmp (key, "access-mode")) { switch (p_env->access_mode) { case _AM_OSX: return "OS X"; case _AM_NONE: return "no access method"; } } return NULL; } /** Read CD-Text binary data. */ static uint8_t * read_cdtext_osx(void *p_user_data) { _img_private_t *p_env = p_user_data; dk_cd_read_toc_t cd_read; size_t size = CDTEXT_LEN_BINARY_MAX + 4; uint8_t *data = malloc(size); memset( &cd_read, 0, sizeof(cd_read) ); memset( data, 0, size ); cd_read.format = kCDTOCFormatTEXT; cd_read.formatAsTime = 0; cd_read.bufferLength = size; cd_read.buffer = data; if ( ioctl( p_env->gen.fd, DKIOCCDREADTOC, &cd_read ) < 0 ) { cdio_debug( "could not read CD-Text, %s", strerror(errno) ); free( data ); return NULL; } return data; } /** Read CD-Text and return cdtext_t structure. */ static cdtext_t * get_cdtext_osx (void *p_user_data) { generic_img_private_t *p_env = p_user_data; uint8_t *p_cdtext_data = NULL; size_t len; if (!p_env) return NULL; if (p_env->b_cdtext_error) return NULL; if (NULL == p_env->cdtext) { p_cdtext_data = read_cdtext_osx (p_env); if (NULL != p_cdtext_data) { len = CDIO_MMC_GET_LEN16(p_cdtext_data)-2; p_env->cdtext = cdtext_init(); if(len <= 0 || 0 != cdtext_data_init (p_env->cdtext, &p_cdtext_data[4], len)) { p_env->b_cdtext_error = true; cdtext_destroy (p_env->cdtext); p_env->cdtext = NULL; } free(p_cdtext_data); } } return p_env->cdtext; } /** Return the media catalog number MCN. */ static char * get_mcn_osx (const void *user_data) { const _img_private_t *p_env = user_data; dk_cd_read_mcn_t cd_read; memset( &cd_read, 0, sizeof(cd_read) ); if( ioctl( p_env->gen.fd, DKIOCCDREADMCN, &cd_read ) < 0 ) { cdio_debug( "could not read MCN, %s", strerror(errno) ); return NULL; } return strdup((char*)cd_read.mcn); } /** Return the international standard recording code ISRC. */ static char * get_track_isrc_osx (const void *user_data, track_t i_track) { const _img_private_t *p_env = user_data; dk_cd_read_isrc_t cd_read; memset( &cd_read, 0, sizeof(cd_read) ); cd_read.track = i_track; if( ioctl( p_env->gen.fd, DKIOCCDREADISRC, &cd_read ) < 0 ) { cdio_debug( "could not read ISRC, %s", strerror(errno) ); return NULL; } return strdup((char*)cd_read.isrc); } /** Get format of track. */ static track_format_t get_track_format_osx(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; dk_cd_read_track_info_t cd_read; CDTrackInfo a_track; if (!p_env->gen.toc_init) read_toc_osx (p_env) ; if (i_track > p_env->i_last_track || i_track < p_env->gen.i_first_track) return TRACK_FORMAT_ERROR; memset( &cd_read, 0, sizeof(cd_read) ); cd_read.address = i_track; cd_read.addressType = kCDTrackInfoAddressTypeTrackNumber; cd_read.buffer = &a_track; cd_read.bufferLength = sizeof(CDTrackInfo); if( ioctl( p_env->gen.fd, DKIOCCDREADTRACKINFO, &cd_read ) == -1 ) { cdio_warn( "could not read trackinfo for track %d:\n%s", i_track, strerror(errno)); return TRACK_FORMAT_ERROR; } cdio_debug( "%d: trackinfo trackMode: %x dataMode: %x", i_track, a_track.trackMode, a_track.dataMode ); if (a_track.trackMode == CDIO_CDROM_DATA_TRACK) { if (a_track.dataMode == CDROM_CDI_TRACK) { return TRACK_FORMAT_CDI; } else if (a_track.dataMode == CDROM_XA_TRACK) { return TRACK_FORMAT_XA; } else { return TRACK_FORMAT_DATA; } } else { return TRACK_FORMAT_AUDIO; } } /** Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool get_track_green_osx(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; CDTrackInfo a_track; if (!p_env->gen.toc_init) read_toc_osx (p_env) ; if ( i_track > p_env->i_last_track || i_track < p_env->gen.i_first_track ) return false; else { dk_cd_read_track_info_t cd_read; memset( &cd_read, 0, sizeof(cd_read) ); cd_read.address = i_track; cd_read.addressType = kCDTrackInfoAddressTypeTrackNumber; cd_read.buffer = &a_track; cd_read.bufferLength = sizeof(CDTrackInfo); if( ioctl( p_env->gen.fd, DKIOCCDREADTRACKINFO, &cd_read ) == -1 ) { cdio_warn( "could not read trackinfo for track %d:\n%s", i_track, strerror(errno)); return false; } return ((a_track.trackMode & CDIO_CDROM_DATA_TRACK) != 0); } } /* Set CD-ROM drive speed */ static int set_speed_osx (void *p_user_data, int i_speed) { const _img_private_t *p_env = p_user_data; if (!p_env) return -1; return ioctl(p_env->gen.fd, DKIOCCDSETSPEED, i_speed); } #endif /* HAVE_DARWIN_CDROM */ /** Close tray on CD-ROM. @param psz_drive the CD-ROM drive to be closed. */ /* FIXME: We don't use the device name because we don't how to. */ #define CLOSE_TRAY_CMD "/usr/sbin/drutil tray close" driver_return_code_t close_tray_osx (const char *psz_drive) { #ifdef HAVE_DARWIN_CDROM FILE *p_file; char sz_cmd[80]; if ( !psz_drive) return DRIVER_OP_UNINIT; /* Right now we really aren't making use of snprintf, but possibly someday we will. */ snprintf( sz_cmd, sizeof(sz_cmd), CLOSE_TRAY_CMD ); if( ( p_file = popen( sz_cmd, "r" ) ) != NULL ) { char psz_result[0x200]; int i_ret = fread( psz_result, 1, sizeof(psz_result) - 1, p_file ); if( i_ret == 0 && ferror( p_file ) != 0 ) { pclose( p_file ); return DRIVER_OP_ERROR; } pclose( p_file ); psz_result[ i_ret ] = 0; if( 0 == i_ret ) { return DRIVER_OP_SUCCESS; } } return DRIVER_OP_ERROR; #else return DRIVER_OP_NO_DRIVER; #endif /*HAVE_DARWIN_CDROM*/ } /** Return a string containing the default CD device if none is specified. */ char ** cdio_get_devices_osx(void) { #ifndef HAVE_DARWIN_CDROM return NULL; #else io_object_t next_media; mach_port_t master_port; kern_return_t kern_result; io_iterator_t media_iterator; CFMutableDictionaryRef classes_to_match; char **drives = NULL; unsigned int num_drives=0; /* Probe devices to get up to date information. */ ProbeStorageDevices(); kern_result = IOMasterPort( MACH_PORT_NULL, &master_port ); if( kern_result != KERN_SUCCESS ) { return( NULL ); } classes_to_match = IOServiceMatching( kIOMediaClass ); if( classes_to_match == NULL ) { return( NULL ); } CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaEjectableKey), kCFBooleanTrue ); CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaWholeKey), kCFBooleanTrue ); kern_result = IOServiceGetMatchingServices( master_port, classes_to_match, &media_iterator ); if( kern_result != KERN_SUCCESS ) { return( NULL ); } next_media = IOIteratorNext( media_iterator ); if( next_media != 0 ) { char psz_buf[0x32]; size_t dev_path_length; CFTypeRef str_bsd_path; do { str_bsd_path = IORegistryEntryCreateCFProperty( next_media, CFSTR( kIOBSDNameKey ), kCFAllocatorDefault, 0 ); if( str_bsd_path == NULL ) { IOObjectRelease( next_media ); continue; } /* Below, by appending 'r' to the BSD node name, we indicate a raw disk. Raw disks receive I/O requests directly and don't go through a buffer cache. */ snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' ); dev_path_length = strlen( psz_buf ); if( CFStringGetCString( str_bsd_path, (char*)&psz_buf + dev_path_length, sizeof(psz_buf) - dev_path_length, kCFStringEncodingASCII ) ) { cdio_add_device_list(&drives, strdup(psz_buf), &num_drives); } CFRelease( str_bsd_path ); IOObjectRelease( next_media ); } while( ( next_media = IOIteratorNext( media_iterator ) ) != 0 ); } IOObjectRelease( media_iterator ); cdio_add_device_list(&drives, NULL, &num_drives); return drives; #endif /* HAVE_DARWIN_CDROM */ } /** Return a string containing the default CD device if none is specified. */ char * cdio_get_default_device_osx(void) { #ifndef HAVE_DARWIN_CDROM return NULL; #else io_object_t next_media; kern_return_t kern_result; io_iterator_t media_iterator; CFMutableDictionaryRef classes_to_match; /* Probe devices to get up to date information. */ ProbeStorageDevices(); classes_to_match = IOServiceMatching( kIOMediaClass ); if( classes_to_match == NULL ) { return( NULL ); } CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaEjectableKey), kCFBooleanTrue ); CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaWholeKey), kCFBooleanTrue ); kern_result = IOServiceGetMatchingServices( kIOMasterPortDefault, classes_to_match, &media_iterator ); if( kern_result != KERN_SUCCESS ) { return( NULL ); } next_media = IOIteratorNext( media_iterator ); if( next_media != 0 ) { char psz_buf[0x32]; size_t dev_path_length; CFTypeRef str_bsd_path; do { /* Skip other removable media, like USB flash memory keys: */ if (!IOObjectConformsTo(next_media, kIODVDMediaClass) && !IOObjectConformsTo(next_media, kIOCDMediaClass) && !IOObjectConformsTo(next_media, kIOBDMediaClass)) continue; str_bsd_path = IORegistryEntryCreateCFProperty( next_media, CFSTR( kIOBSDNameKey ), kCFAllocatorDefault, 0 ); if( str_bsd_path == NULL ) { IOObjectRelease( next_media ); continue; } snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' ); dev_path_length = strlen( psz_buf ); if( CFStringGetCString( str_bsd_path, (char*)&psz_buf + dev_path_length, sizeof(psz_buf) - dev_path_length, kCFStringEncodingASCII ) ) { CFRelease( str_bsd_path ); IOObjectRelease( next_media ); IOObjectRelease( media_iterator ); return strdup( psz_buf ); } CFRelease( str_bsd_path ); IOObjectRelease( next_media ); } while( ( next_media = IOIteratorNext( media_iterator ) ) != 0 ); } IOObjectRelease( media_iterator ); cdio_warn ("cdio_get_default_device() - No CD/DVD/BD media - returning NULL"); return NULL; #endif /* HAVE_DARWIN_CDROM */ } /** Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_am_osx (const char *psz_source_name, const char *psz_access_mode) { if (psz_access_mode != NULL) cdio_warn ("there is only one access mode for OS X. Arg %s ignored", psz_access_mode); return cdio_open_osx(psz_source_name); } /** Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact *we* are the ones to set that up. */ CdIo_t * cdio_open_osx (const char *psz_orig_source) { #ifdef HAVE_DARWIN_CDROM CdIo_t *ret; _img_private_t *_data; char *psz_source; cdio_funcs_t _funcs = { .eject_media = _eject_media_osx, .free = _free_osx, .get_arg = _get_arg_osx, .get_cdtext = get_cdtext_osx, .get_cdtext_raw = read_cdtext_osx, .get_default_device = cdio_get_default_device_osx, .get_devices = cdio_get_devices_osx, .get_disc_last_lsn = get_disc_last_lsn_osx, .get_discmode = get_discmode_osx, .get_drive_cap = get_drive_cap_osx, .get_first_track_num = get_first_track_num_generic, .get_hwinfo = get_hwinfo_osx, .get_mcn = get_mcn_osx, .get_num_tracks = get_num_tracks_generic, .get_track_channels = get_track_channels_generic, .get_track_copy_permit = get_track_copy_permit_generic, .get_track_format = get_track_format_osx, .get_track_green = get_track_green_osx, .get_track_lba = get_track_lba_osx, .get_track_msf = NULL, .get_track_preemphasis = get_track_preemphasis_generic, .get_track_isrc = get_track_isrc_osx, .lseek = cdio_generic_lseek, .read = cdio_generic_read, .read_audio_sectors = read_audio_sectors_osx, .read_data_sectors = read_data_sectors_osx, .read_mode1_sector = read_mode1_sector_osx, .read_mode1_sectors = read_mode1_sectors_osx, .read_mode2_sector = read_mode2_sector_osx, .read_mode2_sectors = read_mode2_sectors_osx, .read_toc = read_toc_osx, .run_mmc_cmd = run_mmc_cmd_osx, .set_arg = _set_arg_osx, .set_speed = set_speed_osx, }; _data = calloc (1, sizeof (_img_private_t)); _data->access_mode = _AM_OSX; _data->MediaClass_service = 0; _data->gen.init = false; _data->gen.fd = -1; _data->gen.toc_init = false; _data->gen.b_cdtext_error = false; if (NULL == psz_orig_source) { psz_source=cdio_get_default_device_osx(); if (NULL == psz_source) { goto error_exit; } _set_arg_osx(_data, "source", psz_source); free(psz_source); } else { if (cdio_is_device_generic(psz_orig_source)) _set_arg_osx(_data, "source", psz_orig_source); else { /* The below would be okay if all device drivers worked this way. */ #if 0 cdio_info ("source %s is a not a device", psz_orig_source); #endif goto error_exit; } } ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) goto error_exit; ret->driver_id = DRIVER_OSX; if (cdio_generic_init(_data, O_RDONLY | O_NONBLOCK) && init_osx(_data)) { return ret; } free(ret); error_exit: cdio_generic_free(_data); return NULL; #else return NULL; #endif /* HAVE_DARWIN_CDROM */ } bool cdio_have_osx (void) { #ifdef HAVE_DARWIN_CDROM return true; #else return false; #endif /* HAVE_DARWIN_CDROM */ } libcdio-2.2.0/lib/driver/portable.h000066400000000000000000000030421474051130400171400ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This file contains definitions to fill in for differences or deficiencies to OS or compiler irregularities. If this file is included other routines can be more portable. */ #ifndef CDIO_DRIVER_PORTABLE_H_ #define CDIO_DRIVER_PORTABLE_H_ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #if !defined(HAVE_FTRUNCATE) # if defined (_WIN32) # define ftruncate chsize # endif #endif /*HAVE_FTRUNCATE*/ #if !defined(HAVE_SNPRINTF) # if defined (_MSC_VER) # define snprintf _snprintf # endif #endif /*HAVE_SNPRINTF*/ #if !defined(HAVE_VSNPRINTF) # if defined (_MSC_VER) # define vsnprintf _vsnprintf # endif #endif /*HAVE_SNPRINTF*/ #if !defined(HAVE_DRAND48) && defined(HAVE_RAND) # define drand48() (rand() / (double)RAND_MAX) #endif #endif /* CDIO_DRIVER_PORTABLE_H_ */ libcdio-2.2.0/lib/driver/read.c000066400000000000000000000262071474051130400162460ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** \file read.h * * \brief sector (block, frame)-related libcdio routines. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include "cdio_private.h" #include "cdio_assert.h" #ifdef HAVE_STRING_H #include #endif #define check_read_parms(p_cdio, p_buf, i_lsn) \ if (!p_cdio) return DRIVER_OP_UNINIT; \ if (!p_buf || CDIO_INVALID_LSN == i_lsn) \ return DRIVER_OP_ERROR; #define check_lsn(i_lsn) \ check_read_parms(p_cdio, p_buf, i_lsn); \ { \ lsn_t end_lsn = \ cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK); \ if ( i_lsn > end_lsn ) { \ cdio_info("Trying to access past end of disk lsn: %ld, end lsn: %ld", \ (long int) i_lsn, (long int) end_lsn); \ return DRIVER_OP_ERROR; \ } \ } #define check_lsn_blocks(i_lsn, i_blocks) \ check_read_parms(p_cdio, p_buf, i_lsn); \ { \ lsn_t end_lsn = \ cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK); \ if ( i_lsn > end_lsn ) { \ cdio_info("Trying to access past end of disk lsn: %ld, end lsn: %ld", \ (long int) i_lsn, (long int) end_lsn); \ return DRIVER_OP_ERROR; \ } \ /* Care is used in the expression below to be correct with */ \ /* respect to unsigned integers. */ \ if ( i_lsn + i_blocks > end_lsn + 1 ) { \ cdio_info("Request truncated to end disk; lsn: %ld, end lsn: %ld", \ (long int) i_lsn, (long int) end_lsn); \ i_blocks = end_lsn - i_lsn + 1; \ } \ } /*! lseek - reposition read/write file offset Returns (off_t) -1 on error. Similar to (if not the same as) libc's lseek() */ off_t cdio_lseek (const CdIo_t *p_cdio, off_t offset, int whence) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.lseek) return (p_cdio->op.lseek) (p_cdio->env, offset, whence); return DRIVER_OP_UNSUPPORTED; } /*! Reads into buf the next size bytes. Similar to (if not the same as) libc's read(). This is a "cooked" read, or one handled by the OS. It probably won't work on audio data. For that use cdio_read_audio_sector(s). @param p_cdio object to read from @param p_buf place to read data into. The caller should make sure this location can store at least i_size bytes. @param i_size number of bytes to read @return (ssize_t) -1 on error. */ ssize_t cdio_read (const CdIo_t *p_cdio, void *p_buf, size_t i_size) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.read) return (p_cdio->op.read) (p_cdio->env, p_buf, i_size); return DRIVER_OP_UNSUPPORTED; } /*! Reads an audio sector from cd device into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error. */ driver_return_code_t cdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn) { check_lsn(i_lsn); if (p_cdio->op.read_audio_sectors) return p_cdio->op.read_audio_sectors (p_cdio->env, p_buf, i_lsn, 1); return DRIVER_OP_UNSUPPORTED; } /*! Reads audio sectors from cd device into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error. */ driver_return_code_t cdio_read_audio_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, uint32_t i_blocks) { check_lsn_blocks(i_lsn, i_blocks); if (0 == i_blocks) return DRIVER_OP_SUCCESS; if (p_cdio->op.read_audio_sectors) { cdio_debug("Reading audio sector(s) lsn %u for %d blocks", i_lsn, i_blocks); return (p_cdio->op.read_audio_sectors) (p_cdio->env, p_buf, i_lsn, i_blocks); } return DRIVER_OP_UNSUPPORTED; } /*! Reads an audio sector from cd device into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error. */ driver_return_code_t cdio_read_data_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks) { check_lsn(i_lsn); if (0 == i_blocks) return DRIVER_OP_SUCCESS; if (p_cdio->op.read_data_sectors) { cdio_debug("Reading data sector(s) lsn, %u blocksize %d, for %d blocks", i_lsn, i_blocksize, i_blocks); return p_cdio->op.read_data_sectors (p_cdio->env, p_buf, i_lsn, i_blocksize, i_blocks); } return DRIVER_OP_UNSUPPORTED; } #ifndef SEEK_SET #define SEEK_SET 0 #endif /*! Reads a single mode1 form1 or form2 sector from cd device into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error. */ driver_return_code_t cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2) { uint32_t size = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ; check_lsn(i_lsn); if (p_cdio->op.read_mode1_sector) { cdio_debug("Reading mode 1 secto lsn %u", i_lsn); return p_cdio->op.read_mode1_sector(p_cdio->env, p_buf, i_lsn, b_form2); } else if (p_cdio->op.lseek && p_cdio->op.read) { char buf[M2RAW_SECTOR_SIZE] = { 0, }; if (0 > cdio_lseek(p_cdio, CDIO_CD_FRAMESIZE*i_lsn, SEEK_SET)) return -1; if (0 > cdio_read(p_cdio, buf, CDIO_CD_FRAMESIZE)) return -1; memcpy (p_buf, buf, size); return DRIVER_OP_SUCCESS; } return DRIVER_OP_UNSUPPORTED; } /*! Reads mode 1 sectors @param p_cdio object to read from @param buf place to read data into @param lsn sector to read @param b_form2 true for reading mode 1 form 2 sectors or false for mode 1 form 1 sectors. @param i_blocks number of sectors to read */ driver_return_code_t cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2, uint32_t i_blocks) { check_lsn_blocks(i_lsn, i_blocks); if (0 == i_blocks) return DRIVER_OP_SUCCESS; if (p_cdio->op.read_mode1_sectors) return (p_cdio->op.read_mode1_sectors) (p_cdio->env, p_buf, i_lsn, b_form2, i_blocks); return DRIVER_OP_UNSUPPORTED; } /*! Reads a mode 2 sector @param p_cdio object to read from @param buf place to read data into @param lsn sector to read @param b_form2 true for reading mode 2 form 2 sectors or false for mode 2 form 1 sectors. */ driver_return_code_t cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2) { check_lsn(i_lsn); if (p_cdio->op.read_mode2_sector) return p_cdio->op.read_mode2_sector (p_cdio->env, p_buf, i_lsn, b_form2); /* fallback */ if (p_cdio->op.read_mode2_sectors != NULL) return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, b_form2, 1); return DRIVER_OP_UNSUPPORTED; } /*! Reads mode 2 sectors @param p_cdio object to read from @param buf place to read data into @param lsn sector to read @param b_form2 true for reading mode2 form 2 sectors or false for mode 2 form 1 sectors. @param i_blocks number of sectors to read */ driver_return_code_t cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2, uint32_t i_blocks) { check_lsn_blocks(i_lsn, i_blocks); if (0 == i_blocks) return DRIVER_OP_SUCCESS; if (p_cdio->op.read_mode2_sectors) return (p_cdio->op.read_mode2_sectors) (p_cdio->env, p_buf, i_lsn, b_form2, i_blocks); return DRIVER_OP_UNSUPPORTED; } /** The special case of reading a single block is a common one so we provide a routine for that as a convenience. */ driver_return_code_t cdio_read_sector(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, cdio_read_mode_t read_mode) { return cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, 1); } /*! Reads a number of sectors (AKA blocks). @param p_buf place to read data into. The caller should make sure this location is large enough. See below for size information. @param read_mode the kind of "mode" to use in reading. @param i_lsn sector to read @param i_blocks number of sectors to read @return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations are returned on error. If read_mode is CDIO_MODE_AUDIO, *p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes. If read_mode is CDIO_MODE_DATA, *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE, M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of sector getting read. If you don't know whether you have a Mode 1/2, Form 1/ Form 2/Formless sector best to reserve space for the maximum which is M2RAW_SECTOR_SIZE. If read_mode is CDIO_MODE_M2F1, *p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes. If read_mode is CDIO_MODE_M2F2, *p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes. */ driver_return_code_t cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, cdio_read_mode_t read_mode, uint32_t i_blocks) { switch(read_mode) { case CDIO_READ_MODE_AUDIO: return cdio_read_audio_sectors (p_cdio, p_buf, i_lsn, i_blocks); case CDIO_READ_MODE_M1F1: return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, false, i_blocks); case CDIO_READ_MODE_M1F2: return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, true, i_blocks); case CDIO_READ_MODE_M2F1: return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, false, i_blocks); case CDIO_READ_MODE_M2F2: return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, true, i_blocks); } /* Can't happen. Just to shut up gcc. */ return DRIVER_OP_ERROR; } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/realpath.c000066400000000000000000000066601474051130400171340ustar00rootroot00000000000000/* Copyright (C) 2010, 2011 Rocky Bernstein Diego 'Flameeyes' Pettenò Thomas Schmitt 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* POSIX realpath if that's around, and something like it if not. To compile as a standalone program: gcc -Wall -g -I../.. -DHAVE_CONFIG_H -DSTANDALONE -o realpath realpath.c */ /* Make sure we handle: - resolve relative links like /dev/cdrom -> sr2 - abort on cyclic linking like /dev/cdrom -> /dev/cdrom */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_UNISTD_H /* readlink */ # include #endif #ifdef HAVE_INTTYPES_H # include "inttypes.h" #endif #ifdef HAVE_LIMITS_H # include #endif #ifndef PATH_MAX #define PATH_MAX 4096 #endif #include /*! cdio_realpath() same as POSIX.1-2001 realpath if that's around. If not we do poor-man's simulation of that behavior. */ char *cdio_realpath (const char *psz_src_path, char *psz_resolved_path) { #ifdef HAVE_REALPATH psz_resolved_path = realpath(psz_src_path, psz_resolved_path); #elif defined(HAVE_READLINK) char tmp_src[PATH_MAX+1]; char tmp_dst[PATH_MAX+1]; char *p_adr; int i, len; const int loop_limit = 100; strcpy(tmp_src, psz_src_path); /* FIXME: remove loop and change with stat before and after readlink which looks direct symlink. Rely on errno to figure out other non-existent or looped symlinks. */ for(i = 0; i < loop_limit; i++) { len = readlink(tmp_src, tmp_dst, PATH_MAX); if (-1 == len) { /* Right now we expect a "not symlink" error. However after we put in the stat() suggested above, there won't be a symlink error and we should start reporting what the failure is. */ break; } else { tmp_dst[len] = '\0'; if (tmp_dst[0] != '/') { /* Take care of relative link like /dev/cdrom -> sr2 */ p_adr = strrchr(tmp_src, '/'); if (p_adr != NULL) { strncpy(p_adr + 1, tmp_dst, PATH_MAX - (p_adr + 1 - tmp_src)); } else { strncpy(tmp_src, tmp_dst, PATH_MAX); } } else { strncpy(tmp_src, tmp_dst, PATH_MAX); } tmp_src[PATH_MAX - 1] = 0; /* strncpy() does not always set a 0 */ } } strncpy(psz_resolved_path, tmp_src, PATH_MAX); #else strncpy(psz_resolved_path, psz_src_path, PATH_MAX); #endif return psz_resolved_path; } #ifdef STANDALONE int main(int argc, char **argv) { int i; char dest[PATH_MAX]; if (argc < 2) { fprintf(stderr, "Usage: %s path [path ...]\n", argv[0]); fprintf(stderr, " Resolve symbolic links\n"); exit(1); } for (i= 1; i < argc; i++) { dest[0] = 0; cdio_realpath (argv[i], dest); printf("%s -> %s\n", argv[i], dest); } exit(0); } #endif libcdio-2.2.0/lib/driver/sector.c000066400000000000000000000136321474051130400166300ustar00rootroot00000000000000/* Copyright (C) 2004, 2005, 2011, 2012, 2014, 2016 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include #include "cdio_assert.h" #include "portable.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #include /*! String of bytes used to identify the beginning of a Mode 1 or Mode 2 sector. */ const uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE] = {0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}; /* Variables to hold debugger-helping enumerations */ enum cdio_cd_enums; enum m2_sector_enums; lba_t cdio_lba_to_lsn (lba_t lba) { if (CDIO_INVALID_LBA == lba) return CDIO_INVALID_LSN; return lba - CDIO_PREGAP_SECTORS; } /* The below is adapted from cdparanoia code which claims it is straight from the MMC3 spec. */ void cdio_lsn_to_msf (lsn_t lsn, msf_t *msf) { int m, s, f; cdio_assert (msf != 0); if ( lsn >= -CDIO_PREGAP_SECTORS ){ m = (lsn + CDIO_PREGAP_SECTORS) / CDIO_CD_FRAMES_PER_MIN; lsn -= m * CDIO_CD_FRAMES_PER_MIN; s = (lsn + CDIO_PREGAP_SECTORS) / CDIO_CD_FRAMES_PER_SEC; lsn -= s * CDIO_CD_FRAMES_PER_SEC; f = lsn + CDIO_PREGAP_SECTORS; } else { m = (lsn + CDIO_CD_MAX_LSN) / CDIO_CD_FRAMES_PER_MIN; lsn -= m * (CDIO_CD_FRAMES_PER_MIN); s = (lsn+CDIO_CD_MAX_LSN) / CDIO_CD_FRAMES_PER_SEC; lsn -= s * CDIO_CD_FRAMES_PER_SEC; f = lsn + CDIO_CD_MAX_LSN; } if (m > 99) { cdio_warn ("number of minutes (%d) truncated to 99.", m); m = 99; } msf->m = cdio_to_bcd8 (m); msf->s = cdio_to_bcd8 (s); msf->f = cdio_to_bcd8 (f); } /*! Convert an LBA into a string representation of the MSF. \warning cdio_lba_to_msf_str returns new allocated string */ char * cdio_lba_to_msf_str (lba_t lba) { if (CDIO_INVALID_LBA == lba) { return strdup("*INVALID"); } else { msf_t msf; msf.m = msf.s = msf.f = 0; cdio_lba_to_msf (lba, &msf); return cdio_msf_to_str(&msf); } } /*! Convert an LSN into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_lsn_to_lba (lsn_t lsn) { if (CDIO_INVALID_LSN == lsn) return CDIO_INVALID_LBA; return lsn + CDIO_PREGAP_SECTORS; } /*! Convert an LBA into the corresponding MSF. */ void cdio_lba_to_msf (lba_t lba, msf_t *msf) { cdio_assert (msf != 0); cdio_lsn_to_msf(cdio_lba_to_lsn(lba), msf); } /*! Convert a MSF into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_msf_to_lba (const msf_t *msf) { uint32_t lba = 0; cdio_assert (msf != 0); lba = cdio_from_bcd8 (msf->m); lba *= CDIO_CD_SECS_PER_MIN; lba += cdio_from_bcd8 (msf->s); lba *= CDIO_CD_FRAMES_PER_SEC; lba += cdio_from_bcd8 (msf->f); return lba; } /*! Convert a MSF into the corresponding LSN. CDIO_INVALID_LSN is returned if there is an error. */ lba_t cdio_msf_to_lsn (const msf_t *msf) { return cdio_lba_to_lsn(cdio_msf_to_lba (msf)); } /*! Convert an LBA into a string representation of the MSF. \warning cdio_lba_to_msf_str returns new allocated string */ char * cdio_msf_to_str (const msf_t *msf) { char buf[16]; snprintf (buf, sizeof (buf), "%2.2x:%2.2x:%2.2x", msf->m, msf->s, msf->f); return strdup (buf); } /*! Convert a MSF - broken out as 3 integer components into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds, unsigned int frames) { return ((minutes * CDIO_CD_SECS_PER_MIN + seconds) * CDIO_CD_FRAMES_PER_SEC + frames); } /*! Convert a string of the form MM:SS:FF into the corresponding LBA. CDIO_INVALID_LBA is returned if there is an error. */ lba_t cdio_mmssff_to_lba (const char *psz_mmssff) { int psz_field; lba_t ret; unsigned char c; if (0 == strcmp (psz_mmssff, "0")) return 0; c = *psz_mmssff++; if(c >= '0' && c <= '9') psz_field = (c - '0'); else return CDIO_INVALID_LBA; while(':' != (c = *psz_mmssff++)) { if(c >= '0' && c <= '9') psz_field = psz_field * 10 + (c - '0'); else return CDIO_INVALID_LBA; } ret = cdio_msf3_to_lba (psz_field, 0, 0); c = *psz_mmssff++; if(c >= '0' && c <= '9') psz_field = (c - '0'); else return CDIO_INVALID_LBA; if(':' != (c = *psz_mmssff++)) { if(c >= '0' && c <= '9') { psz_field = psz_field * 10 + (c - '0'); c = *psz_mmssff++; if(c != ':') return CDIO_INVALID_LBA; } else return CDIO_INVALID_LBA; } if(psz_field >= CDIO_CD_SECS_PER_MIN) return CDIO_INVALID_LBA; ret += cdio_msf3_to_lba (0, psz_field, 0); c = *psz_mmssff++; if (isdigit(c)) psz_field = (c - '0'); else return -1; if('\0' != (c = *psz_mmssff++)) { if (isdigit(c)) { psz_field = psz_field * 10 + (c - '0'); c = *psz_mmssff++; } else return CDIO_INVALID_LBA; } if('\0' != c) return CDIO_INVALID_LBA; if(psz_field >= CDIO_CD_FRAMES_PER_SEC) return CDIO_INVALID_LBA; ret += psz_field; return ret; } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/driver/solaris.c000066400000000000000000001175211474051130400170070ustar00rootroot00000000000000/* Copyright (C) 2002-2006, 2009, 2011-2012, 2017 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include "cdio_assert.h" #include "cdio_private.h" #define DEFAULT_CDIO_DEVICE "/vol/dev/aliases/cdrom0" #ifdef HAVE_SOLARIS_CDROM static char ** cdio_get_devices_solaris_cXtYdZs2(int flag); #ifdef HAVE_GLOB_H #include #endif #include #include #include #include #include #ifdef HAVE_SYS_CDIO_H # include /* CDIOCALLOW etc... */ #else #error "You need to have CDROM support" #endif #include #include #include #include #include #include #include #include "cdtext_private.h" /* not defined in dkio.h yet */ #define DK_DVDRW 0x13 /* reader */ typedef enum { _AM_NONE, _AM_SUN_CTRL_ATAPI, _AM_SUN_CTRL_SCSI, _AM_MMC_RDWR, _AM_MMC_RDWR_EXCL #ifdef FINISHED _AM_READ_CD, _AM_READ_10 #endif } access_mode_t; typedef struct { /* Things common to all drivers like this. This must be first. */ generic_img_private_t gen; access_mode_t access_mode; /* Some of the more OS specific things. */ /* Entry info for each track, add 1 for leadout. */ struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1]; /* Track information */ struct cdrom_tochdr tochdr; } _img_private_t; /*! Return the international standard recording code ISRC. Note: string is malloc'd so caller should free() then returned string when done with it. */ static char * get_track_isrc_solaris (const void *p_user_data, track_t i_track) { const _img_private_t *p_env = p_user_data; return mmc_get_track_isrc( p_env->gen.cdio, i_track ); } static track_format_t get_track_format_solaris(void *p_user_data, track_t i_track); static access_mode_t str_to_access_mode_solaris(const char *psz_access_mode) { const access_mode_t default_access_mode = _AM_SUN_CTRL_SCSI; if (NULL==psz_access_mode) return default_access_mode; if (!strcmp(psz_access_mode, "ATAPI")) return _AM_SUN_CTRL_SCSI; /* force ATAPI to be SCSI */ else if (!strcmp(psz_access_mode, "SCSI")) return _AM_SUN_CTRL_SCSI; else if (!strcmp(psz_access_mode, "MMC_RDWR")) return _AM_MMC_RDWR; else if (!strcmp(psz_access_mode, "MMC_RDWR_EXCL")) return _AM_MMC_RDWR_EXCL; else { cdio_warn ("unknown access type: %s. Default SCSI used.", psz_access_mode); return default_access_mode; } } /*! Pause playing CD through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_pause_solaris (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMPAUSE); } /*! Playing starting at given MSF through analog output @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_play_msf_solaris (void *p_user_data, msf_t *p_start_msf, msf_t *p_end_msf) { const _img_private_t *p_env = p_user_data; struct cdrom_msf solaris_msf; solaris_msf.cdmsf_min0 = cdio_from_bcd8(p_start_msf->m); solaris_msf.cdmsf_sec0 = cdio_from_bcd8(p_start_msf->s); solaris_msf.cdmsf_frame0 = cdio_from_bcd8(p_start_msf->f); solaris_msf.cdmsf_min1 = cdio_from_bcd8(p_end_msf->m); solaris_msf.cdmsf_sec1 = cdio_from_bcd8(p_end_msf->s); solaris_msf.cdmsf_frame1 = cdio_from_bcd8(p_end_msf->f); return ioctl(p_env->gen.fd, CDROMPLAYMSF, &solaris_msf); } /*! Playing CD through analog output at the desired track and index @param p_cdio the CD object to be acted upon. @param p_track_index location to start/end. */ static driver_return_code_t audio_play_track_index_solaris (void *p_user_data, cdio_track_index_t *p_track_index) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMPLAYTRKIND, p_track_index); } /*! Read Audio Subchannel information @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_read_subchannel_solaris (void *p_user_data, cdio_subchannel_t *p_subchannel) { const _img_private_t *p_env = p_user_data; struct cdrom_subchnl subchannel; int i_rc; p_subchannel->format = CDIO_CDROM_MSF; i_rc = ioctl(p_env->gen.fd, CDROMSUBCHNL, &subchannel); if (0 == i_rc) { p_subchannel->control = subchannel.cdsc_ctrl; p_subchannel->track = subchannel.cdsc_trk; p_subchannel->index = subchannel.cdsc_ind; p_subchannel->abs_addr.m = cdio_to_bcd8(subchannel.cdsc_absaddr.msf.minute); p_subchannel->abs_addr.s = cdio_to_bcd8(subchannel.cdsc_absaddr.msf.second); p_subchannel->abs_addr.f = cdio_to_bcd8(subchannel.cdsc_absaddr.msf.frame); p_subchannel->rel_addr.m = cdio_to_bcd8(subchannel.cdsc_reladdr.msf.minute); p_subchannel->rel_addr.s = cdio_to_bcd8(subchannel.cdsc_reladdr.msf.second); p_subchannel->rel_addr.f = cdio_to_bcd8(subchannel.cdsc_reladdr.msf.frame); p_subchannel->audio_status = subchannel.cdsc_audiostatus; return DRIVER_OP_SUCCESS; } else { cdio_info ("ioctl CDROMSUBCHNL failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } } /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_resume_solaris (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMRESUME, 0); } /*! Resume playing an audio CD. @param p_cdio the CD object to be acted upon. */ static driver_return_code_t audio_set_volume_solaris (void *p_user_data, cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMVOLCTRL, p_volume); } /*! Stop playing an audio CD. @param p_user_data the CD object to be acted upon. */ static driver_return_code_t audio_stop_solaris (void *p_user_data) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMSTOP); } static int cdio_decode_btl_number(char **cpt, int stopper, int *no) { *no = 0; for ((*cpt)++; **cpt != stopper; (*cpt)++) { if (**cpt < '0' || **cpt > '9') return 0; *no = *no * 10 + **cpt - '0'; } return 1; } /* Read bus, target, lun from name "cXtYdZs2". Return 0 if name is not of the desired form. */ static int cdio_decode_btl_solaris(char *name, int *busno, int *tgtno, int *lunno, int flag) { char *cpt; int ret; *busno = *tgtno = *lunno = -1; cpt = name; if (*cpt != 'c') return 0; ret = cdio_decode_btl_number(&cpt, 't', busno); if (ret <= 0) return ret; ret = cdio_decode_btl_number(&cpt, 'd', tgtno); if (ret <= 0) return ret; ret = cdio_decode_btl_number(&cpt, 's', lunno); if (ret <= 0) return ret; cpt++; if (*cpt != '2' || *(cpt + 1) != 0) return 0; return 1; } static int set_scsi_tuple_solaris (_img_private_t *p_env) { int bus_no = -1, host_no = -1, channel_no = -1, target_no = -1, lun_no = -1; int ret; char tuple[160], *cpt; cpt = strrchr(p_env->gen.source_name, '/'); if (cpt == NULL) cpt = p_env->gen.source_name; else cpt++; ret = cdio_decode_btl_solaris(cpt, &bus_no, &target_no, &lun_no, 0); if (ret <= 0) return(ret); host_no = bus_no; channel_no = 0; snprintf(tuple, sizeof(tuple)-1, "%d,%d,%d,%d,%d", bus_no, host_no, channel_no, target_no, lun_no); p_env->gen.scsi_tuple = strdup(tuple); return 1; } /*! Initialize CD device. */ static bool init_solaris (_img_private_t *p_env) { int open_flags = O_RDONLY | O_NDELAY; if (_AM_MMC_RDWR != p_env->access_mode && _AM_MMC_RDWR_EXCL != p_env->access_mode) /* (was once set to _AM_SUN_CTRL_SCSI unconditionally) */ p_env->access_mode = _AM_SUN_CTRL_SCSI; if (!cdio_generic_init(p_env, open_flags)) return false; set_scsi_tuple_solaris(p_env); return true; } /*! Run a SCSI MMC command. p_user_data internal CD structure. i_timeout_ms time in milliseconds we will wait for the command to complete. i_cdb Size of p_cdb p_cdb CDB bytes. e_direction direction the transfer is to go. i_buf Size of buffer p_buf Buffer for data, both sending and receiving */ static driver_return_code_t run_mmc_cmd_solaris(void *p_user_data, unsigned int i_timeout_ms, unsigned int i_cdb, const mmc_cdb_t *p_cdb, cdio_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf) { _img_private_t *p_env = p_user_data; struct uscsi_cmd cgc; int i_rc; cdio_mmc_request_sense_t sense; unsigned char *u_sense = (unsigned char *) &sense; memset (&cgc, 0, sizeof (struct uscsi_cmd)); cgc.uscsi_cdb = (caddr_t) p_cdb; /* See: man uscsi http://docs.sun.com/app/docs/doc/816-5177/uscsi-7i?a=view */ p_env->gen.scsi_mmc_sense_valid = 0; memset(u_sense, 0, sizeof(sense)); cgc.uscsi_rqbuf = (caddr_t) u_sense; cgc.uscsi_rqlen = sizeof(sense); /* No error messages, no retries, do not execute with other commands, request sense data */ cgc.uscsi_flags = USCSI_SILENT | USCSI_DIAGNOSE | USCSI_ISOLATE | USCSI_RQENABLE; if (SCSI_MMC_DATA_READ == e_direction) cgc.uscsi_flags |= USCSI_READ; else if (SCSI_MMC_DATA_WRITE == e_direction) cgc.uscsi_flags |= USCSI_WRITE; cgc.uscsi_timeout = msecs2secs(i_timeout_ms); cgc.uscsi_bufaddr = p_buf; cgc.uscsi_buflen = i_buf; cgc.uscsi_cdblen = i_cdb; i_rc = ioctl(p_env->gen.fd, USCSICMD, &cgc); /* Record SCSI sense reply for API call mmc_last_cmd_sense(). */ if (sense.additional_sense_len) { /* sense data available */ int sense_size = sense.additional_sense_len + 8; if (sense_size > sizeof(sense)) sense_size = sizeof(sense); memcpy((void *) p_env->gen.scsi_mmc_sense, &sense, sense_size); p_env->gen.scsi_mmc_sense_valid = sense_size; } if (0 == i_rc) return DRIVER_OP_SUCCESS; if (-1 == i_rc) { cdio_info ("ioctl USCSICMD failed: %s", strerror(errno)); switch (errno) { case EPERM: return DRIVER_OP_NOT_PERMITTED; break; case EINVAL: return DRIVER_OP_BAD_PARAMETER; break; case EFAULT: return DRIVER_OP_BAD_POINTER; break; case EIO: default: return DRIVER_OP_ERROR; break; } } else if (i_rc < -1) return DRIVER_OP_ERROR; else /*Not sure if this the best thing, but we'll use anyway. */ return DRIVER_OP_SUCCESS; } /*! Reads audio sectors from CD device into data starting from lsn. Returns 0 if no error. May have to check size of nblocks. There may be a limit that can be read in one go, e.g. 25 blocks. */ static int _read_audio_sectors_solaris (void *p_user_data, void *data, lsn_t i_lsn, unsigned int i_blocks) { msf_t _msf; struct cdrom_cdda cdda; _img_private_t *p_env = p_user_data; cdio_lba_to_msf (cdio_lsn_to_lba(i_lsn), &_msf); if (p_env->gen.ioctls_debugged == 75) cdio_debug ("only displaying every 75th ioctl from now on"); if (p_env->gen.ioctls_debugged == 30 * 75) cdio_debug ("only displaying every 30*75th ioctl from now on"); if (p_env->gen.ioctls_debugged < 75 || (p_env->gen.ioctls_debugged < (30 * 75) && p_env->gen.ioctls_debugged % 75 == 0) || p_env->gen.ioctls_debugged % (30 * 75) == 0) cdio_debug ("reading %d", i_lsn); p_env->gen.ioctls_debugged++; if (i_blocks > 60) { cdio_warn("%s:\n", "we can't handle reading more than 60 blocks. Reset to 60"); } cdda.cdda_addr = i_lsn; cdda.cdda_length = i_blocks; cdda.cdda_data = (caddr_t) data; cdda.cdda_subcode = CDROM_DA_NO_SUBCODE; if (ioctl (p_env->gen.fd, CDROMCDDA, &cdda) == -1) { perror ("ioctl(..,CDROMCDDA,..)"); return DRIVER_OP_ERROR; /* exit (EXIT_FAILURE); */ } return DRIVER_OP_SUCCESS; } /*! Reads a single mode1 sector from cd device into data starting from i_lsn. */ static driver_return_code_t _read_mode1_sector_solaris (void *p_env, void *data, lsn_t i_lsn, bool b_form2) { #ifdef FIXED do something here. #else return cdio_generic_read_form1_sector(p_env, data, i_lsn); #endif } /*! Reads i_blocks of mode2 sectors from cd device into data starting from i_lsn. */ static driver_return_code_t _read_mode1_sectors_solaris (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2, unsigned int i_blocks) { _img_private_t *p_env = p_user_data; unsigned int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < i_blocks; i++) { if ( (retval = _read_mode1_sector_solaris (p_env, ((char *)p_data) + (blocksize * i), i_lsn + i, b_form2)) ) return retval; } return DRIVER_OP_SUCCESS; } /*! Reads a single mode2 sector from cd device into data starting from lsn. */ static driver_return_code_t _read_mode2_sector_solaris (void *p_user_data, void *p_data, lsn_t i_lsn, bool b_form2) { char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; struct cdrom_msf solaris_msf; msf_t _msf; int offset = 0; struct cdrom_cdxa cd_read; _img_private_t *p_env = p_user_data; cdio_lba_to_msf (cdio_lsn_to_lba(i_lsn), &_msf); solaris_msf.cdmsf_min0 = cdio_from_bcd8(_msf.m); solaris_msf.cdmsf_sec0 = cdio_from_bcd8(_msf.s); solaris_msf.cdmsf_frame0 = cdio_from_bcd8(_msf.f); if (p_env->gen.ioctls_debugged == 75) cdio_debug ("only displaying every 75th ioctl from now on"); if (p_env->gen.ioctls_debugged == 30 * 75) cdio_debug ("only displaying every 30*75th ioctl from now on"); if (p_env->gen.ioctls_debugged < 75 || (p_env->gen.ioctls_debugged < (30 * 75) && p_env->gen.ioctls_debugged % 75 == 0) || p_env->gen.ioctls_debugged % (30 * 75) == 0) cdio_debug ("reading %2.2d:%2.2d:%2.2d", solaris_msf.cdmsf_min0, solaris_msf.cdmsf_sec0, solaris_msf.cdmsf_frame0); p_env->gen.ioctls_debugged++; /* Using CDROMXA ioctl will actually use the same uscsi command * as ATAPI, except we don't need to be root */ offset = CDIO_CD_XA_SYNC_HEADER; cd_read.cdxa_addr = i_lsn; cd_read.cdxa_data = buf; cd_read.cdxa_length = 1; cd_read.cdxa_format = CDROM_XA_SECTOR_DATA; if (ioctl (p_env->gen.fd, CDROMCDXA, &cd_read) == -1) { perror ("ioctl(..,CDROMCDXA,..)"); return 1; /* exit (EXIT_FAILURE); */ } if (b_form2) memcpy (p_data, buf + (offset-CDIO_CD_SUBHEADER_SIZE), M2RAW_SECTOR_SIZE); else memcpy (((char *)p_data), buf + offset, CDIO_CD_FRAMESIZE); return DRIVER_OP_SUCCESS; } /*! Reads i_blocks of mode2 sectors from cd device into data starting from i_lsn. */ static driver_return_code_t _read_mode2_sectors_solaris (void *p_user_data, void *data, lsn_t i_lsn, bool b_form2, unsigned int i_blocks) { _img_private_t *p_env = p_user_data; unsigned int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; for (i = 0; i < i_blocks; i++) { if ( (retval = _read_mode2_sector_solaris (p_env, ((char *)data) + (blocksize * i), i_lsn + i, b_form2)) ) return retval; } return 0; } /*! Return the size of the CD in logical block address (LBA) units. @return the size. On error return CDIO_INVALID_LSN. */ static lsn_t get_disc_last_lsn_solaris (void *p_user_data) { _img_private_t *p_env = p_user_data; struct cdrom_tocentry tocent; uint32_t size; tocent.cdte_track = CDIO_CDROM_LEADOUT_TRACK; tocent.cdte_format = CDIO_CDROM_LBA; if (ioctl (p_env->gen.fd, CDROMREADTOCENTRY, &tocent) == -1) { perror ("ioctl(CDROMREADTOCENTRY)"); exit (EXIT_FAILURE); } size = tocent.cdte_addr.lba; return size; } /*! Set the arg "key" with "value" in the source device. Currently "source" and "access-mode" are valid keys. "source" sets the source device in I/O operations "access-mode" sets the the method of CD access DRIVER_OP_SUCCESS is returned if no error was found, and nonzero if there as an error. */ static driver_return_code_t _set_arg_solaris (void *p_user_data, const char key[], const char value[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { if (!value) return DRIVER_OP_ERROR; free (p_env->gen.source_name); p_env->gen.source_name = strdup (value); } else if (!strcmp (key, "access-mode")) { p_env->access_mode = str_to_access_mode_solaris(key); } else return DRIVER_OP_ERROR; return DRIVER_OP_SUCCESS; } /*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ static bool read_toc_solaris (void *p_user_data) { _img_private_t *p_env = p_user_data; int i; /* read TOC header */ if ( ioctl(p_env->gen.fd, CDROMREADTOCHDR, &p_env->tochdr) == -1 ) { cdio_warn("%s: %s\n", "error in ioctl CDROMREADTOCHDR", strerror(errno)); return false; } p_env->gen.i_first_track = p_env->tochdr.cdth_trk0; p_env->gen.i_tracks = p_env->tochdr.cdth_trk1; /* read individual tracks */ for (i=p_env->gen.i_first_track; i<=p_env->gen.i_tracks; i++) { struct cdrom_tocentry *p_toc = &(p_env->tocent[i-p_env->gen.i_first_track]); p_toc->cdte_track = i; p_toc->cdte_format = CDIO_CDROM_MSF; if ( ioctl(p_env->gen.fd, CDROMREADTOCENTRY, p_toc) == -1 ) { cdio_warn("%s %d: %s\n", "error in ioctl CDROMREADTOCENTRY for track", i, strerror(errno)); return false; } set_track_flags(&(p_env->gen.track_flags[i]), p_toc->cdte_ctrl); } /* read the lead-out track */ p_env->tocent[p_env->tochdr.cdth_trk1].cdte_track = CDIO_CDROM_LEADOUT_TRACK; p_env->tocent[p_env->tochdr.cdth_trk1].cdte_format = CDIO_CDROM_MSF; if (ioctl(p_env->gen.fd, CDROMREADTOCENTRY, &p_env->tocent[p_env->tochdr.cdth_trk1]) == -1 ) { cdio_warn("%s: %s\n", "error in ioctl CDROMREADTOCENTRY for lead-out", strerror(errno)); return false; } p_env->gen.toc_init = true; return true; } /*! Eject media in CD drive. If successful, as a side effect we also free obj. */ static driver_return_code_t eject_media_solaris (void *p_user_data) { _img_private_t *p_env = p_user_data; int ret; close(p_env->gen.fd); p_env->gen.fd = -1; if (p_env->gen.fd > -1) { if ((ret = ioctl(p_env->gen.fd, CDROMEJECT)) != 0) { cdio_generic_free((void *) p_env); cdio_warn ("CDROMEJECT failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } else { return DRIVER_OP_SUCCESS; } } return DRIVER_OP_ERROR; } static bool is_mmc_supported(void *user_data) { _img_private_t *env = user_data; return (_AM_NONE == env->access_mode) ? false : true; } /*! Return the value associated with the key "arg". */ static const char * get_arg_solaris (void *p_user_data, const char key[]) { _img_private_t *p_env = p_user_data; if (!strcmp (key, "source")) { return p_env->gen.source_name; } else if (!strcmp (key, "access-mode")) { switch (p_env->access_mode) { case _AM_SUN_CTRL_ATAPI: return "ATAPI"; case _AM_SUN_CTRL_SCSI: return "SCSI"; case _AM_MMC_RDWR: return "MMC_RDWR"; case _AM_MMC_RDWR_EXCL: return "MMC_RDWR_EXCL"; case _AM_NONE: return "no access method"; } } else if (!strcmp (key, "scsi-tuple")) { return p_env->gen.scsi_tuple; } else if (!strcmp (key, "mmc-supported?")) { return is_mmc_supported(p_user_data) ? "true" : "false"; } return NULL; } /*! Get the block size used in read requests, via ioctl. @return the blocksize if > 0; error if <= 0 */ static int get_blocksize_solaris (void *p_user_data) { _img_private_t *p_env = p_user_data; int ret; int i_blocksize; if ( !p_env || p_env->gen.fd <=0 ) return DRIVER_OP_UNINIT; if ((ret = ioctl(p_env->gen.fd, CDROMGBLKMODE, &i_blocksize)) != 0) { cdio_warn ("CDROMGBLKMODE failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } else { return i_blocksize; } } #ifdef HAVE_SOLARIS_CDROM /*! Return a string containing the default CD device if none is specified. This call does not assume a fixed default drive address but rather uses the first drive that gets enumerated by cdio_get_devices_solaris_cXtYdZs2(). */ static char * cdio_get_default_cXtYdZs2(void) { char **devlist, *result = NULL; devlist = cdio_get_devices_solaris_cXtYdZs2(1); if(devlist != NULL) { if(devlist[0] != NULL) result = strdup(devlist[0]); free(devlist); } if(result != NULL) return result; return strdup(DEFAULT_CDIO_DEVICE); } #endif /*! Return a string containing the default CD device if none is specified. */ char * cdio_get_default_device_solaris(void) { char *volume_device; char *volume_name; char *volume_action; char *device; struct stat stb; /* vold and its directory /vol have been replaced by "Tamarack" which is based on hald. This happened in 2006. */ if(stat("/vol", &stb) == -1) return cdio_get_default_cXtYdZs2(); if((stb.st_mode & S_IFMT) != S_IFDIR) return cdio_get_default_cXtYdZs2(); if ((volume_device = getenv("VOLUME_DEVICE")) != NULL && (volume_name = getenv("VOLUME_NAME")) != NULL && (volume_action = getenv("VOLUME_ACTION")) != NULL && strcmp(volume_action, "insert") == 0) { uint len = strlen(volume_device) + strlen(volume_name) + 2; device = calloc(1, len); if (device == NULL) return strdup(DEFAULT_CDIO_DEVICE); snprintf(device, len, "%s/%s", volume_device, volume_name); if (stat(device, &stb) != 0 || !S_ISCHR(stb.st_mode)) { free(device); return strdup(DEFAULT_CDIO_DEVICE); } return device; } /* Check if it could be a Solaris media*/ if((stat(DEFAULT_CDIO_DEVICE, &stb) == 0) && S_ISDIR(stb.st_mode)) { uint len = strlen(DEFAULT_CDIO_DEVICE + 4); device = calloc(1, len); snprintf(device, len, "%s/s0", DEFAULT_CDIO_DEVICE); return device; } return strdup(DEFAULT_CDIO_DEVICE); } /*! Get disc type associated with cd object. */ static discmode_t get_discmode_solaris (void *p_user_data) { _img_private_t *p_env = p_user_data; track_t i_track; discmode_t discmode=CDIO_DISC_MODE_NO_INFO; struct dk_minfo media; int ret; memset(&media, 0, sizeof(media)); /* Get the media info */ if((ret = ioctl(p_env->gen.fd, DKIOCGMEDIAINFO, &media)) != 0) { cdio_warn ("DKIOCGMEDIAINFO failed: %s\n", strerror(errno)); return CDIO_DISC_MODE_NO_INFO; } switch(media.dki_media_type) { case DK_CDROM: case DK_CDR: case DK_CDRW: /* Do cdrom detection */ break; case DK_DVDROM: return CDIO_DISC_MODE_DVD_ROM; case DK_DVDR: discmode = CDIO_DISC_MODE_DVD_R; break; case DK_DVDRAM: discmode = CDIO_DISC_MODE_DVD_RAM; break; case DK_DVDRW: case DK_DVDRW+1: discmode = CDIO_DISC_MODE_DVD_RW; break; default: /* no valid match */ return CDIO_DISC_MODE_NO_INFO; } /* GNU/Linux ioctl(.., CDROM_DISC_STATUS) does not return "CD DATA Form 2" for SVCD's even though they are are form 2. Issue a SCSI MMC-2 FULL TOC command first to try get more accurate information. */ discmode = mmc_get_discmode(p_env->gen.cdio); if (CDIO_DISC_MODE_NO_INFO != discmode) return discmode; if((discmode == CDIO_DISC_MODE_DVD_RAM || discmode == CDIO_DISC_MODE_DVD_RW || discmode == CDIO_DISC_MODE_DVD_R)) { /* Fallback to uscsi if we can */ if(geteuid() == 0) return get_discmode_solaris(p_user_data); return discmode; } if (!p_env->gen.toc_init) read_toc_solaris (p_env); if (!p_env->gen.toc_init) return CDIO_DISC_MODE_NO_INFO; for (i_track = p_env->gen.i_first_track; i_track < p_env->gen.i_first_track + p_env->tochdr.cdth_trk1 ; i_track ++) { track_format_t track_fmt=get_track_format_solaris(p_env, i_track); switch(track_fmt) { case TRACK_FORMAT_AUDIO: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_XA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_DATA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_ERROR: default: discmode = CDIO_DISC_MODE_ERROR; } } return discmode; } /*! Return the session number of the last on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ static driver_return_code_t get_last_session_solaris (void *p_user_data, /*out*/ lsn_t *i_last_session_lsn) { const _img_private_t *p_env = p_user_data; int i_rc; i_rc = ioctl(p_env->gen.fd, CDROMREADOFFSET, &i_last_session_lsn); if (0 == i_rc) { return DRIVER_OP_SUCCESS; } else { cdio_warn ("ioctl CDROMREADOFFSET failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } } /*! Get format of track. */ static track_format_t get_track_format_solaris(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if ( !p_env ) return TRACK_FORMAT_ERROR; if (!p_env->gen.init) init_solaris(p_env); if (!p_env->gen.toc_init) read_toc_solaris (p_user_data) ; if ( (i_track > p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) return TRACK_FORMAT_ERROR; i_track -= p_env->gen.i_first_track; /* This is pretty much copied from the "badly broken" cdrom_count_tracks in linux/cdrom.c. */ if (p_env->tocent[i_track].cdte_ctrl & CDROM_DATA_TRACK) { if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_CDI_TRACK) return TRACK_FORMAT_CDI; else if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_XA_TRACK) return TRACK_FORMAT_XA; else return TRACK_FORMAT_DATA; } else return TRACK_FORMAT_AUDIO; } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ static bool get_track_green_solaris(void *p_user_data, track_t i_track) { _img_private_t *p_env = p_user_data; if ( !p_env ) return false; if (!p_env->gen.init) init_solaris(p_env); if (!p_env->gen.toc_init) read_toc_solaris (p_env) ; if (i_track >= p_env->gen.i_tracks+p_env->gen.i_first_track || i_track < p_env->gen.i_first_track) return false; i_track -= p_env->gen.i_first_track; /* FIXME: Dunno if this is the right way, but it's what I was using in cd-info for a while. */ return ((p_env->tocent[i_track].cdte_ctrl & 2) != 0); } /*! Return the starting MSF (minutes/secs/frames) for track number track_num in obj. Track numbers usually start at something greater than 0, usually 1. The "leadout" track is specified either by using track_num LEADOUT_TRACK or the total tracks+1. False is returned if there is no entry. */ static bool get_track_msf_solaris(void *p_user_data, track_t i_track, msf_t *msf) { _img_private_t *p_env = p_user_data; if (NULL == msf) return false; if (!p_env->gen.init) init_solaris(p_env); if (!p_env->gen.toc_init) read_toc_solaris (p_env) ; if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks + p_env->gen.i_first_track; if (i_track > (p_env->gen.i_tracks+p_env->gen.i_first_track) || i_track < p_env->gen.i_first_track) { return false; } else { struct cdrom_tocentry *msf0 = &p_env->tocent[i_track-1]; msf->m = cdio_to_bcd8(msf0->cdte_addr.msf.minute); msf->s = cdio_to_bcd8(msf0->cdte_addr.msf.second); msf->f = cdio_to_bcd8(msf0->cdte_addr.msf.frame); return true; } } /*! Get the block size used in read requests, via ioctl. @return the blocksize if > 0; error if <= 0 */ static driver_return_code_t set_blocksize_solaris (void *p_user_data, uint16_t i_blocksize) { _img_private_t *p_env = p_user_data; int ret; if ( !p_env || p_env->gen.fd <=0 ) return DRIVER_OP_UNINIT; if ((ret = ioctl(p_env->gen.fd, CDROMSBLKMODE, i_blocksize)) != 0) { cdio_warn ("CDROMSBLKMODE failed: %s\n", strerror(errno)); return DRIVER_OP_ERROR; } else { return DRIVER_OP_SUCCESS; } } /* Set CD-ROM drive speed */ static driver_return_code_t set_speed_solaris (void *p_user_data, int i_speed) { const _img_private_t *p_env = p_user_data; if (!p_env) return DRIVER_OP_UNINIT; return ioctl(p_env->gen.fd, CDROMSDRVSPEED, i_speed); } #else /*! Return a string containing the default VCD device if none is specified. */ char * cdio_get_default_device_solaris(void) { return strdup(DEFAULT_CDIO_DEVICE); } #endif /* HAVE_SOLARIS_CDROM */ /*! Close tray on CD-ROM. @param psz_device the CD-ROM drive to be closed. */ driver_return_code_t close_tray_solaris (const char *psz_device) { #ifdef HAVE_SOLARIS_CDROM int i_rc; int fd = open (psz_device, O_RDONLY|O_NONBLOCK); if ( fd > -1 ) { i_rc = DRIVER_OP_SUCCESS; if((i_rc = ioctl(fd, CDROMSTART)) != 0) { cdio_warn ("ioctl CDROMSTART failed: %s\n", strerror(errno)); i_rc = DRIVER_OP_ERROR; } close(fd); } else i_rc = DRIVER_OP_ERROR; return i_rc; #else return DRIVER_OP_NO_DRIVER; #endif /*HAVE_SOLARIS_CDROM*/ } #ifdef HAVE_SOLARIS_CDROM /*! Return an array of strings giving possible CD devices. New method after demise of vold in 2006. */ /* flag bit0= need only the first drive */ static char ** cdio_get_devices_solaris_cXtYdZs2(int flag) { int busno, tgtno, lunno, ret; char volpath[160]; char **drives = NULL; unsigned int i_files=0; DIR *dir = NULL; struct dirent *entry; #ifdef LIBCDIO_SOLARIS_WITH_CD_INQUIRY CdIo_t *cdio = NULL; mmc_cdb_t cdb = {{0, }}; int timeout_ms; driver_return_code_t i_status; char reply[36]; static unsigned char spc_inquiry[] = { 0x12, 0, 0, 0, 36, 0 }; #else struct dk_cinfo cinfo; int fd = -1; #endif static int recursion = 0; if (recursion) { fprintf(stderr, "Program error ! Recursion of cdio_get_devices_solaris_cXtYdZs2()\n"); return NULL; } recursion = 1; dir = opendir("/dev/rdsk"); if (dir == NULL) { cdio_warn ("opendir(\"/dev/rdsk\") failed: %s\n", strerror(errno)); goto ex; } while (1) { entry = readdir(dir); if (entry == NULL) { if (errno) { cdio_warn ("readdir(/dev/rdsk) failed: %s\n", strerror(errno)); goto ex; } break; } ret = cdio_decode_btl_solaris(entry->d_name, &busno, &tgtno, &lunno, 0); if (ret < 0) goto ex; if (ret == 0) continue; /* not cXtYdZs2 */ if (strlen(entry->d_name) > sizeof(volpath) - 11) continue; snprintf(volpath, sizeof(volpath), "/dev/rdsk/%s", entry->d_name); #ifdef LIBCDIO_SOLARIS_WITH_CD_INQUIRY cdio = cdio_open_am_solaris(volpath, "MMC_RDWR"); if(cdio == NULL) continue; memcpy(cdb.field, spc_inquiry, 6); timeout_ms = 10000; i_status = run_mmc_cmd_solaris(cdio->env, timeout_ms, 6, &cdb, SCSI_MMC_DATA_READ, (unsigned int) spc_inquiry[4], reply); cdio_destroy(cdio); cdio = NULL; if (i_status != 0) continue; /* SBC-3 , table 83 , PERIPHERAL DEVICE TYPE : 5 = CD/DVD device */ if((reply[0] & 0x1F) != 5) continue; #else /* LIBCDIO_SOLARIS_WITH_CD_INQUIRY */ fd = open(volpath, O_RDONLY | O_NDELAY); if (fd < 0) continue; /* See man dkio */ ret = ioctl(fd, DKIOCINFO, &cinfo); close(fd); fd = -1; if (ret < 0) continue; if (cinfo.dki_ctype != DKC_CDROM) continue; #endif /* ! LIBCDIO_SOLARIS_WITH_CD_INQUIRY */ cdio_add_device_list(&drives, volpath, &i_files); if(flag & 1) goto ex; /* Only the first drive is desired */ } ex:; recursion = 0; if(dir != NULL) closedir(dir); cdio_add_device_list(&drives, NULL, &i_files); return drives; } #endif /*HAVE_SOLARIS_CDROM*/ /*! Return an array of strings giving possible CD devices. */ char ** cdio_get_devices_solaris (void) { #ifndef HAVE_SOLARIS_CDROM return NULL; #else char volpath[256]; struct stat st; char **drives = NULL; unsigned int i_files=0; #ifdef HAVE_GLOB_H unsigned int i; glob_t globbuf; #endif /* vold and its directory /vol have been replaced by "Tamarack" which is based on hald. This happened in 2006. */ if(stat("/vol", &st) == -1) return cdio_get_devices_solaris_cXtYdZs2(0); if((st.st_mode & S_IFMT) != S_IFDIR) return cdio_get_devices_solaris_cXtYdZs2(0); #ifdef HAVE_GLOB_H globbuf.gl_offs = 0; glob("/vol/dev/aliases/cdrom*", GLOB_DOOFFS, NULL, &globbuf); for (i=0; iaccess_mode = str_to_access_mode_solaris(access_mode); _data->gen.init = false; _data->gen.fd = -1; _data->gen.toc_init = false; _data->gen.b_cdtext_error = false; if (NULL == psz_orig_source) { psz_source = cdio_get_default_device_solaris(); if (NULL == psz_source) { free(_data); return NULL; } _set_arg_solaris(_data, "source", psz_source); free(psz_source); } else { if (cdio_is_device_generic(psz_orig_source)) _set_arg_solaris(_data, "source", psz_orig_source); else { /* The below would be okay if all device drivers worked this way. */ #if 0 cdio_info ("source %s is not a device", psz_orig_source); #endif free(_data); return NULL; } } ret = cdio_new ( (void *) _data, &_funcs ); if (ret == NULL) return NULL; ret->driver_id = DRIVER_SOLARIS; if (init_solaris(_data)) return ret; else { cdio_generic_free (_data); free(ret); return NULL; } #else return NULL; #endif /* HAVE_SOLARIS_CDROM */ } bool cdio_have_solaris (void) { #ifdef HAVE_SOLARIS_CDROM return true; #else return false; #endif /* HAVE_SOLARIS_CDROM */ } libcdio-2.2.0/lib/driver/track.c000066400000000000000000000253501474051130400164350ustar00rootroot00000000000000/* Copyright (C) 2003-2005, 2008, 2011-2013 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! Track-related routines. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include "cdio_private.h" const char *track_format2str[6] = { "audio", "CD-i", "XA", "data", "PSX", "error" }; /* Variables to hold debugger-helping enumerations */ enum cdio_track_enums; /*! Return the number of the first track. CDIO_INVALID_TRACK is returned on error. */ track_t cdio_get_first_track_num(const CdIo_t *p_cdio) { if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return CDIO_INVALID_TRACK; } if (p_cdio->op.get_first_track_num) { return p_cdio->op.get_first_track_num (p_cdio->env); } else { return CDIO_INVALID_TRACK; } } /*! Return the last track number. CDIO_INVALID_TRACK is returned on error. */ track_t cdio_get_last_track_num (const CdIo_t *p_cdio) { if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return CDIO_INVALID_TRACK; } { const track_t i_first_track = cdio_get_first_track_num(p_cdio); if ( CDIO_INVALID_TRACK != i_first_track ) { const track_t u_tracks = cdio_get_num_tracks(p_cdio); if ( CDIO_INVALID_TRACK != u_tracks ) return i_first_track + u_tracks - 1; } return CDIO_INVALID_TRACK; } } /*! Return number of channels in track: 2 or 4; -2 if not implemented or -1 for error. Not meaningful if track is not an audio track. */ int cdio_get_track_channels(const CdIo_t *p_cdio, track_t u_track) { track_t u_last_track; if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return -1; } u_last_track = cdio_get_last_track_num(p_cdio); if (u_track > u_last_track) { cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", u_track, u_last_track); return -1; } if (p_cdio->op.get_track_channels) { return p_cdio->op.get_track_channels (p_cdio->env, u_track); } else { return -2; } } /*! Return copy protection status on a track. Is this meaningful if not an audio track? */ track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio, track_t u_track) { if (p_cdio->op.get_track_copy_permit) { return p_cdio->op.get_track_copy_permit (p_cdio->env, u_track); } else { return CDIO_TRACK_FLAG_UNKNOWN; } } /*! Get format of track. */ track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t u_track) { if (!p_cdio) return TRACK_FORMAT_ERROR; if (p_cdio->op.get_track_format) { return p_cdio->op.get_track_format (p_cdio->env, u_track); } else { return TRACK_FORMAT_ERROR; } } /*! Return the Joliet level recognized for p_cdio. */ uint8_t cdio_get_joliet_level(const CdIo_t *p_cdio) { if (!p_cdio) return 0; { const generic_img_private_t *p_env = (generic_img_private_t *) (p_cdio->env); return p_env->u_joliet_level; } } /*! Return the number of tracks in the current medium. CDIO_INVALID_TRACK is returned on error. */ track_t cdio_get_num_tracks (const CdIo_t *p_cdio) { if (p_cdio == NULL) return CDIO_INVALID_TRACK; if (p_cdio->op.get_num_tracks) { return p_cdio->op.get_num_tracks (p_cdio->env); } else { return CDIO_INVALID_TRACK; } } /*! Find the track which contans lsn. CDIO_INVALID_TRACK is returned if the lsn outside of the CD or if there was some error. If the lsn is before the pregap of the first track 0 is returned. Otherwise we return the track that spans the lsn. */ track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn) { if (!p_cdio) return CDIO_INVALID_TRACK; { track_t i_low_track = cdio_get_first_track_num(p_cdio); track_t i_high_track = cdio_get_last_track_num(p_cdio)+1; track_t i_lead_track = i_high_track; if (CDIO_INVALID_TRACK == i_low_track || CDIO_INVALID_TRACK == i_high_track ) return CDIO_INVALID_TRACK; if (lsn < cdio_get_track_lsn(p_cdio, i_low_track)) return 0; /* We're in the pre-gap of first track */ if (lsn > cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK)) return CDIO_INVALID_TRACK; /* We're beyond the end. */ do { const track_t i_mid = (i_low_track + i_high_track) / 2; const lsn_t i_mid_lsn = cdio_get_track_lsn(p_cdio, i_mid); if (lsn <= i_mid_lsn) i_high_track = i_mid - 1; if (lsn >= i_mid_lsn) i_low_track = i_mid + 1; } while ( i_low_track <= i_high_track ); if (i_low_track > i_high_track + 1) { i_high_track++; } if (i_high_track == i_lead_track ) { return CDIO_CDROM_LEADOUT_TRACK; } else { return i_high_track; } } } /*! Return true if we have XA data (green, mode2 form1) or XA data (green, mode2 form2). That is track begins: sync - header - subheader 12 4 - 8 FIXME: there's gotta be a better design for this and get_track_format? */ bool cdio_get_track_green(const CdIo_t *p_cdio, track_t u_track) { if (p_cdio == NULL) { return false; } if (p_cdio->op.get_track_green) { return p_cdio->op.get_track_green (p_cdio->env, u_track); } else { return false; } } /*! Return the starting LBA for track number track_num in cdio. Tracks numbers start at 1. The "leadout" track is specified either by using track_num LEADOUT_TRACK or the total tracks+1. CDIO_INVALID_LBA is returned on error. */ lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t u_track) { if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return CDIO_INVALID_LBA; } if (p_cdio->op.get_track_lba) { return p_cdio->op.get_track_lba (p_cdio->env, u_track); } else { msf_t msf; if (p_cdio->op.get_track_msf) if (cdio_get_track_msf(p_cdio, u_track, &msf)) return cdio_msf_to_lba(&msf); return CDIO_INVALID_LBA; } } /*! Return the starting LSN for track number u_track in cdio. Tracks numbers start at 1. The "leadout" track is specified either by using u_track LEADOUT_TRACK or the total tracks+1. CDIO_INVALID_LSN is returned on error. */ lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t u_track) { /*track_t u_last_track; */ if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return CDIO_INVALID_LSN; } /* u_last_track = cdio_get_last_track_num(p_cdio); if (u_track > u_last_track && u_track != CDIO_CDROM_LEADOUT_TRACK) { cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", u_track, u_last_track); return CDIO_INVALID_LSN; } */ if (p_cdio->op.get_track_lba) { return cdio_lba_to_lsn(p_cdio->op.get_track_lba (p_cdio->env, u_track)); } else { msf_t msf; if (cdio_get_track_msf(p_cdio, u_track, &msf)) return cdio_msf_to_lsn(&msf); return CDIO_INVALID_LSN; } } /*! Return the International Standard Recording Code (ISRC) for track number u_track in p_cdio. Track numbers start at 1. Note: The caller must free the returned string with cdio_free() when done with it. */ char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t u_track) { track_t u_last_track; if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return NULL; } u_last_track = cdio_get_last_track_num(p_cdio); if (u_track > u_last_track) { cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", u_track, u_last_track); return NULL; } if (p_cdio->op.get_track_isrc) { return p_cdio->op.get_track_isrc (p_cdio->env, u_track); } else { return NULL; } } /*! Return the starting LBA for the pregap for track number u_track in cdio. Track numbers start at 1. CDIO_INVALID_LBA is returned on error. */ lba_t cdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t u_track) { if (NULL == p_cdio) { cdio_info("Null CdIo object passed\n"); return CDIO_INVALID_LBA; } if (p_cdio->op.get_track_pregap_lba) { return p_cdio->op.get_track_pregap_lba (p_cdio->env, u_track); } else { return CDIO_INVALID_LBA; } } /*! Return the starting LSN for the pregap for track number u_track in cdio. Track numbers start at 1. CDIO_INVALID_LSN is returned on error. */ lsn_t cdio_get_track_pregap_lsn(const CdIo_t *p_cdio, track_t u_track) { return cdio_lba_to_lsn(cdio_get_track_pregap_lba(p_cdio, u_track)); } /*! Return the ending LSN for track number u_track in cdio. CDIO_INVALID_LSN is returned on error. */ lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t u_track) { lsn_t lsn = cdio_get_track_lsn(p_cdio, u_track+1); if (CDIO_INVALID_LSN == lsn) return CDIO_INVALID_LSN; /* Safe, we've always the leadout. */ return lsn - 1; } /*! Return the starting MSF (minutes/secs/frames) for track number u_track in cdio. Track numbers start at 1. The "leadout" track is specified either by using u_track LEADOUT_TRACK or the total tracks+1. False is returned if there is no track entry. */ bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t u_track, /*out*/ msf_t *msf) { if (!p_cdio) return false; if (p_cdio->op.get_track_msf) { return p_cdio->op.get_track_msf (p_cdio->env, u_track, msf); } else if (p_cdio->op.get_track_lba) { lba_t lba = p_cdio->op.get_track_lba (p_cdio->env, u_track); if (lba == CDIO_INVALID_LBA) return false; cdio_lba_to_msf(lba, msf); return true; } else { return false; } } /*! Return copy protection status on a track. Is this meaningful if not an audio track? */ track_flag_t cdio_get_track_preemphasis(const CdIo *p_cdio, track_t u_track) { if (p_cdio->op.get_track_preemphasis) { return p_cdio->op.get_track_preemphasis (p_cdio->env, u_track); } else { return CDIO_TRACK_FLAG_UNKNOWN; } } /*! Return the number of sectors between this track an the next. This includes any pregap sectors before the start of the next track. Tracks start at 1. 0 is returned if there is an error. */ unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t u_track) { const track_t u_tracks = cdio_get_num_tracks(p_cdio); if (u_track >=1 && u_track <= u_tracks) return ( cdio_get_track_lba(p_cdio, u_track+1) - cdio_get_track_lba(p_cdio, u_track) ); return 0; } libcdio-2.2.0/lib/driver/utf8.c000066400000000000000000000227131474051130400162170ustar00rootroot00000000000000/* Copyright (C) 2006, 2008 Burkhard Plaum Copyright (C) 2011, 2014 Rocky Bernstein Copyright (C) 2012 Pete Batard 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* UTF-8 support */ #ifdef HAVE_CONFIG_H # define __CDIO_CONFIG_H__ 1 # include "config.h" #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include #include #include #include "cdio_assert.h" /* Windows requires some basic UTF-8 support outside of Joliet */ #if defined(_WIN32) #include #define wchar_to_utf8_no_alloc(wsrc, dest, dest_size) \ WideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, dest_size, NULL, NULL) #define utf8_to_wchar_no_alloc(src, wdest, wdest_size) \ MultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, wdest_size) /* * Converts an UTF-16 string to UTF8 (allocate returned string) * Returns NULL on error */ static inline char* cdio_wchar_to_utf8(const wchar_t* wstr) { int size = 0; char* str = NULL; /* Find out the size we need to allocate for our converted string */ size = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); if (size <= 1) /* An empty string would be size 1 */ return NULL; if ((str = (char*)calloc(size, 1)) == NULL) return NULL; if (wchar_to_utf8_no_alloc(wstr, str, size) != size) { free(str); return NULL; } return str; } /* * Converts an UTF8 string to UTF-16 (allocate returned string) * Returns NULL on error */ wchar_t* cdio_utf8_to_wchar(const char* str) { int size = 0; wchar_t* wstr = NULL; /* Find out the size we need to allocate for our converted string */ size = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); if (size <= 1) /* An empty string would be size 1 */ return NULL; if ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL) return NULL; if (utf8_to_wchar_no_alloc(str, wstr, size) != size) { free(wstr); return NULL; } return wstr; } /* UTF-8 compliant version of fopen() */ FILE* fopen_utf8(const char* filename, const char* mode) { FILE* ret = NULL; wchar_t* wfilename = cdio_utf8_to_wchar(filename); wchar_t* wmode = cdio_utf8_to_wchar(mode); ret = _wfopen(wfilename, wmode); cdio_free(wfilename); cdio_free(wmode); return ret; } #endif #ifdef HAVE_ICONV #include struct cdio_charset_coverter_s { iconv_t ic; }; cdio_charset_coverter_t * cdio_charset_converter_create(const char * src_charset, const char * dst_charset) { cdio_charset_coverter_t * ret; ret = calloc(1, sizeof(*ret)); ret->ic = iconv_open(dst_charset, src_charset); return ret; } #if 0 static void bgav_hexdump(uint8_t * data, int len, int linebreak) { int i; int bytes_written = 0; int imax; while(bytes_written < len) { imax = (bytes_written + linebreak > len) ? len - bytes_written : linebreak; for(i = 0; i < imax; i++) fprintf(stderr, "%02x ", data[bytes_written + i]); for(i = imax; i < linebreak; i++) fprintf(stderr, " "); for(i = 0; i < imax; i++) { if(!(data[bytes_written + i] & 0x80) && (data[bytes_written + i] >= 32)) fprintf(stderr, "%c", data[bytes_written + i]); else fprintf(stderr, "."); } bytes_written += imax; fprintf(stderr, "\n"); } } #endif void cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv) { iconv_close(cnv->ic); free(cnv); } #define BYTES_INCREMENT 16 static bool do_convert(iconv_t cd, const char * src, int src_len, char ** dst, int *dst_len) { char * ret; char *inbuf; char *outbuf; int alloc_size; int output_pos; size_t inbytesleft; size_t outbytesleft; if(src_len < 0) src_len = strlen(src); #if 0 fprintf(stderr, "Converting:\n"); bgav_hexdump(src, src_len, 16); #endif alloc_size = src_len + BYTES_INCREMENT; inbytesleft = src_len; /* We reserve space here to add a final '\0' */ outbytesleft = alloc_size-1; ret = malloc(alloc_size); inbuf = (char *)src; outbuf = ret; while(1) { if(iconv(cd, (ICONV_CONST char **)&inbuf, &inbytesleft, &outbuf, &outbytesleft) == (size_t)-1) { switch(errno) { case E2BIG: output_pos = (int)(outbuf - ret); alloc_size += BYTES_INCREMENT; outbytesleft += BYTES_INCREMENT; ret = realloc(ret, alloc_size); if (ret == NULL) { cdio_warn("Can't realloc(%d).", alloc_size); return false; } outbuf = ret + output_pos; break; default: cdio_warn("Iconv failed: %s", strerror(errno)); if (ret != NULL) free(ret); return false; break; } } if(!inbytesleft) break; } /* Zero terminate */ *outbuf = '\0'; /* Set return values */ *dst = ret; if(dst_len) *dst_len = (int)(outbuf - ret); #if 0 fprintf(stderr, "Conversion done, src:\n"); bgav_hexdump(src, src_len, 16); fprintf(stderr, "dst:\n"); bgav_hexdump((uint8_t*)(ret), (int)(outbuf - ret), 16); #endif return true; } bool cdio_charset_convert(cdio_charset_coverter_t*cnv, char * src, int src_len, char ** dst, int * dst_len) { return do_convert(cnv->ic, src, src_len, dst, dst_len); } bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, int * dst_len, const char * dst_charset) { iconv_t ic; bool result; ic = iconv_open(dst_charset, "UTF-8"); result = do_convert(ic, src, -1, dst, dst_len); iconv_close(ic); return result; } bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char * src_charset) { iconv_t ic; bool result; ic = iconv_open("UTF-8", src_charset); result = do_convert(ic, src, src_len, dst, NULL); iconv_close(ic); return result; } #elif defined(_WIN32) bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, int * dst_len, const char * dst_charset) { wchar_t* le_dst; size_t i, len; if (src == NULL || dst == NULL || dst_len == NULL || dst_charset == NULL || strcmp(dst_charset, "UCS-2BE") != 0) return false; /* Eliminate empty strings */ le_dst = cdio_utf8_to_wchar(src); if ((le_dst == NULL) || (le_dst[0] == 0)) { cdio_free(le_dst); return false; } /* Perform byte reversal */ len = wcslen(le_dst); *dst = (char*)calloc(len+1, sizeof(wchar_t)); cdio_assert(*dst != NULL); for (i=0; i<2*len; i++) { (*dst)[i] = ((char*)le_dst)[i+1]; (*dst)[i+1] = ((char*)le_dst)[i]; } free(le_dst); return true; } bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char *src_charset) { int codepage = 0; wchar_t* wstr = NULL; int i, size = 0; if (src == NULL || dst == NULL || src_charset == NULL) return false; /* Convert big endian to little endian */ if (strcmp(src_charset, "UCS-2BE") == 0) { /* Compute UCS-2 src length */ if (src_len == (size_t)-1) { for (src_len = 0; ((uint16_t*)src)[src_len] !=0; src_len++); } else { src_len >>=1; } /* Eliminate empty strings */ if ((src_len < 1) || ((src[0] == 0) && (src[1] == 0))) { *dst = NULL; return false; } /* Perform byte reversal */ wstr = (wchar_t*)calloc(src_len+1, sizeof(wchar_t)); cdio_assert(wstr != NULL); for (i=0; i Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_INTTYPES_H #include "inttypes.h" #endif #include #include "cdio_assert.h" #include #include #include size_t _cdio_strlenv(char **str_array) { size_t n = 0; cdio_assert (str_array != NULL); while(str_array[n]) n++; return n; } void _cdio_strfreev(char **strv) { int n; cdio_assert (strv != NULL); for(n = 0; strv[n]; n++) free(strv[n]); free(strv); } char ** _cdio_strsplit(const char str[], char delim) /* fixme -- non-reentrant */ { int n; char **strv = NULL; char *_str, *p; char _delim[2] = { 0, 0 }; cdio_assert (str != NULL); _str = strdup(str); _delim[0] = delim; cdio_assert (_str != NULL); n = 1; p = _str; while(*p) if (*(p++) == delim) n++; strv = calloc (n+1, sizeof (char *)); cdio_assert (strv != NULL); n = 0; while((p = strtok(n ? NULL : _str, _delim)) != NULL) strv[n++] = strdup(p); free(_str); return strv; } void * _cdio_memdup (const void *mem, size_t count) { void *new_mem = NULL; if (mem) { new_mem = calloc (1, count); cdio_assert (new_mem != NULL); memcpy (new_mem, mem, count); } return new_mem; } char * _cdio_strdup_upper (const char str[]) { char *new_str = NULL; if (str) { char *p; p = new_str = strdup (str); while (*p) { *p = toupper ((unsigned char) *p); p++; } } return new_str; } /* Convert MinGW/MSYS paths that start in "/c/..." to "c:/..." so that they can be used with fopen(), stat(), etc. Returned string must be freed by the caller using cdio_free().*/ char * _cdio_strdup_fixpath (const char path[]) { char *new_path = NULL; if (path) { new_path = strdup (path); #if defined(_WIN32) if (new_path && (strlen (new_path) >= 3) && (new_path[0] == '/') && (new_path[2] == '/') && (isalpha (new_path[1]))) { new_path[0] = new_path[1]; new_path[1] = ':'; } #endif } return new_path; } uint8_t cdio_to_bcd8 (uint8_t n) { /*cdio_assert (n < 100);*/ return ((n/10)<<4) | (n%10); } uint8_t cdio_from_bcd8(uint8_t p) { return (0xf & p)+(10*(p >> 4)); } const char *cdio_version_string = CDIO_VERSION; const unsigned int libcdio_version_num = LIBCDIO_VERSION_NUM; /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/iso9660/000077500000000000000000000000001474051130400150045ustar00rootroot00000000000000libcdio-2.2.0/lib/iso9660/.gitignore000066400000000000000000000001261474051130400167730ustar00rootroot00000000000000/*.lo /*.o /.deps /.libs /Makefile /Makefile.in /*~ /libiso9660.la /libiso9660.la.ver libcdio-2.2.0/lib/iso9660/Makefile.am000066400000000000000000000135011474051130400170400ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012, 2025 # Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################## # Things to make the libiso9660 library ######################################################## # # From libtool documentation amended with guidance from N. Boullis: # # 1. Start with version information of `0:0:0' for each libtool library. # # 2. It is probably not a good idea to update the version information # several times between public releases, but rather once per public # release. (This seems to be more an aesthetic consideration than # a hard technical one.) # # 3. If the library source code has changed at all since the last # update, then increment REVISION (`C:R:A' becomes `C:R+1:A'). # # 4. If any interfaces have been added, removed, or changed since the # last update, increment CURRENT, and set REVISION to 0. # # 5. If any interfaces have been added since the last public release, # then increment AGE. # # 6. If any interfaces have been removed or changed since the last # public release, then set AGE to 0. A changed interface means an # incompatibility with previous versions. libiso9660_la_CURRENT = 12 libiso9660_la_REVISION = 0 libiso9660_la_AGE = 0 EXTRA_DIST = libiso9660.sym noinst_HEADERS = iso9660_private.h lib_LTLIBRARIES = libiso9660.la if ENABLE_ROCK rock_src = rock.c else rock_src = endif libiso9660_la_SOURCES = \ iso9660.c \ iso9660_private.h \ iso9660_fs.c \ $(rock_src) \ xa.c libiso9660_la_LIBADD = @LIBCDIO_LIBS@ libiso9660_la_ldflags = -version-info $(libiso9660_la_CURRENT):$(libiso9660_la_REVISION):$(libiso9660_la_AGE) @LT_NO_UNDEFINED@ libiso9660_la_dependencies = $(top_builddir)/lib/driver/libcdio.la AM_CPPFLAGS = $(LIBCDIO_CFLAGS) ######################################################## # Things to version the symbols in the libraries ######################################################## # An explanation of the versioning problem from Nicolas Boullis and # the versioned symbol solution he uses below... # # Currently, libvcdinfo uses the cdio_open function from libcdio. # Let's imagine a program foobar that uses both the vcdinfo_open # function from libvcdinfo and the cdio_open function from libcdio. # Currently, libcdio has SONAME libcdio.so.0, libvcdinfo has SONAME # libvcdinfo.so.0 and requires libcdio.so.0, and foobar requires both # libvcdinfo.so.0 and libcdio.so.0. Everything looks fine. # # Now, for some reason, you decide to change the cdio_open function. # That's your right, but you have to bump the CURRENT version and (if I # understand it correctly, athough this is not that clear in libtool's # documentation) set the AGE to 0. Anyway, this bumps the SONAME, which is # sane since the interface changes incompatibly. # Now, you have a new libcdio with SONAME libcdio.so.1. But libvcdinfo and # foobar still require libcdio.so.0. Everything is still fine. # Now, after some minor changes, the author of foobar recompiles foobar. # Then, foobar now requires libvcdinfo.so.0 and libcdio.so.1. And foobar # now segfaults... # What is happening? When you run foobar, if brings both libvcdinfo.so.0 # and libcdio.so.1, but libvcdinfo.so.0 also brings libcdio.so.0. So you # have both libcdio.so.0 and libcdio.so.1 that bring their symbols to the # global namespace. Hence, you have to incompatible versions of the # cdio_open function in the name space. When foobar calls cdio_open, it # may choose the wrong function, and segfaults... # With versioned symbols, the cdio_open function from libcdio.so.0 may be # known as (something that looks like) cdio_open@@CDIO_0. An the cdio_open # function from libcdio.so.1 as cdio_open@@CDIO_1. Both versions of # libcdio would still be brought in by the most recent foobar, but foobar # (and libvcdinfo) know which versioned function to use and then use the # good one. # This is some simple versioning where every symbol is versioned with # something that looks like the SONAME of the library. More complex (and # better) versioning is possible; it is for example what is used by glibc. # But good complex versioning is something that requires much more # work... # The below is a impliments symbol versioning. First of all, I # compute MAJOR as CURENT - AGE; that is what is used within libtool # (at least on GNU/Linux systems) for the number in the SONAME. The # nm command gives the list of symbols known in each of the object # files that will be part of the shared library. And the sed command # extracts from this list those symbols that will be shared. (This sed # command comes from libtool.) libiso9660_la_MAJOR = $(shell expr $(libiso9660_la_CURRENT) - $(libiso9660_la_AGE)) if BUILD_VERSIONED_LIBS libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags) -Wl,--version-script=libiso9660.la.ver libiso9660_la_DEPENDENCIES = $(libcdio9660_la_dependencies) libiso9660.la.ver libiso9660.la.ver: $(srcdir)/libiso9660.sym @echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@ @echo ' global:' >> $@ @sed 's/^/ /;s/$$/;/' $< >> $@ @echo ' local:' >> $@ @echo ' *;' >> $@ @echo '};' >> $@ MOSTLYCLEANFILES = libiso9660.la.ver else libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags) libiso9660_la_DEPENDENCIES = $(libcdio9660_la_dependencies) endif libcdio-2.2.0/lib/iso9660/iso9660.c000066400000000000000000001003431474051130400162700ustar00rootroot00000000000000/* Copyright (C) 2003-2009, 2013-2014, 2016-2017 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /*! String inside frame which identifies an ISO 9660 filesystem. This string is the "id" field of an iso9660_pvd_t or an iso9660_svd_t. Note should come *before* #include which does a #define of this name. */ const char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'}; /* Private headers */ #include "iso9660_private.h" #include "cdio_assert.h" /* Public headers */ #include #include #include #include #include #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_ERRNO_H #include #endif #ifndef HAVE_SETENV static int setenv(const char *envname, const char *envval, int overwrite) { return -1; } #endif #ifndef HAVE_UNSETENV static int unsetenv(const char *envname) { return -1; } #endif #ifndef HAVE_TIMEGM static time_t timegm(struct tm *tm) { time_t ret; char *tz; tz = getenv("TZ"); setenv("TZ", "UTC", 1); tzset(); ret = mktime(tm); if (tz) setenv("TZ", tz, 1); else unsetenv("TZ"); tzset(); return ret; } #endif #ifndef HAVE_GMTIME_R static struct tm * gmtime_r(const time_t *timer, struct tm *result) { struct tm *tmp = gmtime(timer); if (tmp) { *result = *tmp; return result; } return tmp; } #endif #ifndef HAVE_LOCALTIME_R static struct tm * localtime_r(const time_t *timer, struct tm *result) { struct tm *tmp = localtime(timer); if (tmp) { *result = *tmp; return result; } return tmp; } #endif /* Variables to hold debugger-helping enumerations */ enum iso_enum1_s iso_enums1; enum iso_flag_enum_s iso_flag_enums; enum iso_vd_enum_s iso_vd_enums; enum iso_extension_enum_s iso_extension_enums; /* some parameters... */ #define SYSTEM_ID "CD-RTOS CD-BRIDGE" #define VOLUME_SET_ID "" /*! Change trailing blanks in str to nulls. Str has a maximum size of n characters. */ static char * strip_trail (const char str[], size_t n) { static char buf[1025]; int j; cdio_assert (n < 1024); strncpy (buf, str, n); buf[n] = '\0'; for (j = strlen (buf) - 1; j >= 0; j--) { if (buf[j] != ' ') break; buf[j] = '\0'; } return buf; } static void pathtable_get_size_and_entries(const void *pt, unsigned int *size, unsigned int *entries); /*! Get time structure from structure in an ISO 9660 directory index record. Even though tm_wday and tm_yday fields are not explicitly in idr_date, the are calculated from the other fields. If tm is to reflect the localtime set b_localtime true, otherwise tm will reported in GMT. */ bool iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime, /*out*/ struct tm *p_tm) { if (!idr_date) return false; /* Section 9.1.5 of ECMA 119 says: If all seven numbers are zero, it shall mean that the date and time are not specified. HACK: However we've seen it happen that everything except gmtoff is zero and the expected date is the beginning of the epoch. So we accept 6 numbers being zero. I'm also not sure if using the beginning of the Epoch is also the right thing to do either. */ if ( 0 == idr_date->dt_year && 0 == idr_date->dt_month && 0 == idr_date->dt_day && 0 == idr_date->dt_hour && 0 == idr_date->dt_minute && 0 == idr_date->dt_second ) { time_t t = 0; struct tm temp_tm; localtime_r(&t, &temp_tm); memcpy(p_tm, &temp_tm, sizeof(struct tm)); return true; } memset(p_tm, 0, sizeof(struct tm)); p_tm->tm_year = idr_date->dt_year; p_tm->tm_mon = idr_date->dt_month - 1; p_tm->tm_mday = idr_date->dt_day; p_tm->tm_hour = idr_date->dt_hour; p_tm->tm_min = idr_date->dt_minute; p_tm->tm_sec = idr_date->dt_second - idr_date->dt_gmtoff * (15 * 60); p_tm->tm_isdst = -1; /* information not available */ #ifdef HAVE_STRUCT_TM_TM_ZONE /* Initialize everything */ p_tm->tm_zone = 0; #endif /* Recompute tm_wday and tm_yday via mktime. mktime will also renormalize date values to account for the timezone offset. */ { time_t t = 0; struct tm temp_tm; t = timegm(p_tm); if (b_localtime) localtime_r(&t, &temp_tm); else gmtime_r(&t, &temp_tm); memcpy(p_tm, &temp_tm, sizeof(struct tm)); } return true; } /* A note regarding the strange strtol() testing below as pointed out SMS. From man strtol: If an underflow occurs, strtol() returns LONG_MIN. If an overflow occurs, strtol() returns LONG_MAX. In both cases, errno is set to ERANGE. This implies that one should only look at errno if the value is LONG_MIN or LONG_MAX. */ #define set_ltime_field(TM_FIELD, LT_FIELD, ADD_CONSTANT) \ { \ char num[10]; long tmp; \ memcpy(num, p_ldate->LT_FIELD, sizeof(p_ldate->LT_FIELD)); \ num[sizeof(p_ldate->LT_FIELD)] = '\0'; \ errno = 0; \ tmp = strtol(num, \ (char **)NULL, 10); \ if ( tmp < INT_MIN || tmp > INT_MAX || \ ((unsigned long)tmp + ADD_CONSTANT) > INT_MAX || \ (tmp + ADD_CONSTANT) < INT_MIN ) \ return false; \ p_tm->TM_FIELD = tmp + ADD_CONSTANT; \ } /*! Get "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. */ bool iso9660_get_ltime (const iso9660_ltime_t *p_ldate, /*out*/ struct tm *p_tm) { if (!p_tm) return false; memset(p_tm, 0, sizeof(struct tm)); set_ltime_field(tm_year, lt_year, -1900); set_ltime_field(tm_mon, lt_month, -1); set_ltime_field(tm_mday, lt_day, 0); set_ltime_field(tm_hour, lt_hour, 0); set_ltime_field(tm_min, lt_minute, 0); set_ltime_field(tm_sec, lt_second, 0); p_tm->tm_isdst= -1; /* information not available */ #ifndef HAVE_TM_GMTOFF p_tm->tm_sec += p_ldate->lt_gmtoff * (15 * 60); #endif #ifdef HAVE_STRUCT_TM_TM_ZONE /* Initialize everything */ p_tm->tm_zone = 0; #endif /* Recompute tm_wday and tm_yday via mktime. mktime will also renormalize date values to account for the timezone offset. */ { time_t t; struct tm temp_tm; t = mktime(p_tm); localtime_r(&t, &temp_tm); memcpy(p_tm, &temp_tm, sizeof(struct tm)); } p_tm->tm_isdst= -1; /* information not available */ #ifdef HAVE_TM_GMTOFF p_tm->tm_gmtoff = -p_ldate->lt_gmtoff * (15 * 60); #endif return true; } /*! Set time in format used in ISO 9660 directory index record from a Unix time structure. timezone is given as an offset correction in minutes. */ void iso9660_set_dtime_with_timezone (const struct tm *p_tm, int time_zone, /*out*/ iso9660_dtime_t *p_idr_date) { memset (p_idr_date, 0, 7); if (!p_tm) return; p_idr_date->dt_year = p_tm->tm_year; p_idr_date->dt_month = p_tm->tm_mon + 1; p_idr_date->dt_day = p_tm->tm_mday; p_idr_date->dt_hour = p_tm->tm_hour; p_idr_date->dt_minute = p_tm->tm_min; p_idr_date->dt_second = p_tm->tm_sec; /* The ISO 9660 timezone is in the range -48..+52 and each unit represents a 15-minute interval. */ p_idr_date->dt_gmtoff = time_zone / 15; if (p_idr_date->dt_gmtoff < -48 ) { cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted", p_idr_date->dt_gmtoff); p_idr_date->dt_gmtoff = -48; } else if (p_idr_date->dt_gmtoff > 52) { cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted", p_idr_date->dt_gmtoff); p_idr_date->dt_gmtoff = 52; } } /*! Set time in format used in ISO 9660 directory index record from a Unix time structure. */ void iso9660_set_dtime(const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date) { int time_zone = 0; if (p_tm) { #ifdef HAVE_TM_GMTOFF /* Convert seconds to minutes */ time_zone = p_tm->tm_gmtoff / 60; #else time_zone = (p_tm->tm_isdst > 0) ? -60 : 0; #endif } iso9660_set_dtime_with_timezone (p_tm, time_zone, p_idr_date); } /*! Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. timezone is given as an offset correction in minutes. */ void iso9660_set_ltime_with_timezone(const struct tm *p_tm, int time_zone, /*out*/ iso9660_ltime_t *pvd_date) { char *_pvd_date = (char *) pvd_date; memset (_pvd_date, (int) '0', 16); pvd_date->lt_gmtoff = (iso712_t) 0; /* Start out with time zone GMT. */ if (!p_tm) return; #if defined(__GNUC__) && !defined(__DARWIN_C_ANSI) #pragma GCC diagnostic ignored "-Wformat-truncation" #endif snprintf(_pvd_date, 17, "%4.4d%2.2d%2.2d" "%2.2d%2.2d%2.2d" "%2.2d", p_tm->tm_year + 1900, p_tm->tm_mon + 1, p_tm->tm_mday, p_tm->tm_hour, p_tm->tm_min, p_tm->tm_sec, 0 /* 1/100 secs */ ); /* Set time zone in 15-minute interval encoding. */ pvd_date->lt_gmtoff -= (time_zone / 15); if (pvd_date->lt_gmtoff < -48 ) { cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted", (int) pvd_date->lt_gmtoff); pvd_date->lt_gmtoff = -48; } else if (pvd_date->lt_gmtoff > 52) { cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted", (int) pvd_date->lt_gmtoff); pvd_date->lt_gmtoff = 52; } } /*! Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. */ void iso9660_set_ltime(const struct tm *p_tm, /*out*/ iso9660_ltime_t *pvd_date) { int time_zone = 0; if (p_tm) { #ifdef HAVE_TM_GMTOFF /* Set time zone in 15-minute interval encoding. */ time_zone = p_tm->tm_gmtoff / 60; #else time_zone = (p_tm->tm_isdst > 0) ? -60 : 0; #endif } iso9660_set_ltime_with_timezone (p_tm, time_zone, pvd_date); } /*! Convert an ISO-9660 file name which is in the format usually stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @return length of the translated string is returned. It will be no greater than the length of psz_oldname. */ int iso9660_name_translate(const char *psz_oldname, char *psz_newname) { return iso9660_name_translate_ext(psz_oldname, psz_newname, 0); } /*! Convert an ISO-9660 file name which is in the format usually stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the other ;'s into version numbers. @param psz_oldname the ISO-9660 filename to be translated. @param psz_newname returned string. The caller allocates this and it should be at least the size of psz_oldname. @param u_joliet_level 0 if not using Joliet Extension. Otherwise the Joliet level. @return length of the translated string is returned. It will be no greater than the length of psz_oldname. */ int iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname, uint8_t u_joliet_level) { int len = strlen(psz_oldname); int i; if (0 == len) return 0; for (i = 0; i < len; i++) { unsigned char c = psz_oldname[i]; if (!c) break; /* Lower case, unless we have Joliet extensions. */ if (!u_joliet_level && isupper(c)) c = tolower(c); /* Drop trailing '.;1' (ISO 9660:1988 7.5.1 requires period) */ if (c == '.' && i == len - 3 && psz_oldname[i + 1] == ';' && psz_oldname[i + 2] == '1') break; /* Drop trailing ';1' */ if (c == ';' && i == len - 2 && psz_oldname[i + 1] == '1') break; /* Convert remaining ';' to '.' */ if (c == ';') c = '.'; psz_newname[i] = c; } psz_newname[i] = '\0'; return i; } /*! Pad string src with spaces to size len and copy this to dst. If len is less than the length of src, dst will be truncated to the first len characters of src. src can also be scanned to see if it contains only ACHARs, DCHARs, 7-bit ASCII chars depending on the enumeration _check. In addition to getting changed, dst is the return value. Note: this string might not be NULL terminated. */ char * iso9660_strncpy_pad(char dst[], const char src[], size_t len, enum strncpy_pad_check _check) { size_t rlen; cdio_assert (dst != NULL); cdio_assert (src != NULL); cdio_assert (len > 0); switch (_check) { int idx; case ISO9660_NOCHECK: break; case ISO9660_7BIT: for (idx = 0; src[idx]; idx++) if ((int8_t) src[idx] < 0) { cdio_warn ("string '%s' fails 7bit constraint (pos = %d)", src, idx); break; } break; case ISO9660_ACHARS: for (idx = 0; src[idx]; idx++) if (!iso9660_is_achar (src[idx])) { cdio_warn ("string '%s' fails a-character constraint (pos = %d)", src, idx); break; } break; case ISO9660_DCHARS: for (idx = 0; src[idx]; idx++) if (!iso9660_is_dchar (src[idx])) { cdio_warn ("string '%s' fails d-character constraint (pos = %d)", src, idx); break; } break; default: cdio_assert_not_reached (); break; } rlen = strlen (src); if (rlen > len) cdio_warn ("string '%s' is getting truncated to %d characters", src, (unsigned int) len); strncpy (dst, src, len); if (rlen < len) memset(dst+rlen, ' ', len-rlen); return dst; } /*! Return true if c is a DCHAR - a valid ISO-9660 level 1 character. These are the ASCSII capital letters A-Z, the digits 0-9 and an underscore. */ bool iso9660_is_dchar (int c) { if (!IN (c, 0x30, 0x5f) || IN (c, 0x3a, 0x40) || IN (c, 0x5b, 0x5e)) return false; return true; } /*! Return true if c is an ACHAR - These are the DCHAR's plus some ASCII symbols including the space symbol. */ bool iso9660_is_achar (int c) { if (!IN (c, 0x20, 0x5f) || IN (c, 0x23, 0x24) || c == 0x40 || IN (c, 0x5b, 0x5e)) return false; return true; } void iso9660_set_evd(void *pd) { iso_volume_descriptor_t ied; cdio_assert (sizeof(iso_volume_descriptor_t) == ISO_BLOCKSIZE); cdio_assert (pd != NULL); memset(&ied, 0, sizeof(ied)); ied.type = to_711(ISO_VD_END); iso9660_strncpy_pad (ied.id, ISO_STANDARD_ID, sizeof(ied.id), ISO9660_DCHARS); ied.version = to_711(ISO_VERSION); memcpy(pd, &ied, sizeof(ied)); } void iso9660_set_pvd(void *pd, const char volume_id[], const char publisher_id[], const char preparer_id[], const char application_id[], uint32_t iso_size, const void *root_dir, uint32_t path_table_l_extent, uint32_t path_table_m_extent, uint32_t path_table_size, const time_t *pvd_time ) { iso9660_pvd_t ipd; struct tm temp_tm; cdio_assert (sizeof(iso9660_pvd_t) == ISO_BLOCKSIZE); cdio_assert (pd != NULL); cdio_assert (volume_id != NULL); cdio_assert (application_id != NULL); memset(&ipd,0,sizeof(ipd)); /* paranoia? */ /* magic stuff ... thatis CD XA marker... */ strncpy(((char*)&ipd)+ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING, strlen(ISO_XA_MARKER_STRING)+1); ipd.type = to_711(ISO_VD_PRIMARY); iso9660_strncpy_pad (ipd.id, ISO_STANDARD_ID, 5, ISO9660_DCHARS); ipd.version = to_711(ISO_VERSION); iso9660_strncpy_pad (ipd.system_id, SYSTEM_ID, 32, ISO9660_ACHARS); iso9660_strncpy_pad (ipd.volume_id, volume_id, 32, ISO9660_DCHARS); ipd.volume_space_size = to_733(iso_size); ipd.volume_set_size = to_723(1); ipd.volume_sequence_number = to_723(1); ipd.logical_block_size = to_723(ISO_BLOCKSIZE); ipd.path_table_size = to_733(path_table_size); ipd.type_l_path_table = to_731(path_table_l_extent); ipd.type_m_path_table = to_732(path_table_m_extent); /* root_directory_record doesn't contain the 1-byte filename, so we add one for that. */ cdio_assert (sizeof(ipd.root_directory_record) == 33); memcpy(&(ipd.root_directory_record), root_dir, sizeof(ipd.root_directory_record)); ipd.root_directory_filename='\0'; ipd.root_directory_record.length = sizeof(ipd.root_directory_record)+1; iso9660_strncpy_pad (ipd.volume_set_id, VOLUME_SET_ID, ISO_MAX_VOLUMESET_ID, ISO9660_DCHARS); iso9660_strncpy_pad (ipd.publisher_id, publisher_id, ISO_MAX_PUBLISHER_ID, ISO9660_ACHARS); iso9660_strncpy_pad (ipd.preparer_id, preparer_id, ISO_MAX_PREPARER_ID, ISO9660_ACHARS); iso9660_strncpy_pad (ipd.application_id, application_id, ISO_MAX_APPLICATION_ID, ISO9660_ACHARS); iso9660_strncpy_pad (ipd.copyright_file_id , "", 37, ISO9660_DCHARS); iso9660_strncpy_pad (ipd.abstract_file_id , "", 37, ISO9660_DCHARS); iso9660_strncpy_pad (ipd.bibliographic_file_id, "", 37, ISO9660_DCHARS); gmtime_r(pvd_time, &temp_tm); iso9660_set_ltime (&temp_tm, &(ipd.creation_date)); gmtime_r(pvd_time, &temp_tm); iso9660_set_ltime (&temp_tm, &(ipd.modification_date)); iso9660_set_ltime (NULL, &(ipd.expiration_date)); iso9660_set_ltime (NULL, &(ipd.effective_date)); ipd.file_structure_version = to_711(1); /* we leave ipd.application_data = 0 */ memcpy(pd, &ipd, sizeof(ipd)); /* copy stuff to arg ptr */ } unsigned int iso9660_dir_calc_record_size(unsigned int namelen, unsigned int su_len) { unsigned int length; length = sizeof(iso9660_dir_t); length += namelen; if (length % 2) /* pad to word boundary */ length++; length += su_len; if (length % 2) /* pad to word boundary again */ length++; return length; } void iso9660_dir_add_entry_su(void *dir, const char filename[], uint32_t extent, uint32_t size, uint8_t file_flags, const void *su_data, unsigned int su_size, const time_t *entry_time) { iso9660_dir_t *idr = dir; uint8_t *dir8 = dir; unsigned int offset = 0; uint32_t dsize = from_733(idr->size); int length, su_offset; struct tm temp_tm = { 0 }; cdio_assert (sizeof(iso9660_dir_t) == 33); if (!dsize && !idr->length) dsize = ISO_BLOCKSIZE; /* for when dir lacks '.' entry */ cdio_assert (dsize > 0 && !(dsize % ISO_BLOCKSIZE)); cdio_assert (dir != NULL); cdio_assert (extent > 17); cdio_assert (filename != NULL); cdio_assert (strlen(filename) <= MAX_ISOPATHNAME); length = sizeof(iso9660_dir_t); length += strlen(filename); length = _cdio_ceil2block (length, 2); /* pad to word boundary */ su_offset = length; length += su_size; length = _cdio_ceil2block (length, 2); /* pad to word boundary again */ /* find the last entry's end */ { unsigned int ofs_last_rec = 0; offset = 0; while (offset < dsize) { if (!dir8[offset]) { offset++; continue; } offset += dir8[offset]; ofs_last_rec = offset; } cdio_assert (offset == dsize); offset = ofs_last_rec; } /* be sure we don't cross sectors boundaries */ offset = _cdio_ofs_add (offset, length, ISO_BLOCKSIZE); offset -= length; cdio_assert (offset + length <= dsize); idr = (iso9660_dir_t *) &dir8[offset]; cdio_assert (offset+length < dsize); memset(idr, 0, length); idr->length = to_711(length); idr->extent = to_733(extent); idr->size = to_733(size); gmtime_r(entry_time, &temp_tm); iso9660_set_dtime (&temp_tm, &(idr->recording_time)); idr->file_flags = to_711(file_flags); idr->volume_sequence_number = to_723(1); idr->filename.len = to_711(strlen(filename) ? strlen(filename) : 1); /* working hack! */ memcpy(&idr->filename.str[1], filename, from_711(idr->filename.len)); if (su_size > 0 && su_data) memcpy(&dir8[offset] + su_offset, su_data, su_size); } void iso9660_dir_init_new (void *dir, uint32_t self, uint32_t ssize, uint32_t parent, uint32_t psize, const time_t *dir_time) { iso9660_dir_init_new_su (dir, self, ssize, NULL, 0, parent, psize, NULL, 0, dir_time); } void iso9660_dir_init_new_su (void *dir, uint32_t self, uint32_t ssize, const void *ssu_data, unsigned int ssu_size, uint32_t parent, uint32_t psize, const void *psu_data, unsigned int psu_size, const time_t *dir_time) { cdio_assert (ssize > 0 && !(ssize % ISO_BLOCKSIZE)); cdio_assert (psize > 0 && !(psize % ISO_BLOCKSIZE)); cdio_assert (dir != NULL); memset (dir, 0, ssize); /* "\0" -- working hack due to padding */ iso9660_dir_add_entry_su (dir, "\0", self, ssize, ISO_DIRECTORY, ssu_data, ssu_size, dir_time); iso9660_dir_add_entry_su (dir, "\1", parent, psize, ISO_DIRECTORY, psu_data, psu_size, dir_time); } /* Zero's out pathable. Do this first. */ void iso9660_pathtable_init (void *pt) { cdio_assert (sizeof (iso_path_table_t) == 8); cdio_assert (pt != NULL); memset (pt, 0, ISO_BLOCKSIZE); /* fixme */ } /*! Returns POSIX mode bitstring for a given file. */ mode_t iso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent) { mode_t mode = 0; #ifdef HAVE_ROCK if (yep == p_iso_dirent->rr.b3_rock) { return iso9660_get_posix_filemode_from_rock(&p_iso_dirent->rr); } else #endif if (p_iso_dirent->b_xa) { return iso9660_get_posix_filemode_from_xa(p_iso_dirent->xa.attributes); } return mode; } static const iso_path_table_t * pathtable_get_entry (const void *pt, unsigned int entrynum) { const uint8_t *tmp = pt; unsigned int offset = 0; unsigned int count = 0; cdio_assert (pt != NULL); while (from_711 (*tmp)) { if (count == entrynum) break; cdio_assert (count < entrynum); offset += sizeof (iso_path_table_t); offset += from_711 (*tmp); if (offset % 2) offset++; tmp = (uint8_t *)pt + offset; count++; } if (!from_711 (*tmp)) return NULL; return (const void *) tmp; } void pathtable_get_size_and_entries (const void *pt, unsigned int *size, unsigned int *entries) { const uint8_t *tmp = pt; unsigned int offset = 0; unsigned int count = 0; cdio_assert (pt != NULL); while (from_711 (*tmp)) { offset += sizeof (iso_path_table_t); offset += from_711 (*tmp); if (offset % 2) offset++; tmp = (uint8_t *)pt + offset; count++; } if (size) *size = offset; if (entries) *entries = count; } unsigned int iso9660_pathtable_get_size (const void *pt) { unsigned int size = 0; pathtable_get_size_and_entries (pt, &size, NULL); return size; } uint16_t iso9660_pathtable_l_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent) { iso_path_table_t *ipt = (iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt)); size_t name_len = strlen (name) ? strlen (name) : 1; unsigned int entrynum = 0; cdio_assert (iso9660_pathtable_get_size (pt) < ISO_BLOCKSIZE); /*fixme */ memset (ipt, 0, sizeof (iso_path_table_t) + name_len); /* paranoia */ ipt->name_len = to_711 (name_len); ipt->extent = to_731 (extent); ipt->parent = to_721 (parent); memcpy (ipt->name, name, name_len); pathtable_get_size_and_entries (pt, NULL, &entrynum); if (entrynum > 1) { const iso_path_table_t *ipt2 = pathtable_get_entry (pt, entrynum - 2); cdio_assert (ipt2 != NULL); cdio_assert (from_721 (ipt2->parent) <= parent); } return entrynum; } uint16_t iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent) { iso_path_table_t *ipt = (iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt)); size_t name_len = strlen (name) ? strlen (name) : 1; unsigned int entrynum = 0; cdio_assert (iso9660_pathtable_get_size(pt) < ISO_BLOCKSIZE); /* fixme */ memset(ipt, 0, sizeof (iso_path_table_t) + name_len); /* paranoia */ ipt->name_len = to_711 (name_len); ipt->extent = to_732 (extent); ipt->parent = to_722 (parent); memcpy (ipt->name, name, name_len); pathtable_get_size_and_entries (pt, NULL, &entrynum); if (entrynum > 1) { const iso_path_table_t *ipt2 = pathtable_get_entry (pt, entrynum - 2); cdio_assert (ipt2 != NULL); cdio_assert (from_722 (ipt2->parent) <= parent); } return entrynum; } /*! Check that pathname is a valid ISO-9660 directory name. A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs. */ bool iso9660_dirname_valid_p (const char pathname[]) { const char *p = pathname; int len; cdio_assert (pathname != NULL); if (*p == '/' || *p == '.' || *p == '\0') return false; if (strlen (pathname) > MAX_ISOPATHNAME) return false; len = 0; for (; *p; p++) if (iso9660_is_dchar (*p)) { len++; if (len > 8) return false; } else if (*p == '/') { if (!len) return false; len = 0; } else return false; /* unexpected char */ if (!len) return false; /* last char may not be '/' */ return true; } /*! Check that pathname is a valid ISO-9660 pathname. A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs. True is returned if pathname is valid. */ bool iso9660_pathname_valid_p (const char pathname[]) { const char *p = NULL; cdio_assert (pathname != NULL); if ((p = strrchr (pathname, '/'))) { bool rc; char *_tmp = strdup (pathname); *strrchr (_tmp, '/') = '\0'; rc = iso9660_dirname_valid_p (_tmp); free (_tmp); if (!rc) return false; p++; } else p = pathname; if (strlen (pathname) > (MAX_ISOPATHNAME - 6)) return false; { int len = 0; int dots = 0; for (; *p; p++) if (iso9660_is_dchar (*p)) { len++; if (dots == 0 ? len > 8 : len > 3) return false; } else if (*p == '.') { dots++; if (dots > 1) return false; if (!len) return false; len = 0; } else return false; if (dots != 1) return false; } return true; } /*! Take pathname and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followd by ";" and the version number. For example, mydir/file.ext -> mydir/file.ext;1 for version 1. The resulting ISO-9660 pathname is returned. */ char * iso9660_pathname_isofy (const char pathname[], uint16_t version) { char tmpbuf[1024] = { 0, }; cdio_assert (strlen (pathname) < (sizeof (tmpbuf) - sizeof (";65535"))); snprintf (tmpbuf, sizeof(tmpbuf), "%s;%d", pathname, version); return strdup (tmpbuf); } /*! Return the PVD's application ID. NULL is returned if there is some problem in getting this. */ char * iso9660_get_application_id(iso9660_pvd_t *p_pvd) { if (NULL==p_pvd) return NULL; return strdup(strip_trail(p_pvd->application_id, ISO_MAX_APPLICATION_ID)); } #ifdef FIXME lsn_t iso9660_get_dir_extent(const iso9660_dir_t *idr) { if (NULL == idr) return 0; return from_733(idr->extent); } #endif uint8_t iso9660_get_dir_len(const iso9660_dir_t *idr) { if (NULL == idr) return 0; return idr->length; } #ifdef FIXME uint8_t iso9660_get_dir_size(const iso9660_dir_t *idr) { if (NULL == idr) return 0; return from_733(idr->size); } #endif uint8_t iso9660_get_pvd_type(const iso9660_pvd_t *pvd) { if (NULL == pvd) return 255; return(pvd->type); } const char * iso9660_get_pvd_id(const iso9660_pvd_t *pvd) { if (NULL == pvd) return "ERR"; return(pvd->id); } int iso9660_get_pvd_space_size(const iso9660_pvd_t *pvd) { if (NULL == pvd) return 0; return from_733(pvd->volume_space_size); } int iso9660_get_pvd_block_size(const iso9660_pvd_t *pvd) { if (NULL == pvd) return 0; return from_723(pvd->logical_block_size); } /*! Return the primary volume id version number (of pvd). If there is an error 0 is returned. */ int iso9660_get_pvd_version(const iso9660_pvd_t *pvd) { if (NULL == pvd) return 0; return pvd->version; } /*! Return the LSN of the root directory for pvd. If there is an error CDIO_INVALID_LSN is returned. */ lsn_t iso9660_get_root_lsn(const iso9660_pvd_t *pvd) { if (NULL == pvd) return CDIO_INVALID_LSN; else { const iso9660_dir_t *idr = &(pvd->root_directory_record); if (NULL == idr) return CDIO_INVALID_LSN; return(from_733 (idr->extent)); } } /*! Return a string containing the preparer id with trailing blanks removed. */ char * iso9660_get_preparer_id(const iso9660_pvd_t *pvd) { if (NULL==pvd) return NULL; return strdup(strip_trail(pvd->preparer_id, ISO_MAX_PREPARER_ID)); } /*! Return a string containing the publisher id with trailing blanks removed. */ char * iso9660_get_publisher_id(const iso9660_pvd_t *pvd) { if (NULL==pvd) return NULL; return strdup(strip_trail(pvd->publisher_id, ISO_MAX_PUBLISHER_ID)); } /*! Return a string containing the PVD's system id with trailing blanks removed. */ char * iso9660_get_system_id(const iso9660_pvd_t *pvd) { if (NULL==pvd) return NULL; return strdup(strip_trail(pvd->system_id, ISO_MAX_SYSTEM_ID)); } /*! Return the PVD's volume ID. */ char * iso9660_get_volume_id(const iso9660_pvd_t *pvd) { if (NULL == pvd) return NULL; return strdup(strip_trail(pvd->volume_id, ISO_MAX_VOLUME_ID)); } /*! Return the PVD's volumeset ID. NULL is returned if there is some problem in getting this. */ char * iso9660_get_volumeset_id(const iso9660_pvd_t *pvd) { if ( NULL == pvd ) return NULL; return strdup(strip_trail(pvd->volume_set_id, ISO_MAX_VOLUMESET_ID)); } /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/iso9660/iso9660_fs.c000066400000000000000000001625171474051130400167730ustar00rootroot00000000000000/* Copyright (C) 2003-2008, 2011-2015, 2017, 2024 Rocky Bernstein Copyright (C) 2018, 2020 Pete Batard Copyright (C) 2018 Thomas Schmitt Copyright (C) 2001 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* iso9660 filesystem-based routines */ /* FIXME: _cdio_list_free for iso9660 statbuf is insufficient because it doesn't free bits that are allocated inside the data. */ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_LANGINFO_CODESET #include #endif #include #include #include #include #include /* Private headers */ #include "cdio_assert.h" #include "_cdio_stdio.h" #include "cdio_private.h" /** Implementation of iso9660_t type */ struct _iso9660_s { cdio_header_t header; /**< Internal header - MUST come first. */ CdioDataSource_t *stream; /**< Stream pointer */ bool_3way_t b_xa; /**< true if has XA attributes. */ bool_3way_t b_mode2; /**< true if has mode 2, false for mode 1. */ uint8_t u_joliet_level; /**< 0 = no Joliet extensions. 1-3: Joliet level. */ iso9660_pvd_t pvd; iso9660_svd_t svd; iso_extension_mask_t iso_extension_mask; /**< What extensions we tolerate. */ uint32_t i_datastart; /**< Usually 0 when i_framesize is ISO_BLOCKSIZE. This is the normal condition. But in a fuzzy read we may be reading a CD-image and not a true ISO 9660 image this might be CDIO_CD_SYNC_SIZE */ uint32_t i_framesize; /**< Usually ISO_BLOCKSIZE (2048), but in a fuzzy read, we may be reading a CD-image and not a true ISO 9660 image this might be CDIO_CD_FRAMESIZE_RAW (2352) or M2RAW_SECTOR_SIZE (2336). */ int i_fuzzy_offset; /**< Adjustment in bytes to make ISO_STANDARD_ID ("CD001") come out as ISO_PVD_SECTOR (frame 16). Normally this should be 0 for an ISO 9660 image, but if one is say reading a BIN/CUE or cdrdao BIN/TOC without having the CUE or TOC and trying to extract an ISO-9660 filesystem inside that it may be different. */ bool b_have_superblock; /**< Superblock has been read in? */ }; static long int iso9660_seek_read_framesize (const iso9660_t *p_iso, void *ptr, lsn_t start, long int size, uint16_t i_framesize); /* Adjust the p_iso's i_datastart, i_byte_offset and i_framesize based on whether we find a frame header or not. */ static void adjust_fuzzy_pvd( iso9660_t *p_iso ) { long int i_byte_offset; if (!p_iso) return; i_byte_offset = (ISO_PVD_SECTOR * p_iso->i_framesize) + p_iso->i_fuzzy_offset + p_iso->i_datastart; /* If we have a raw 2352-byte frame then we should expect to see a sync frame and a header. */ if (CDIO_CD_FRAMESIZE_RAW == p_iso->i_framesize) { char buf[CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE]; i_byte_offset -= CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE; if ( DRIVER_OP_SUCCESS != cdio_stream_seek (p_iso->stream, i_byte_offset, SEEK_SET) ) return; if (sizeof(buf) == cdio_stream_read (p_iso->stream, buf, sizeof(buf), 1)) { /* Does the sector frame header suggest Mode 1 format? */ if (!memcmp(CDIO_SECTOR_SYNC_HEADER, buf+CDIO_CD_SUBHEADER_SIZE, CDIO_CD_SYNC_SIZE)) { if (buf[14+CDIO_CD_SUBHEADER_SIZE] != 0x16) { cdio_warn ("Expecting the PVD sector header MSF to be 0x16, is: %x", buf[14]); } if (buf[15+CDIO_CD_SUBHEADER_SIZE] != 0x1) { cdio_warn ("Expecting the PVD sector mode to be Mode 1 is: %x", buf[15]); } p_iso->b_mode2 = nope; p_iso->b_xa = nope; } else if (!memcmp(CDIO_SECTOR_SYNC_HEADER, buf, CDIO_CD_SYNC_SIZE)) { /* Frame header indicates Mode 2 Form 1*/ if (buf[14] != 0x16) { cdio_warn ("Expecting the PVD sector header MSF to be 0x16, is: %x", buf[14]); } if (buf[15] != 0x2) { cdio_warn ("Expecting the PVD sector mode to be Mode 2 is: %x", buf[15]); } p_iso->b_mode2 = yep; /* Do do: check Mode 2 Form 2? */ } else { /* Has no frame header */ p_iso->i_framesize = M2RAW_SECTOR_SIZE; p_iso->i_fuzzy_offset = (CDIO_CD_FRAMESIZE_RAW - M2RAW_SECTOR_SIZE) * ISO_PVD_SECTOR + p_iso->i_fuzzy_offset + p_iso->i_datastart; p_iso->i_datastart = 0; } } } } /*! Open an ISO 9660 image for reading in either fuzzy mode or not. */ static iso9660_t * iso9660_open_ext_private (const char *psz_path, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz, bool b_fuzzy) { iso9660_t *p_iso = (iso9660_t *) calloc(1, sizeof(iso9660_t)) ; if (!p_iso) return NULL; p_iso->header.u_type = CDIO_HEADER_TYPE_ISO; p_iso->stream = cdio_stdio_new( psz_path ); if (NULL == p_iso->stream) goto error; p_iso->i_framesize = ISO_BLOCKSIZE; p_iso->b_have_superblock = (b_fuzzy) ? iso9660_ifs_fuzzy_read_superblock(p_iso, iso_extension_mask, i_fuzz) : iso9660_ifs_read_superblock(p_iso, iso_extension_mask) ; if ( ! p_iso->b_have_superblock ) goto error; /* Determine if image has XA attributes. */ p_iso->b_xa = strncmp ((char *) &(p_iso->pvd) + ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING, sizeof (ISO_XA_MARKER_STRING)) ? nope : yep; p_iso->iso_extension_mask = iso_extension_mask; return p_iso; error: if (p_iso && p_iso->stream) cdio_stdio_destroy(p_iso->stream); free(p_iso); return NULL; } /*! Open an ISO 9660 image for reading. Maybe in the future we will have a mode. NULL is returned on error. @param psz_path full path of ISO9660 file. @return a IS9660 structure is unconditionally returned. The caller should call iso9660_close() when done. */ iso9660_t * iso9660_open (const char *psz_path /*, mode*/) { return iso9660_open_ext(psz_path, ISO_EXTENSION_NONE); } /*! Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. NULL is returned on error. @see iso9660_open_fuzzy */ iso9660_t * iso9660_open_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask) { return iso9660_open_ext_private(psz_path, iso_extension_mask, 0, false); } /*! Open an ISO 9660 image for "fuzzy" reading. This means that we will try to guess various internal offset based on internal checks. This may be useful when trying to read an ISO 9660 image contained in a file format that libiso9660 doesn't know natively (or knows imperfectly.) Some tolerence allowed for positioning the ISO 9660 image. We scan for STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. NULL is returned on error. @see iso9660_open, @see iso9660_fuzzy_ext */ iso9660_t * iso9660_open_fuzzy (const char *psz_path, uint16_t i_fuzz /*, mode*/) { return iso9660_open_fuzzy_ext(psz_path, ISO_EXTENSION_NONE, i_fuzz); } /*! Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). Maybe in the future we will have a mode. NULL is returned on error. @see iso9660_open_ext @see iso9660_open_fuzzy */ iso9660_t * iso9660_open_fuzzy_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) { return iso9660_open_ext_private(psz_path, iso_extension_mask, i_fuzz, true); } /*! Close previously opened ISO 9660 image and free resources associated with the image. Call this when done using using an ISO 9660 image. @return true is unconditionally returned. If there was an error false would be returned. */ bool iso9660_close (iso9660_t *p_iso) { if (NULL != p_iso) { cdio_stdio_destroy(p_iso->stream); p_iso->stream = NULL; free(p_iso); } return true; } static bool check_pvd (const iso9660_pvd_t *p_pvd, cdio_log_level_t log_level) { if ( ISO_VD_PRIMARY != from_711(p_pvd->type) ) { cdio_log (log_level, "unexpected PVD type %d", p_pvd->type); return false; } if (strncmp (p_pvd->id, ISO_STANDARD_ID, strlen (ISO_STANDARD_ID))) { cdio_log (log_level, "unexpected ID encountered (expected '" ISO_STANDARD_ID "', got '%.5s')", p_pvd->id); return false; } return true; } /*! Core procedure for the iso9660_ifs_get_###_id() calls. pvd_member/svd_member is a pointer to an achar_t or dchar_t ID string which we can superset as char. If the Joliet converted string is the same as the achar_t/dchar_t one, we fall back to using the latter, as it may be longer. */ static inline bool get_member_id(iso9660_t *p_iso, cdio_utf8_t **p_psz_member_id, char* pvd_member, char* svd_member, size_t max_size) { int j; bool strip; if (!p_iso) { *p_psz_member_id = NULL; return false; } #ifdef HAVE_JOLIET if (p_iso->u_joliet_level) { /* Translate USC-2 string from Secondary Volume Descriptor */ if (cdio_charset_to_utf8(svd_member, max_size, p_psz_member_id, "UCS-2BE")) { /* NB: *p_psz_member_id is never NULL on success. */ if (strncmp(*p_psz_member_id, pvd_member, strlen(*p_psz_member_id)) != 0) { /* Strip trailing spaces */ for (j = strlen(*p_psz_member_id)-1; j >= 0; j--) { if ((*p_psz_member_id)[j] != ' ') break; (*p_psz_member_id)[j] = '\0'; } if ((*p_psz_member_id)[0] != 0) { /* Joliet string is not empty and differs from non Joliet one => use it */ return true; } } /* Joliet string was either empty or same */ free(*p_psz_member_id); } } #endif /*HAVE_JOLIET*/ *p_psz_member_id = calloc(max_size+1, sizeof(cdio_utf8_t)); if (!*p_psz_member_id) { cdio_warn("Memory allocation error"); return false; } /* Copy string while removing trailing spaces */ (*p_psz_member_id)[max_size] = 0; for (strip=true, j=max_size-1; j>=0; j--) { if (strip && (pvd_member[j] == ' ')) continue; strip = false; (*p_psz_member_id)[j] = pvd_member[j]; } if (strlen(*p_psz_member_id) == 0) { free(*p_psz_member_id); *p_psz_member_id = NULL; return false; } return true; } /*! Return the application ID. NULL is returned in psz_app_id if there is some problem in getting this. */ bool iso9660_ifs_get_application_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_app_id) { return get_member_id(p_iso, p_psz_app_id, (char*)p_iso->pvd.application_id, (char*)p_iso->svd.application_id, ISO_MAX_APPLICATION_ID); } /*! Return the Joliet level recognized for p_iso. */ uint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso) { if (!p_iso) return 0; return p_iso->u_joliet_level; } /*! Return a string containing the preparer id with trailing blanks removed. */ bool iso9660_ifs_get_preparer_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_preparer_id) { return get_member_id(p_iso, p_psz_preparer_id, (char*)p_iso->pvd.preparer_id, (char*)p_iso->svd.preparer_id, ISO_MAX_PREPARER_ID); } /*! Return a string containing the PVD's publisher id with trailing blanks removed. */ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_publisher_id) { return get_member_id(p_iso, p_psz_publisher_id, (char*)p_iso->pvd.publisher_id, (char*)p_iso->svd.publisher_id, ISO_MAX_PUBLISHER_ID); } /*! Return a string containing the PVD's publisher id with trailing blanks removed. */ bool iso9660_ifs_get_system_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_system_id) { return get_member_id(p_iso, p_psz_system_id, (char*)p_iso->pvd.system_id, (char*)p_iso->svd.system_id, ISO_MAX_SYSTEM_ID); } /*! Return a string containing the PVD's publisher id with trailing blanks removed. */ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_volume_id) { return get_member_id(p_iso, p_psz_volume_id, (char*)p_iso->pvd.volume_id, (char*)p_iso->svd.volume_id, ISO_MAX_VOLUME_ID); } /*! Return a string containing the PVD's publisher id with trailing blanks removed. */ bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso, /*out*/ cdio_utf8_t **p_psz_volumeset_id) { return get_member_id(p_iso, p_psz_volumeset_id, (char*)p_iso->pvd.volume_set_id, (char*)p_iso->svd.volume_set_id, ISO_MAX_VOLUMESET_ID); } /*! Read the Primary Volume Descriptor for an ISO 9660 image. True is returned if read, and false if there was an error. */ static bool iso9660_ifs_read_pvd_loglevel (const iso9660_t *p_iso, /*out*/ iso9660_pvd_t *p_pvd, cdio_log_level_t log_level) { if (0 == iso9660_iso_seek_read (p_iso, p_pvd, ISO_PVD_SECTOR, 1)) { cdio_log ( log_level, "error reading PVD sector (%d)", ISO_PVD_SECTOR ); return false; } return check_pvd(p_pvd, log_level); } /*! Read the Primary Volume Descriptor for an ISO 9660 image. True is returned if read, and false if there was an error. */ bool iso9660_ifs_read_pvd (const iso9660_t *p_iso, /*out*/ iso9660_pvd_t *p_pvd) { return iso9660_ifs_read_pvd_loglevel(p_iso, p_pvd, CDIO_LOG_WARN); } /*! Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ bool iso9660_ifs_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask) { iso9660_svd_t p_svd; /* Secondary volume descriptor. */ int i; if (!p_iso || !iso9660_ifs_read_pvd(p_iso, &(p_iso->pvd))) return false; p_iso->u_joliet_level = 0; /* There may be multiple Secondary Volume Descriptors (eg. El Torito + Joliet) */ for (i=1; (0 != iso9660_iso_seek_read (p_iso, &p_svd, ISO_PVD_SECTOR+i, 1)); i++) { if (ISO_VD_END == from_711(p_svd.type) ) /* Last SVD */ break; if ( ISO_VD_SUPPLEMENTARY == from_711(p_svd.type) ) { /* We're only interested in Joliet => make sure the SVD isn't overwritten */ if (p_iso->u_joliet_level == 0) memcpy(&(p_iso->svd), &p_svd, sizeof(iso9660_svd_t)); if (p_svd.escape_sequences[0] == 0x25 && p_svd.escape_sequences[1] == 0x2f) { switch (p_svd.escape_sequences[2]) { case 0x40: if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL1) p_iso->u_joliet_level = 1; break; case 0x43: if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL2) p_iso->u_joliet_level = 2; break; case 0x45: if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL3) p_iso->u_joliet_level = 3; break; default: cdio_info("Supplementary Volume Descriptor found, but not Joliet"); } if (p_iso->u_joliet_level > 0) { cdio_info("Found Extension: Joliet Level %d", p_iso->u_joliet_level); } } } } return true; } /*! Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem. */ bool iso9660_ifs_fuzzy_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) { /* Got some work to do to find ISO_STANDARD_ID ("CD001") */ unsigned int i; for (i=0; ii_framesize = framesizes[k]; p_iso->i_datastart = (ISO_BLOCKSIZE == framesizes[k]) ? 0 : CDIO_CD_SYNC_SIZE; p_iso->i_fuzzy_offset = 0; if (0 == iso9660_seek_read_framesize (p_iso, frame, lsn, 1, p_iso->i_framesize)) { return false; } q = memchr(frame, 'C', p_iso->i_framesize); for ( p=q; p && p < frame + p_iso->i_framesize ; p=q+1 ) { q = memchr(p, 'C', p_iso->i_framesize - (p - frame)); if ( !q || (pvd = strstr(q, ISO_STANDARD_ID)) ) break; } if (pvd) { /* Yay! Found something */ p_iso->i_fuzzy_offset = (pvd - frame - 1) - ((ISO_PVD_SECTOR-lsn)*p_iso->i_framesize) ; /* But is it *really* a PVD? */ if ( iso9660_ifs_read_pvd_loglevel(p_iso, &(p_iso->pvd), CDIO_LOG_DEBUG) ) { adjust_fuzzy_pvd(p_iso); return true; } } } } } return false; } /*! Read the Primary Volume Descriptor for of CD. */ bool iso9660_fs_read_pvd(const CdIo_t *p_cdio, /*out*/ iso9660_pvd_t *p_pvd) { /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/ char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; driver_return_code_t driver_return = cdio_read_data_sectors (p_cdio, buf, ISO_PVD_SECTOR, ISO_BLOCKSIZE, 1); if (DRIVER_OP_SUCCESS != driver_return) { cdio_warn ("error reading PVD sector (%d) error %d", ISO_PVD_SECTOR, driver_return); return false; } /* The size of a PVD or SVD is smaller than a sector. So we allocated a bigger block above (buf) and now we'll copy just the part we need to save. */ cdio_assert (sizeof(buf) >= sizeof (iso9660_pvd_t)); memcpy(p_pvd, buf, sizeof(iso9660_pvd_t)); return check_pvd(p_pvd, CDIO_LOG_WARN); } /*! Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ bool iso9660_fs_read_superblock (CdIo_t *p_cdio, iso_extension_mask_t iso_extension_mask) { if (!p_cdio) return false; { generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; iso9660_pvd_t *p_pvd = &(p_env->pvd); iso9660_svd_t *p_svd = &(p_env->svd); char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; driver_return_code_t driver_return; if ( !iso9660_fs_read_pvd(p_cdio, p_pvd) ) return false; p_env->u_joliet_level = 0; driver_return = cdio_read_data_sectors ( p_cdio, buf, ISO_PVD_SECTOR+1, ISO_BLOCKSIZE, 1 ); if (DRIVER_OP_SUCCESS == driver_return) { /* The size of a PVD or SVD is smaller than a sector. So we allocated a bigger block above (buf) and now we'll copy just the part we need to save. */ cdio_assert (sizeof(buf) >= sizeof (iso9660_svd_t)); memcpy(p_svd, buf, sizeof(iso9660_svd_t)); if ( ISO_VD_SUPPLEMENTARY == from_711(p_svd->type) ) { if (p_svd->escape_sequences[0] == 0x25 && p_svd->escape_sequences[1] == 0x2f) { switch (p_svd->escape_sequences[2]) { case 0x40: if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL1) p_env->u_joliet_level = 1; break; case 0x43: if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL2) p_env->u_joliet_level = 2; break; case 0x45: if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL3) p_env->u_joliet_level = 3; break; default: cdio_info("Supplementary Volume Descriptor found, but not Joliet"); } if (p_env->u_joliet_level > 0) { cdio_info("Found Extension: Joliet Level %d", p_env->u_joliet_level); } } } } } return true; } /*! Seek to a position and then read n blocks. Size read is returned. */ static long int iso9660_seek_read_framesize (const iso9660_t *p_iso, void *ptr, lsn_t start, long int size, uint16_t i_framesize) { long int ret; int64_t i_byte_offset; if (!p_iso) return 0; i_byte_offset = (start * (int64_t)(p_iso->i_framesize)) + p_iso->i_fuzzy_offset + p_iso->i_datastart; ret = cdio_stream_seek (p_iso->stream, i_byte_offset, SEEK_SET); if (ret!=0) return 0; return cdio_stream_read (p_iso->stream, ptr, i_framesize, size); } /*! Seek to a position and then read n blocks. Size read is returned. */ long int iso9660_iso_seek_read (const iso9660_t *p_iso, void *ptr, lsn_t start, long int size) { return iso9660_seek_read_framesize(p_iso, ptr, start, size, ISO_BLOCKSIZE); } /*! Check for the end of a directory record list in a single directory block. If at the end, set the offset to start of the next block and return "true". The caller often skips actions only when at the end of a record list. */ static bool iso9660_check_dir_block_end(iso9660_dir_t *p_iso9660_dir, unsigned *offset) { if (!iso9660_get_dir_len(p_iso9660_dir)) { /* Length 0 indicates that no more directory records are in this block. This matches how Linux and libburn's libisofs work. Note that assignment below does not exactly round up. If (offset % ISO_BLOCKSIZE) == 0 then offset is incremented by ISO_BLOCKSIZE, i.e. the block is skipped. */ *offset += ISO_BLOCKSIZE - (*offset % ISO_BLOCKSIZE); return true; } if ((*offset + iso9660_get_dir_len(p_iso9660_dir) - 1) / ISO_BLOCKSIZE != *offset / ISO_BLOCKSIZE) { /* Directory record spans over block limit. Hop to next block where a new record is supposed to begin, if it is not after the end of the directory data. */ *offset += ISO_BLOCKSIZE - (*offset % ISO_BLOCKSIZE); return true; } return false; } static inline bool _iso9660_is_rock_ridge_enabled(void* p_image) { cdio_header_t* p_header = (cdio_header_t*)p_image; if (!p_header) return false; if (p_header->u_type == CDIO_HEADER_TYPE_ISO) { iso9660_t* p_iso = (iso9660_t*)p_image; return (p_iso->iso_extension_mask & ISO_EXTENSION_ROCK_RIDGE); } /* Rock Ridge is always enabled for other types */ return true; } /*! Convert a directory record name to a 0-terminated string. One of parameters alloc_result and cpy_result should be non-NULL to take the result. */ static bool _iso9660_recname_to_cstring(const char *src, size_t src_len, cdio_utf8_t **alloc_result, cdio_utf8_t *cpy_result, uint8_t u_joliet_level) { #ifdef HAVE_JOLIET if (u_joliet_level) { int i_inlen = src_len; cdio_utf8_t *p_psz_out = NULL; if (cdio_charset_to_utf8(src, i_inlen, &p_psz_out, "UCS-2BE")) { if (cpy_result != NULL) strcpy(cpy_result, p_psz_out); if (alloc_result != NULL) *alloc_result = p_psz_out; else free(p_psz_out); } else { return false; } } else #endif /*HAVE_JOLIET*/ { if (alloc_result != NULL) { *alloc_result = calloc(1, src_len + 1); if (*alloc_result == NULL) return false; strncpy(*alloc_result, src, src_len); (*alloc_result)[src_len] = 0; } if (cpy_result != NULL) { strncpy(cpy_result, src, src_len); cpy_result[src_len] = 0; } } return true; } static iso9660_stat_t * _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, iso9660_stat_t *last_p_stat, void* p_image, bool_3way_t b_xa, uint8_t u_joliet_level) { uint8_t dir_len= iso9660_get_dir_len(p_iso9660_dir); iso711_t i_fname; unsigned int stat_len; iso9660_stat_t *p_stat = last_p_stat; char rr_fname[256] = ""; int i_rr_fname = 0; lsn_t extent_lsn; bool first_extent; if (!dir_len) return NULL; i_fname = from_711(p_iso9660_dir->filename.len); /* .. string in statbuf is one longer than in p_iso9660_dir's listing '\1' */ stat_len = sizeof(iso9660_stat_t) + i_fname + 2; /* Reuse multiextent p_stat if not NULL */ if (!p_stat) { p_stat = calloc(1, stat_len); first_extent = true; } else { /* Ignore Rock Ridge Deep Directory RE entries */ if (p_stat->rr.u_su_fields & ISO_ROCK_SUF_RE) goto fail; first_extent = false; } if (!p_stat) { cdio_warn("Couldn't calloc(1, %d)", stat_len); return NULL; } p_stat->type = (p_iso9660_dir->file_flags & ISO_DIRECTORY) ? _STAT_DIR : _STAT_FILE; /* Test for gaps between extents. Important: Use previous .total_size */ extent_lsn = from_733 (p_iso9660_dir->extent); if (p_stat->total_size > 0) { /* This is a follow-up extent. Check for a gap. */ if (p_stat->lsn + p_stat->total_size / ISO_BLOCKSIZE != extent_lsn || p_stat->total_size % ISO_BLOCKSIZE) { /* Gap detected. Throw error. */ cdio_warn("Non-contiguous data extents with '%s'", p_stat->filename); goto fail; } } else if (first_extent) { p_stat->lsn = extent_lsn; } /* Only now update .total_size */ p_stat->total_size += from_733(p_iso9660_dir->size); #ifdef HAVE_ROCK if (_iso9660_is_rock_ridge_enabled(p_image)) p_stat->rr.b3_rock = dunno; #endif p_stat->b_xa = false; #ifndef DO_NOT_WANT_COMPATIBILITY if (first_extent) { p_stat->size = from_733(p_iso9660_dir->size); p_stat->secsize = CDIO_EXTENT_BLOCKS(p_stat->size); } #endif /* DO_NOT_WANT_COMPATIBILITY */ /* Only resolve the full filename when we're not dealing with extent */ if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) { /* Check if this is the last part of a multiextent file */ if (!first_extent) { cdio_utf8_t *p_psz_out = NULL; int bad_multi; int i_inlen = i_fname; if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1], i_inlen, &p_psz_out, NULL, u_joliet_level)) goto fail; bad_multi = (strcmp(p_stat->filename, p_psz_out) != 0); free(p_psz_out); if (bad_multi) { cdio_warn("Non consecutive multiextent file parts for '%s'", p_stat->filename); goto fail; } } #ifdef HAVE_ROCK i_rr_fname = get_rock_ridge_filename(p_iso9660_dir, p_image, rr_fname, p_stat); #endif if (i_rr_fname > 0) { if (i_rr_fname > i_fname) { /* realloc gives valgrind errors */ iso9660_stat_t *p_stat_new = calloc(1, sizeof(iso9660_stat_t)+i_rr_fname+2); if (!p_stat_new) { cdio_warn("Couldn't calloc(1, %d)", (int)(sizeof(iso9660_stat_t)+i_rr_fname+2)); goto fail; } memcpy(p_stat_new, p_stat, stat_len); free(p_stat); p_stat = p_stat_new; } strncpy(p_stat->filename, rr_fname, i_rr_fname+1); } else { if ('\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname) { strncpy (p_stat->filename, ".", strlen(".")+1); } else if ('\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname) { strncpy (p_stat->filename, "..", strlen("..")+1); } else { int i_inlen = i_fname; if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1], i_inlen, NULL, p_stat->filename, u_joliet_level)) goto fail; } } } else { int i_inlen = i_fname; if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1], i_inlen, NULL, p_stat->filename, u_joliet_level)) goto fail; } iso9660_get_dtime(&(p_iso9660_dir->recording_time), true, &(p_stat->tm)); if (dir_len < sizeof(iso9660_dir_t)) { iso9660_stat_free(p_stat); return NULL; } { int su_length = iso9660_get_dir_len(p_iso9660_dir) - sizeof (iso9660_dir_t); su_length -= i_fname; if (su_length % 2) su_length--; if (su_length < 0 || su_length < sizeof (iso9660_xa_t)) return p_stat; if (nope == b_xa) { return p_stat; } else { iso9660_xa_t *xa_data = (void *) (((char *) p_iso9660_dir) + (iso9660_get_dir_len(p_iso9660_dir) - su_length)); cdio_log_level_t loglevel = (yep == b_xa) ? CDIO_LOG_WARN : CDIO_LOG_INFO; if (xa_data->signature[0] != 'X' || xa_data->signature[1] != 'A') { cdio_log (loglevel, "XA signature not found in ISO9660's system use area;" " ignoring XA attributes for this file entry."); cdio_debug ("%d %d %d, '%c%c' (%d, %d)", iso9660_get_dir_len(p_iso9660_dir), i_fname, su_length, xa_data->signature[0], xa_data->signature[1], xa_data->signature[0], xa_data->signature[1]); return p_stat; } p_stat->b_xa = true; p_stat->xa = *xa_data; } } return p_stat; fail: iso9660_stat_free(p_stat); return NULL; } /*! Return the directory name stored in the iso9660_dir_t A string is allocated: the caller must deallocate. This routine can return NULL if memory allocation fails. */ char * iso9660_dir_to_name (const iso9660_dir_t *iso9660_dir) { uint8_t len=iso9660_get_dir_len(iso9660_dir); if (!len) return NULL; cdio_assert (len >= sizeof (iso9660_dir_t)); /* (iso9660_dir->file_flags & ISO_DIRECTORY) */ if (iso9660_dir->filename.str[1] == '\0') return strdup("."); else if (iso9660_dir->filename.str[1] == '\1') return strdup(".."); else { return strdup(&iso9660_dir->filename.str[1]); } } /* Return a pointer to a ISO 9660 stat buffer or NULL if there's an error */ static iso9660_stat_t * _fs_stat_root (CdIo_t *p_cdio) { if (!p_cdio) return NULL; { iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL; generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_stat; bool_3way_t b_xa; if (!p_env->u_joliet_level) iso_extension_mask &= ~ISO_EXTENSION_JOLIET; /* FIXME try also with Joliet.*/ if ( !iso9660_fs_read_superblock (p_cdio, iso_extension_mask) ) { cdio_warn("Could not read ISO-9660 Superblock."); return NULL; } switch(cdio_get_discmode(p_cdio)) { case CDIO_DISC_MODE_CD_XA: b_xa = yep; break; case CDIO_DISC_MODE_CD_DATA: b_xa = nope; break; default: b_xa = dunno; } #ifdef HAVE_JOLIET p_iso9660_dir = p_env->u_joliet_level ? &(p_env->svd.root_directory_record) : &(p_env->pvd.root_directory_record) ; #else p_iso9660_dir = &(p_env->pvd.root_directory_record) ; #endif p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, NULL, p_cdio, b_xa, p_env->u_joliet_level); return p_stat; } } static iso9660_stat_t * _ifs_stat_root (iso9660_t *p_iso) { iso9660_stat_t *p_stat; iso9660_dir_t *p_iso9660_dir; #ifdef HAVE_JOLIET p_iso9660_dir = p_iso->u_joliet_level ? &(p_iso->svd.root_directory_record) : &(p_iso->pvd.root_directory_record) ; #else p_iso9660_dir = &(p_iso->pvd.root_directory_record) ; #endif p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, NULL, p_iso, p_iso->b_xa, p_iso->u_joliet_level); return p_stat; } static iso9660_stat_t * _fs_stat_traverse (const CdIo_t *p_cdio, const iso9660_stat_t *_root, char **splitpath) { unsigned offset = 0; uint8_t *_dirbuf = NULL; uint32_t blocks; iso9660_stat_t *p_stat; generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; iso9660_stat_t *p_iso9660_stat = NULL; bool skip_following_extents = false; if (!splitpath[0]) { unsigned int len=sizeof(iso9660_stat_t) + strlen(_root->filename)+1; p_stat = calloc(1, len); cdio_assert (p_stat != NULL); memcpy(p_stat, _root, len); p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max); cdio_assert (p_stat->rr.psz_symlink != NULL); memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink, p_stat->rr.i_symlink_max); return p_stat; } if (_root->type == _STAT_FILE) return NULL; cdio_assert (_root->type == _STAT_DIR); blocks = CDIO_EXTENT_BLOCKS(_root->total_size); _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); if (!_dirbuf) { cdio_warn("Couldn't calloc(1, %d)", blocks * ISO_BLOCKSIZE); return NULL; } if (cdio_read_data_sectors (p_cdio, _dirbuf, _root->lsn, ISO_BLOCKSIZE, blocks)) return NULL; while (offset < (blocks * ISO_BLOCKSIZE)) { iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset]; int cmp; if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) continue; if (skip_following_extents) { /* Do not register remaining extents of ill file */ p_iso9660_stat = NULL; } else { p_iso9660_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, p_iso9660_stat, (CdIo_t*)p_cdio, dunno, p_env->u_joliet_level); if (NULL == p_iso9660_stat) skip_following_extents = true; /* Start ill file mode */ } if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) skip_following_extents = false; /* Ill or not: The file ends now */ if (NULL == p_iso9660_stat || (p_iso9660_dir->file_flags & ISO_MULTIEXTENT)) goto skip_to_next_record; cmp = strcmp(splitpath[0], p_iso9660_stat->filename); if ( 0 != cmp && 0 == p_env->u_joliet_level && yep != p_iso9660_stat->rr.b3_rock ) { char *trans_fname = NULL; unsigned int i_trans_fname=strlen(p_iso9660_stat->filename); if (i_trans_fname) { trans_fname = calloc(1, i_trans_fname+1); if (!trans_fname) { cdio_warn("can't allocate %lu bytes", (long unsigned int) strlen(p_iso9660_stat->filename)); iso9660_stat_free(p_iso9660_stat); return NULL; } iso9660_name_translate_ext(p_iso9660_stat->filename, trans_fname, p_env->u_joliet_level); cmp = strcmp(splitpath[0], trans_fname); free(trans_fname); } } if (!cmp) { iso9660_stat_t *ret_stat = _fs_stat_traverse (p_cdio, p_iso9660_stat, &splitpath[1]); iso9660_stat_free(p_iso9660_stat); free (_dirbuf); return ret_stat; } iso9660_stat_free(p_iso9660_stat); p_iso9660_stat = NULL; skip_to_next_record:; offset += iso9660_get_dir_len(p_iso9660_dir); } cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); /* not found */ free (_dirbuf); return NULL; } static iso9660_stat_t * _fs_iso_stat_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root, char **splitpath) { unsigned offset = 0; uint8_t *_dirbuf = NULL; uint32_t blocks; int ret, cmp; iso9660_stat_t *p_stat = NULL; iso9660_dir_t *p_iso9660_dir = NULL; if (!splitpath[0]) { unsigned int len=sizeof(iso9660_stat_t) + strlen(_root->filename)+1; p_stat = calloc(1, len); cdio_assert (p_stat != NULL); memcpy(p_stat, _root, len); p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max); cdio_assert (p_stat->rr.psz_symlink != NULL); memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink, p_stat->rr.i_symlink_max); return p_stat; } if (_root->type == _STAT_FILE) return NULL; cdio_assert (_root->type == _STAT_DIR); blocks = CDIO_EXTENT_BLOCKS(_root->total_size); _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); if (!_dirbuf) { cdio_warn("Couldn't calloc(1, %d)", blocks * ISO_BLOCKSIZE); return NULL; } ret = iso9660_iso_seek_read (p_iso, _dirbuf, _root->lsn, blocks); if (ret != blocks * ISO_BLOCKSIZE) { free(_dirbuf); return NULL; } for (offset = 0; offset < (blocks * ISO_BLOCKSIZE); offset += iso9660_get_dir_len(p_iso9660_dir)) { p_iso9660_dir = (void *) &_dirbuf[offset]; if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) continue; p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, p_stat, p_iso, p_iso->b_xa, p_iso->u_joliet_level); if (!p_stat) { cdio_warn("Bad directory information for %s", splitpath[0]); free(_dirbuf); return NULL; } /* If we have multiextent file parts, loop until the last one */ if (p_iso9660_dir->file_flags & ISO_MULTIEXTENT) continue; cmp = strcmp(splitpath[0], p_stat->filename); if ( 0 != cmp && 0 == p_iso->u_joliet_level && yep != p_stat->rr.b3_rock ) { char *trans_fname = NULL; unsigned int i_trans_fname=strlen(p_stat->filename); if (i_trans_fname) { trans_fname = calloc(1, i_trans_fname+1); if (!trans_fname) { cdio_warn("can't allocate %lu bytes", (long unsigned int) strlen(p_stat->filename)); iso9660_stat_free(p_stat); return NULL; } iso9660_name_translate_ext(p_stat->filename, trans_fname, p_iso->u_joliet_level); cmp = strcmp(splitpath[0], trans_fname); free(trans_fname); } } if (!cmp) { iso9660_stat_t *ret_stat = _fs_iso_stat_traverse (p_iso, p_stat, &splitpath[1]); iso9660_stat_free(p_stat); free (_dirbuf); return ret_stat; } iso9660_stat_free(p_stat); p_stat = NULL; } cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); /* not found */ free (_dirbuf); return NULL; } /*! Return file status for psz_path. NULL is returned on error. @param p_cdio the CD object to read from @param psz_path filename path to look up and get information about @return ISO 9660 file information Important note: You make get different results looking up "/" versus "/." and the latter may give more complete information. "/" will take information from the PVD only, whereas "/." will force a directory read of "/" and find "." and in that Rock-Ridge information might be found which fills in more stat information. Ideally iso9660_fs_stat should be fixed. Patches anyone? */ iso9660_stat_t * iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[]) { iso9660_stat_t *p_root; char **p_psz_splitpath; iso9660_stat_t *p_stat; if (!p_cdio) return NULL; if (!psz_path) return NULL; p_root = _fs_stat_root (p_cdio); if (!p_root) return NULL; p_psz_splitpath = _cdio_strsplit (psz_path, '/'); p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath); iso9660_stat_free(p_root); _cdio_strfreev (p_psz_splitpath); return p_stat; } typedef iso9660_stat_t * (stat_root_t) (void *p_image); typedef iso9660_stat_t * (stat_traverse_t) (const void *p_image, const iso9660_stat_t *_root, char **splitpath); /*! Get file status for psz_path into stat. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. */ static iso9660_stat_t * fs_stat_translate (void *p_image, stat_root_t stat_root, stat_traverse_t stat_traverse, const char psz_path[]) { iso9660_stat_t *p_root; char **p_psz_splitpath; iso9660_stat_t *p_stat; if (!p_image) return NULL; if (!psz_path) return NULL; p_root = stat_root (p_image); if (!p_root) return NULL; p_psz_splitpath = _cdio_strsplit (psz_path, '/'); p_stat = stat_traverse (p_image, p_root, p_psz_splitpath); iso9660_stat_free(p_root); _cdio_strfreev (p_psz_splitpath); return p_stat; } /*! Return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. @param p_cdio the CD object to read from @param psz_path filename path to look up and get information about @return ISO 9660 file information. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t * iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[]) { return fs_stat_translate(p_cdio, (stat_root_t *) _fs_stat_root, (stat_traverse_t *) _fs_stat_traverse, psz_path); } /*! @param p_iso the ISO-9660 file image to get data from @param psz_path filename path translate @return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t * iso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[]) { return fs_stat_translate(p_iso, (stat_root_t *) _ifs_stat_root, (stat_traverse_t *) _fs_iso_stat_traverse, psz_path); } /*! @param p_cdio the CD object to read from @param pzs_path path the look up @return file status for pathname. NULL is returned on error. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t * iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[]) { iso9660_stat_t *p_root; char **splitpath; iso9660_stat_t *stat; if (!p_iso) return NULL; if (!psz_path) return NULL; p_root = _ifs_stat_root (p_iso); if (!p_root) return NULL; splitpath = _cdio_strsplit (psz_path, '/'); stat = _fs_iso_stat_traverse (p_iso, p_root, splitpath); iso9660_stat_free(p_root); _cdio_strfreev (splitpath); return stat; } /*! Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. @param p_cdio the CD object to read from @param pzs_path path the read the directory from. @return file status for psz_path. The caller must free the The caller must free the returned result using iso9660_stat_free(). */ CdioISO9660FileList_t * iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) { generic_img_private_t *p_env; iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_iso9660_stat = NULL; iso9660_stat_t *p_stat; unsigned offset = 0; uint8_t *_dirbuf = NULL; uint32_t blocks; CdioISO9660DirList_t *retval; bool skip_following_extents = false; if (!p_cdio) return NULL; if (!psz_path) return NULL; p_env = (generic_img_private_t *) p_cdio->env; p_stat = iso9660_fs_stat (p_cdio, psz_path); if (!p_stat) return NULL; if (p_stat->type != _STAT_DIR) { iso9660_stat_free(p_stat); return NULL; } /* Check for overflow on 32-bit systems. uint32_t has a limited maximum value, and if p_stat->total_size (the total size of the directory) is very large, the calculation might exceed this limit. */ if (p_stat->total_size > SIZE_MAX / ISO_BLOCKSIZE) { cdio_warn("Total size is too large"); iso9660_stat_free(p_stat); return NULL; } blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size); retval = _cdio_list_new (); /* Check for potential integer overflow when calculating total blocks */ if (blocks > (SIZE_MAX / ISO_BLOCKSIZE)) { cdio_warn("Total size is too large"); iso9660_stat_free(p_stat); return NULL; } _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); if (!_dirbuf) { cdio_warn("Couldn't calloc(1, %d)", blocks * ISO_BLOCKSIZE); iso9660_stat_free(p_stat); iso9660_dirlist_free(retval); return NULL; } if (cdio_read_data_sectors (p_cdio, _dirbuf, p_stat->lsn, ISO_BLOCKSIZE, blocks)) { iso9660_stat_free(p_stat); iso9660_dirlist_free(retval); return NULL; } while (offset < (blocks * ISO_BLOCKSIZE)) { p_iso9660_dir = (void *) &_dirbuf[offset]; if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) continue; if (skip_following_extents) { /* Do not register remaining extents of ill file */ p_iso9660_stat = NULL; } else { p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, p_iso9660_stat, p_cdio, dunno, p_env->u_joliet_level); if (NULL == p_iso9660_stat) skip_following_extents = true; /* Start ill file mode */ } if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) skip_following_extents = false; /* Ill or not: The file ends now */ if ((p_iso9660_stat) && ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) { _cdio_list_append (retval, p_iso9660_stat); p_iso9660_stat = NULL; } offset += iso9660_get_dir_len(p_iso9660_dir); } cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); free(_dirbuf); iso9660_stat_free(p_stat); return retval; } /*! Read psz_path (a directory) and return a list of iso9660_stat_t of the files inside that. The caller must free the returned result. */ CdioISO9660FileList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) { iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_iso9660_stat = NULL; iso9660_stat_t *p_stat; long int ret; unsigned offset = 0; uint8_t *_dirbuf = NULL; uint32_t blocks; CdioList_t *retval; size_t dirbuf_len; bool skip_following_extents = false; if (!p_iso) return NULL; if (!psz_path) return NULL; p_stat = iso9660_ifs_stat (p_iso, psz_path); if (!p_stat) return NULL; if (p_stat->type != _STAT_DIR) { iso9660_stat_free(p_stat); return NULL; } /* Check for overflow on 32-bit systems. uint32_t has a limited maximum value, and if p_stat->total_size (the total size of the directory) is very large, the calculation might exceed this limit. */ if (p_stat->total_size > SIZE_MAX / ISO_BLOCKSIZE) { cdio_warn("Total size is too large"); iso9660_stat_free(p_stat); return NULL; } blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size); dirbuf_len = blocks * ISO_BLOCKSIZE; retval = _cdio_list_new (); if (!dirbuf_len) { cdio_warn("Invalid directory buffer sector size %u", blocks); iso9660_stat_free(p_stat); _cdio_list_free (retval, true, NULL); return NULL; } _dirbuf = calloc(1, dirbuf_len); if (!_dirbuf) { cdio_warn("Couldn't calloc(1, %lu)", (unsigned long)dirbuf_len); iso9660_stat_free(p_stat); _cdio_list_free (retval, true, NULL); return NULL; } ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, blocks); if (ret != dirbuf_len) { _cdio_list_free (retval, true, NULL); iso9660_stat_free(p_stat); free (_dirbuf); return NULL; } while (offset < (dirbuf_len)) { p_iso9660_dir = (void *) &_dirbuf[offset]; if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) continue; if (skip_following_extents) { /* Do not register remaining extents of ill file */ p_iso9660_stat = NULL; } else { p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, p_iso9660_stat, p_iso, p_iso->b_xa, p_iso->u_joliet_level); if (NULL == p_iso9660_stat) skip_following_extents = true; /* Start ill file mode */ else if (p_iso9660_stat->rr.u_su_fields & ISO_ROCK_SUF_RE) continue; /* Ignore RE entries */ } if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) skip_following_extents = false; /* Ill or not: The file ends now */ if ((p_iso9660_stat) && ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) { _cdio_list_append(retval, p_iso9660_stat); p_iso9660_stat = NULL; } offset += iso9660_get_dir_len(p_iso9660_dir); } free (_dirbuf); iso9660_stat_free(p_stat); if (offset != dirbuf_len) { _cdio_list_free (retval, true, (CdioDataFree_t) iso9660_stat_free); return NULL; } return retval; } typedef CdioISO9660FileList_t * (iso9660_readdir_t) (void *p_image, const char * psz_path); CdioISO9660FileList_t * iso9660_filelist_new(void) { return (CdioISO9660FileList_t *) _cdio_list_new (); } CdioISO9660DirList_t * iso9660_dirlist_new(void) { return (CdioISO9660FileList_t *) _cdio_list_new (); } static iso9660_stat_t * find_lsn_recurse (void *p_image, iso9660_readdir_t iso9660_readdir, const char psz_path[], lsn_t lsn, /*out*/ char **ppsz_full_filename) { CdioISO9660FileList_t *entlist = iso9660_readdir (p_image, psz_path); CdioISO9660DirList_t *dirlist = iso9660_filelist_new(); CdioListNode_t *entnode; cdio_assert (entlist != NULL); /* iterate over each entry in the directory */ _CDIO_LIST_FOREACH (entnode, entlist) { iso9660_stat_t *statbuf = _cdio_list_node_data (entnode); const char *psz_filename = (char *) statbuf->filename; unsigned int len = strlen(psz_path) + strlen(psz_filename)+2; if (*ppsz_full_filename != NULL) free(*ppsz_full_filename); *ppsz_full_filename = calloc(1, len); snprintf (*ppsz_full_filename, len, "%s%s/", psz_path, psz_filename); if (statbuf->type == _STAT_DIR && strcmp ((char *) statbuf->filename, ".") && strcmp ((char *) statbuf->filename, "..")) { snprintf (*ppsz_full_filename, len, "%s%s/", psz_path, psz_filename); _cdio_list_append (dirlist, strdup(*ppsz_full_filename)); } if (statbuf->lsn == lsn) { const unsigned int len2 = sizeof(iso9660_stat_t) + strlen(statbuf->filename) + 1; iso9660_stat_t *ret_stat = calloc(1, len2); if (!ret_stat) { iso9660_dirlist_free(dirlist); cdio_warn("Couldn't calloc(1, %d)", len2); free(*ppsz_full_filename); *ppsz_full_filename = NULL; return NULL; } memcpy(ret_stat, statbuf, len2); iso9660_filelist_free (entlist); iso9660_dirlist_free(dirlist); return ret_stat; } } iso9660_filelist_free (entlist); /* now recurse/descend over directories encountered */ _CDIO_LIST_FOREACH (entnode, dirlist) { char *psz_path_prefix = _cdio_list_node_data (entnode); iso9660_stat_t *ret_stat; free(*ppsz_full_filename); *ppsz_full_filename = NULL; ret_stat = find_lsn_recurse (p_image, iso9660_readdir, psz_path_prefix, lsn, ppsz_full_filename); if (NULL != ret_stat) { iso9660_dirlist_free(dirlist); return ret_stat; } } if (*ppsz_full_filename != NULL) { free(*ppsz_full_filename); *ppsz_full_filename = NULL; } iso9660_dirlist_free(dirlist); return NULL; } /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. Returns stat_t of entry if we found lsn, or NULL otherwise. */ iso9660_stat_t * iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn) { char *psz_full_filename = NULL; iso9660_stat_t * p_statbuf; p_statbuf = find_lsn_recurse (p_cdio, (iso9660_readdir_t *) iso9660_fs_readdir, "/", i_lsn, &psz_full_filename); if (psz_full_filename != NULL) free(psz_full_filename); return p_statbuf; } iso9660_stat_t * #if defined(__GNUC__) && !defined(__DARWIN_C_ANSI) iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn) __attribute__ ((alias ("iso9660_fs_find_lsn"))); #else iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn); #endif /*! Given a directory pointer, find the filesystem entry that contains LSN and return information about it. @param p_iso the ISO-9660 file image to get data from. @param i_lsn the LSN to find @param ppsz_full_filename the place to store the name of the path that has LSN. On entry this should point to NULL. If not, the value will be freed. On exit a value is malloc'd and the caller is responsible for freeing the result. @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t * iso9660_fs_find_lsn_with_path(CdIo_t *p_cdio, lsn_t i_lsn, /*out*/ char **ppsz_full_filename) { return find_lsn_recurse (p_cdio, (iso9660_readdir_t *) iso9660_fs_readdir, "/", i_lsn, ppsz_full_filename); } /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @param p_iso the ISO-9660 file image to get data from. @param i_lsn the LSN to find @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t * iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn) { char *psz_full_filename = NULL; iso9660_stat_t *ret = find_lsn_recurse (p_iso, (iso9660_readdir_t *) iso9660_ifs_readdir, "/", i_lsn, &psz_full_filename); if (psz_full_filename != NULL) free(psz_full_filename); return ret; } #ifdef HAVE_ROCK /* Some compilers complain if the prototype is not defined */ iso9660_stat_t * _iso9660_dd_find_lsn(void* p_image, lsn_t i_lsn); /* Same as above for Rock Ridge deep directory traversing. */ iso9660_stat_t * _iso9660_dd_find_lsn(void* p_image, lsn_t i_lsn) { cdio_header_t* p_header = (cdio_header_t*)p_image; char* psz_full_filename = NULL; void* p_image_dd; iso9660_readdir_t* f_readdir; iso9660_stat_t* ret; size_t size; switch(p_header->u_type) { case CDIO_HEADER_TYPE_ISO: size = sizeof(iso9660_t); f_readdir = (iso9660_readdir_t*)iso9660_ifs_readdir; break; case CDIO_HEADER_TYPE_CDIO: size = sizeof(CdIo_t); f_readdir = (iso9660_readdir_t*)iso9660_fs_readdir; break; default: cdio_assert(false); return NULL; } /* Work with a duplicate to allow concurrency. */ p_image_dd = calloc(1, size); if (!p_image_dd) { cdio_warn("Memory duplication error"); return NULL; } memcpy(p_image_dd, p_image, size); /* Disable the deep directory flag so we can process all entries */ p_header = (cdio_header_t*)p_image_dd; p_header->u_flags |= CDIO_HEADER_FLAGS_DISABLE_RR_DD; ret = find_lsn_recurse(p_image_dd, f_readdir, "/", i_lsn, &psz_full_filename); if (psz_full_filename != NULL) free(psz_full_filename); free(p_image_dd); return ret; } #endif /* HAVE ROCK */ /*! Given a directory pointer, find the filesystem entry that contains lsn and return information about it. @param p_iso pointer to iso_t @param i_lsn LSN to find @param ppsz_path full path of lsn filename. On entry *ppsz_path should be NULL. On return it will be allocated an point to the full path of the file at lsn or NULL if the lsn is not found. You should deallocate *ppsz_path when you are done using it. @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ iso9660_stat_t * iso9660_ifs_find_lsn_with_path(iso9660_t *p_iso, lsn_t i_lsn, /*out*/ char **ppsz_full_filename) { return find_lsn_recurse (p_iso, (iso9660_readdir_t *) iso9660_ifs_readdir, "/", i_lsn, ppsz_full_filename); } /*! Free the passed iso9660_stat_t structure. @param p_stat iso9660 stat buffer to free. */ void iso9660_stat_free(iso9660_stat_t *p_stat) { if (p_stat != NULL) { if (p_stat->rr.psz_symlink) { CDIO_FREE_IF_NOT_NULL(p_stat->rr.psz_symlink); } free(p_stat); } } /*! Free the passed CdioISOC9660FileList_t structure. */ void iso9660_filelist_free(CdioISO9660FileList_t *p_filelist) { _cdio_list_free(p_filelist, true, (CdioDataFree_t) iso9660_stat_free); } /*! Free the passed CdioISOC9660DirList_t structure. */ void iso9660_dirlist_free(CdioISO9660DirList_t *p_filelist) { _cdio_list_free(p_filelist, true, free); } /*! Return true if ISO 9660 image has extended attrributes (XA). */ bool iso9660_ifs_is_xa (const iso9660_t * p_iso) { if (!p_iso) return false; return yep == p_iso->b_xa; } static bool_3way_t iso_have_rr_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root, char **splitpath, uint64_t *pu_file_limit) { unsigned offset = 0; uint8_t *_dirbuf = NULL; uint32_t blocks; int ret; bool_3way_t have_rr = nope; if (!splitpath[0]) return false; if (_root->type == _STAT_FILE) return nope; if (*pu_file_limit == 0) return dunno; cdio_assert (_root->type == _STAT_DIR); blocks = CDIO_EXTENT_BLOCKS(_root->total_size); _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); if (!_dirbuf) { cdio_warn("Couldn't calloc(1, %d)", blocks * ISO_BLOCKSIZE); return dunno; } ret = iso9660_iso_seek_read (p_iso, _dirbuf, _root->lsn, blocks); if (ret != blocks * ISO_BLOCKSIZE) { free(_dirbuf); return false; } while (offset < (blocks * ISO_BLOCKSIZE)) { iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset]; iso9660_stat_t *p_stat; unsigned int i_last_component = 1; if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) continue; p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, NULL, p_iso, p_iso->b_xa, p_iso->u_joliet_level); have_rr = p_stat->rr.b3_rock; if ( have_rr != yep) { if (strlen(splitpath[0]) == 0) have_rr = false; else have_rr = iso_have_rr_traverse (p_iso, p_stat, &splitpath[i_last_component], pu_file_limit); } iso9660_stat_free(p_stat); if (have_rr != nope) { free (_dirbuf); return have_rr; } offset += iso9660_get_dir_len(p_iso9660_dir); *pu_file_limit = (*pu_file_limit)-1; if ((*pu_file_limit) == 0) { free (_dirbuf); return dunno; } } cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); /* not found */ free (_dirbuf); return nope; } /*! Return "yup" if any file has Rock-Ridge extensions. Warning: this can be time consuming. On an ISO 9600 image with lots of files but no Rock-Ridge extensions, the entire directory structure will be scanned up to u_file_limit. @param p_iso the ISO-9660 file image to get data from @param u_file_limit the maximimum number of (non-rock-ridge) files to consider before giving up and returning "dunno". "dunno" can also be returned if there was some error encountered such as not being able to allocate memory in processing. */ extern bool_3way_t iso9660_have_rr(iso9660_t *p_iso, uint64_t u_file_limit) { iso9660_stat_t *p_root; char *p_psz_splitpath[2] = {strdup("/"), strdup("")}; bool_3way_t is_rr = nope; if (!p_iso) return false; p_root = _ifs_stat_root (p_iso); if (!p_root) return dunno; if (u_file_limit == 0) u_file_limit = UINT64_MAX; is_rr = iso_have_rr_traverse (p_iso, p_root, p_psz_splitpath, &u_file_limit); iso9660_stat_free(p_root); free(p_psz_splitpath[0]); free(p_psz_splitpath[1]); return is_rr; } libcdio-2.2.0/lib/iso9660/iso9660_private.h000066400000000000000000000046701474051130400200350ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel See also iso9660.h by Eric Youngdale (1993). Copyright 1993 Yggdrasil Computing, Incorporated Copyright (c) 1999,2000 J. Schilling 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_ISO9660_ISO9660_PRIVATE_H_ #define CDIO_ISO9660_ISO9660_PRIVATE_H_ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDBOOL_H # include #endif #define ISO_VERSION 1 PRAGMA_BEGIN_PACKED typedef struct iso_volume_descriptor_s { uint8_t type; /**< 7.1.1 */ char id[5]; /**< "CD001" (ISO_STANDARD_ID) */ uint8_t version; /**< 7.1.1 */ char data[2041]; } GNUC_PACKED iso_volume_descriptor_t; #define iso_volume_descriptor_t_SIZEOF ISO_BLOCKSIZE #define iso9660_pvd_t_SIZEOF ISO_BLOCKSIZE /* * XXX JS: The next structure has an odd length! * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length. * For this reason, we cannot use sizeof (struct iso_path_table) or * sizeof (struct iso_directory_record) to compute on disk sizes. * Instead, we use offsetof(..., name) and add the name size. * See mkisofs.h */ /** We use this to help us look up the parent inode numbers. */ typedef struct iso_path_table_s { uint8_t name_len; /**< 7.1.1 */ uint8_t xa_len; /**< 7.1.1 */ uint32_t extent; /**< 7.3.1/7.3.2 */ uint16_t parent; /**< 7.2.1/7.2.2 */ char name[EMPTY_ARRAY_SIZE]; } GNUC_PACKED iso_path_table_t; #define iso_path_table_t_SIZEOF 8 #define iso9660_dir_t_SIZEOF 33 PRAGMA_END_PACKED #endif /* CDIO_ISO0660_ISO9660_PRIVATE_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/iso9660/libiso9660.sym000066400000000000000000000037421474051130400173520ustar00rootroot00000000000000iso_enums1 iso_extension_enums iso_flag_enums iso_vd_enums iso_rock_enums iso_rock_nm_flag iso_rock_sl_flag iso_rock_tf_flag iso9660_close iso9660_dir_add_entry_su iso9660_dir_calc_record_size iso9660_dir_init_new iso9660_dir_init_new_su iso9660_dir_to_name iso9660_dirlist_free iso9660_dirlist_new iso9660_dirname_valid_p iso9660_filelist_new iso9660_filelist_free iso9660_find_fs_lsn iso9660_fs_find_lsn iso9660_fs_find_lsn_with_path iso9660_fs_read_pvd iso9660_fs_read_superblock iso9660_fs_readdir iso9660_fs_stat iso9660_fs_stat_translate iso9660_get_application_id iso9660_get_dir_len iso9660_get_dtime iso9660_get_ltime iso9660_get_posix_filemode iso9660_get_posix_filemode_from_rock iso9660_get_posix_filemode_from_xa iso9660_get_preparer_id iso9660_get_publisher_id iso9660_get_pvd_block_size iso9660_get_pvd_id iso9660_get_pvd_space_size iso9660_get_pvd_type iso9660_get_pvd_version iso9660_get_rock_attr_str iso9660_get_root_lsn iso9660_get_system_id iso9660_get_volume_id iso9660_get_volumeset_id iso9660_get_xa_attr_str iso9660_have_rr iso9660_ifs_find_lsn iso9660_ifs_find_lsn_with_path iso9660_ifs_fuzzy_read_superblock iso9660_ifs_get_application_id iso9660_ifs_get_joliet_level iso9660_ifs_get_preparer_id iso9660_ifs_get_publisher_id iso9660_ifs_get_system_id iso9660_ifs_get_volume_id iso9660_ifs_get_volumeset_id iso9660_ifs_is_xa iso9660_ifs_read_pvd iso9660_ifs_read_superblock iso9660_ifs_readdir iso9660_ifs_stat iso9660_ifs_stat_translate iso9660_is_achar iso9660_is_dchar iso9660_iso_seek_read iso9660_name_translate iso9660_name_translate_ext iso9660_open iso9660_open_ext iso9660_open_fuzzy iso9660_open_fuzzy_ext iso9660_pathname_isofy iso9660_pathname_valid_p iso9660_pathtable_get_size iso9660_pathtable_init iso9660_pathtable_l_add_entry iso9660_pathtable_m_add_entry iso9660_set_dtime iso9660_set_dtime_with_timezone iso9660_set_evd iso9660_set_ltime iso9660_set_ltime_with_timezone iso9660_set_pvd iso9660_stat_free iso9660_strncpy_pad iso9660_xa_init iso9660_xa_free ISO_STANDARD_ID libcdio-2.2.0/lib/iso9660/rock.c000066400000000000000000000354241474051130400161160ustar00rootroot00000000000000/* Copyright (C) 2020, 2023 Pete Batard Copyright (C) 2005, 2008, 2010-2011, 2014, 2017, 2022 Rocky Bernstein Adapted from GNU/Linux fs/isofs/rock.c (C) 1992, 1993 Eric Youngdale 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Rock Ridge Extensions to iso9660 */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #include #include #include #include "filemode.h" #include "cdio_private.h" #define CDIO_MKDEV(ma,mi) ((ma)<<16 | (mi)) enum iso_rock_enums iso_rock_enums; iso_rock_nm_flag_t iso_rock_nm_flag; iso_rock_sl_flag_t iso_rock_sl_flag; iso_rock_tf_flag_t iso_rock_tf_flag; /* Used by get_rock_ridge_filename() */ extern iso9660_stat_t* _iso9660_dd_find_lsn(void* p_image, lsn_t i_lsn); /* Our own realloc routine tailored for the iso9660_stat_t symlink field. I can't figure out how to make realloc() work without valgrind complaint. */ static bool realloc_symlink(/*in/out*/ iso9660_stat_t *p_stat, uint8_t i_grow) { if (!p_stat->rr.i_symlink) { const uint16_t i_max = 2*i_grow+1; p_stat->rr.psz_symlink = (char *) calloc(1, i_max); p_stat->rr.i_symlink_max = i_max; return (NULL != p_stat->rr.psz_symlink); } else { unsigned int i_needed = p_stat->rr.i_symlink + i_grow * 2; // Allocate enough space for growth and additional buffer if ( i_needed <= p_stat->rr.i_symlink_max) return true; else { char * psz_newsymlink = (char *) calloc(1, 2*i_needed); if (!psz_newsymlink) return false; p_stat->rr.i_symlink_max = 2*i_needed; memcpy(psz_newsymlink, p_stat->rr.psz_symlink, p_stat->rr.i_symlink); free(p_stat->rr.psz_symlink); p_stat->rr.psz_symlink = psz_newsymlink; return true; } } } /* These functions are designed to read the system areas of a directory record * and extract relevant information. There are different functions provided * depending upon what information we need at the time. One function fills * out an inode structure, a second one extracts a filename, a third one * returns a symbolic link name, and a fourth one returns the extent number * for the file. */ #define SIG(A,B) ((A) | ((B) << 8)) /* isonum_721() */ /* This is a way of ensuring that we have something in the system use fields that is compatible with Rock Ridge */ #define CHECK_SP(FAIL) \ if (rr->u.SP.magic[0] != 0xbe) FAIL; \ if (rr->u.SP.magic[1] != 0xef) FAIL; \ p_stat->rr.s_rock_offset = rr->u.SP.skip; /* We define a series of macros because each function must do exactly the same thing in certain places. We use the macros to ensure that everything is done correctly */ #define CONTINUE_DECLS \ uint32_t cont_extent = 0, cont_offset = 0, cont_size = 0; \ uint8_t *buffer = NULL, ce_count = 0 #define CHECK_CE(FAIL) \ { cont_extent = from_733(rr->u.CE.extent); \ cont_offset = from_733(rr->u.CE.offset); \ if (cont_offset >= ISO_BLOCKSIZE) FAIL; \ cont_size = from_733(rr->u.CE.size); \ if (cont_size >= ISO_BLOCKSIZE) FAIL; \ } #define SETUP_ROCK_RIDGE(DE, CHR, LEN) \ { \ LEN= sizeof(iso9660_dir_t) + DE->filename.len; \ if (LEN & 1) LEN++; \ CHR = ((unsigned char *) DE) + LEN; \ LEN = *((unsigned char *) DE) - LEN; \ if (0xff != p_stat->rr.s_rock_offset) \ { \ LEN -= p_stat->rr.s_rock_offset; \ CHR += p_stat->rr.s_rock_offset; \ if (LEN<0) LEN=0; \ } \ } /* Copy a long or short time from the iso_rock_tf_t into the specified field of a iso_rock_statbuf_t. non-paramater variables are p_stat, rr, and cnt. */ #define add_time(FLAG, TIME_FIELD) \ if (rr->u.TF.flags & FLAG) { \ p_stat->rr.TIME_FIELD.b_used = true; \ p_stat->rr.TIME_FIELD.b_longdate = \ (0 != (rr->u.TF.flags & ISO_ROCK_TF_LONG_FORM)); \ if (p_stat->rr.TIME_FIELD.b_longdate) { \ memcpy(&(p_stat->rr.TIME_FIELD.t.ltime), \ &(rr->u.TF.time_bytes[cnt]), \ sizeof(iso9660_ltime_t)); \ cnt += sizeof(iso9660_ltime_t); \ } else { \ memcpy(&(p_stat->rr.TIME_FIELD.t.dtime), \ &(rr->u.TF.time_bytes[cnt]), \ sizeof(iso9660_dtime_t)); \ cnt += sizeof(iso9660_dtime_t); \ } \ } /* Indicates if we should process deep directory entries */ static inline bool is_rr_dd_enabled(void * p_image) { cdio_header_t* p_header = (cdio_header_t*)p_image; if (!p_header) return false; return !(p_header->u_flags & CDIO_HEADER_FLAGS_DISABLE_RR_DD); } /*! Get @return length of name field; 0: not found, -1: to be ignored */ int get_rock_ridge_filename(iso9660_dir_t * p_iso9660_dir, /*in*/ void * p_image, /*out*/ char * psz_name, /*in/out*/ iso9660_stat_t *p_stat) { int len; unsigned char *chr; int symlink_len = 0; CONTINUE_DECLS; int i_namelen = 0; int truncate=0; if (!p_stat || nope == p_stat->rr.b3_rock) return 0; *psz_name = 0; SETUP_ROCK_RIDGE(p_iso9660_dir, chr, len); repeat: { iso_extension_record_t * rr; int sig; int rootflag; while (len > 1){ /* There may be one byte for padding somewhere */ rr = (iso_extension_record_t *) chr; sig = *chr+(*(chr+1) << 8); /* We used to check for some valid values of SIG, specifically SP, CE, ER, RR, PX, PN, SL, NM, CL, PL, TF, and ZF. However there are various extensions to this set. So we skip checking now. */ if (rr->len == 0) goto out; /* Something got screwed up here */ chr += rr->len; len -= rr->len; switch(sig) { case SIG('S','P'): CHECK_SP({cdio_warn("Invalid Rock Ridge SP field"); goto out;}); p_stat->rr.u_su_fields |= ISO_ROCK_SUF_SP; break; case SIG('C','E'): { 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.str[1] && 1 == i_fname) break; } CHECK_CE({cdio_warn("Invalid Rock Ridge CE field"); goto out;}); p_stat->rr.u_su_fields |= ISO_ROCK_SUF_CE; /* Though no mastering utility in its right mind would produce anything like this, the specs make it theoretically possible to have more RR extensions after a CE, so we delay the CE block processing for later. */ break; case SIG('E','R'): cdio_debug("ISO 9660 Extensions: "); { int p; for (p=0; p < rr->u.ER.len_id; p++) cdio_debug("%c", rr->u.ER.data[p]); } break; case SIG('N','M'): /* Alternate name */ p_stat->rr.u_su_fields |= ISO_ROCK_SUF_NM; if (truncate) break; if (rr->u.NM.flags & ISO_ROCK_NM_PARENT) { i_namelen = sizeof(".."); strncat(psz_name, "..", i_namelen); break; } else if (rr->u.NM.flags & ISO_ROCK_NM_CURRENT) { i_namelen = sizeof("."); strncat(psz_name, ".", i_namelen); break; } if (rr->u.NM.flags & ~1) { cdio_info("Unsupported NM flag settings (%d)",rr->u.NM.flags); break; } if((strlen(psz_name) + rr->len - 5) >= 254) { truncate = 1; break; } strncat(psz_name, rr->u.NM.name, rr->len - 5); i_namelen += rr->len - 5; break; case SIG('P','X'): /* POSIX file attributes */ p_stat->rr.st_mode = from_733(rr->u.PX.st_mode); p_stat->rr.st_nlinks = from_733(rr->u.PX.st_nlinks); p_stat->rr.st_uid = from_733(rr->u.PX.st_uid); p_stat->rr.st_gid = from_733(rr->u.PX.st_gid); p_stat->rr.u_su_fields |= ISO_ROCK_SUF_PX; break; case SIG('S','L'): { /* Symbolic link */ uint8_t slen; iso_rock_sl_part_t * p_sl; iso_rock_sl_part_t * p_oldsl; slen = rr->len - 5; p_sl = &rr->u.SL.link; p_stat->rr.i_symlink = symlink_len; p_stat->rr.u_su_fields |= ISO_ROCK_SUF_SL; while (slen > 1){ rootflag = 0; switch(p_sl->flags &~1){ case 0: realloc_symlink(p_stat, p_sl->len); memcpy(&(p_stat->rr.psz_symlink[p_stat->rr.i_symlink]), p_sl->text, p_sl->len); p_stat->rr.i_symlink += p_sl->len; break; case 4: realloc_symlink(p_stat, 1); p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '.'; /* continue into next case. */ case 2: realloc_symlink(p_stat, 1); p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '.'; break; case 8: rootflag = 1; realloc_symlink(p_stat, 1); p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '/'; break; default: cdio_warn("Symlink component flag not implemented"); } slen -= p_sl->len + 2; p_oldsl = p_sl; p_sl = (iso_rock_sl_part_t *) (((char *) p_sl) + p_sl->len + 2); if (slen < 2) { if (((rr->u.SL.flags & 1) != 0) && ((p_oldsl->flags & 1) == 0)) p_stat->rr.i_symlink += 1; break; } /* * If this component record isn't continued, then append a '/'. */ if (!rootflag && (p_oldsl->flags & 1) == 0) { realloc_symlink(p_stat, 1); p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '/'; } } } symlink_len = p_stat->rr.i_symlink; realloc_symlink(p_stat, 1); p_stat->rr.psz_symlink[symlink_len]='\0'; break; case SIG('T','F'): /* Time stamp(s) for a file */ { int cnt = 0; add_time(ISO_ROCK_TF_CREATE, create); add_time(ISO_ROCK_TF_MODIFY, modify); add_time(ISO_ROCK_TF_ACCESS, access); add_time(ISO_ROCK_TF_ATTRIBUTES, attributes); add_time(ISO_ROCK_TF_BACKUP, backup); add_time(ISO_ROCK_TF_EXPIRATION, expiration); add_time(ISO_ROCK_TF_EFFECTIVE, effective); p_stat->rr.u_su_fields |= ISO_ROCK_SUF_TF; break; } case SIG('C','L'): /* Child Link for a deep directory */ if (!is_rr_dd_enabled(p_image)) break; { iso9660_stat_t* target = NULL; p_stat->rr.u_su_fields |= ISO_ROCK_SUF_CL; target = _iso9660_dd_find_lsn(p_image, from_733(rr->u.PL.location)); if (!target) { cdio_warn("Could not get Rock Ridge deep directory child"); break; } memcpy(p_stat, target, sizeof(iso9660_stat_t)); /* Prevent the symlink from being freed on the duplicated struct */ target->rr.psz_symlink = NULL; iso9660_stat_free(target); } break; case SIG('P','L'): /* Parent link of a deep directory */ if (is_rr_dd_enabled(p_image)) p_stat->rr.u_su_fields |= ISO_ROCK_SUF_PL; break; case SIG('R','E'): /* Relocated entry for a deep directory */ if (is_rr_dd_enabled(p_image)) p_stat->rr.u_su_fields |= ISO_ROCK_SUF_RE; break; case SIG('S','F'): /* Sparse File */ p_stat->rr.u_su_fields |= ISO_ROCK_SUF_SF; cdio_warn("Rock Ridge Sparse File detected"); break; default: break; } } } /* Process delayed CE blocks */ if (cont_size != 0) { free(buffer); buffer = calloc(1, ISO_BLOCKSIZE); if (!buffer) goto out; if (iso9660_iso_seek_read(p_image, buffer, cont_extent, 1) != ISO_BLOCKSIZE) goto out; chr = &buffer[cont_offset]; len = cont_size; cont_size = 0; /* Someone abusing the specs may also be creating looping CEs */ if (ce_count++ < 64) goto repeat; else cdio_warn("More than 64 consecutive Rock Ridge CEs detected"); } if (p_stat->rr.u_su_fields & ISO_ROCK_SUF_FORMAL) p_stat->rr.b3_rock = yep; free(buffer); return i_namelen; /* If 0, this file did not have a NM field */ out: free(buffer); return 0; } #define BUF_COUNT 16 #define BUF_SIZE sizeof("drwxrwxrwx") /* Return a pointer to a internal free buffer */ static char * _getbuf (void) { static char _buf[BUF_COUNT][BUF_SIZE]; static int _i = -1; _i++; _i %= BUF_COUNT; memset (_buf[_i], 0, BUF_SIZE); return _buf[_i]; } /*! Returns a string which interpreting the POSIX mode st_mode. For example: \verbatim drwxrws--- -rw-rw-r-- lrwxrwxrwx \endverbatim A description of the characters in the string follows The 1st character is either "b" for a block device, "c" for a character device, "d" if the entry is a directory, "l" for a symbolic link, "p" for a pipe or FIFO, "s" for a "socket", or "-" if none of the these. The 2nd to 4th characters refer to permissions for a user while the the 5th to 7th characters refer to permissions for a group while, and the 8th to 10h characters refer to permissions for everyone. In each of these triplets the first character (2, 5, 8) is "r" if the entry is allowed to be read. The second character of a triplet (3, 6, 9) is "w" if the entry is allowed to be written. The third character of a triplet (4, 7, 10) is "x" if the entry is executable but not user (for character 4) or group (for characters 6) settable and "s" if the item has the corresponding user/group set. For a directory having an executable property on ("x" or "s") means the directory is allowed to be listed or "searched". If the execute property is not allowed for a group or user but the corresponding group/user is set "S" indicates this. If none of these properties holds the "-" indicates this. */ const char * iso9660_get_rock_attr_str(posix_mode_t st_mode) { char *result = _getbuf(); if (S_ISBLK(st_mode)) result[ 0] = 'b'; else if (S_ISDIR(st_mode)) result[ 0] = 'd'; else if (S_ISCHR(st_mode)) result[ 0] = 'c'; else if (S_ISLNK(st_mode)) result[ 0] = 'l'; else if (S_ISFIFO(st_mode)) result[ 0] = 'p'; else if (S_ISSOCK(st_mode)) result[ 0] = 's'; /* May eventually fill in others.. */ else result[ 0] = '-'; result[ 1] = (st_mode & ISO_ROCK_IRUSR) ? 'r' : '-'; result[ 2] = (st_mode & ISO_ROCK_IWUSR) ? 'w' : '-'; if (st_mode & ISO_ROCK_ISUID) result[ 3] = (st_mode & ISO_ROCK_IXUSR) ? 's' : 'S'; else result[ 3] = (st_mode & ISO_ROCK_IXUSR) ? 'x' : '-'; result[ 4] = (st_mode & ISO_ROCK_IRGRP) ? 'r' : '-'; result[ 5] = (st_mode & ISO_ROCK_IWGRP) ? 'w' : '-'; if (st_mode & ISO_ROCK_ISGID) result[ 6] = (st_mode & ISO_ROCK_IXGRP) ? 's' : 'S'; else result[ 6] = (st_mode & ISO_ROCK_IXGRP) ? 'x' : '-'; result[ 7] = (st_mode & ISO_ROCK_IROTH) ? 'r' : '-'; result[ 8] = (st_mode & ISO_ROCK_IWOTH) ? 'w' : '-'; result[ 9] = (st_mode & ISO_ROCK_IXOTH) ? 'x' : '-'; result[10] = '\0'; return result; } /*! Returns POSIX mode bitstring for a given file. */ mode_t iso9660_get_posix_filemode_from_rock(const iso_rock_statbuf_t *rr) { return (mode_t) rr->st_mode; } libcdio-2.2.0/lib/iso9660/xa.c000066400000000000000000000120511474051130400155570ustar00rootroot00000000000000/* Copyright (C) 2003, 2005, 2008, 2011 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif /*! String inside frame which identifies XA attributes. Note should come *before* public headers which does a #define of this name. */ const char ISO_XA_MARKER_STRING[] = {'C', 'D', '-', 'X', 'A', '0', '0', '1'}; /* Public headers */ #include #include #include /* 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 to the enumeration value names in the typedefs above in a debugger and debugger expressions. */ xa_misc_enum_t debugger_xa_misc_enum; #define BUF_COUNT 16 #define BUF_SIZE 80 /* Return a pointer to a internal free buffer */ static char * _getbuf (void) { static char _buf[BUF_COUNT][BUF_SIZE]; static int _num = -1; _num++; _num %= BUF_COUNT; memset (_buf[_num], 0, BUF_SIZE); return _buf[_num]; } /*! Returns a string which interpreting the extended attribute xa_attr. For example: \verbatim d---1xrxrxr ---2--r-r-r -a--1xrxrxr \endverbatim A description of the characters in the string follows The 1st character is either "d" if the entry is a directory, or "-" if not. The 2nd character is either "a" if the entry is CDDA (audio), or "-" if not. The 3rd character is either "i" if the entry is interleaved, or "-" if not. The 4th character is either "2" if the entry is mode2 form2 or "-" if not. The 5th character is either "1" if the entry is mode2 form1 or "-" if not. Note that an entry will either be in mode2 form1 or mode form2. That is you will either see "2-" or "-1" in the 4th & 5th positions. The 6th and 7th characters refer to permissions for a user while the the 8th and 9th characters refer to permissions for a group while, and the 10th and 11th characters refer to permissions for a others. In each of these pairs the first character (6, 8, 10) is "x" if the entry is executable. For a directory this means the directory is allowed to be listed or "searched". The second character of a pair (7, 9, 11) is "r" if the entry is allowed to be read. */ const char * iso9660_get_xa_attr_str (uint16_t xa_attr) { char *result = _getbuf(); xa_attr = uint16_from_be (xa_attr); result[ 0] = (xa_attr & XA_ATTR_DIRECTORY) ? 'd' : '-'; result[ 1] = (xa_attr & XA_ATTR_CDDA) ? 'a' : '-'; result[ 2] = (xa_attr & XA_ATTR_INTERLEAVED) ? 'i' : '-'; result[ 3] = (xa_attr & XA_ATTR_MODE2FORM2) ? '2' : '-'; result[ 4] = (xa_attr & XA_ATTR_MODE2FORM1) ? '1' : '-'; result[ 5] = (xa_attr & XA_PERM_XUSR) ? 'x' : '-'; result[ 6] = (xa_attr & XA_PERM_RUSR) ? 'r' : '-'; result[ 7] = (xa_attr & XA_PERM_XGRP) ? 'x' : '-'; result[ 8] = (xa_attr & XA_PERM_RGRP) ? 'r' : '-'; /* Hack alert: wonder if this should be ROTH and XOTH? */ result[ 9] = (xa_attr & XA_PERM_XSYS) ? 'x' : '-'; result[10] = (xa_attr & XA_PERM_RSYS) ? 'r' : '-'; result[11] = '\0'; return result; } iso9660_xa_t * iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr, uint8_t filenum) { cdio_assert (_xa != NULL); _xa->user_id = uint16_to_be (uid); _xa->group_id = uint16_to_be (gid); _xa->attributes = uint16_to_be (attr); _xa->signature[0] = 'X'; _xa->signature[1] = 'A'; _xa->filenum = filenum; _xa->reserved[0] = _xa->reserved[1] = _xa->reserved[2] = _xa->reserved[3] = _xa->reserved[4] = 0x00; return _xa; } void iso9660_xa_free (iso9660_xa_t *_xa) { if (_xa != NULL) free(_xa); } /*! Returns POSIX mode bitstring for a given file. */ posix_mode_t iso9660_get_posix_filemode_from_xa(uint16_t i_perms) { posix_mode_t mode = 0; if (i_perms & XA_PERM_RUSR) mode |= S_IRUSR; if (i_perms & XA_PERM_XUSR) mode |= S_IXUSR; #ifdef S_IRGRP if (i_perms & XA_PERM_RGRP) mode |= S_IRGRP; #endif #ifdef S_IXGRP if (i_perms & XA_PERM_XGRP) mode |= S_IXGRP; #endif #ifdef S_IROTH if (i_perms & XA_PERM_ROTH) mode |= S_IROTH; #endif #ifdef S_IXOTH if (i_perms & XA_PERM_XOTH) mode |= S_IXOTH; #endif if (i_perms & XA_ATTR_DIRECTORY) mode |= S_IFDIR; return mode; } libcdio-2.2.0/lib/udf/000077500000000000000000000000001474051130400144435ustar00rootroot00000000000000libcdio-2.2.0/lib/udf/.gitignore000066400000000000000000000000661474051130400164350ustar00rootroot00000000000000/*.la /*.lo /*.o /.deps /.libs /Makefile /Makefile.in libcdio-2.2.0/lib/udf/Makefile.am000066400000000000000000000041621474051130400165020ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2006, 2008, 2011, 2013, 2017 # Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################## # Things to make the libudf library ######################################################## # # From libtool documentation amended with guidance from N. Boullis: # # 1. Start with version information of `0:0:0' for each libtool library. # # 2. It is probably not a good idea to update the version information # several times between public releases, but rather once per public # release. (This seems to be more an aesthetic consideration than # a hard technical one.) # # 3. If the library source code has changed at all since the last # update, then increment REVISION (`C:R:A' becomes `C:R+1:A'). # # 4. If any interfaces have been added, removed, or changed since the # last update, increment CURRENT, and set REVISION to 0. # # 5. If any interfaces have been added since the last public release, # then increment AGE. # # 6. If any interfaces have been removed or changed since the last # public release, then set AGE to 0. A changed interface means an # incompatibility with previous versions. libudf_la_CURRENT = 4 libudf_la_REVISION = 0 libudf_la_AGE = 0 EXTRA_DIST = libudf.sym noinst_HEADERS = udf_fs.h udf_private.h lib_LTLIBRARIES = libudf.la libudf_la_SOURCES = udf.c udf_file.c udf_fs.c udf_time.c filemode.c libudf_la_LIBADD = @LIBCDIO_LIBS@ @LT_NO_UNDEFINED@ AM_CPPFLAGS = $(LIBCDIO_CFLAGS) libcdio-2.2.0/lib/udf/filemode.c000066400000000000000000000116171474051130400164010ustar00rootroot00000000000000/* filemode.c -- make a string describing file modes Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc. 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #if HAVE_CONFIG_H # include # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_SYS_STAT_H #include #endif #include #include "filemode.h" /* Set the 's' and 't' flags in file attributes string CHARS, according to the file mode BITS. */ static void setst (mode_t bits, char *chars) { #ifdef S_ISUID if (bits & S_ISUID) { if (chars[3] != 'x') /* Set-uid, but not executable by owner. */ chars[3] = 'S'; else chars[3] = 's'; } #endif #ifdef S_ISGID if (bits & S_ISGID) { if (chars[6] != 'x') /* Set-gid, but not executable by group. */ chars[6] = 'S'; else chars[6] = 's'; } #endif #ifdef S_ISVTX if (bits & S_ISVTX) { if (chars[9] != 'x') /* Sticky, but not executable by others. */ chars[9] = 'T'; else chars[9] = 't'; } #endif } /* Return a character indicating the type of file described by file mode BITS: 'd' for directories 'D' for doors 'b' for block special files 'c' for character special files 'n' for network special files 'm' for multiplexor files 'M' for an off-line (regular) file 'l' for symbolic links 's' for sockets 'p' for fifos 'C' for contigous data files '-' for regular files '?' for any other file type. */ static char ftypelet (mode_t bits) { #ifdef S_ISBLK if (S_ISBLK (bits)) return 'b'; #endif if (S_ISCHR (bits)) return 'c'; if (S_ISDIR (bits)) return 'd'; if (S_ISREG (bits)) return '-'; #ifdef S_ISFIFO if (S_ISFIFO (bits)) return 'p'; #endif #ifdef S_ISLNK if (S_ISLNK (bits)) return 'l'; #endif #ifdef S_ISSOCK if (S_ISSOCK (bits)) return 's'; #endif #ifdef S_ISMPC if (S_ISMPC (bits)) return 'm'; #endif #ifdef S_ISNWK if (S_ISNWK (bits)) return 'n'; #endif #ifdef S_ISDOOR if (S_ISDOOR (bits)) return 'D'; #endif #ifdef S_ISCTG if (S_ISCTG (bits)) return 'C'; #endif /* The following two tests are for Cray DMF (Data Migration Facility), which is a HSM file system. A migrated file has a `st_dm_mode' that is different from the normal `st_mode', so any tests for migrated files should use the former. */ #ifdef S_ISOFD if (S_ISOFD (bits)) /* off line, with data */ return 'M'; #endif #ifdef S_ISOFL /* off line, with no data */ if (S_ISOFL (bits)) return 'M'; #endif return '?'; } /*! udf_mode_string - fill in string STR with an ls-style ASCII representation of the st_mode field of file stats block STATP. 10 characters are stored in STR; no terminating null is added. The characters stored in STR are: 0 File type. 'd' for directory, 'c' for character special, 'b' for block special, 'm' for multiplex, 'l' for symbolic link, 's' for socket, 'p' for fifo, '-' for regular, '?' for any other file type 1 'r' if the owner may read, '-' otherwise. 2 'w' if the owner may write, '-' otherwise. 3 'x' if the owner may execute, 's' if the file is set-user-id, '-' otherwise. 'S' if the file is set-user-id, but the execute bit isn't set. 4 'r' if group members may read, '-' otherwise. 5 'w' if group members may write, '-' otherwise. 6 'x' if group members may execute, 's' if the file is set-group-id, '-' otherwise. 'S' if it is set-group-id but not executable. 7 'r' if any user may read, '-' otherwise. 8 'w' if any user may write, '-' otherwise. 9 'x' if any user may execute, 't' if the file is "sticky" (will be retained in swap space after execution), '-' otherwise. 'T' if the file is sticky but not executable. */ char * udf_mode_string (mode_t i_mode, char *psz_str) { psz_str[ 0] = ftypelet (i_mode); psz_str[ 1] = i_mode & S_IRUSR ? 'r' : '-'; psz_str[ 2] = i_mode & S_IWUSR ? 'w' : '-'; psz_str[ 3] = i_mode & S_IXUSR ? 'x' : '-'; psz_str[ 4] = i_mode & S_IRGRP ? 'r' : '-'; psz_str[ 5] = i_mode & S_IWGRP ? 'w' : '-'; psz_str[ 6] = i_mode & S_IXGRP ? 'x' : '-'; psz_str[ 7] = i_mode & S_IROTH ? 'r' : '-'; psz_str[ 8] = i_mode & S_IWOTH ? 'w' : '-'; psz_str[ 9] = i_mode & S_IXOTH ? 'x' : '-'; psz_str[10] = '\0'; setst (i_mode, psz_str); return psz_str; } libcdio-2.2.0/lib/udf/libudf.sym000066400000000000000000000010331474051130400164370ustar00rootroot00000000000000debug_ecma_167_enums1 debug_ecma_167_timezone_enum debug_file_characteristics debug_icbtag_file_type_enum debug_tagid debug_udf_enums1 debug_udf_time_enum VSD_STD_ID_BEA01 VSD_STD_ID_BOOT2 VSD_STD_ID_CD001 VSD_STD_ID_CDW01 VSD_STD_ID_NSR03 VSD_STD_ID_TEA01 udf_close udf_dirent_free udf_get_file_entry udf_get_file_length udf_get_fileid_descriptor udf_get_filename udf_get_link_count udf_get_part_number udf_get_posix_filemode udf_opendir udf_read_block udf_readdir udf_is_dir udf_open udf_read_sectors udf_stamp_to_time udf_time_to_stamp libcdio-2.2.0/lib/udf/udf.c000066400000000000000000000066141474051130400153740ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Access routines */ /* udf_private.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. */ #include "udf_private.h" #include #include "filemode.h" #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif /** The below variables are trickery to force enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions */ tag_id_t debug_tagid; file_characteristics_t debug_file_characteristics; icbtag_file_type_enum_t debug_icbtag_file_type_enum; icbtag_flag_enum_t debug_flag_enum; ecma_167_enum1_t debug_ecma_167_enum1; ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; udf_enum1_t debug_udf_enum1; /*! Returns POSIX mode bitstring for a given file. */ mode_t udf_get_posix_filemode(const udf_dirent_t *p_udf_dirent) { udf_file_entry_t udf_fe; mode_t mode = 0; if (udf_get_file_entry(p_udf_dirent, &udf_fe)) { uint32_t i_perms; #ifdef S_ISUID uint16_t i_flags; i_flags = uint16_from_le(udf_fe.icb_tag.flags); #endif i_perms = uint32_from_le(udf_fe.permissions); if (i_perms & FE_PERM_U_READ) mode |= S_IRUSR; if (i_perms & FE_PERM_U_WRITE) mode |= S_IWUSR; if (i_perms & FE_PERM_U_EXEC) mode |= S_IXUSR; #ifdef S_IRGRP if (i_perms & FE_PERM_G_READ) mode |= S_IRGRP; if (i_perms & FE_PERM_G_WRITE) mode |= S_IWGRP; if (i_perms & FE_PERM_G_EXEC) mode |= S_IXGRP; #endif #ifdef S_IROTH if (i_perms & FE_PERM_O_READ) mode |= S_IROTH; if (i_perms & FE_PERM_O_WRITE) mode |= S_IWOTH; if (i_perms & FE_PERM_O_EXEC) mode |= S_IXOTH; #endif switch (udf_fe.icb_tag.file_type) { case ICBTAG_FILE_TYPE_DIRECTORY: mode |= S_IFDIR; break; case ICBTAG_FILE_TYPE_REGULAR: mode |= S_IFREG; break; #ifdef S_IFLNK case ICBTAG_FILE_TYPE_SYMLINK: mode |= S_IFLNK; break; #endif case ICBTAG_FILE_TYPE_CHAR: mode |= S_IFCHR; break; #ifdef S_IFSOCK case ICBTAG_FILE_TYPE_SOCKET: mode |= S_IFSOCK; break; #endif case ICBTAG_FILE_TYPE_BLOCK: mode |= S_IFBLK; break; default: ; }; #ifdef S_ISUID if (i_flags & ICBTAG_FLAG_SETUID) mode |= S_ISUID; if (i_flags & ICBTAG_FLAG_SETGID) mode |= S_ISGID; if (i_flags & ICBTAG_FLAG_STICKY) mode |= S_ISVTX; #endif } return mode; } /*! Return the partition number of the the opened udf handle. -1 Is returned if we have an error. */ int16_t udf_get_part_number(const udf_t *p_udf) { if (!p_udf) return -1; return p_udf->i_partition; } libcdio-2.2.0/lib/udf/udf_file.c000066400000000000000000000165541474051130400163770ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2010, 2012, 2024 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Access routines */ /* udf_private.h has to come first else _FILE_OFFSET_BITS are redefined in say opensolaris. */ #include "udf_private.h" #include #include "udf_fs.h" #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STDIO_H #include /* Remove when adding cdio/logging.h */ #endif /* Useful defines */ #define MIN(a, b) (au.alloc_descs[offset] const char * udf_get_filename(const udf_dirent_t *p_udf_dirent) { if (!p_udf_dirent) return NULL; if (!p_udf_dirent->psz_name) return ".."; return p_udf_dirent->psz_name; } /* Copy an UDF File Entry into a Directory Entry structure. */ bool udf_get_file_entry(const udf_dirent_t *p_udf_dirent, /*out*/ udf_file_entry_t *p_udf_fe) { if (!p_udf_dirent) return false; memcpy(p_udf_fe, &p_udf_dirent->fe, sizeof(udf_file_entry_t)); return true; } /*! Return the file id descriptor of the given file. */ bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent, /*out*/ udf_fileid_desc_t *p_udf_fid) { if (!p_udf_dirent) return false; if (!p_udf_dirent->fid) { /* FIXME do something about trying to get the descriptor. */ return false; } memcpy(p_udf_fid, p_udf_dirent->fid, sizeof(udf_fileid_desc_t)); return true; } /*! Return the number of hard links of the file. Return 0 if error. */ uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { return uint16_from_le(p_udf_dirent->fe.link_count); } return 0; /* Error. Non-error case handled above. */ } /*! Return the file length the file. Return 2147483647L if error. */ uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { return uint64_from_le(p_udf_dirent->fe.info_len); } return 2147483647L; /* Error. Non-error case handled above. */ } /*! Return true if the file is a directory. */ bool udf_is_dir(const udf_dirent_t *p_udf_dirent) { return p_udf_dirent->b_dir; } /* * Translate a file offset into a logical block and then into a physical * block. */ static lba_t offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, /*out*/ lba_t *pi_lba, /*out*/ uint32_t *pi_max_size) { udf_t *p_udf = p_udf_dirent->p_udf; const udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) &p_udf_dirent->fe; const udf_icbtag_t *p_icb_tag = &p_udf_fe->icb_tag; const uint16_t strat_type= uint16_from_le(p_icb_tag->strat_type); if (i_offset < 0) { cdio_warn("Negative offset value"); return CDIO_INVALID_LBA; } switch (strat_type) { case 4096: cdio_warn("Cannot deal with strategy4096 yet!"); return CDIO_INVALID_LBA; break; case ICBTAG_STRATEGY_TYPE_4: { off_t icblen = 0; uint64_t lsector; int ad_offset, ad_num = 0; uint16_t addr_ilk = uint16_from_le(p_icb_tag->flags&ICBTAG_FLAG_AD_MASK); switch (addr_ilk) { case ICBTAG_FLAG_AD_SHORT: { udf_short_ad_t *p_icb; /* * The allocation descriptor field is filled with short_ad's. * If the offset is beyond the current extent, look for the * next extent. */ do { i_offset -= icblen; ad_offset = sizeof(udf_short_ad_t) * ad_num; if (ad_offset > uint32_from_le(p_udf_fe->u_alloc_descs)) { cdio_warn("File offset out of bounds"); return CDIO_INVALID_LBA; } p_icb = (udf_short_ad_t *) GETICB( uint32_from_le(p_udf_fe->u_extended_attr) + ad_offset ); icblen = p_icb->len; ad_num++; } while(i_offset >= icblen); lsector = (i_offset / UDF_BLOCKSIZE) + p_icb->pos; *pi_max_size = p_icb->len; } break; case ICBTAG_FLAG_AD_LONG: { /* * The allocation descriptor field is filled with long_ad's * If the i_offset is beyond the current extent, look for the * next extent. */ udf_long_ad_t *p_icb; do { i_offset -= icblen; ad_offset = sizeof(udf_long_ad_t) * ad_num; if (ad_offset > uint32_from_le(p_udf_fe->u_alloc_descs)) { cdio_warn("File offset out of bounds"); return CDIO_INVALID_LBA; } p_icb = (udf_long_ad_t *) GETICB( uint32_from_le(p_udf_fe->u_extended_attr) + ad_offset ); icblen = p_icb->len; ad_num++; } while(i_offset >= icblen); lsector = (i_offset / UDF_BLOCKSIZE) + uint32_from_le(((udf_long_ad_t *)(p_icb))->loc.lba); *pi_max_size = p_icb->len; } break; case ICBTAG_FLAG_AD_IN_ICB: /* * This type means that the file *data* is stored in the * allocation descriptor field of the file entry. */ *pi_max_size = 0; cdio_warn("Don't know how to data in ICB handle yet"); return CDIO_INVALID_LBA; case ICBTAG_FLAG_AD_EXTENDED: cdio_warn("Don't know how to handle extended addresses yet"); return CDIO_INVALID_LBA; default: cdio_warn("Unsupported allocation descriptor %d", addr_ilk); return CDIO_INVALID_LBA; } *pi_lba = (lba_t)lsector + p_udf->i_part_start; if (*pi_lba < 0) { cdio_warn("Negative LBA value"); return CDIO_INVALID_LBA; } return *pi_lba; } default: cdio_warn("Unknown strategy type %d", strat_type); return DRIVER_OP_ERROR; } } /** Attempts to read up to count bytes from UDF directory entry p_udf_dirent into the buffer starting at buf. buf should be a multiple of UDF_BLOCKSIZE bytes. Reading continues after the point at which we last read or from the beginning the first time. If count is zero, read() returns zero and has no other results. If count is greater than SSIZE_MAX, the result is unspecified. It is the caller's responsibility to ensure that count is less than the number of blocks recorded via p_udf_dirent. If there is an error, cast the result to driver_return_code_t for the specific error code. */ ssize_t udf_read_block(const udf_dirent_t *p_udf_dirent, void * buf, size_t count) { if (count == 0) return 0; else { driver_return_code_t ret; uint32_t i_max_size=0; udf_t *p_udf = p_udf_dirent->p_udf; lba_t i_lba = offset_to_lba(p_udf_dirent, p_udf->i_position, &i_lba, &i_max_size); if (i_lba != CDIO_INVALID_LBA) { uint32_t i_max_blocks = CEILING(i_max_size, UDF_BLOCKSIZE); if ( i_max_blocks < count ) { cdio_warn("read count %u is larger than %u extent size.", (unsigned int)count, i_max_blocks); cdio_warn("read count truncated to %u", (unsigned int)count); count = i_max_blocks; } ret = udf_read_sectors(p_udf, buf, i_lba, count); if (DRIVER_OP_SUCCESS == ret) { ssize_t i_read_len = MIN(i_max_size, count * UDF_BLOCKSIZE); p_udf->i_position += i_read_len; return i_read_len; } return ret; } else { return DRIVER_OP_ERROR; } } } libcdio-2.2.0/lib/udf/udf_fs.c000066400000000000000000000544461474051130400160720ustar00rootroot00000000000000/* Copyright (C) 2005-2006, 2008, 2011, 2013-2014, 2017, 2024 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* * Portions copyright (c) 2001, 2002 Scott Long * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STDLIB_H # include #endif /* These definitions are also to make debugging easy. Note that they have to come *before* #include which sets #defines for these. */ const char VSD_STD_ID_BEA01[] = {'B', 'E', 'A', '0', '1'}; const char VSD_STD_ID_BOOT2[] = {'B', 'O', 'O', 'T', '2'}; const char VSD_STD_ID_CD001[] = {'C', 'D', '0', '0', '1'}; const char VSD_STD_ID_CDW01[] = {'C', 'D', 'W', '0', '2'}; const char VSD_STD_ID_NSR03[] = {'N', 'S', 'R', '0', '3'}; const char VSD_STD_ID_TEA01[] = {'T', 'E', 'A', '0', '1'}; #include #include #include #include "udf_private.h" #include "udf_fs.h" #include "cdio_assert.h" /* * The UDF specs are pretty clear on how each data structure is made * up, but not very clear on how they relate to each other. Here is * the skinny... This demostrates a filesystem with one file in the * root directory. Subdirectories are treated just as normal files, * but they have File Id Descriptors of their children as their file * data. As for the Anchor Volume Descriptor Pointer, it can exist in * two of the following three places: sector 256, sector n (the max * sector of the disk), or sector n - 256. It's a pretty good bet * that one will exist at sector 256 though. One caveat is unclosed * CD media. For that, sector 256 cannot be written, so the Anchor * Volume Descriptor Pointer can exist at sector 512 until the media * is closed. * * Sector: * 256: * n: Anchor Volume Descriptor Pointer * n - 256: | * | * |-->Main Volume Descriptor Sequence * | | * | | * | |-->Logical Volume Descriptor * | | * |-->Partition Descriptor | * | | * | | * |-->Fileset Descriptor * | * | * |-->Root Dir File Entry * | * | * |-->File data: * File Id Descriptor * | * | * |-->File Entry * | * | * |-->File data */ static udf_dirent_t * udf_new_dirent(udf_file_entry_t *p_udf_fe, udf_t *p_udf, const char *psz_name, bool b_dir, bool b_parent); /** * Check the descriptor tag for both the correct id and correct checksum. * Return zero if all is good, -1 if not. */ int udf_checktag(const udf_tag_t *p_tag, udf_Uint16_t tag_id) { uint8_t *itag; uint8_t i; uint8_t cksum = 0; itag = (uint8_t *)p_tag; #ifdef WORDS_BIGENDIAN tag_id = UINT16_SWAP_LE_BE(tag_id); #endif if (p_tag->id != tag_id) return -1; for (i = 0; i < 15; i++) cksum = cksum + itag[i]; cksum = cksum - itag[4]; if (cksum == p_tag->cksum) return 0; return -1; } bool udf_get_lba(const udf_file_entry_t *p_udf_fe, /*out*/ uint32_t *start, /*out*/ uint32_t *end) { if (! p_udf_fe->u_alloc_descs) return false; // check the validity of the u_extended_attr member if (p_udf_fe->u_extended_attr > UINT32_MAX - sizeof(udf_short_ad_t)) return false; switch (p_udf_fe->icb_tag.flags & ICBTAG_FLAG_AD_MASK) { case ICBTAG_FLAG_AD_SHORT: { /* The allocation descriptor field is filled with short_ad's. */ udf_short_ad_t *p_ad = (udf_short_ad_t *) (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr)); *start = uint32_from_le(p_ad->pos); *end = *start + ((uint32_from_le(p_ad->len) & UDF_LENGTH_MASK) - 1) / UDF_BLOCKSIZE; return true; } break; case ICBTAG_FLAG_AD_LONG: { /* The allocation descriptor field is filled with long_ad's */ udf_long_ad_t *p_ad = (udf_long_ad_t *) (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr)); *start = uint32_from_le(p_ad->loc.lba); /* ignore partition number */ *end = *start + ((uint32_from_le(p_ad->len) & UDF_LENGTH_MASK) - 1) / UDF_BLOCKSIZE; return true; } break; case ICBTAG_FLAG_AD_EXTENDED: { udf_ext_ad_t *p_ad = (udf_ext_ad_t *) (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr)); *start = uint32_from_le(p_ad->ext_loc.lba); /* ignore partition number */ *end = *start + ((uint32_from_le(p_ad->len) & UDF_LENGTH_MASK) - 1) / UDF_BLOCKSIZE; return true; } break; default: return false; } return false; } #define udf_PATH_DELIMITERS "/\\" /* Searches p_udf_dirent for a directory entry called psz_token. Note that p_udf_dirent may be replaced or freed during this call and only the returned udf_dirent_t must be used afterwards. */ static udf_dirent_t * udf_ff_traverse(udf_dirent_t *p_udf_dirent, char *psz_token) { while ((p_udf_dirent = udf_readdir(p_udf_dirent))) { if (strcmp(psz_token, p_udf_dirent->psz_name) == 0) { char *next_tok = strtok(NULL, udf_PATH_DELIMITERS); if (!next_tok) return p_udf_dirent; /* found */ else if (p_udf_dirent->b_dir) { udf_dirent_t * p_udf_dirent_next = udf_opendir(p_udf_dirent); if (p_udf_dirent_next) { /* free p_udf_dirent to avoid leaking memory. */ udf_dirent_free(p_udf_dirent); /* previous p_udf_dirent_next is freed by udf_ff_traverse. */ p_udf_dirent_next = udf_ff_traverse(p_udf_dirent_next, next_tok); return p_udf_dirent_next; } } } } return NULL; } /* FIXME! */ #define udf_MAX_PATHLEN 2048 udf_dirent_t * udf_fopen(udf_dirent_t *p_udf_root, const char *psz_name) { udf_dirent_t *p_udf_file = NULL; if (p_udf_root) { char tokenline[udf_MAX_PATHLEN]; char *psz_token; /* file position must be reset when accessing a new file */ p_udf_root->p_udf->i_position = 0; strncpy(tokenline, psz_name, udf_MAX_PATHLEN-1); tokenline[udf_MAX_PATHLEN-1] = '\0'; psz_token = strtok(tokenline, udf_PATH_DELIMITERS); if (psz_token) { udf_dirent_t *p_udf_dirent = udf_new_dirent(&p_udf_root->fe, p_udf_root->p_udf, p_udf_root->psz_name, p_udf_root->b_dir, p_udf_root->b_parent); p_udf_file = udf_ff_traverse(p_udf_dirent, psz_token); } else if ( 0 == strncmp("/", psz_name, sizeof("/")) ) { return udf_new_dirent(&p_udf_root->fe, p_udf_root->p_udf, p_udf_root->psz_name, p_udf_root->b_dir, p_udf_root->b_parent); } } return p_udf_file; } /* Convert unicode16 to UTF-8. The returned string is allocated and must be freed by the caller */ static char* unicode16_decode(const uint8_t *data, unsigned int u_len) { int i; char* r = NULL; switch (data[0]) { case 8: r = (char*)calloc(u_len, 1); if (r == NULL) return r; for (i=0; ipsz_name = strdup(psz_name); p_udf_dirent->b_dir = b_dir; p_udf_dirent->b_parent = b_parent; p_udf_dirent->p_udf = p_udf; p_udf_dirent->i_part_start = p_udf->i_part_start; p_udf_dirent->dir_left = uint64_from_le(p_udf_fe->info_len); memcpy(&(p_udf_dirent->fe), p_udf_fe, sizeof(udf_file_entry_t)); udf_get_lba( p_udf_fe, &(p_udf_dirent->i_loc), &(p_udf_dirent->i_loc_end) ); return p_udf_dirent; } /*! Seek to a position i_start and then read i_blocks. Number of blocks read is returned. One normally expects the return to be equal to i_blocks. */ driver_return_code_t udf_read_sectors (const udf_t *p_udf, void *ptr, lsn_t i_start, long i_blocks) { driver_return_code_t ret; long i_read; off_t i_byte_offset; if (!p_udf) return 0; /* Without the cast, i_start * UDF_BLOCKSIZE may be evaluated as 32 bit */ i_byte_offset = ((off_t)i_start) * UDF_BLOCKSIZE; /* Since we're using SEEK_SET, the value must be positive */ if (i_byte_offset < 0) { if (sizeof(off_t) <= 4) /* probably missing LFS */ cdio_warn("Large File Support is required to access streams of 2 GB or more"); return DRIVER_OP_BAD_PARAMETER; } if (p_udf->b_stream) { ret = cdio_stream_seek (p_udf->stream, i_byte_offset, SEEK_SET); if (DRIVER_OP_SUCCESS != ret) return ret; i_read = cdio_stream_read (p_udf->stream, ptr, UDF_BLOCKSIZE, i_blocks); if (i_read) return DRIVER_OP_SUCCESS; return DRIVER_OP_ERROR; } else { return cdio_read_data_sectors(p_udf->cdio, ptr, i_start, UDF_BLOCKSIZE, i_blocks); } } /*! Open an UDF for reading. Maybe in the future we will have a mode. NULL is returned on error. Caller must free result - use udf_close for that. */ udf_t * udf_open (const char *psz_path) { udf_t *p_udf = (udf_t *) calloc(1, sizeof(udf_t)) ; uint8_t data[UDF_BLOCKSIZE]; if (!p_udf) return NULL; /* Sanity check */ cdio_assert(sizeof(udf_file_entry_t) == UDF_BLOCKSIZE); p_udf->cdio = cdio_open(psz_path, DRIVER_UNKNOWN); if (!p_udf->cdio) { /* Not a CD-ROM drive or CD Image. Maybe it's a UDF file not encapsulated as a CD-ROM Image (e.g. often .UDF or (sic) .ISO) */ p_udf->stream = cdio_stdio_new( psz_path ); if (!p_udf->stream) goto error; p_udf->b_stream = true; } /* * Look for an Anchor Volume Descriptor Pointer at sector 256. */ if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, &data, 256, 1) ) goto error; memcpy(&(p_udf->anchor_vol_desc_ptr), &data, sizeof(anchor_vol_desc_ptr_t)); if (udf_checktag((udf_tag_t *)&(p_udf->anchor_vol_desc_ptr), TAGID_ANCHOR)) goto error; /* * Then try to find a reference to a Primary Volume Descriptor. */ { anchor_vol_desc_ptr_t *p_avdp = &p_udf->anchor_vol_desc_ptr; const uint32_t mvds_start = uint32_from_le(p_avdp->main_vol_desc_seq_ext.loc); const uint32_t mvds_end = mvds_start + (uint32_from_le(p_avdp->main_vol_desc_seq_ext.len) - 1) / UDF_BLOCKSIZE; uint32_t i_lba; for (i_lba = mvds_start; i_lba < mvds_end; i_lba++) { udf_pvd_t *p_pvd = (udf_pvd_t *) &data; if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, p_pvd, i_lba, 1) ) goto error; if (!udf_checktag(&p_pvd->tag, TAGID_PRI_VOL)) { p_udf->pvd_lba = i_lba; break; } } /* * If we couldn't find a reference, bail out. */ if (i_lba == mvds_end) goto error; } return p_udf; error: cdio_stdio_destroy(p_udf->stream); free(p_udf); return NULL; } /** * Gets the Volume Identifier, as an UTF-8 string * psz_volid, place to put the string * i_volid, size of the buffer psz_volid points to * returns the size of buffer needed for all data * Note: this call accepts a NULL psz_volid, to retrieve the length required. */ int udf_get_volume_id(udf_t *p_udf, /*out*/ char *psz_volid, unsigned int i_volid) { uint8_t data[UDF_BLOCKSIZE]; const udf_pvd_t *p_pvd = (udf_pvd_t *) &data; char* r; unsigned int volid_len; /* clear the output to empty string */ if (psz_volid != NULL) psz_volid[0] = 0; /* get primary volume descriptor */ if ( DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &data, p_udf->pvd_lba, 1) ) return 0; volid_len = p_pvd->vol_ident[UDF_VOLID_SIZE-1]; if(volid_len > UDF_VOLID_SIZE-1) { /* this field is only UDF_VOLID_SIZE bytes something is wrong */ volid_len = UDF_VOLID_SIZE-1; } r = unicode16_decode((uint8_t *) p_pvd->vol_ident, volid_len); if (r == NULL) return 0; volid_len = strlen(r)+1; /* +1 for NUL terminator */ if (psz_volid != NULL) { strncpy(psz_volid, r, i_volid); psz_volid[i_volid-1] = 0; /* strncpy does not always terminate the dest */ } free(r); return volid_len; } /** * Gets the Volume Set Identifier, as a 128-byte dstring (not decoded) * WARNING This is not a null terminated string * volsetid, place to put the data * i_volsetid, size of the buffer psz_volsetid points to * the buffer should be >=128 bytes to store the whole volumesetidentifier * returns the size of the available volsetid information (128) * or 0 on error */ int udf_get_volumeset_id(udf_t *p_udf, /*out*/ uint8_t *volsetid, unsigned int i_volsetid) { uint8_t data[UDF_BLOCKSIZE]; const udf_pvd_t *p_pvd = (udf_pvd_t *) &data; /* get primary volume descriptor */ if ( DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &data, p_udf->pvd_lba, 1) ) return 0; if (i_volsetid > UDF_VOLSET_ID_SIZE) { i_volsetid = UDF_VOLSET_ID_SIZE; } memcpy(volsetid, p_pvd->volset_id, i_volsetid); return UDF_VOLSET_ID_SIZE; } /** * Gets the Logical Volume Identifier string, as an UTF-8 string * psz_logvolid, place to put the string (should be at least 64 bytes) * i_logvolid, size of the buffer psz_logvolid points to * returns the size of buffer needed for all data, including NUL terminator * A call to udf_get_root() should have been issued before this call * Note: this call accepts a NULL psz_volid, to retrieve the length required. */ int udf_get_logical_volume_id(udf_t *p_udf, /*out*/ char *psz_logvolid, unsigned int i_logvolid) { uint8_t data[UDF_BLOCKSIZE]; logical_vol_desc_t *p_logvol = (logical_vol_desc_t *) &data; char* r; int logvolid_len; /* clear the output to empty string */ if (psz_logvolid != NULL) psz_logvolid[0] = 0; if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, p_logvol, p_udf->lvd_lba, 1) ) return 0; r = unicode16_decode((uint8_t *) p_logvol->logvol_id, p_logvol->logvol_id[127]); if (r == NULL) return 0; logvolid_len = strlen(r)+1; /* +1 for NUL terminator */ if (psz_logvolid != NULL) { strncpy(psz_logvolid, r, i_logvolid); psz_logvolid[i_logvolid-1] = 0; /* strncpy does not always terminate the dest */ } free(r); return logvolid_len; } /*! Get the root in p_udf. If b_any_partition is false then the root must be in the given partition. NULL is returned if the partition is not found or a root is not found or there is on error. Caller must free result - use udf_dirent_free for that. */ udf_dirent_t * udf_get_root (udf_t *p_udf, bool b_any_partition, partition_num_t i_partition) { const anchor_vol_desc_ptr_t *p_avdp = &p_udf->anchor_vol_desc_ptr; const uint32_t mvds_start = uint32_from_le(p_avdp->main_vol_desc_seq_ext.loc); const uint32_t mvds_end = mvds_start + (uint32_from_le(p_avdp->main_vol_desc_seq_ext.len) - 1) / UDF_BLOCKSIZE; uint32_t i_lba; uint8_t data[UDF_BLOCKSIZE]; /* Now we have the joy of finding the Partition Descriptor and the Logical Volume Descriptor for the Main Volume Descriptor Sequence. Once we've got that, we use the Logical Volume Descriptor to get a Fileset Descriptor and that has the Root Directory File Entry. */ for (i_lba = mvds_start; i_lba < mvds_end; i_lba++) { uint8_t data2[UDF_BLOCKSIZE]; partition_desc_t *p_partition = (partition_desc_t *) &data2; if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, p_partition, i_lba, 1) ) return NULL; if (!udf_checktag(&p_partition->tag, TAGID_PARTITION)) { const partition_num_t i_partition_check = uint16_from_le(p_partition->number); if (b_any_partition || i_partition_check == i_partition) { /* Squirrel away some data regarding partition */ p_udf->i_partition = uint16_from_le(p_partition->number); p_udf->i_part_start = uint32_from_le(p_partition->start_loc); if (p_udf->lvd_lba) break; } } else if (!udf_checktag(&p_partition->tag, TAGID_LOGVOL)) { /* Get fileset descriptor */ logical_vol_desc_t *p_logvol = (logical_vol_desc_t *) &data2; bool b_valid = UDF_BLOCKSIZE == uint32_from_le(p_logvol->logical_blocksize); if (b_valid) { p_udf->lvd_lba = i_lba; p_udf->fsd_offset = uint32_from_le(p_logvol->lvd_use.fsd_loc.loc.lba); if (p_udf->i_part_start) break; } } } if (p_udf->lvd_lba && p_udf->i_part_start) { udf_fsd_t *p_fsd = (udf_fsd_t *) &data; driver_return_code_t ret = udf_read_sectors(p_udf, p_fsd, p_udf->i_part_start + p_udf->fsd_offset, 1); if (DRIVER_OP_SUCCESS == ret && !udf_checktag(&p_fsd->tag, TAGID_FSD)) { udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) &data; const uint32_t parent_icb = uint32_from_le(p_fsd->root_icb.loc.lba); /* Check partition numbers match of last-read block? */ ret = udf_read_sectors(p_udf, p_udf_fe, p_udf->i_part_start + parent_icb, 1); if (ret == DRIVER_OP_SUCCESS && !udf_checktag(&p_udf_fe->tag, TAGID_FILE_ENTRY)) { /* Check partition numbers match of last-read block? */ /* We win! - Save root directory information. */ return udf_new_dirent(p_udf_fe, p_udf, "/", true, false ); } } } return NULL; } #define free_and_null(x) \ CDIO_FREE_IF_NOT_NULL(x); \ x=NULL /*! Close UDF and free resources associated with p_udf. */ bool udf_close (udf_t *p_udf) { if (!p_udf) return true; if (p_udf->b_stream) { cdio_stdio_destroy(p_udf->stream); } else { cdio_destroy(p_udf->cdio); } /* Get rid of root directory if allocated. */ free_and_null(p_udf); return true; } udf_dirent_t * udf_opendir(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent->b_dir && !p_udf_dirent->b_parent && p_udf_dirent->fid) { udf_t *p_udf = p_udf_dirent->p_udf; udf_file_entry_t udf_fe; driver_return_code_t i_ret = udf_read_sectors(p_udf, &udf_fe, p_udf->i_part_start + p_udf_dirent->fid->icb.loc.lba, 1); if (DRIVER_OP_SUCCESS == i_ret && !udf_checktag(&udf_fe.tag, TAGID_FILE_ENTRY)) { if (ICBTAG_FILE_TYPE_DIRECTORY == udf_fe.icb_tag.file_type) { udf_dirent_t *p_udf_dirent_new = udf_new_dirent(&udf_fe, p_udf, p_udf_dirent->psz_name, true, true); return p_udf_dirent_new; } } } return NULL; } udf_dirent_t * udf_readdir(udf_dirent_t *p_udf_dirent) { udf_t *p_udf; uint8_t* p; if (p_udf_dirent->dir_left <= 0) { udf_dirent_free(p_udf_dirent); return NULL; } /* file position must be reset when accessing a new file */ p_udf = p_udf_dirent->p_udf; p_udf->i_position = 0; if (p_udf_dirent->fid) { /* advance to next File Identifier Descriptor */ /* FIXME: need to advance file entry (fe) as well. */ uint32_t ofs = 4 * ((sizeof(*(p_udf_dirent->fid)) + p_udf_dirent->fid->u.i_imp_use + p_udf_dirent->fid->i_file_id + 3) / 4); p_udf_dirent->fid = (udf_fileid_desc_t *)((uint8_t *)p_udf_dirent->fid + ofs); } if (!p_udf_dirent->fid) { uint32_t i_sectors = (p_udf_dirent->i_loc_end - p_udf_dirent->i_loc + 1); uint32_t size = UDF_BLOCKSIZE * i_sectors; driver_return_code_t i_ret; if (!p_udf_dirent->sector) p_udf_dirent->sector = (uint8_t*) malloc(size); i_ret = udf_read_sectors(p_udf, p_udf_dirent->sector, p_udf_dirent->i_part_start+p_udf_dirent->i_loc, i_sectors); if (DRIVER_OP_SUCCESS == i_ret) p_udf_dirent->fid = (udf_fileid_desc_t *) p_udf_dirent->sector; else p_udf_dirent->fid = NULL; } if (p_udf_dirent->fid && !udf_checktag(&(p_udf_dirent->fid->tag), TAGID_FID)) { uint32_t ofs = 4 * ((sizeof(*p_udf_dirent->fid) + p_udf_dirent->fid->u.i_imp_use + p_udf_dirent->fid->i_file_id + 3) / 4); p_udf_dirent->dir_left -= ofs; p_udf_dirent->b_dir = (p_udf_dirent->fid->file_characteristics & UDF_FILE_DIRECTORY) != 0; p_udf_dirent->b_parent = (p_udf_dirent->fid->file_characteristics & UDF_FILE_PARENT) != 0; { const unsigned int u_len = p_udf_dirent->fid->i_file_id; if (DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &p_udf_dirent->fe, p_udf->i_part_start + uint32_from_le(p_udf_dirent->fid->icb.loc.lba), 1)) { udf_dirent_free(p_udf_dirent); return NULL; } free_and_null(p_udf_dirent->psz_name); p = (uint8_t*)p_udf_dirent->fid->u.imp_use.data + p_udf_dirent->fid->u.i_imp_use; p_udf_dirent->psz_name = unicode16_decode(p, u_len); } return p_udf_dirent; } udf_dirent_free(p_udf_dirent); return NULL; } /*! free free resources associated with p_udf_dirent. */ bool udf_dirent_free(udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { p_udf_dirent->fid = NULL; free_and_null(p_udf_dirent->psz_name); free_and_null(p_udf_dirent->sector); free_and_null(p_udf_dirent); } return true; } libcdio-2.2.0/lib/udf/udf_fs.h000066400000000000000000000021321474051130400160600ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_UDF_UDF_FS_H_ #define CDIO_UDF_UDF_FS_H_ #include /** * Check the descriptor tag for both the correct id and correct checksum. * Return zero if all is good, -1 if not. */ int udf_checktag(const udf_tag_t *p_tag, udf_Uint16_t tag_id); #endif /* CDIO_UDF_UDF_FS_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/udf/udf_private.h000066400000000000000000000037001474051130400171240ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2008, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CDIO_UDF_UDF_PRIVATE_H_ #define CDIO_UDF_UDF_PRIVATE_H_ #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDBOOL_H # include #endif #include #include #include #include "_cdio_stdio.h" /* Implementation of opaque types */ struct udf_s { 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 */ 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 */ uint32_t fsd_offset; /* lba of fileset descriptor */ }; #endif /* CDIO_UDF_UDF_PRIVATE_H_ */ /* * Local variables: * c-file-style: "gnu" * tab-width: 8 * indent-tabs-mode: nil * End: */ libcdio-2.2.0/lib/udf/udf_time.c000066400000000000000000000171031474051130400164050ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2011 Rocky Bernstein Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. Modified From part of the GNU C Library. Contributed by Paul Eggert. 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Some history from the GNU/Linux kernel from which this is also taken... dgb 10/02/98: ripped this from glibc source to help convert timestamps to unix time 10/04/98: added new table-based lookup after seeing how ugly the gnu code is blf 09/27/99: ripped out all the old code and inserted new table from John Brockmeyer (without leap second corrections) rewrote udf_stamp_to_time and fixed timezone accounting in udf_timespec_to_stamp. */ /* * We don't take into account leap seconds. This may be correct or incorrect. * For more NIST information (especially dealing with leap seconds), see: * http://www.boulder.nist.gov/timefreq/pubs/bulletin/leapsecond.htm */ #ifdef HAVE_CONFIG_H #include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef NEED_TIMEZONEVAR #define timezonevar 1 #endif #include "udf_private.h" #include /** Imagine the below enum values as #define'd or constant values rather than distinct values of an enum. */ enum { HOURS_PER_DAY = 24, SECS_PER_MINUTE = 60, MAX_YEAR_SECONDS = 69, DAYS_PER_YEAR = 365, /* That is, in most of the years. */ EPOCH_YEAR = 1970, SECS_PER_HOUR = (60 * SECS_PER_MINUTE), SECS_PER_DAY = SECS_PER_HOUR * HOURS_PER_DAY } debug_udf_time_enum; #ifndef __isleap /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ #define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #endif /* How many days come before each month (0-12). */ static const unsigned short int __mon_yday[2][13] = { /* Normal years. */ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, DAYS_PER_YEAR }, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, DAYS_PER_YEAR+1 } }; #define SPY(y,l,s) (SECS_PER_DAY * (DAYS_PER_YEAR*y+l)+s) /* Seconds per year */ static time_t year_seconds[MAX_YEAR_SECONDS]= { /*1970*/ SPY( 0, 0,0), SPY( 1, 0,0), SPY( 2, 0,0), SPY( 3, 1,0), /*1974*/ SPY( 4, 1,0), SPY( 5, 1,0), SPY( 6, 1,0), SPY( 7, 2,0), /*1978*/ SPY( 8, 2,0), SPY( 9, 2,0), SPY(10, 2,0), SPY(11, 3,0), /*1982*/ SPY(12, 3,0), SPY(13, 3,0), SPY(14, 3,0), SPY(15, 4,0), /*1986*/ SPY(16, 4,0), SPY(17, 4,0), SPY(18, 4,0), SPY(19, 5,0), /*1990*/ SPY(20, 5,0), SPY(21, 5,0), SPY(22, 5,0), SPY(23, 6,0), /*1994*/ SPY(24, 6,0), SPY(25, 6,0), SPY(26, 6,0), SPY(27, 7,0), /*1998*/ SPY(28, 7,0), SPY(29, 7,0), SPY(30, 7,0), SPY(31, 8,0), /*2002*/ SPY(32, 8,0), SPY(33, 8,0), SPY(34, 8,0), SPY(35, 9,0), /*2006*/ SPY(36, 9,0), SPY(37, 9,0), SPY(38, 9,0), SPY(39,10,0), /*2010*/ SPY(40,10,0), SPY(41,10,0), SPY(42,10,0), SPY(43,11,0), /*2014*/ SPY(44,11,0), SPY(45,11,0), SPY(46,11,0), SPY(47,12,0), /*2018*/ SPY(48,12,0), SPY(49,12,0), SPY(50,12,0), SPY(51,13,0), /*2022*/ SPY(52,13,0), SPY(53,13,0), SPY(54,13,0), SPY(55,14,0), /*2026*/ SPY(56,14,0), SPY(57,14,0), SPY(58,14,0), SPY(59,15,0), /*2030*/ SPY(60,15,0), SPY(61,15,0), SPY(62,15,0), SPY(63,16,0), /*2034*/ SPY(64,16,0), SPY(65,16,0), SPY(66,16,0), SPY(67,17,0), /*2038*/ SPY(68,17,0) }; #if defined(HAVE_TIMEZONE_VAR) && !defined(_WIN32) extern long timezone; #endif time_t * udf_stamp_to_time(time_t *dest, long int *dest_usec, const udf_timestamp_t src) { int yday; uint8_t type = src.type_tz >> 12; int16_t offset; if (type == 1) { offset = src.type_tz << 4; /* sign extent offset */ offset = (offset >> 4); if (offset == -2047) /* unspecified offset */ offset = 0; } else offset = 0; if ((src.year < EPOCH_YEAR) || (src.year >= EPOCH_YEAR+MAX_YEAR_SECONDS)) { *dest = -1; *dest_usec = -1; return NULL; } *dest = year_seconds[src.year - EPOCH_YEAR]; *dest -= offset * SECS_PER_MINUTE; yday = ((__mon_yday[__isleap (src.year)] [src.month-1]) + (src.day-1)); *dest += src.second + ( SECS_PER_MINUTE * ( ( (yday* HOURS_PER_DAY) + src.hour ) * 60 + src.minute ) ); *dest_usec = src.microseconds + (src.centiseconds * 10000) + (src.hundreds_of_microseconds * 100); return dest; } #ifdef HAVE_STRUCT_TIMESPEC /*! Convert a UDF timestamp to a time_t. If microseconds are desired, use dest_usec. The return value is the same as dest. */ udf_timestamp_t * udf_timespec_to_stamp(const struct timespec ts, udf_timestamp_t *dest) { long int days, rem, y; const unsigned short int *ip; int16_t offset = 0; int16_t tv_sec; #ifdef HAVE_TIMEZONE_VAR offset = -timezone; #endif if (!dest) return dest; dest->type_tz = 0x1000 | (offset & 0x0FFF); tv_sec = ts.tv_sec + (offset * SECS_PER_MINUTE); days = tv_sec / SECS_PER_DAY; rem = tv_sec % SECS_PER_DAY; dest->hour = rem / SECS_PER_HOUR; rem %= SECS_PER_HOUR; dest->minute = rem / SECS_PER_MINUTE; dest->second = rem % SECS_PER_MINUTE; y = EPOCH_YEAR; #define DIV(a,b) ((a) / (b) - ((a) % (b) < 0)) #define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400)) while (days < 0 || days >= (__isleap(y) ? DAYS_PER_YEAR+1 : DAYS_PER_YEAR)) { long int yg = y + days / DAYS_PER_YEAR - (days % DAYS_PER_YEAR < 0); /* Adjust DAYS and Y to match the guessed year. */ days -= ((yg - y) * DAYS_PER_YEAR + LEAPS_THRU_END_OF (yg - 1) - LEAPS_THRU_END_OF (y - 1)); y = yg; } dest->year = y; ip = __mon_yday[__isleap(y)]; for (y = 11; days < (long int) ip[y]; --y) continue; days -= ip[y]; dest->month = y + 1; dest->day = days + 1; dest->centiseconds = ts.tv_nsec / 10000000; dest->hundreds_of_microseconds = ( (ts.tv_nsec / 1000) - (dest->centiseconds * 10000) ) / 100; dest->microseconds = ( (ts.tv_nsec / 1000) - (dest->centiseconds * 10000) - (dest->hundreds_of_microseconds * 100) ); return dest; } #endif /*! Return the modification time of the file. */ time_t udf_get_modification_time(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { time_t ret_time; long int usec; udf_stamp_to_time(&ret_time, &usec, p_udf_dirent->fe.modification_time); return ret_time; } return 0; } /*! Return the access time of the file. */ time_t udf_get_access_time(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { time_t ret_time; long int usec; udf_stamp_to_time(&ret_time, &usec, p_udf_dirent->fe.access_time); return ret_time; } return 0; } /*! Return the attribute (most recent create or access) time of the file */ time_t udf_get_attribute_time(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { time_t ret_time; long int usec; udf_stamp_to_time(&ret_time, &usec, p_udf_dirent->fe.attribute_time); return ret_time; } return 0; } libcdio-2.2.0/libcdio++.pc.in000066400000000000000000000004411474051130400156020ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: @PACKAGE_NAME@++ Description: C++ OO Portable CD-ROM I/O library Version: @PACKAGE_VERSION@ #Requires: glib-2.0 Libs: -L${libdir} -lcdio++ -lcdio @LIBS@ @DARWIN_PKG_LIB_HACK@ Cflags: -I${includedir} libcdio-2.2.0/libcdio.pc.in000066400000000000000000000004341474051130400154560ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: @PACKAGE_NAME@ Description: Portable CD-ROM I/O library Version: @PACKAGE_VERSION@ #Requires: glib-2.0 Libs: -L${libdir} -lcdio @LIBS@ @LTLIBICONV@ @DARWIN_PKG_LIB_HACK@ Cflags: -I${includedir} libcdio-2.2.0/libcdio.sln000066400000000000000000000041741474051130400152500ustar00rootroot00000000000000 Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.12.35527.113 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcdio", ".vs\libcdio.vcxproj", "{E465056A-C6F3-45EE-B791-CAF8E0CE629D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cd-info", ".vs\cd-info.vcxproj", "{8E55CFDB-5E38-4A07-84F8-36939C825735}" ProjectSection(ProjectDependencies) = postProject {E465056A-C6F3-45EE-B791-CAF8E0CE629D} = {E465056A-C6F3-45EE-B791-CAF8E0CE629D} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Debug|x64.ActiveCfg = Debug|x64 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Debug|x64.Build.0 = Debug|x64 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Debug|x86.ActiveCfg = Debug|Win32 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Debug|x86.Build.0 = Debug|Win32 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Release|x64.ActiveCfg = Release|x64 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Release|x64.Build.0 = Release|x64 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Release|x86.ActiveCfg = Release|Win32 {E465056A-C6F3-45EE-B791-CAF8E0CE629D}.Release|x86.Build.0 = Release|Win32 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Debug|x64.ActiveCfg = Debug|x64 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Debug|x64.Build.0 = Debug|x64 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Debug|x86.ActiveCfg = Debug|Win32 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Debug|x86.Build.0 = Debug|Win32 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Release|x64.ActiveCfg = Release|x64 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Release|x64.Build.0 = Release|x64 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Release|x86.ActiveCfg = Release|Win32 {8E55CFDB-5E38-4A07-84F8-36939C825735}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal libcdio-2.2.0/libiso9660++.pc.in000066400000000000000000000004671474051130400160130ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ libiconv=@LTLIBICONV@ Name: libiso9660++ Description: C++ OO ISO-9660 library of libcdio Version: @PACKAGE_VERSION@ Requires: libcdio Libs: -L${libdir} -liso9660++ -lcdio++ -liso9660 @LTLIBICONV@ -lcdio Cflags: -I${includedir} libcdio-2.2.0/libiso9660.pc.in000066400000000000000000000004311474051130400156540ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ libiconv=@LTLIBICONV@ Name: libiso9660 Description: ISO-9660 library of libcdio Version: @PACKAGE_VERSION@ Requires: libcdio Libs: -L${libdir} -liso9660 @LTLIBICONV@ -lcdio Cflags: -I${includedir} libcdio-2.2.0/libudf.pc.in000066400000000000000000000003511474051130400153140ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libudf Description: UDF library of libcdio Version: @PACKAGE_VERSION@ Requires: libcdio Libs: -L${libdir} -ludf -lcdio Cflags: -I${includedir} libcdio-2.2.0/m4/000077500000000000000000000000001474051130400134375ustar00rootroot00000000000000libcdio-2.2.0/m4/codeset.m4000066400000000000000000000016151474051130400153320ustar00rootroot00000000000000# codeset.m4 # serial 5 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[char* cs = nl_langinfo(CODESET); return !cs;]])], [am_cv_langinfo_codeset=yes], [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo(CODESET).]) fi ]) libcdio-2.2.0/m4/host-cpu-c-abi.m4000066400000000000000000000413541474051130400164230ustar00rootroot00000000000000# host-cpu-c-abi.m4 serial 17 dnl Copyright (C) 2002-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible and Sam Steingold. dnl Sets the HOST_CPU variable to the canonical name of the CPU. dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its dnl C language ABI (application binary interface). dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in dnl config.h. dnl dnl This canonical name can be used to select a particular assembly language dnl source file that will interoperate with C code on the given host. dnl dnl For example: dnl * 'i386' and 'sparc' are different canonical names, because code for i386 dnl will not run on SPARC CPUs and vice versa. They have different dnl instruction sets. dnl * 'sparc' and 'sparc64' are different canonical names, because code for dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit dnl mode, but not both. dnl * 'mips' and 'mipsn32' are different canonical names, because they use dnl different argument passing and return conventions for C functions, and dnl although the instruction set of 'mips' is a large subset of the dnl instruction set of 'mipsn32'. dnl * 'mipsn32' and 'mips64' are different canonical names, because they use dnl different sizes for the C types like 'int' and 'void *', and although dnl the instruction sets of 'mipsn32' and 'mips64' are the same. dnl * The same canonical name is used for different endiannesses. You can dnl determine the endianness through preprocessor symbols: dnl - 'arm': test __ARMEL__. dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN. dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because dnl - Instructions that do not exist on all of these CPUs (cmpxchg, dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your dnl assembly language source files use such instructions, you will dnl need to make the distinction. dnl - Speed of execution of the common instruction set is reasonable across dnl the entire family of CPUs. If you have assembly language source files dnl that are optimized for particular CPU types (like GNU gmp has), you dnl will need to make the distinction. dnl See . AC_DEFUN([gl_HOST_CPU_C_ABI], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_C_ASM]) AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], [case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl gl_cv_host_cpu_c_abi=i386 ;; x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 # with native Windows (mingw, MSVC). # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (defined __x86_64__ || defined __amd64__ \ || defined _M_X64 || defined _M_AMD64) int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=x86_64-x32], [gl_cv_host_cpu_c_abi=x86_64])], [gl_cv_host_cpu_c_abi=i386]) ;; changequote(,)dnl alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) changequote([,])dnl gl_cv_host_cpu_c_abi=alpha ;; arm* | aarch64 ) # Assume arm with EABI. # On arm64 systems, the C compiler may be generating code in one of # these ABIs: # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __aarch64__ int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=arm64-ilp32], [gl_cv_host_cpu_c_abi=arm64])], [# Don't distinguish little-endian and big-endian arm, since they # don't require different machine code for simple operations and # since the user can distinguish them through the preprocessor # defines __ARMEL__ vs. __ARMEB__. # But distinguish arm which passes floating-point arguments and # return values in integer registers (r0, r1, ...) - this is # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which # passes them in float registers (s0, s1, ...) and double registers # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer # sets the preprocessor defines __ARM_PCS (for the first case) and # __ARM_PCS_VFP (for the second case), but older GCC does not. echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c # Look for a reference to the register d0 in the .s file. AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then gl_cv_host_cpu_c_abi=armhf else gl_cv_host_cpu_c_abi=arm fi rm -f conftest* ]) ;; hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) # On hppa, the C compiler may be generating 32-bit code or 64-bit # code. In the latter case, it defines _LP64 and __LP64__. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __LP64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=hppa64], [gl_cv_host_cpu_c_abi=hppa]) ;; ia64* ) # On ia64 on HP-UX, the C compiler may be generating 64-bit code or # 32-bit code. In the latter case, it defines _ILP32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=ia64-ilp32], [gl_cv_host_cpu_c_abi=ia64]) ;; mips* ) # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this # at 32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mips64], [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIN32. # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIO32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (_MIPS_SIM == _ABIN32) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mipsn32], [gl_cv_host_cpu_c_abi=mips])]) ;; powerpc* ) # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. # No need to distinguish them here; the caller may distinguish # them based on the OS. # On powerpc64 systems, the C compiler may still be generating # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may # be generating 64-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __powerpc64__ || defined __LP64__ int ok; #else error fail #endif ]])], [# On powerpc64, there are two ABIs on Linux: The AIX compatible # one and the ELFv2 one. The latter defines _CALL_ELF=2. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _CALL_ELF && _CALL_ELF == 2 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=powerpc64-elfv2], [gl_cv_host_cpu_c_abi=powerpc64]) ], [gl_cv_host_cpu_c_abi=powerpc]) ;; rs6000 ) gl_cv_host_cpu_c_abi=powerpc ;; riscv32 | riscv64 ) # There are 2 architectures (with variants): rv32* and rv64*. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if __riscv_xlen == 64 int ok; #else error fail #endif ]])], [cpu=riscv64], [cpu=riscv32]) # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. # Size of 'long' and 'void *': AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ int ok; #else error fail #endif ]])], [main_abi=lp64], [main_abi=ilp32]) # Float ABIs: # __riscv_float_abi_double: # 'float' and 'double' are passed in floating-point registers. # __riscv_float_abi_single: # 'float' are passed in floating-point registers. # __riscv_float_abi_soft: # No values are passed in floating-point registers. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_double int ok; #else error fail #endif ]])], [float_abi=d], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_single int ok; #else error fail #endif ]])], [float_abi=f], [float_abi='']) ]) gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" ;; s390* ) # On s390x, the C compiler may be generating 64-bit (= s390x) code # or 31-bit (= s390) code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ || defined __s390x__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=s390x], [gl_cv_host_cpu_c_abi=s390]) ;; sparc | sparc64 ) # UltraSPARCs running Linux have `uname -m` = "sparc64", but the # C compiler still generates 32-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=sparc64], [gl_cv_host_cpu_c_abi=sparc]) ;; *) gl_cv_host_cpu_c_abi="$host_cpu" ;; esac ]) dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" AC_SUBST([HOST_CPU]) AC_SUBST([HOST_CPU_C_ABI]) # This was # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) # earlier, but KAI C++ 3.2d doesn't like this. sed -e 's/-/_/g' >> confdefs.h <. dnl Don't make changes that are incompatible with that documentation! AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. gl_saved_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then gl_saved_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$gl_saved_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. gl_saved_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from successful returns. This is even documented in */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ { /* Try standardized names. */ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); /* Try IRIX, OSF/1 names. */ iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); /* Try AIX names. */ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); /* Try HP-UX names. */ iconv_t cd4 = iconv_open ("utf8", "eucJP"); if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) result |= 16; if (cd1 != (iconv_t)(-1)) iconv_close (cd1); if (cd2 != (iconv_t)(-1)) iconv_close (cd2); if (cd3 != (iconv_t)(-1)) iconv_close (cd3); if (cd4 != (iconv_t)(-1)) iconv_close (cd4); } return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$gl_saved_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$gl_saved_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". AC_DEFUN_ONCE([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature], [gl_cv_iconv_nonconst], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); ]], [[]])], [gl_cv_iconv_nonconst=yes], [gl_cv_iconv_nonconst=no]) ]) else dnl When compiling GNU libiconv on a system that does not have iconv yet, dnl pick the POSIX compliant declaration without 'const'. gl_cv_iconv_nonconst=yes fi if test $gl_cv_iconv_nonconst = yes; then iconv_arg1="" else iconv_arg1="const" fi AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test $gl_cv_iconv_nonconst != yes; then ICONV_CONST="const" fi ]) dnl A summary result, for those packages which want to print a summary at the dnl end of the configuration. if test "$am_func_iconv" = yes; then if test -n "$LIBICONV"; then am_cv_func_iconv_summary='yes, in libiconv' else am_cv_func_iconv_summary='yes, in libc' fi else if test "$am_cv_func_iconv" = yes; then am_cv_func_iconv_summary='not working, consider installing GNU libiconv' else am_cv_func_iconv_summary='no, consider installing GNU libiconv' fi fi ]) libcdio-2.2.0/m4/lib-ld.m4000066400000000000000000000124101474051130400150420ustar00rootroot00000000000000# lib-ld.m4 serial 13 dnl Copyright (C) 1996-2003, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi if test -n "$LD"; then AC_MSG_CHECKING([for ld]) elif test "$GCC" = yes; then AC_MSG_CHECKING([for ld used by $CC]) elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi if test -n "$LD"; then # Let the user override the test with a path. : else AC_CACHE_VAL([acl_cv_path_LD], [ acl_cv_path_LD= # Final result of this test ac_prog=ld # Program to search in $PATH if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in *-*-mingw* | windows*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) acl_output=`($CC -print-prog-name=ld) 2>&5` ;; esac case $acl_output in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` done # Got the pathname. No search in PATH is needed. acl_cv_path_LD="$acl_output" ac_prog= ;; "") # If it fails, then pretend we aren't using GCC. ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. acl_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_saved_IFS" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) AC_ARG_WITH(PACK[-prefix], [[ --with-]]PACK[[-prefix[=DIR] search for ]]PACKLIBS[[ in DIR/include and DIR/lib --without-]]PACK[[-prefix don't search for ]]PACKLIBS[[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi ]) if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= fi dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Use breadth-first search. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi fi done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. saved_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$saved_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. dnl But on GNU systems, ignore -lc options, because dnl - linking with libc is the default anyway, dnl - linking with libc.a may produce an error dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie" dnl or may produce an executable that always crashes, see dnl . dep=`echo "X$dep" | sed -e 's/^X-l//'` if test "X$dep" != Xc \ || case $host_os in linux* | gnu* | k*bsd*-gnu) false ;; *) true ;; esac; then names_next_round="$names_next_round $dep" fi ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_saved_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_saved_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_saved_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_saved_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) libcdio-2.2.0/m4/lib-prefix.m4000066400000000000000000000303261474051130400157460ustar00rootroot00000000000000# lib-prefix.m4 serial 22 dnl Copyright (C) 2001-2005, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib-prefix], [[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_saved_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_saved_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_saved_prefix="$prefix" prefix="$acl_final_prefix" acl_saved_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_saved_exec_prefix" prefix="$acl_saved_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a function acl_is_expected_elfclass, that tests whether standard input dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing dnl the basename of the libdir to try in turn, either "lib" or "lib64" or dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib, lib32, and lib64. dnl On most glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. dnl We determine the compiler's default mode by looking at the compiler's dnl library search path. If at least one of its elements ends in /lib64 or dnl points to a directory whose absolute pathname ends in /lib64, we use that dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, dnl namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], [AC_EGREP_CPP([Extensible Linking Format], [#if defined __ELF__ || (defined __linux__ && defined __EDG__) Extensible Linking Format #endif ], [gl_cv_elf=yes], [gl_cv_elf=no]) ]) if test $gl_cv_elf = yes; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then # Use POSIX od. func_elfclass () { od -A n -t d1 -j 4 -N 1 } else # Use BSD hexdump. func_elfclass () { dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' echo } fi # Use 'expr', not 'test', to compare the values of func_elfclass, because on # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002, # not 1 or 2. changequote(,)dnl case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null } ;; *) # Unknown. acl_is_expected_elfclass () { : } ;; esac changequote([,])dnl else acl_is_expected_elfclass () { : } fi dnl Allow the user to override the result by setting acl_cv_libdirstems. AC_CACHE_CHECK([for the common suffixes of directories in the library search path], [acl_cv_libdirstems], [dnl Try 'lib' first, because that's the default for libdir in GNU, see dnl . acl_libdirstem=lib acl_libdirstem2= acl_libdirstem3= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. if test $HOST_CPU_C_ABI_32BIT = no; then acl_libdirstem2=lib/64 case "$host_cpu" in sparc*) acl_libdirstem3=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; esac fi ;; netbsd*) dnl On NetBSD/sparc64, there is a 'sparc' subdirectory that contains dnl 32-bit libraries. if test $HOST_CPU_C_ABI_32BIT != no; then case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparc ;; esac fi ;; *) dnl If $CC generates code for a 32-bit ABI, the libraries are dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. dnl Find the compiler's search path. However, non-system compilers dnl sometimes have odd library search paths. But we can't simply invoke dnl '/usr/bin/gcc -print-search-dirs' because that would not take into dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test $HOST_CPU_C_ABI_32BIT != no; then # 32-bit or unknown ABI. if test -d /usr/lib32; then acl_libdirstem2=lib32 fi fi if test $HOST_CPU_C_ABI_32BIT != yes; then # 64-bit or unknown ABI. if test -d /usr/lib64; then acl_libdirstem3=lib64 fi fi if test -n "$searchpath"; then acl_saved_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib32 ) acl_libdirstem2=lib32 ;; */lib64 ) acl_libdirstem3=lib64 ;; esac ;; esac fi done IFS="$acl_saved_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= fi if test $HOST_CPU_C_ABI_32BIT = no; then # 64-bit ABI. acl_libdirstem2= fi fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" ]) dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and dnl acl_libdirstem3. changequote(,)dnl acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` changequote([,])dnl ]) libcdio-2.2.0/m4/pkg.m4000066400000000000000000000316561474051130400144750ustar00rootroot00000000000000# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. dnl dnl If pkg-config is not found or older than specified, it will result dnl in an empty PKG_CONFIG variable. To avoid widespread issues with dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting. dnl You can specify [PKG_CONFIG=false] as an action instead, which would dnl result in pkg-config tests failing, but no bogus error messages. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi if test -z "$PKG_CONFIG"; then m4_default([$2], [AC_MSG_ERROR([pkg-config not found])]) fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES libcdio-2.2.0/maintMakefile000066400000000000000000000003211474051130400156040ustar00rootroot00000000000000# Lots of warnings! AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE) libcdio-2.2.0/make-check-filter.pl000077500000000000000000000014321474051130400167320ustar00rootroot00000000000000#!/usr/bin/env perl # Use this to cut out the crud from make check. # Use like this: # make check 2>&1 | ruby ../make-check-filter.pl # See Makefile.am my @pats = ("^ CC", "^ CXX", '^(re|g)?make\[', "^(re|g)?make ", "Making check in", '^[+]{2} WARN: ', '^m4/', # doesn't work always '^configure.ac', # doesn't work always '^ cd \.\.', # doesn't work always '^config.status', # doesn't work always "^ vcd_demo.right", '^-- ', '^-+$', '^##<<+$', '^##>>+$', '`.+\' is up to date.$', '^\s*$'); my $pats = "(" . join("|", @pats) . ')'; # print "$pats\n"; my $skip_re = /${pats}/; # open(STDIN, '<', '/etc/hosts') # or die "cannot open > /etc/hosts: $!"; while () { next if $_ =~ /$pats/; print $_; } libcdio-2.2.0/make-check-filter.rb000077500000000000000000000012511474051130400167210ustar00rootroot00000000000000#!/usr/bin/env ruby # Use this to cut out the crud from make check. # Use like this: # make check 2>&1 | ruby ../make-check-filter.rb # See Makefile.am pats = '(' + ["^ CC", "^ CXX", '^(re|g)?make\[', "^(re|g)?make ", "Making check in", '^[+]{2} WARN: ', '^m4/', # doesn't work always '^configure.ac', # doesn't work always '^ cd \.\.', # doesn't work always '^config.status', # doesn't work always "^ vcd_demo.right", '^-- ', '^-+$', '^##<<+$', '^##>>+$', '`.+\' is up to date.$', '^\s*$', ].join('|') + ')' # puts pats skip_re = /#{pats}/ while gets() next if $_ =~ skip_re puts $_ end libcdio-2.2.0/misc/000077500000000000000000000000001474051130400140525ustar00rootroot00000000000000libcdio-2.2.0/misc/libcdio.ebuild000066400000000000000000000012031474051130400166410ustar00rootroot00000000000000# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /sources/libcdio/libcdio/misc/libcdio.ebuild,v 1.1 2003/04/29 08:17:59 rocky Exp $ IUSE="" DESCRIPTION="A library to encapsulate CD-ROM reading and control." HOMEPAGE="http://savannah.nongnu.org/projects/libcdio/" SRC_URI="http://savannah.nongnu.org/download/${PN}/${PN}.pkg/${PV}/${P}.tar.gz" LICENSE="GPL" SLOT="0" KEYWORDS="x86" src_compile() { econf || die emake || die } src_install() { make DESTDIR=${D} install dodoc AUTHORS COPYING Changelog INSTALL NEWS README THANKS } libcdio-2.2.0/package/000077500000000000000000000000001474051130400145125ustar00rootroot00000000000000libcdio-2.2.0/package/.gitignore000066400000000000000000000000161474051130400164770ustar00rootroot00000000000000/libcdio.spec libcdio-2.2.0/package/libcdio.spec.in000066400000000000000000000073771474051130400174160ustar00rootroot00000000000000### $Id: libcdio.spec.in,v 1.2 2006/03/28 14:11:56 rocky Exp $ ### autogenerated---edit *.spec.in %define name @PACKAGE@ %define ver @VERSION@ %define rel 0 Name: %{name} Summary: CD-ROM access library Summary(de): CD-ROM Zugriffsbibliothek Version: %{ver} Release: %{rel} Copyright: GPL Group: Development/Libraries URL: http://www.gnu.org/software/libcdio/ Source0: %{name}-%{version}.tar.gz Packager: Manfred Tremmel Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root %description The libcdio package contains a library for CD-ROM and CD image access. Applications wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM or of the specific details of various CD-image formats may benefit from using this library. A library for working with ISO-9660 filesystems libiso9660 is included. A generic interface for issuing MMC (multimedia commands) is also part of the libcdio library. %description -l de Diese Bibliothek dient zur Kapselung von CD-ROM Zugriffen und dessen Kontrolle. Anwendungen brauchen sich nicht um die Betriebssystemspezifischen oder Device-Abh¤ngigen Eigenschaften des CD-ROM zu k¼mmern, dies erledigt die Bibliothek. %package devel Summary: libcdio development package Summary(de): libcdio Entwicklerpaket Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel libcdio development package %description devel -l de libcdio Entwicklerpaket %package -n cdinfo Summary: cd-info Summary(de): cd-info Group: Applications/Multimedia Requires: %{name} = %{version}-%{release} #Requires: libvcd >= 0.7.20 Requires: libcddb BuildRequires: libcddb-devel #BuildRequires: libvcd-devel >= 0.7.20 %description -n cdinfo cd-info prints various information about a CD or CD image, analyzes and gives information about each of the tracks, and tries to detect the type of CD (e.g. VCD, Audio CD, PhotoCD, a bootable CD, etc.). For audio CD's more information is given if libcddb is installed. For Video CD's more information is given if the libvcdinfo library is installed. %description -n cdinfo -l de cd-info gibt verschiedene informationen ber eine CD oder ein CD-Image aus, analysiert und informiert ber jeden der Tracks und versucht, den Typ der CD zu ermitteln (z.B. VCD, Audio-CD, PhotoCD, eine bootbare CD usw.). Zu Audio-CDs werden weitere Informationen ausgegeben, wenn die libcddb installiert ist. Zu Video-CDs werden mehr Informationen ausgegeben, wenn die libvcdinfo installiert ist. %prep %setup %build %configure %__make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %makeinstall rm -rf ${RPM_BUILD_ROOT}/%{_mandir} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %post /sbin/ldconfig %postun /sbin/ldconfig %files %defattr(-,root,root) %doc AUTHORS INSTALL NEWS THANKS TODO %{_libdir}/lib*.so.* %files devel %defattr(-, root, root) %doc ChangeLog COPYING README %{_libdir}/lib*.so %{_libdir}/*.*a %{_includedir}/cdio/* %{_infodir}/* %{_libdir}/pkgconfig/*.pc %files -n cdinfo %defattr(-,root,root) %{_bindir}/* %changelog * Sun Feb 15 2004 Manfred Tremmel - some little changes * Sat Feb 14 2004 Rocky Bernstein - require vcdimager 0.7.20, small rpm fixes * Tue Sep 9 2003 Rocky Bernstein - small fixes really from Frantisek Dvorak * Sun Aug 30 2003 Frantisek Dvorak - two files added * Wed Aug 06 2003 Rocky Bernstein - fixes really Manfred Tremmel at http://www.iiv.de/schwinde/buerger/tremmel/ * Fri Apr 25 2003 Manfred Tremmel - first spec file libcdio-2.2.0/parse/000077500000000000000000000000001474051130400142315ustar00rootroot00000000000000libcdio-2.2.0/parse/.gitignore000066400000000000000000000001451474051130400162210ustar00rootroot00000000000000/cue.tab.c /cue.tab.h /cuelexer /cueparser /toc.tab.c /toc.tab.h /tocparser /lex.cuelex.c /lex.cue.c libcdio-2.2.0/parse/Makefile000066400000000000000000000033271474051130400156760ustar00rootroot00000000000000# $Id: Makefile,v 1.5 2008/03/23 17:21:34 karl Exp $ # # Copyright (C) 2008 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . INCLUDES = -I . all: cueparser cuelexer tocparser lex.cue.c: cue.L cue.tab.h flex -Pcue cue.L lex.cuelex.c: cue.L cue.tab.h flex -Pcuelex cue.L lex.cue.o: lex.cue.c gcc -g -Wall -c lex.cue.c $(INCLUDES) lex.cuelex.o: lex.cuelex.c gcc -g -DSTANDALONE -Wall -c lex.cuelex.c cue.tab.c, cue.tab.h: cue.y bison -p cue -d cue.y cue.tab.o: cue.tab.c cue.tab.h gcc -g -Wall -DSTANDALONE -c cue.tab.c $(INCLUDES) cueparser: lex.cue.o cue.tab.o gcc -g lex.cue.o cue.tab.o -lfl -o cueparser cuelexer: lex.cuelex.o gcc -g lex.cuelex.o -lfl -o cuelexer toc.tab.h: toc.tab.c toc.tab.c: toc.y bison -p toc -d toc.y toclexer.o: toclexer.c gcc -g -Wall -c toclexer.c $(INCLUDES) toc.tab.o: toc.tab.c toc.tab.h gcc -g -Wall -DSTANDALONE -c toc.tab.c $(INCLUDES) tocparser: toc.tab.o toclexer.o gcc -g toclexer.o toc.tab.o -o tocparser clean: rm -f lex.cue.c lex.cuelex.c lex.cue.o lex.cuelex.o cue.tab.c \ cue.tab.o cueparser cuelexer check: (cd test && ./runall) libcdio-2.2.0/parse/cue.L000066400000000000000000000103601474051130400151220ustar00rootroot00000000000000/* $Id: cue.L,v 1.2 2008/03/23 17:21:34 karl Exp $ -*- C -*- */ /* CUE-sheet scanner Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ %{ #undef yywrap #ifdef STANDALONE #include #endif #include "cue.tab.h" static int debug_lex=0; %} %x filename TrackDef "TRACK" Audio "AUDIO" Mode1_2048 "MODE1/2048" Mode1_2352 "MODE1/2352" Mode2_2336 "MODE2/2336" Mode2_2352 "MODE2/2352" Index "INDEX" File "FILE" Pregap "PREGAP" Postgap "POSTGAP" Binary "BINARY" Motorola "MOTOROLA" Flags "FLAGS" Catalog "CATALOG" Isrc "ISRC" Four_Channel "4CH" Dont_Copy "DCP" Pre_Emphasis "PRE" Colon ":" Integer [[:digit:]]+ Spaces [[:blank:]\n\r]+ String \".+\" Filename [^[:blank:]\n\r]+ %% {TrackDef} { /*"*/ return TRACK_TOKEN; } {Audio} { return AUDIO_TOKEN; } {Mode1_2048} { return MODE1_2048_TOKEN; } {Mode1_2352} { return MODE1_2352_TOKEN; } {Mode2_2336} { return MODE2_2336_TOKEN; } {Mode2_2352} { return MODE2_2352_TOKEN; } {Index} { return INDEX_TOKEN; } {File} { BEGIN(filename); return FILE_TOKEN; } {Pregap} { return PREGAP_TOKEN; } {Postgap} { return POSTGAP_TOKEN; } {Binary} { return BINARY_TOKEN; } {Motorola} { return MOTOROLA_TOKEN; } {Flags} { return FLAGS_TOKEN; } {Catalog} { return CATALOG_TOKEN; } {Isrc} { if (debug_lex) printf("Isrc token\n"); } {Four_Channel} { return FOURCH_TOKEN; } {Dont_Copy} { return DCP_TOKEN; } {Pre_Emphasis} { if (debug_lex) printf("Pre_Emphasis token\n"); } {Colon} { return COLON_TOKEN; } {Integer} { return INTEGER_TOKEN; } {Filename} { BEGIN(INITIAL); return FILENAME_TOKEN; } {String} { return STRING_TOKEN; } {Spaces} { return SPACES_TOKEN; } <> { return EOF; } %% #if STANDALONE int main( int argc, const char **argv ) { int token; ++argv, --argc; /* skip over program name */ debug_lex = 1; if ( argc > 0 ) yyin = fopen( argv[0], "r" ); else yyin = stdin; while ((token=yylex()) != EOF) { switch (token) { case TRACK_TOKEN: printf("TRACK\n"); break; case AUDIO_TOKEN: printf("AUDIO token\n"); break; case MODE1_2048_TOKEN: printf("MODE1/2048\n"); break; case MODE1_2352_TOKEN: printf("MODE1/2352\n"); break; case MODE2_2336_TOKEN: printf("MODE1/2336\n"); break; case MODE2_2352_TOKEN: printf("MODE2/2352\n"); break; case INDEX_TOKEN: printf("INDEX\n"); break; case FILE_TOKEN: printf("FILE\n"); break; case PREGAP_TOKEN: printf("PREGAP\n"); break; case POSTGAP_TOKEN: printf("POSTGAP\n"); break; case BINARY_TOKEN: printf("BINARY\n"); break; case SPACES_TOKEN: printf("spaces\n"); break; case STRING_TOKEN: printf("string: %s\n", yytext); break; case INTEGER_TOKEN: printf("integer: %d (%s)\n", atoi(yytext), yytext); break; case COLON_TOKEN: printf(":\n"); break; case FLAGS_TOKEN: printf("FLAGS\n"); break; case CATALOG_TOKEN: printf("CATALOG\n"); break; case DCP_TOKEN: printf("DCP\n"); break; case MOTOROLA_TOKEN: printf("MOTOROLA\n"); break; case FOURCH_TOKEN: printf("4CH\n"); break; case FILENAME_TOKEN: printf("filename %s\n", yytext); break; default: ; } } return 0; } #endif libcdio-2.2.0/parse/cue.y000066400000000000000000000074561474051130400152130ustar00rootroot00000000000000%{ /* $Id: cue.y,v 1.2 2008/03/23 17:21:34 karl Exp $ Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include extern FILE *cuein; int cuelex(void); int cueerror(char *s); #ifdef STANDALONE #include #define YYDEBUG 1 #endif %} /* BISON Declarations */ %token TRACK_TOKEN %token AUDIO_TOKEN %token MODE1_2048_TOKEN %token MODE1_2352_TOKEN %token MODE2_2336_TOKEN %token MODE2_2352_TOKEN %token INDEX_TOKEN %token FILE_TOKEN %token PREGAP_TOKEN %token POSTGAP_TOKEN %token BINARY_TOKEN %token MOTOROLA_TOKEN %token FLAGS_TOKEN %token CATALOG_TOKEN %token ISRC_TOKEN %token FOURCH_TOKEN %token DCP_TOKEN %token PRE_TOKEN %token COLON_TOKEN %token INTEGER_TOKEN %token SPACES_TOKEN %token STRING_TOKEN %token FILENAME_TOKEN /* Grammar follows */ %% /* We optionally allow spaces at the end of the file. */ cue: cue_stmts opt_spaces ; /* one or more cuesheet statements. We allow spaces before the beginning of the cuesheet statement */ cue_stmts: cue_stmts SPACES_TOKEN cue_stmt | opt_spaces cue_stmt ; cue_stmt: catalog_stmt | file_stmt | track_stmt | flags_stmt | pregap_stmt | postgap_stmt | index_stmt ; /* FILE *filename* {BINARY|MOTOROLA|AUDIO} */ file_stmt: FILE_TOKEN SPACES_TOKEN file_id SPACES_TOKEN file_flags ; file_id: FILENAME_TOKEN | STRING_TOKEN ; file_flags: BINARY_TOKEN | MOTOROLA_TOKEN | AUDIO_TOKEN ; /* CATALOG *n* */ catalog_stmt: CATALOG_TOKEN INTEGER_TOKEN ; /* TRACK *n* {MODE1/2048 | MODE1/2352 | MODE2/2336 | MODE2/2352} */ track_stmt: TRACK_TOKEN SPACES_TOKEN INTEGER_TOKEN SPACES_TOKEN track_mode_exp ; track_mode_exp: MODE1_2048_TOKEN | MODE1_2352_TOKEN | MODE2_2336_TOKEN | MODE2_2352_TOKEN ; /* FLAGS {DCP | 4CH | PRE} */ flags_stmt: FLAGS_TOKEN SPACES_TOKEN flags_exp ; flags_exp: DCP_TOKEN | FOURCH_TOKEN | PRE_TOKEN ; /* PREGAP dd:dd:ddx */ pregap_stmt: PREGAP_TOKEN SPACES_TOKEN msf_exp ; /* PROSTGAP dd:dd:dd */ postgap_stmt: POSTGAP_TOKEN SPACES_TOKEN msf_exp ; /* INDEX *n* dd:dd:dd */ index_stmt: INDEX_TOKEN SPACES_TOKEN INTEGER_TOKEN SPACES_TOKEN msf_exp ; /* a MSF e.g. 00:00:00 or 02:00 */ msf_exp: INTEGER_TOKEN COLON_TOKEN INTEGER_TOKEN COLON_TOKEN INTEGER_TOKEN | INTEGER_TOKEN COLON_TOKEN INTEGER_TOKEN ; opt_spaces: SPACES_TOKEN | ; %% #ifdef STANDALONE /* The controlling function */ int cueerror(char *s) /* called by cueparse on error */ { printf("%s\n",s); return(0); } int main( int argc, char **argv ) { int c; cuedebug = 0; while (1) { int option_index = 0; static struct option long_options[] = { {"debug", 0, 0, 'd'}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "d", long_options, &option_index); if (c == -1) break; switch (c) { case 'd': cuedebug = 1; break; default: printf ("?? getopt returned character code 0%o ??\n", c); exit(1); } } if ( optind < argc ) cuein = fopen( argv[optind], "r" ); else cuein = stdin; if (cueparse()==0) { printf("Is a CUE file\n"); } else { printf("Isn't a CUE file\n"); } exit(0); } #endif /* STANDALONE*/ libcdio-2.2.0/parse/test/000077500000000000000000000000001474051130400152105ustar00rootroot00000000000000libcdio-2.2.0/parse/test/runall000077500000000000000000000002761474051130400164400ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; my @tests; if (@ARGV) { @tests = @ARGV; } else { @tests=qw(t1.cue t2.cue t3.cue); } foreach my $cue_file (@tests) { system("../cueparser $cue_file"); } libcdio-2.2.0/parse/test/t1.cue000066400000000000000000000002651474051130400162350ustar00rootroot00000000000000FILE "t1.bin" BINARY TRACK 01 MODE2/2352 FLAGS DCP INDEX 01 00:00:00 TRACK 02 MODE2/2352 FLAGS DCP INDEX 00 00:04:00 INDEX 01 00:06:00 INDEX 02 00:06:32 libcdio-2.2.0/parse/test/t2.cue000066400000000000000000000002561474051130400162360ustar00rootroot00000000000000 FILE t2.bin AUDIO TRACK 01 MODE1/2352 FLAGS DCP INDEX 01 00:00:00 TRACK 02 MODE1/2048 FLAGS DCP INDEX 00 00:04:00 INDEX 01 00:06:00 INDEX 02 00:06:32 libcdio-2.2.0/parse/test/t3.cue000066400000000000000000000002471474051130400162370ustar00rootroot00000000000000FILE BINARY BINARY TRACK 01 MODE2/2352 FLAGS DCP INDEX 01 00:00:00 TRACK 02 MODE2/2352 FLAGS DCP INDEX 00 00:04:00 INDEX 01 00:06:93 INDEX 02 00:61:32 libcdio-2.2.0/parse/toc.L000066400000000000000000000036611474051130400151410ustar00rootroot00000000000000/* $Id: toc.L,v 1.2 2008/03/23 17:21:34 karl Exp $ -*- C -*- */ /* cdrdao TOC scanner Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ %{ #undef yywrap #ifdef STANDALONE #include #endif #include "toc.tab.h" static int debug_lex=0; %} %union { unsigned long int val; /* For returning numbers. */ char const * str; /* For returning stringss. */ } integer [[:digit:]]+ /* The below isn't octal. I'm just going by the name and pattern in the cdrdao pacct grammar. */ stringoctal [[:digit:]]{3} spaces [[:blank:]\n\r]+ # Need to expand this to include "octal" \000 and embedded quotes. string \".+\" %% {integer} { /*"*/ return Integer; } {stringoctal} { /*"*/ return StringOctal; } {spaces} { return Spaces; } %% #if STANDALONE int main( int argc, const char **argv ) { int token; ++argv, --argc; /* skip over program name */ debug_lex = 1; if ( argc > 0 ) yyin = fopen( argv[0], "r" ); else yyin = stdin; while ((token=yylex()) != EOF) { switch (token) { case StringOctal: printf("StringOctal\n"); break; case Spaces: printf("Spaces\n"); break; case Integer: printf("Integer\n"); break; default: ; } } return 0; } #endif libcdio-2.2.0/parse/toc.y000066400000000000000000000142141474051130400152120ustar00rootroot00000000000000/* Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Yacc grammer for cdrdao TOC file */ %{ #include "toclexer.h" #include "errno.h" FILE *toc_in; int tocerror (char const *s); #ifdef STANDALONE #include #define YYDEBUG 1 #endif %} /* BISON Declarations */ %token ARRANGER %token AUDIO %token AUDIOFILE %token CATALOG %token CD_DA %token CD_I %token CD_ROM %token CD_ROM_XA %token CD_TEXT %token COMPOSER %token COPY %token DATAFILE %token DISC_ID %token EN %token END %token FIFO %token FILE_TOKEN %token FOUR_CHANNEL_AUDIO %token GENRE %token INDEX %token ISRC %token LANGUAGE %token LANGUAGE_MAP %token MESSAGE %token MODE0 %token MODE1 %token MODE1_RAW %token MODE2 %token MODE2_FORM1 %token MODE2_FORM2 %token MODE2_FORM_MIX %token MODE2_RAW %token NO %token PERFORMER %token PREGAP %token PRE_EMPHASIS %token RESERVED1 %token RESERVED2 %token RESERVED3 %token RESERVED4 %token RW %token RW_RAW %token SILENCE %token SIZE_INFO %token SONGWRITER %token START %token SWAP %token TITLE %token TOC_INFO1 %token TOC_INFO2 %token TRACK %token TWO_CHANNEL_AUDIO %token UPC_EAN %token ZERO %token LeftBrace /* "{" */ %token RightBrace /* "}" */ %token Colon /* ":" */ %token Error /* Error token return */ %token Id /* Id but not one of the above keywords */ %token Integer %token String %union { long unsigned int val; /* For returning numbers. */ symrec *tptr; /* For returning symbol-table pointers. */ } /* Grammar follows */ %% /* We optionally allow spaces at the end of the TOC file. */ toc: catalog_or_tocType cdTextGlobal tracks ; catalog_or_tocType: catalog_or_tocType CATALOG String | catalog_or_tocType tocType | /* empty */ ; tracks: tracks track | track ; track: TRACK trackMode opt_subChannelMode opt_track_flags cdTextTrack opt_pregap_msf subTracks_or_starts_or_ends opt_index_msfs ; opt_track_flags: opt_track_flags track_flag | /* empty */; track_flag: ISRC String | opt_no COPY | opt_no PRE_EMPHASIS | TWO_CHANNEL_AUDIO | FOUR_CHANNEL_AUDIO ; opt_no: NO | /* empty */; opt_pregap_msf: PREGAP msf | /* empty */; opt_index_msfs: opt_index_msfs INDEX msf | /* empty */ ; subTrack_or_start_or_end: subTrack | START opt_msf | END opt_msf ; subTracks_or_starts_or_ends: subTracks_or_starts_or_ends subTrack_or_start_or_end | subTrack_or_start_or_end ; subTrack: AudioFile String opt_swap opt_start_offset samples | DATAFILE String opt_start_length | FIFO String dataLength | SILENCE samples | ZERO opt_dataMode opt_subChannelMode dataLength ; AudioFile: AUDIOFILE | FILE_TOKEN ; opt_swap: SWAP | /* empty */; opt_start_offset: "#" sLong | /* empty */; opt_start_length: "#" sLong | '#' sLong dataLength | /* empty */; opt_dataMode: dataMode | /* empty */ ; opt_string: String | /* empty */ ; uLong: Integer ; sLong: Integer ; msf: Integer Colon Integer Colon Integer ; opt_msf: msf | /* empty */ ; samples: msf | uLong ; dataLength: msf | uLong ; dataMode: AUDIO | MODE0 | MODE1 | MODE1_RAW | MODE2 | MODE2_RAW | MODE2_FORM1 | MODE2_FORM2 | MODE2_FORM_MIX ; trackMode: AUDIO | MODE1 | MODE1_RAW | MODE2 | MODE2_RAW | MODE2_FORM1 | MODE2_FORM2 | MODE2_FORM_MIX ; opt_subChannelMode: RW | RW_RAW | /* empty */; tocType: CD_DA | CD_ROM | CD_ROM_XA | CD_I ; packType: TITLE | PERFORMER | SONGWRITER | COMPOSER | ARRANGER | MESSAGE | DISC_ID | GENRE | TOC_INFO1 | TOC_INFO2 | RESERVED1 | RESERVED2 | RESERVED3 | RESERVED4 | UPC_EAN | ISRC | SIZE_INFO ; binaryData: LeftBrace Integers RightBrace ; Integers: Integers "," Integer | Integer ; cdTextItem: packType opt_string_or_binaryData | ; opt_string_or_binaryData: opt_string | binaryData ; cdTextBlock: LANGUAGE Integer LeftBrace cdTextItem RightBrace ; opt_cdTextBlock: cdTextBlock | /* empty */; opt_cdTextBlocks: opt_cdTextBlocks cdTextBlock | /* empty */ ; opt_cdTextLanguageMap : LANGUAGE_MAP LeftBrace Language_mappings RightBrace | /* empty */; Language_mappings: Language_mappings Language_mapping | Language_mapping ; Language_mapping: Integer ":" Language_id ; Language_id: Integer | EN; cdTextTrack: CD_TEXT LeftBrace opt_cdTextBlocks RightBrace | ; cdTextGlobal: CD_TEXT LeftBrace opt_cdTextLanguageMap opt_cdTextBlock RightBrace | /* empty */; %% #ifdef STANDALONE /* The controlling function */ int tocerror(char const *s) /* called by tocparse on error */ { printf("%s\n",s); return(0); } int main( int argc, char **argv ) { int c; tocdebug = 0; while (1) { int option_index = 0; static struct option long_options[] = { {"debug", 0, 0, 'd'}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "d", long_options, &option_index); if (c == -1) break; switch (c) { case 'd': tocdebug = 1; break; default: printf ("?? getopt returned character code 0%o ??\n", c); exit(1); } } if ( optind < argc ) { toc_in = fopen( argv[optind], "r" ); if (!toc_in) { printf("unable to open %s for reading: %s\n", argv[optind], strerror(errno)); exit(1); } } else toc_in = stdin; if (tocparse()==0) { printf("Is a TOC file\n"); } else { printf("Isn't a TOC file\n"); } exit(0); } #endif /* STANDALONE*/ libcdio-2.2.0/parse/toclexer.c000066400000000000000000000123611474051130400162250ustar00rootroot00000000000000/* $Id: toclexer.c,v 1.2 2008/03/23 17:21:34 karl Exp $ Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Lexical scanner for cdrdao's TOC. */ #include "toclexer.h" #include "toc.tab.h" #include #define YYEOF 0 /* A structure for associating a word with a token. */ typedef struct keyword_s { char const *psz_keyword; token_t i_token; } keyword_t; /* These are all of the words that might appear in a TOC file and the token association that the parser will use. */ const keyword_t keywords[] = { {"ARRANGER", ARRANGER}, {"AUDIO", AUDIO}, {"AUDIOFILE", AUDIOFILE}, {"CATALOG", CATALOG}, {"CD_DA", CD_DA}, {"CD_I", CD_I}, {"CD_ROM", CD_ROM}, {"CD_ROM_XA", CD_ROM_XA}, {"CD_TEXT", CD_TEXT}, {"COMPOSER", COMPOSER}, {"COPY", COPY}, {"DATAFILE", DATAFILE}, {"DISC_ID", DISC_ID}, {"EN", EN}, {"END", END}, {"FIFO", FIFO}, {"FILE", FILE_TOKEN}, {"FOUR_CHANNEL_AUDIO", FOUR_CHANNEL_AUDIO}, {"GENRE", GENRE}, {"INDEX", INDEX}, {"ISRC", ISRC}, {"LANGUAGE", LANGUAGE}, {"LANGUAGE_MAP", LANGUAGE_MAP}, {"MESSAGE", MESSAGE}, {"MODE0", MODE0}, {"MODE1", MODE1}, {"MODE1_RAW", MODE1_RAW}, {"MODE2", MODE2}, {"MODE2_FORM1", MODE2_FORM1}, {"MODE2_FORM2", MODE2_FORM2}, {"MODE2_FORM_MIX", MODE2_FORM_MIX}, {"MODE2_RAW", MODE2_RAW}, {"NO", NO}, {"PERFORMER", PERFORMER}, {"PREGAP", PREGAP}, {"PRE_EMPHASIS", PRE_EMPHASIS}, {"RESERVED1", RESERVED1}, {"RESERVED2", RESERVED2}, {"RESERVED3", RESERVED3}, {"RESERVED4", RESERVED4}, {"RW", RW}, {"RW_RAW", RW_RAW}, {"SILENCE", SILENCE}, {"SIZE_INFO", SIZE_INFO}, {"SONGWRITER", SONGWRITER}, {"START", START}, {"SWAP", SWAP}, {"TITLE", TITLE}, {"TOC_INFO1", TOC_INFO1}, {"TOC_INFO2", TOC_INFO2}, {"TRACK", TRACK}, {"TWO_CHANNEL_AUDIO", TWO_CHANNEL_AUDIO}, {"UPC_EAN", UPC_EAN}, {"ZERO", ZERO}, {0, 0} }; static int compare_keyword(const void *p_id, const void *p_keyword) { char *psz_id = (char *) p_id; char const *psz_keyword = ((keyword_t *) p_keyword)->psz_keyword; return strcmp(psz_id, psz_keyword); } token_t toclex (void) { int c; start: /* Skip white space. */ while ( isspace(c = fgetc (toc_in)) ) ; /* Process a number. */ if (isdigit (c)) { ungetc (c, toc_in); fscanf (toc_in, "%lu", &(toclval.val)); return Integer; } /* Process a comment. */ if ( '/' == c ) { if ('/' == (c = fgetc (toc_in)) ) { while ((c = fgetc (toc_in)) != EOF && c != '\n') ; /* Return end-of-input. */ if (EOF == c) return YYEOF; goto start; } /* Not a comment. So put back the character after the '/' and return '/' */ ungetc (c, toc_in); return '/'; } /* Char starts an identifier => read the name. */ if (isalpha (c)) { static char symbol[50] = ""; unsigned int i; i = 0; do { /* Add this character to the buffer. */ symbol[i++] = c; /* Get another character. */ c = fgetc (toc_in); } while (isgraph (c)); ungetc (c, toc_in); symbol[i] = '\0'; toclval.psz_str = symbol; { keyword_t *p_keyword; p_keyword = bsearch(symbol, keywords, (sizeof(keywords) / sizeof(keyword_t)) - 1, sizeof(keyword_t), compare_keyword); if (!p_keyword) return Id; return p_keyword->i_token; } } /* Process a string. To do: save the value of the string and process octal numbers. */ if ( '"' == c ) { int b_backslash = 0; while ( EOF != (c = fgetc (toc_in)) && (b_backslash || '"' != c ) ) { b_backslash = ('\\' == c ); } /* Return end-of-input. */ if (EOF == c) return YYEOF; return String; } /* Return end-of-input. */ if (EOF == c) return YYEOF; switch (c) { case ':': return Colon; case '{': return LeftBrace; case '}': return RightBrace; default: /* Return a single char. */ return c; } } libcdio-2.2.0/parse/toclexer.h000066400000000000000000000022261474051130400162310ustar00rootroot00000000000000/* $Id: toclexer.h,v 1.2 2008/03/23 17:21:34 karl Exp $ Copyright (C) 2005, 2008 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Common header between TOC lexer and parser. */ #include #include #include "string.h" typedef int token_t; extern FILE *toc_in; typedef union { long unsigned int val; /* For returning numbers. */ char const *psz_str; /* For strings. */ } tocval_t; #define YYSTYPE tocval_t YYSTYPE toclval; /* Call to the TOC scanner */ token_t toclex (void); libcdio-2.2.0/src/000077500000000000000000000000001474051130400137065ustar00rootroot00000000000000libcdio-2.2.0/src/.gitignore000066400000000000000000000003261474051130400156770ustar00rootroot00000000000000/*.exe /*.exe.stackdump /*.o /*.orig /*.rej /*~ /.deps /.libs /Makefile /Makefile.in /cd-drive /cd-drive.1 /cd-info /cd-info.1 /cd-read /cd-read.1 /cdda-player /iso-info /iso-info.1 /iso-read /iso-read.1 /mmc-tool libcdio-2.2.0/src/Makefile.am000066400000000000000000000075761474051130400157610ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2006, 2008, 2012, 2017 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . .PHONY: check-leaks GETOPT_C = getopt.c getopt1.c check_programs = noinst_HEADERS = cddb.h getopt.h util.h #################################################### # Things to make the utility/diagnostic programs #################################################### CDDB_LIBS=@CDDB_LIBS@ CDDA_PLAYER_LIBS=@CDDA_PLAYER_LIBS@ if BUILD_CDDA_PLAYER cdda_player_SOURCES = cdda-player.c cddb.c cddb.h $(GETOPT_C) cdda_player_LDADD = $(LIBCDIO_LIBS) $(CDDB_LIBS) $(CDDA_PLAYER_LIBS) bin_cdda_player = cdda-player check_programs += cdda-player endif if BUILD_CD_DRIVE cd_drive_SOURCES = cd-drive.c util.c util.h $(GETOPT_C) cd_drive_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) bin_cd_drive = cd-drive man_cd_drive = cd-drive.1 check_programs += cd-drive endif if BUILD_CDINFO cd_info_SOURCES = cd-info.c cddb.c cddb.h util.c util.h $(GETOPT_C) cd_info_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(CDDB_LIBS) $(VCDINFO_LIBS) $(LTLIBICONV) bin_cd_info = cd-info man_cd_info = cd-info.1 check_programs += cd-info endif if BUILD_CDINFO_LINUX cdinfo_linux_SOURCES = cdinfo-linux.c cdinfo_linux_LDADD = $(LIBCDIO_LIBS) bin_cdinfo_linux = cdinfo-linux check_programs += cdinfo-linux endif if BUILD_CD_READ cd_read_SOURCES = cd-read.c util.c util.h $(GETOPT_C) cd_read_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) bin_cd_read = cd-read man_cd_read = cd-read.1 check_programs += cd-read endif if BUILD_ISO_INFO iso_info_SOURCES = iso-info.c util.c util.h $(GETOPT_C) iso_info_LDADD = $(LIBUDF_LIBS) $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) bin_iso_info = iso-info man_iso_info = iso-info.1 check_programs += iso-info endif if BUILD_ISO_READ iso_read_SOURCES = iso-read.c util.c util.h $(GETOPT_C) iso_read_LDADD = $(LIBUDF_LIBS) $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) bin_iso_read = iso-read man_iso_read = iso-read.1 check_programs += iso-read endif mmc_tool_SOURCES = mmc-tool.c util.c util.h $(GETOPT_C) mmc_tool_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) bin_mmc_tool = mmc-tool check_programs += mmc-tool bin_PROGRAMS = $(bin_cd_drive) $(bin_cd_info) $(bin_cdinfo_linux) $(bin_cd_read) $(bin_iso_info) $(bin_iso_read) $(bin_cdda_player) $(bin_mmc_tool) AM_CPPFLAGS = -I$(top_srcdir) $(LIBCDIO_CFLAGS) $(VCDINFO_CFLAGS) $(CDDB_CFLAGS) man_MANS = $(man_cd_drive) $(man_cd_info) $(man_cd_read) $(man_iso_read) $(man_iso_info) EXTRA_DIST = cd-drive.help2man cd-info.help2man cd-read.help2man \ iso-info.help2man iso-read.help2man $(GETOPT_C) getopt_int.h \ $(man_MANS) check-leaks: $(check_programs) for p in $(check_programs); do \ valgrind ./$$p; \ done if MAINTAINER_MODE $(man_MANS): %.1: %$(EXEEXT) %.help2man -$(HELP2MAN) --opt-include=$(srcdir)/$(<:.exe=).help2man --no-info --libtool -o $@ ./$< endif MAINTAINERCLEANFILES = $(man_MANS) MOSTLYCLEANFILES = *.orig *.rej *.dSYM .libs mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -fr $(MOSTLYCLEANFILES) -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) libcdio-2.2.0/src/cd-drive.c000066400000000000000000000220051474051130400155460ustar00rootroot00000000000000/* Copyright (C) 2011, 2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Program to show drivers installed and capabilities of CD drives. */ #include "util.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include "getopt.h" #include #include /* Used by `main' to communicate with `parse_opt'. And global options */ static struct arguments { uint32_t debug_level; int version_only; int silent; source_image_t source_image; } opts; /* Configuration option codes */ enum { OP_HANDLED, OP_SOURCE_DEVICE, OP_USAGE, /* These are the remaining configuration options */ OP_VERSION, }; /* Parse all options. */ static bool parse_options (int argc, char *argv[]) { int opt; int rc = EXIT_FAILURE; static const char helpText[] = "Usage: %s [OPTION...]\n" " -d, --debug=INT Set debugging to LEVEL\n" " -i, --cdrom-device[=DEVICE] show only info about CD-ROM device\n" " -q, --quiet Don't produce warning output\n" " -V, --version display version and copyright information\n" " and exit\n" "\n" "Help options:\n" " -?, --help Show this help message\n" " --usage Display brief usage message\n"; static const char usageText[] = "Usage: %s [-d|--debug INT] [-i|--cdrom-device DEVICE] [-q|--quiet]\n" " [-V|--version] [-?|--help] [--usage]\n"; static const char optionsString[] = "d:i::qV?"; static const struct option optionsTable[] = { {"debug", required_argument, NULL, 'd' }, {"cdrom-device", optional_argument, NULL, 'i' }, {"quiet", no_argument, NULL, 'q' }, {"version", no_argument, NULL, 'V' }, {"help", no_argument, NULL, '?' }, {"usage", no_argument, NULL, OP_USAGE }, {NULL, 0, NULL, 0 } }; program_name = strrchr(argv[0],'/'); program_name = program_name ? strdup(program_name+1) : strdup(argv[0]); while ((opt = getopt_long(argc, argv, optionsString, optionsTable, NULL)) != -1) { switch (opt) { case 'd': opts.debug_level = atoi(optarg); break; case 'i': if (opts.source_image != (source_image_t) DRIVER_UNKNOWN) { /* NOTE: The libpopt version already set source_name by this time. To restore this behavior, fall through to the else{} block. */ report( stderr, "%s: another source type option given before.\n", program_name ); report( stderr, "%s: give only one source type option.\n", program_name ); break; } else { opts.source_image = (source_image_t) DRIVER_DEVICE; if (optarg != NULL) { source_name = fillout_device_name(optarg); } break; } break; case 'q': opts.silent = 1; break; case 'V': opts.version_only = 1; break; case '?': fprintf(stdout, helpText, program_name); rc = EXIT_INFO; goto error_exit; case OP_USAGE: fprintf(stderr, usageText, program_name); rc = EXIT_INFO; goto error_exit; case OP_HANDLED: break; default: return false; } } if (optind < argc) { const char *remaining_arg = argv[optind++]; /* NOTE: A bug in the libpopt version checked source_image, which rendered the subsequent source_image test useless. */ if (source_name != NULL) { report( stderr, "%s: Source specified in option %s and as %s\n", program_name, source_name, remaining_arg); goto error_exit; } if (opts.source_image == (source_image_t) DRIVER_DEVICE) source_name = fillout_device_name(remaining_arg); else source_name = strdup(remaining_arg); if (optind < argc) { report( stderr, "%s: Source specified in previously %s and %s\n", program_name, source_name, remaining_arg); goto error_exit; } } return true; error_exit: if (source_name != NULL) { free(source_name); } free(program_name); exit(rc); } /* CDIO logging routines */ static void _log_handler (cdio_log_level_t level, const char message[]) { if (level == CDIO_LOG_DEBUG && opts.debug_level < 2) return; if (level == CDIO_LOG_INFO && opts.debug_level < 1) return; if (level == CDIO_LOG_WARN && opts.silent) return; gl_default_cdio_log_handler (level, message); } /*! Prints out SCSI-MMC drive features */ static void print_mmc_drive_level(CdIo_t *p_cdio) { cdio_mmc_level_t mmc_level = mmc_get_drive_mmc_cap(p_cdio); printf( "CD-ROM drive supports " ); switch(mmc_level) { case CDIO_MMC_LEVEL_WEIRD: printf("some nonstandard or degenerate set of MMC\n"); break; case CDIO_MMC_LEVEL_1: printf("MMC 1\n"); break; case CDIO_MMC_LEVEL_2: printf("MMC 2\n"); break; case CDIO_MMC_LEVEL_3: printf("MMC 3\n"); break; case CDIO_MMC_LEVEL_NONE: printf("no MMC\n"); break; } printf("\n"); } /* Initialize global variables. */ static void init(void) { gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler); /* Default option values. */ opts.silent = false; opts.debug_level = 0; opts.source_image = (source_image_t) DRIVER_UNKNOWN; } int main(int argc, char *argv[]) { CdIo_t *p_cdio=NULL; init(); /* Parse our arguments; every option seen by `parse_opt' will be reflected in `arguments'. */ parse_options(argc, argv); print_version(program_name, CDIO_VERSION, false, opts.version_only); if (opts.debug_level == 3) { cdio_loglevel_default = CDIO_LOG_INFO; } else if (opts.debug_level >= 4) { cdio_loglevel_default = CDIO_LOG_DEBUG; } if (NULL == source_name) { char *default_device; p_cdio = cdio_open (NULL, DRIVER_DEVICE); if (NULL == p_cdio) { printf("No loaded CD-ROM device accessible.\n"); } else { default_device = cdio_get_default_device(p_cdio); printf("The driver selected is %s\n", cdio_get_driver_name(p_cdio)); if (default_device) { printf("The default device for this driver is %s\n", default_device); } free(default_device); cdio_destroy(p_cdio); p_cdio=NULL; printf("\n"); } } /* Print out a drivers available */ { const driver_id_t *driver_id_p; printf("Drivers available...\n"); for (driver_id_p=cdio_drivers; *driver_id_p!=DRIVER_UNKNOWN; driver_id_p++) if (cdio_have_driver(*driver_id_p)) { printf(" %-35s\n", cdio_driver_describe(*driver_id_p)); } printf("\n"); } if (NULL == source_name) { /* Print out a list of CD-drives */ char **ppsz_cdrives=NULL, **ppsz_cd; driver_id_t driver_id = DRIVER_DEVICE; ppsz_cdrives = cdio_get_devices_ret(&driver_id); if (NULL != ppsz_cdrives) for( ppsz_cd = ppsz_cdrives; *ppsz_cd != NULL; ppsz_cd++ ) { cdio_drive_read_cap_t i_read_cap; cdio_drive_write_cap_t i_write_cap; cdio_drive_misc_cap_t i_misc_cap; cdio_hwinfo_t hwinfo; p_cdio = cdio_open(*ppsz_cd, driver_id); print_mmc_drive_level(p_cdio); printf("%28s: %s\n", "Drive", *ppsz_cd); if (p_cdio) { if (cdio_get_hwinfo(p_cdio, &hwinfo)) { printf("%-28s: %s\n%-28s: %s\n%-28s: %s\n", "Vendor" , hwinfo.psz_vendor, "Model" , hwinfo.psz_model, "Revision", hwinfo.psz_revision); } print_mmc_drive_features(p_cdio); cdio_get_drive_cap(p_cdio, &i_read_cap, &i_write_cap, &i_misc_cap); print_drive_capabilities(i_read_cap, i_write_cap, i_misc_cap); } printf("\n"); if (p_cdio) cdio_destroy(p_cdio); p_cdio = NULL; } cdio_free_device_list(ppsz_cdrives); ppsz_cdrives = NULL; } else { /* Print CD-drive info for given source */ cdio_drive_read_cap_t i_read_cap; cdio_drive_write_cap_t i_write_cap; cdio_drive_misc_cap_t i_misc_cap; cdio_hwinfo_t hwinfo; printf("Drive %s\n", source_name); p_cdio = cdio_open (source_name, DRIVER_UNKNOWN); if (p_cdio) { print_mmc_drive_level(p_cdio); if (cdio_get_hwinfo(p_cdio, &hwinfo)) { printf("%-28s: %s\n%-28s: %s\n%-28s: %s\n", "Vendor" , hwinfo.psz_vendor, "Model" , hwinfo.psz_model, "Revision", hwinfo.psz_revision); } print_mmc_drive_features(p_cdio); } cdio_get_drive_cap_dev(source_name, &i_read_cap, &i_write_cap, &i_misc_cap); print_drive_capabilities(i_read_cap, i_write_cap, i_misc_cap); printf("\n"); } myexit(p_cdio, EXIT_SUCCESS); /* Not reached:*/ return(EXIT_SUCCESS); } libcdio-2.2.0/src/cd-drive.help2man000066400000000000000000000002551474051130400170350ustar00rootroot00000000000000[NAME] cd-drive \- show CD-ROM drive characteristics [SEE ALSO] \&\f(CWcd-info(1)\fR for information about the CD inside a CD-ROM. [AUTHOR] Rocky Bernstein rocky@gnu.org libcdio-2.2.0/src/cd-info.c000066400000000000000000001213211474051130400153710ustar00rootroot00000000000000/* Copyright (C) 2003-2005, 2007-2008, 2011-2012, 2014, 2017 Rocky Bernstein Copyright (C) 1996, 1997, 1998 Gerd Knorr and Heiko Eißfeldt 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* CD Info - prints various information about a CD, and detects the type of the CD. */ #include "util.h" #include "getopt.h" #ifdef HAVE_STDARG_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_CDDB #include #include "cddb.h" #endif #ifdef HAVE_VCDINFO #include #include #include #endif #include #include #include #include #include #include #include #include #include "cdio_assert.h" #ifdef HAVE_FCNTL_H #include #endif #ifdef __linux__ # include # include # if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,50) # include # endif #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_ALLOCA_H #include #endif #define STRONG "__________________________________\n" #define NORMAL "" #define CDIO_IOCTL_FINISHED 0 #if CDIO_IOCTL_FINISHED static struct cdrom_multisession ms; static struct cdrom_subchnl sub; #endif /* Used by `main' to communicate with `parse_opt'. And global options */ static struct opts_s { int no_tracks; int no_ioctl; int no_analysis; char *access_mode; /* Access method driver should use for control */ int no_cddb; /* If set the below are meaningless. */ int no_vcd; int show_dvd; int no_device; int no_disc_mode; uint32_t debug_level; int version_only; int silent; int no_header; int no_joliet; int no_xa; int no_rock_ridge; int print_iso9660; int list_drives; source_image_t source_image; } opts; /* Configuration option codes */ enum { OP_HANDLED = 0, OP_SOURCE_UNDEF, OP_SOURCE_AUTO, OP_SOURCE_BIN, OP_SOURCE_CUE, OP_SOURCE_CDRDAO, OP_SOURCE_NRG , OP_SOURCE_DEVICE, OP_CDDB_SERVER, OP_CDDB_CACHE, OP_CDDB_EMAIL, OP_CDDB_NOCACHE, OP_CDDB_TIMEOUT, OP_USAGE, /* These are the remaining configuration options */ OP_VERSION, }; /* Parse source options. */ static void parse_source(int opt) { /* NOTE: The libpopt version made use of an extra temporary variable (psz_my_source) for all sources _except_ devices. This distinction seemed to serve no purpose. */ if (opts.source_image != INPUT_UNKNOWN) { report(stderr, "%s: another source type option given before.\n", program_name); report(stderr, "%s: give only one source type option.\n", program_name); return; } /* For all input sources which are not a DEVICE, we need to make a copy of the string; for a DEVICE the fill-out routine makes the copy. */ if (OP_SOURCE_DEVICE != opt) if (optarg != NULL) source_name = strdup(optarg); switch (opt) { case OP_SOURCE_BIN: opts.source_image = INPUT_BIN; break; case OP_SOURCE_CUE: opts.source_image = INPUT_CUE; break; case OP_SOURCE_CDRDAO: opts.source_image = INPUT_CDRDAO; break; case OP_SOURCE_NRG: opts.source_image = INPUT_NRG; break; case OP_SOURCE_AUTO: opts.source_image = INPUT_AUTO; break; case OP_SOURCE_DEVICE: opts.source_image = INPUT_DEVICE; if (optarg != NULL) source_name = fillout_device_name(optarg); break; } } /* Parse all options. */ static bool parse_options (int argc, char *argv[]) { int opt; /* used for argument parsing */ int rc = EXIT_FAILURE; static const char helpText[] = "Usage: %s [OPTION...]\n" " -a, --access-mode=STRING Set CD access method\n" " -d, --debug=INT Set debugging to LEVEL\n" " -T, --no-tracks Don't show track information\n" " -A, --no-analyze Don't show filesystem analysis\n" #ifdef HAVE_CDDB " --no-cddb Don't look up audio CDDB information\n" " or print it\n" " -P, --cddb-port=INT CDDB port number to use (default 8880)\n" " -H, --cddb-http Lookup CDDB via HTTP proxy (default no\n" " proxy)\n" " --cddb-server=STRING CDDB server to contact for information\n" " (default: gnudb.gnudb.org)\n" " --cddb-cache=STRING Location of CDDB cache directory\n" " (default ~/.cddbclient)\n" " --cddb-email=STRING Email address to give CDDB server\n" " (default me@home)\n" " --no-cddb-cache Disable caching of CDDB entries\n" " locally (default caches)\n" " --cddb-timeout=INT CDDB timeout value in seconds\n" " (default 10 seconds)\n" #else " --no-cddb Does nothing since this program is not\n" " -P, --cddb-port=INT CDDB-enabled\n" " -H, --cddb-http\n" " --cddb-server=STRING\n" " --cddb-cache=STRING\n" " --cddb-email=STRING\n" " --no-cddb-cache\n" " --cddb-timeout=INT\n" #endif " --no-device-info Don't show device info, just CD info\n" " --no-disc-mode Don't show disc-mode info\n" " --dvd Attempt to give DVD information if a DVD is\n" " found.\n" #ifdef HAVE_VCDINFO " -v, --no-vcd Don't look up Video CD information\n" #else " -v, --no-vcd Don't look up Video CD information - for\n" " this build, this is always set\n" #endif " -I, --no-ioctl Don't show ioctl() information\n" " -b, --bin-file[=FILE] set \"bin\" CD-ROM disk image file as source\n" " -c, --cue-file[=FILE] set \"cue\" CD-ROM disk image file as source\n" " -N, --nrg-file[=FILE] set Nero CD-ROM disk image file as source\n" " -t, --toc-file[=FILE] set cdrdao CD-ROM disk image file as source\n" " -i, --input[=FILE] set source and determine if \"bin\" image or\n" " device\n" " --iso9660 print directory contents of any ISO-9660\n" " filesystems\n" " -C, --cdrom-device[=DEVICE] set CD-ROM device as source\n" " -l, --list-drives Give a list of CD-drives\n" " --no-header Don't display header and copyright (for\n" " regression testing)\n" #ifdef HAVE_JOLIET " --no-joliet Don't use Joliet extensions\n" #endif " --no-rock-ridge Don't use Rock-Ridge-extension information\n" " --no-xa Don't use XA-extension information\n" " -q, --quiet Don't produce warning output\n" " -V, --version display version and copyright information\n" " and exit\n" "\n" "Help options:\n" " -?, --help Show this help message\n" " --usage Display brief usage message\n"; static const char usageText[] = "Usage: %s [-a|--access-mode STRING] [-d|--debug INT] [-T|--no-tracks]\n" " [-A|--no-analyze] [--no-cddb] [-P|--cddb-port INT] [-H|--cddb-http]\n" " [--cddb-server=STRING] [--cddb-cache=STRING] [--cddb-email=STRING]\n" " [--no-cddb-cache] [--cddb-timeout=INT] [--no-device-info]\n" " [--no-disc-mode] [--dvd] [-v|--no-vcd] [-I|--no-ioctl]\n" " [-b|--bin-file FILE] [-c|--cue-file FILE] [-N|--nrg-file FILE]\n" " [-t|--toc-file FILE] [-i|--input FILE] [--iso9660]\n" " [-C|--cdrom-device DEVICE] [-l|--list-drives] [--no-header]\n" " [--no-joliet] [--no-rock-ridge] [--no-xa] [-q|--quiet] [-V|--version]\n" " [-?|--help] [--usage]\n"; static const char optionsString[] = "a:d:TAP:HvIb::c::N::t::i::C::lqV?"; static const struct option optionsTable[] = { {"access-mode", required_argument, NULL, 'a'}, {"debug", required_argument, NULL, 'd' }, {"no-tracks", no_argument, NULL, 'T' }, {"no-analyze", no_argument, NULL, 'A' }, {"no-cddb", no_argument, &opts.no_cddb, 1 }, {"cddb-port", required_argument, NULL, 'P' }, {"cddb-http", no_argument, NULL, 'H' }, {"cddb-server", required_argument, NULL, OP_CDDB_SERVER }, {"cddb-cache", required_argument, NULL, OP_CDDB_CACHE }, {"cddb-email", required_argument, NULL, OP_CDDB_EMAIL }, {"no-cddb-cache", no_argument, NULL, OP_CDDB_NOCACHE }, {"cddb-timeout", required_argument, NULL, OP_CDDB_TIMEOUT }, {"no-device-info", no_argument, &opts.no_device, 1 }, {"no-disc-mode", no_argument, &opts.no_disc_mode, 1 }, {"dvd", no_argument, &opts.show_dvd, 1 }, {"no-vcd", no_argument, NULL, 'v' }, {"no-ioctl", no_argument, NULL, 'I' }, {"bin-file", optional_argument, NULL, 'b' }, {"cue-file", optional_argument, NULL, 'c' }, {"nrg-file", optional_argument, NULL, 'N' }, {"toc-file", optional_argument, NULL, 't' }, {"input", optional_argument, NULL, 'i' }, {"iso9660", no_argument, &opts.print_iso9660, 1 }, {"cdrom-device", optional_argument, NULL, 'C' }, {"list-drives", no_argument, NULL, 'l' }, {"no-header", no_argument, &opts.no_header, 1 }, #ifdef HAVE_JOLIET {"no-joliet", no_argument, &opts.no_joliet, 1 }, #endif /*HAVE_JOLIET*/ {"no-rock-ridge", no_argument, &opts.no_rock_ridge, 1 }, {"no-xa", no_argument, &opts.no_xa, 1 }, {"quiet", no_argument, NULL, 'q' }, {"version", no_argument, NULL, 'V' }, {"help", no_argument, NULL, '?' }, {"usage", no_argument, NULL, OP_USAGE }, { NULL, 0, NULL, 0 } }; program_name = strrchr(argv[0],'/'); program_name = program_name ? strdup(program_name+1) : strdup(argv[0]); while ((opt = getopt_long(argc, argv, optionsString, optionsTable, NULL)) >= 0) { switch (opt) { case 'a': opts.access_mode = strdup(optarg); break; case 'd': opts.debug_level = atoi(optarg); break; case 'T': opts.no_tracks = 1; break; case 'A': opts.no_analysis = 1; break; #ifdef HAVE_CDDB case 'P': cddb_opts.port = atoi(optarg); break; case 'H': cddb_opts.http = 1; break; case OP_CDDB_SERVER: cddb_opts.server = strdup(optarg); break; case OP_CDDB_CACHE: cddb_opts.cachedir = strdup(optarg); break; case OP_CDDB_EMAIL: cddb_opts.email = strdup(optarg); break; case OP_CDDB_NOCACHE: cddb_opts.disable_cache = 1; break; case OP_CDDB_TIMEOUT: cddb_opts.timeout = atoi(optarg); break; #endif case 'v': opts.no_vcd = 1; break; case 'I': opts.no_ioctl = 1; break; case 'b': parse_source(OP_SOURCE_BIN); break; case 'c': parse_source(OP_SOURCE_CUE); break; case 'N': parse_source(OP_SOURCE_NRG); break; case 't': parse_source(OP_SOURCE_CDRDAO); break; case 'i': parse_source(OP_SOURCE_AUTO); break; case 'C': parse_source(OP_SOURCE_DEVICE); break; case 'l': opts.list_drives = 1; break; case 'q': opts.silent = 1; break; case 'V': opts.version_only = 1; break; case '?': fprintf(stdout, helpText, program_name); rc = EXIT_INFO; goto error_exit; case OP_USAGE: fprintf(stderr, usageText, program_name); rc = EXIT_INFO; goto error_exit; case OP_HANDLED: break; } } if (optind < argc) { const char *remaining_arg = argv[optind++]; if (source_name != NULL) { report(stderr, "%s: Source '%s' given as an argument of an option and as " "unnamed option '%s'\n", program_name, source_name, remaining_arg); goto error_exit; } if (opts.source_image == INPUT_DEVICE) source_name = fillout_device_name(remaining_arg); else source_name = strdup(remaining_arg); if (optind < argc) { report(stderr, "%s: Source specified in previously %s and %s\n", program_name, source_name, remaining_arg); free(source_name); goto error_exit; } } return true; error_exit: free(program_name); exit(rc); } /* CDIO logging routines */ #ifdef HAVE_CDDB static cddb_log_handler_t gl_default_cddb_log_handler = NULL; #endif #ifdef HAVE_VCDINFO static vcd_log_handler_t gl_default_vcd_log_handler = NULL; #endif static void _log_handler (cdio_log_level_t level, const char message[]) { if (level == CDIO_LOG_DEBUG && opts.debug_level < 2) return; if (level == CDIO_LOG_INFO && opts.debug_level < 1) return; if (level == CDIO_LOG_WARN && opts.silent) return; gl_default_cdio_log_handler (level, message); } #ifdef HAVE_CDDB static void _cddb_log_handler (cddb_log_level_t level, const char message[]) { /* CDDB errors should not be considered fatal. */ if (level == (cddb_log_level_t) CDDB_LOG_ERROR) level = (cddb_log_level_t) CDIO_LOG_WARN; /* Might consider doing some sort of CDDB to cdio to log level conversion, but right now it's a no op. */ _log_handler((cdio_log_level_t) level, message); } #endif static void print_cdtext_track_info(cdtext_t *p_cdtext, track_t i_track, const char *psz_msg) { if (NULL != p_cdtext) { cdtext_field_t i; printf("%s\n", psz_msg); for (i=0; i < MAX_CDTEXT_FIELDS; i++) { if (cdtext_get_const(p_cdtext, i, i_track)) { printf("\t%s: %s\n", cdtext_field2str(i), cdtext_get_const(p_cdtext, i, i_track)); } } } } static void print_cdtext_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) { track_t i_last_track = i_first_track+i_tracks; cdtext_t *p_cdtext = cdio_get_cdtext(p_cdio); cdtext_lang_t *languages; cdtext_genre_t genre; int i, j; if(NULL == p_cdtext) { printf("No CD-TEXT on Disc.\n"); return; } languages = cdtext_list_languages_v2(p_cdtext); /* The API promises that non-NULL p_cdtext yields non-NULL languages */ for(i=0; i<8; i++) if ( CDTEXT_LANGUAGE_BLOCK_UNUSED != languages[i] && cdtext_set_language_index(p_cdtext, i)) { printf("\nLanguage %d '%s':\n", i, cdtext_lang2str(languages[i])); print_cdtext_track_info(p_cdtext, 0, "CD-TEXT for Disc:"); genre = cdtext_get_genre(p_cdtext); if ( CDTEXT_GENRE_UNUSED != genre) printf("\tGENRE_CODE: %d (%s)\n", genre, cdtext_genre2str(genre)); for ( j = i_first_track ; j < i_last_track; j++ ) { char msg[50]; sprintf(msg, "CD-TEXT for Track %2d:", j); print_cdtext_track_info(p_cdtext, j, msg); } } } #ifdef HAVE_CDDB static void cddb_errmsg(const char *msg) { report(stderr, "%s: %s\n", program_name, msg); } static void print_cddb_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) { int i, i_cddb_matches = 0; cddb_conn_t *p_conn = NULL; cddb_disc_t *p_cddb_disc = NULL; if ( init_cddb(p_cdio, &p_conn, &p_cddb_disc, cddb_errmsg, i_first_track, i_tracks, &i_cddb_matches) ) { if (-1 == i_cddb_matches) printf("%s: %s\n", program_name, cddb_error_str(cddb_errno(p_conn))); else { printf("%s: Found %d matches in CDDB\n", program_name, i_cddb_matches); for (i=1; i<=i_cddb_matches; i++) { cddb_disc_print(p_cddb_disc); cddb_query_next(p_conn, p_cddb_disc); if (i != i_cddb_matches) cddb_read(p_conn, p_cddb_disc); } } cddb_disc_destroy(p_cddb_disc); cddb_destroy(p_conn); libcddb_shutdown(); } } #endif #ifdef HAVE_VCDINFO static void print_vcd_info(driver_id_t driver) { vcdinfo_open_return_t open_rc; vcdinfo_obj_t *p_vcd = NULL; open_rc = vcdinfo_open(&p_vcd, &source_name, driver, NULL); switch (open_rc) { case VCDINFO_OPEN_VCD: if (vcdinfo_get_format_version (p_vcd) == VCD_TYPE_INVALID) { report(stderr, "VCD format detection failed"); vcdinfo_close(p_vcd); return; } report (stdout, "Format : %s\n", vcdinfo_get_format_version_str(p_vcd)); report (stdout, "Album : `%.16s'\n", vcdinfo_get_album_id(p_vcd)); report (stdout, "Volume count : %d\n", vcdinfo_get_volume_count(p_vcd)); report (stdout, "volume number: %d\n", vcdinfo_get_volume_num(p_vcd)); break; case VCDINFO_OPEN_ERROR: report( stderr, "Error in Video CD opening of %s\n", source_name ); break; case VCDINFO_OPEN_OTHER: report( stderr, "Even though we thought this was a Video CD, " " further inspection says it is not.\n" ); break; } if (p_vcd) vcdinfo_close(p_vcd); } #endif static void print_iso9660_recurse (CdIo_t *p_cdio, const char pathname[], cdio_fs_anal_t fs) { CdioISO9660FileList_t *p_entlist; CdioISO9660DirList_t *p_dirlist = iso9660_dirlist_new(); CdioListNode_t *entnode; uint8_t i_joliet_level; char *translated_name = (char *) alloca(4096); size_t translated_name_size = 4096; i_joliet_level = (opts.no_joliet) ? 0 : cdio_get_joliet_level(p_cdio); p_entlist = iso9660_fs_readdir(p_cdio, pathname); printf ("%s:\n", pathname); if (NULL == p_entlist) { report( stderr, "Error getting above directory information\n" ); iso9660_dirlist_free(p_dirlist); return; } /* Iterate over files in this directory */ _CDIO_LIST_FOREACH (entnode, p_entlist) { iso9660_stat_t *p_statbuf = _cdio_list_node_data (entnode); char *psz_iso_name = p_statbuf->filename; char _fullname[4096] = { 0, }; if (strlen(psz_iso_name) >= translated_name_size) { translated_name_size = strlen(psz_iso_name)+1; if (!translated_name) { report( stderr, "Error allocating memory\n" ); iso9660_dirlist_free(p_dirlist); return; } } if (yep != p_statbuf->rr.b3_rock || 1 == opts.no_rock_ridge) { iso9660_name_translate_ext(psz_iso_name, translated_name, i_joliet_level); } snprintf (_fullname, sizeof (_fullname), "%s%s", pathname, psz_iso_name); strncat (_fullname, "/", sizeof(_fullname) - strlen(_fullname) - 1); if (p_statbuf->type == _STAT_DIR && strcmp (psz_iso_name, ".") && strcmp (psz_iso_name, "..")) _cdio_list_append (p_dirlist, strdup (_fullname)); print_fs_attrs(p_statbuf, 0 == opts.no_rock_ridge, fs & CDIO_FS_ANAL_XA, psz_iso_name, translated_name); if (p_statbuf->rr.i_symlink) { free(p_statbuf->rr.psz_symlink); p_statbuf->rr.i_symlink = 0; } } iso9660_filelist_free(p_entlist); printf ("\n"); /* Now recurse over the directories. */ _CDIO_LIST_FOREACH (entnode, p_dirlist) { char *_fullname = _cdio_list_node_data (entnode); print_iso9660_recurse (p_cdio, _fullname, fs); } iso9660_dirlist_free(p_dirlist); } static void print_iso9660_fs (CdIo_t *p_cdio, cdio_fs_anal_t fs, track_format_t track_format) { iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL; if (opts.no_joliet) { iso_extension_mask &= ~ISO_EXTENSION_JOLIET; } if ( !iso9660_fs_read_superblock(p_cdio, iso_extension_mask) ) return; printf ("ISO9660 filesystem\n"); print_iso9660_recurse (p_cdio, "/", fs); } #define print_vd_info(title, fn) \ psz_str = fn(&pvd); \ if (psz_str) { \ report(stdout, title ": %s\n", psz_str); \ free(psz_str); \ psz_str = NULL; \ } static void print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis, cdio_fs_anal_t fs, int first_data, unsigned int num_audio, track_t i_tracks, track_t i_first_track, track_format_t track_format, CdIo_t *p_cdio) { int need_lf; switch(CDIO_FSTYPE(fs)) { case CDIO_FS_AUDIO: if (num_audio > 0) { #ifdef HAVE_CDDB if (!opts.no_cddb) { printf("Audio CD, CDDB disc ID is %08x\n", cddb_discid(p_cdio, i_tracks)); print_cddb_info(p_cdio, i_tracks, i_first_track); } #endif print_cdtext_info(p_cdio, i_tracks, i_first_track); } break; case CDIO_FS_ISO_9660: printf("CD-ROM with ISO 9660 filesystem"); if (fs & CDIO_FS_ANAL_JOLIET) { printf(" and joliet extension level %d", cdio_iso_analysis.joliet_level); } if (fs & CDIO_FS_ANAL_ROCKRIDGE) printf(" and rockridge extensions"); printf("\n"); break; case CDIO_FS_ISO_9660_INTERACTIVE: printf("CD-ROM with CD-RTOS and ISO 9660 filesystem\n"); break; case CDIO_FS_HIGH_SIERRA: printf("CD-ROM with High Sierra filesystem\n"); break; case CDIO_FS_INTERACTIVE: printf("CD-Interactive%s\n", num_audio > 0 ? "/Ready" : ""); break; case CDIO_FS_HFS: printf("CD-ROM with Macintosh HFS\n"); break; case CDIO_FS_ISO_HFS: printf("CD-ROM with both Macintosh HFS and ISO 9660 filesystem\n"); break; case CDIO_FS_UFS: printf("CD-ROM with Unix UFS\n"); break; case CDIO_FS_EXT2: printf("CD-ROM with GNU/Linux EXT2 (native) filesystem\n"); break; case CDIO_FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); break; case CDIO_FS_UDFX: printf("CD-ROM with UDFX filesystem\n"); break; case CDIO_FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; case CDIO_FS_XISO: printf("CD-ROM with Microsoft X-BOX XISO filesystem\n"); break; } switch(CDIO_FSTYPE(fs)) { case CDIO_FS_ISO_9660: case CDIO_FS_ISO_9660_INTERACTIVE: case CDIO_FS_ISO_HFS: case CDIO_FS_ISO_UDF: printf("ISO 9660: %i blocks, label `%.32s'\n", cdio_iso_analysis.isofs_size, cdio_iso_analysis.iso_label); { iso9660_pvd_t pvd; if ( iso9660_fs_read_pvd(p_cdio, &pvd) ) { char *psz_str; print_vd_info("Application", iso9660_get_application_id); print_vd_info("Preparer ", iso9660_get_preparer_id); print_vd_info("Publisher ", iso9660_get_publisher_id); print_vd_info("System ", iso9660_get_system_id); print_vd_info("Volume ", iso9660_get_volume_id); print_vd_info("Volume Set ", iso9660_get_volumeset_id); } } if (opts.print_iso9660) print_iso9660_fs(p_cdio, fs, track_format); break; } switch(CDIO_FSTYPE(fs)) { case CDIO_FS_UDF: case CDIO_FS_ISO_UDF: report(stdout, "UDF: version %x.%2.2x\n", cdio_iso_analysis.UDFVerMajor, cdio_iso_analysis.UDFVerMinor); break; default: ; } need_lf = 0; if (first_data == 1 && num_audio > 0) need_lf += printf("mixed mode CD "); if (fs & CDIO_FS_ANAL_XA) need_lf += printf("XA sectors "); if (fs & CDIO_FS_ANAL_MULTISESSION) need_lf += printf("Multisession, offset = %i ", ms_offset); if (fs & CDIO_FS_ANAL_HIDDEN_TRACK) need_lf += printf("Hidden Track "); if (fs & CDIO_FS_ANAL_PHOTO_CD) need_lf += printf("%sPhoto CD ", num_audio > 0 ? " Portfolio " : ""); if (fs & CDIO_FS_ANAL_CDTV) need_lf += printf("Commodore CDTV "); if (first_data > 1) need_lf += printf("CD-Plus/Extra "); if (fs & CDIO_FS_ANAL_BOOTABLE) need_lf += printf("bootable CD "); if (fs & CDIO_FS_ANAL_VIDEOCD && num_audio == 0) { need_lf += printf("Video CD "); } if (fs & CDIO_FS_ANAL_SVCD) need_lf += printf("Super Video CD (SVCD) or Chaoji Video CD (CVD)"); if (fs & CDIO_FS_ANAL_CVD) need_lf += printf("Chaoji Video CD (CVD)"); if (need_lf) printf("\n"); #ifdef HAVE_VCDINFO if (fs & (CDIO_FS_ANAL_VIDEOCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_SVCD)) if (!opts.no_vcd) { printf("\n"); print_vcd_info(cdio_get_driver_id(p_cdio)); } #endif } /* Initialize global variables. */ static void init(void) { gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler); #ifdef HAVE_CDDB gl_default_cddb_log_handler = cddb_log_set_handler ((cddb_log_handler_t) _cddb_log_handler); #endif #ifdef HAVE_VCDINFO gl_default_vcd_log_handler = vcd_log_set_handler ((vcd_log_handler_t) _log_handler); #endif /* Default option values. */ opts.silent = false; opts.list_drives = false; opts.no_header = false; opts.no_joliet = 0; opts.no_rock_ridge = 0; opts.no_xa = 0; opts.no_device = 0; opts.no_disc_mode = 0; opts.debug_level = 0; opts.no_tracks = 0; opts.print_iso9660 = 0; #ifdef HAVE_CDDB opts.no_cddb = 0; cddb_opts.port = 8880; cddb_opts.http = 0; cddb_opts.cachedir = NULL; cddb_opts.server = NULL; cddb_opts.timeout = -1; cddb_opts.disable_cache = false; #endif #ifdef HAVE_VCDINFO opts.no_vcd = 0; #else opts.no_vcd = 1; #endif opts.no_ioctl = 0; opts.no_analysis = 0; opts.source_image = INPUT_UNKNOWN; opts.access_mode = NULL; } /* ------------------------------------------------------------------------ */ int main(int argc, char *argv[]) { CdIo_t *p_cdio=NULL; cdio_fs_anal_t fs = CDIO_FS_AUDIO; int i; lsn_t start_track_lsn; /* lsn of first track */ lsn_t data_start = 0; /* start of data area */ int ms_offset = 0; track_t i_tracks = 0; track_t i_first_track = 0; unsigned int num_audio = 0; /* # of audio tracks */ unsigned int num_data = 0; /* # of data tracks */ int first_data = -1; /* # of first data track */ int first_audio = -1; /* # of first audio track */ bool b_playing_audio = false; /* currently playing a CD-DA */ cdio_iso_analysis_t cdio_iso_analysis; char *media_catalog_number; char *isrc; discmode_t discmode = CDIO_DISC_MODE_NO_INFO; cdio_drive_read_cap_t i_read_cap = 0; cdio_drive_write_cap_t i_write_cap; cdio_drive_misc_cap_t i_misc_cap; memset(&cdio_iso_analysis, 0, sizeof(cdio_iso_analysis)); init(); /* Parse our arguments; every option seen by `parse_opt' will be reflected in `arguments'. */ parse_options(argc, argv); print_version(program_name, CDIO_VERSION, opts.no_header, opts.version_only); if (opts.debug_level == 3) { cdio_loglevel_default = CDIO_LOG_INFO; #ifdef HAVE_VCDINFO vcd_loglevel_default = VCD_LOG_INFO; #endif } else if (opts.debug_level >= 4) { cdio_loglevel_default = CDIO_LOG_DEBUG; #ifdef HAVE_VCDINFO vcd_loglevel_default = VCD_LOG_DEBUG; #endif } p_cdio = open_input(source_name, opts.source_image, opts.access_mode); if (p_cdio==NULL) { if (source_name) { err_exit("%s: Error in opening device driver for input %s.\n", program_name, source_name); } else { err_exit("%s: Error in opening device driver for unspecified input.\n", program_name); } } if (source_name==NULL) { source_name=strdup(cdio_get_arg(p_cdio, "source")); if (NULL == source_name) { err_exit("%s: No input device given/found\n", program_name); } } if (0 == opts.silent) { printf("CD location : %s\n", source_name); printf("CD driver name: %s\n", cdio_get_driver_name(p_cdio)); printf(" access mode: %s\n\n", cdio_get_arg(p_cdio, "access-mode")); } cdio_get_drive_cap(p_cdio, &i_read_cap, &i_write_cap, &i_misc_cap); if (0 == opts.no_device) { cdio_hwinfo_t hwinfo; if (cdio_get_hwinfo(p_cdio, &hwinfo)) { printf("%-28s: %s\n%-28s: %s\n%-28s: %s\n", "Vendor" , hwinfo.psz_vendor, "Model" , hwinfo.psz_model, "Revision", hwinfo.psz_revision); } print_drive_capabilities(i_read_cap, i_write_cap, i_misc_cap); } if (opts.list_drives) { driver_id_t driver_id = DRIVER_DEVICE; char ** device_list = cdio_get_devices_ret(&driver_id); char ** d = device_list; printf("list of devices found:\n"); if (NULL != d) { for ( ; *d != NULL ; d++ ) { CdIo_t *p_cdio_d = cdio_open(*d, driver_id); cdio_hwinfo_t hwinfo; printf("Drive %s\n", *d); if (mmc_get_hwinfo(p_cdio_d, &hwinfo)) { printf("%-8s: %s\n%-8s: %s\n%-8s: %s\n", "Vendor" , hwinfo.psz_vendor, "Model" , hwinfo.psz_model, "Revision", hwinfo.psz_revision); } if (p_cdio_d) cdio_destroy(p_cdio_d); } } cdio_free_device_list(device_list); } report(stdout, STRONG "\n"); discmode = cdio_get_discmode(p_cdio); if ( 0 == opts.no_disc_mode ) { printf("Disc mode is listed as: %s\n", discmode2str[discmode]); } if (cdio_is_discmode_dvd(discmode) && !opts.show_dvd) { printf("No further information currently given for DVDs.\n"); printf("Use --dvd to override.\n"); myexit(p_cdio, EXIT_SUCCESS); } i_first_track = cdio_get_first_track_num(p_cdio); if (CDIO_INVALID_TRACK == i_first_track) { err_exit("Can't get first track number. I give up%s.\n", ""); } i_tracks = cdio_get_num_tracks(p_cdio); if (CDIO_INVALID_TRACK == i_tracks) { err_exit("Can't get number of tracks. I give up.%s\n", ""); } if (!opts.no_tracks) { printf("CD-ROM Track List (%i - %i)\n" NORMAL, i_first_track, i_first_track + i_tracks - 1); printf(" #: MSF LSN Type Green? Copy?"); if ( CDIO_DISC_MODE_CD_DA == discmode || CDIO_DISC_MODE_CD_MIXED == discmode ) printf(" Channels Premphasis?"); printf("\n"); } start_track_lsn = cdio_get_track_lsn(p_cdio, i_first_track); /* Read and possibly print track information. */ for (i = i_first_track; i <= CDIO_CDROM_LEADOUT_TRACK; i++) { msf_t msf; char *psz_msf; track_format_t track_format; if (!cdio_get_track_msf(p_cdio, i, &msf)) { err_exit("cdio_track_msf for track %i failed, I give up.\n", i); } track_format = cdio_get_track_format(p_cdio, i); psz_msf = cdio_msf_to_str(&msf); if (i == CDIO_CDROM_LEADOUT_TRACK) { if (!opts.no_tracks) { lsn_t lsn= cdio_msf_to_lsn(&msf); long unsigned int i_bytes_raw = lsn * CDIO_CD_FRAMESIZE_RAW; long unsigned int i_bytes_formatted = lsn - start_track_lsn; printf( "%3d: %8s %06lu leadout ", (int) i, psz_msf, (long unsigned int) lsn ); switch (discmode) { case CDIO_DISC_MODE_DVD_ROM: case CDIO_DISC_MODE_DVD_RAM: case CDIO_DISC_MODE_DVD_R: case CDIO_DISC_MODE_DVD_RW: case CDIO_DISC_MODE_DVD_PR: case CDIO_DISC_MODE_DVD_PRW: case CDIO_DISC_MODE_DVD_OTHER: case CDIO_DISC_MODE_CD_DATA: i_bytes_formatted *= CDIO_CD_FRAMESIZE; break; case CDIO_DISC_MODE_CD_DA: i_bytes_formatted *= CDIO_CD_FRAMESIZE_RAW; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: i_bytes_formatted *= CDIO_CD_FRAMESIZE_RAW0; break; default: i_bytes_formatted *= CDIO_CD_FRAMESIZE_RAW; } if (i_bytes_raw < 1024) printf( "(%lu bytes", i_bytes_raw ); else if (i_bytes_raw < 1024 * 1024) printf( "(%lu KB", i_bytes_raw / 1024 ); else printf( "(%lu MB", i_bytes_raw / (1024 * 1024) ); printf(" raw, "); if (i_bytes_formatted < 1024) printf( "%lu bytes", i_bytes_formatted ); else if (i_bytes_formatted < 1024 * 1024) printf( "%lu KB", i_bytes_formatted / 1024 ); else printf( "%lu MB", i_bytes_formatted / (1024 * 1024) ); printf(" formatted)\n"); } free(psz_msf); break; } else if (!opts.no_tracks) { const char *psz; printf( "%3d: %8s %06lu %-6s %-5s ", (int) i, psz_msf, (long unsigned int) cdio_msf_to_lsn(&msf), track_format2str[track_format], cdio_get_track_green(p_cdio, i)? "true " : "false"); switch (cdio_get_track_copy_permit(p_cdio, i)) { case CDIO_TRACK_FLAG_FALSE: psz="no"; break; case CDIO_TRACK_FLAG_TRUE: psz="yes"; break; case CDIO_TRACK_FLAG_UNKNOWN: psz="?"; break; case CDIO_TRACK_FLAG_ERROR: default: psz="error"; break; } printf("%-5s", psz); if (TRACK_FORMAT_AUDIO == track_format) { const int i_channels = cdio_get_track_channels(p_cdio, i); switch (cdio_get_track_preemphasis(p_cdio, i)) { case CDIO_TRACK_FLAG_FALSE: psz="no"; break; case CDIO_TRACK_FLAG_TRUE: psz="yes"; break; case CDIO_TRACK_FLAG_UNKNOWN: psz="?"; break; case CDIO_TRACK_FLAG_ERROR: default: psz="error"; break; } if (i_channels == -2) printf(" %-8s", "unknown"); else if (i_channels == -1) printf(" %-8s", "error"); else printf(" %-8d", i_channels); printf( " %s", psz); } printf( "\n" ); } free(psz_msf); if (TRACK_FORMAT_AUDIO == track_format) { num_audio++; if (-1 == first_audio) first_audio = i; } else { num_data++; if (-1 == first_data) first_data = i; } /* skip to leadout */ if (i == i_first_track + i_tracks - 1) { i = CDIO_CDROM_LEADOUT_TRACK-1; } } if (cdio_is_discmode_cdrom(discmode)) { /* get and print MCN */ report(stdout, "Media Catalog Number (MCN): "); fflush(stdout); media_catalog_number = cdio_get_mcn(p_cdio); if (NULL == media_catalog_number) { if (i_read_cap & CDIO_DRIVE_CAP_READ_MCN) report(stdout, "not available\n"); else report(stdout, "not supported by drive/driver\n"); } else { report(stdout, "%s\n", media_catalog_number); cdio_free(media_catalog_number); } /* get and print track ISRCs */ if (i_read_cap & CDIO_DRIVE_CAP_READ_ISRC) { for (i = first_audio; i < first_audio + num_audio; i++) { isrc = cdio_get_track_isrc(p_cdio, i); if (NULL != isrc) { report(stdout, "TRACK %2d ISRC: %s\n", i, isrc); fflush(stdout); cdio_free(isrc); } } } /* List number of sessions */ { lsn_t i_last_session; report(stdout, "Last CD Session LSN: "); fflush(stdout); if (DRIVER_OP_SUCCESS == cdio_get_last_session(p_cdio, &i_last_session)) { report(stdout, "%d\n", i_last_session); } else { if (i_misc_cap & CDIO_DRIVE_CAP_MISC_MULTI_SESSION) report(stdout, "failed\n"); else report(stdout, "not supported by drive/driver\n"); } } /* get audio status from subchannel */ if ( CDIO_DISC_MODE_CD_DA == discmode || CDIO_DISC_MODE_CD_MIXED == discmode ) { cdio_subchannel_t subchannel; driver_return_code_t rc; memset(&subchannel, 0, sizeof(subchannel)); report( stdout, "audio status: "); fflush(stdout); rc = cdio_audio_read_subchannel(p_cdio, &subchannel); if (DRIVER_OP_SUCCESS == rc) { bool b_volume = false; bool b_position = false; report ( stdout, "%s\n", mmc_audio_state2str(subchannel.audio_status) ); switch (subchannel.audio_status) { case CDIO_MMC_READ_SUB_ST_PLAY: b_playing_audio = true; /* Fall through to next case. */ case CDIO_MMC_READ_SUB_ST_PAUSED: b_position = true; /* Fall through to next case. */ case CDIO_MMC_READ_SUB_ST_NO_STATUS: b_volume = true; break; default: ; } if (b_position) report( stdout, " at: %02d:%02d abs / %02d:%02d track %d\n", subchannel.abs_addr.m, subchannel.abs_addr.s, subchannel.rel_addr.m, subchannel.rel_addr.s, subchannel.track ); if (b_volume) { cdio_audio_volume_t volume; if (DRIVER_OP_SUCCESS == cdio_audio_get_volume (p_cdio, &volume)) { uint8_t j=0; for (j=0; j<4; j++) { uint8_t i_level = volume.level[j]; report( stdout, "volume level port %d: %3d (0..255) %3d (0..100)\n", j, i_level, (i_level*100+128) / 256 ); } } else report( stdout, " can't get volume levels\n" ); } } else if (DRIVER_OP_UNSUPPORTED == rc) { report( stdout, "not implemented\n" ); } else { report( stdout, "FAILED\n" ); } } } if (!opts.no_analysis) { if (b_playing_audio) { /* Running a CD Analysis would mess up audio playback.*/ report(stdout, "CD Analysis Report omitted because audio is currently " "playing.\n"); myexit(p_cdio, EXIT_SUCCESS); } report(stdout, STRONG "CD Analysis Report\n" NORMAL); /* try to find out what sort of CD we have */ if (num_audio > 0) { /* may be a "real" audio CD or hidden track CD */ msf_t msf; cdio_get_track_msf(p_cdio, i_first_track, &msf); /* CD-I/Ready says start_track_lsn <= 30*75 then CDDA */ if (start_track_lsn > 100 /* 100 is just a guess */) { fs = cdio_guess_cd_type(p_cdio, 0, 1, &cdio_iso_analysis); if ((CDIO_FSTYPE(fs)) != CDIO_FS_UNKNOWN) fs |= CDIO_FS_ANAL_HIDDEN_TRACK; else { fs &= ~CDIO_FS_MASK; /* del filesystem info */ report( stdout, "Oops: %lu unused sectors at start, " "but hidden track check failed.\n", (long unsigned int) start_track_lsn); } } print_analysis(ms_offset, cdio_iso_analysis, fs, first_data, num_audio, i_tracks, i_first_track, cdio_get_track_format(p_cdio, 1), p_cdio); } if (num_data > 0) { /* we have data track(s) */ int j; for (j = 2, i = first_data; i <= i_tracks; i++) { msf_t msf; track_format_t track_format = cdio_get_track_format(p_cdio, i); cdio_get_track_msf(p_cdio, i, &msf); switch ( track_format ) { case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: case TRACK_FORMAT_DATA: case TRACK_FORMAT_PSX: ; } start_track_lsn = (i == 1) ? 0 : cdio_msf_to_lsn(&msf); /* save the start of the data area */ if (i == first_data) data_start = start_track_lsn; /* skip tracks which belong to the current walked session */ if (start_track_lsn < data_start + cdio_iso_analysis.isofs_size) continue; fs = cdio_guess_cd_type(p_cdio, start_track_lsn, i, &cdio_iso_analysis); if (i > 1) { /* track is beyond last session -> new session found */ ms_offset = start_track_lsn; report( stdout, "session #%d starts at track %2i, LSN: %lu," " ISO 9660 blocks: %6i\n", j++, i, (unsigned long int) start_track_lsn, cdio_iso_analysis.isofs_size); report( stdout, "ISO 9660: %i blocks, label `%.32s'\n", cdio_iso_analysis.isofs_size, cdio_iso_analysis.iso_label); fs |= CDIO_FS_ANAL_MULTISESSION; } else { print_analysis(ms_offset, cdio_iso_analysis, fs, first_data, num_audio, i_tracks, i_first_track, track_format, p_cdio); } if ( !(CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660 || CDIO_FSTYPE(fs) == CDIO_FS_ISO_HFS || /* CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660_INTERACTIVE) && (fs & XA))) */ CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660_INTERACTIVE) ) /* no method for non-ISO9660 multisessions */ break; } } } myexit(p_cdio, EXIT_SUCCESS); /* Not reached:*/ return(EXIT_SUCCESS); } libcdio-2.2.0/src/cd-info.help2man000066400000000000000000000005061474051130400166560ustar00rootroot00000000000000[NAME] cd-info \- shows Information about a CD or CD-image [SEE ALSO] \&\f(CWcd-drive(1)\fR for CD-ROM characteristics; \&\f(CWiso-info(1)\fR for information about an ISO-9660 image. [AUTHOR] Rocky Bernstein rocky@gnu.org, based on the cdinfo program by Gerd Knorr and Heiko Eissfeldt libcdio-2.2.0/src/cd-read.c000066400000000000000000000435411474051130400153600ustar00rootroot00000000000000/* Copyright (C) 2003-2006, 2008, 2011, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Program to debug read routines audio, mode1, mode2 forms 1 & 2. */ #include "util.h" #include #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include "getopt.h" #ifndef O_BINARY #define O_BINARY 0 #endif /* Configuration option codes */ enum { OP_HANDLED = 0, /* NOTE: libpopt version associated these with drivers. That appeared to be an unused historical artifact. */ OP_SOURCE_AUTO, OP_SOURCE_BIN, OP_SOURCE_CUE, OP_SOURCE_NRG, OP_SOURCE_CDRDAO, OP_SOURCE_DEVICE, OP_USAGE, /* These are the remaining configuration options */ OP_READ_MODE, OP_VERSION, }; typedef enum { READ_AUDIO = CDIO_READ_MODE_AUDIO, READ_M1F1 = CDIO_READ_MODE_M1F1, READ_M1F2 = CDIO_READ_MODE_M1F2, READ_M2F1 = CDIO_READ_MODE_M2F1, READ_M2F2 = CDIO_READ_MODE_M2F2, READ_MODE_UNINIT, READ_ANY } read_mode_t; /* Structure used so we can binary sort and set the --mode switch. */ typedef struct { char name[30]; read_mode_t read_mode; } subopt_entry_t; /* Sub-options for --mode. Note: entries must be sorted! */ static const subopt_entry_t modes_sublist[] = { {"any", READ_ANY}, {"audio", READ_AUDIO}, {"m1f1", READ_M1F1}, {"m1f2", READ_M1F2}, {"m2f1", READ_M2F1}, {"m2f2", READ_M2F2}, {"mode1form1", READ_M1F1}, {"mode1form2", READ_M1F2}, {"mode2form1", READ_M2F1}, {"mode2form2", READ_M2F2}, {"red", READ_AUDIO}, }; /* Used by `main' to communicate with `parse_opt'. And global options */ static struct arguments { char *access_mode; /* Access method driver should use for control */ char *output_file; /* file to output blocks if not NULL. */ int debug_level; int hexdump; /* Show output as a hexdump */ int nohexdump; /* Don't output as a hexdump. I don't know how to get popt to combine these as one variable. */ int just_hex; /* Don't try to print "printable" characters in hex dump. */ read_mode_t read_mode; int version_only; int no_header; int print_iso9660; source_image_t source_image; lsn_t start_lsn; lsn_t end_lsn; int num_sectors; } opts; static void hexdump (FILE *stream, uint8_t * buffer, unsigned int len, int just_hex) { unsigned int i; for (i = 0; i < len; i++, buffer++) { if (i % 16 == 0) fprintf (stream, "0x%04x: ", i); fprintf (stream, "%02x", *buffer); if (i % 2 == 1) fprintf (stream, " "); if (i % 16 == 15) { if (!just_hex) { uint8_t *p; fprintf (stream, " "); for (p=buffer-15; p <= buffer; p++) { fprintf(stream, "%c", isprint(*p) ? *p : '.'); } } fprintf (stream, "\n"); } } fprintf (stream, "\n"); fflush (stream); } /* Comparison function called by bearch() to find sub-option record. */ static int compare_subopts(const void *key1, const void *key2) { subopt_entry_t *a = (subopt_entry_t *) key1; subopt_entry_t *b = (subopt_entry_t *) key2; return (strncmp(a->name, b->name, 30)); } /* Do processing of a --mode sub option. Basically we find the option in the array, set it's corresponding flag variable to true as well as the "show.all" false. */ static void process_suboption(const char *subopt, const subopt_entry_t *sublist, const int num, const char *subopt_name) { subopt_entry_t *subopt_rec = bsearch(subopt, sublist, num, sizeof(subopt_entry_t), &compare_subopts); if (subopt_rec != NULL) { opts.read_mode = subopt_rec->read_mode; return; } else { unsigned int i; bool is_help=strcmp(subopt, "help")==0; if (is_help) { report( stderr, "The list of sub options for \"%s\" are:\n", subopt_name ); } else { report( stderr, "Invalid option following \"%s\": %s.\n", subopt_name, subopt ); report( stderr, "Should be one of: " ); } for (i=0; i= 0) switch (opt) { case 'a': opts.access_mode = strdup(optarg); break; case 'd': opts.debug_level = atoi(optarg); break; case 'x': opts.hexdump = 1; break; case 's': opts.start_lsn = atoi(optarg); break; case 'e': opts.end_lsn = atoi(optarg); break; case 'n': opts.num_sectors = atoi(optarg); break; case 'b': parse_source(OP_SOURCE_BIN); break; case 'c': parse_source(OP_SOURCE_CUE); break; case 'i': parse_source(OP_SOURCE_AUTO); break; case 'C': parse_source(OP_SOURCE_DEVICE); break; case 'N': parse_source(OP_SOURCE_NRG); break; case 't': parse_source(OP_SOURCE_CDRDAO); break; case 'o': opts.output_file = strdup(optarg); break; case 'm': process_suboption(optarg, modes_sublist, sizeof(modes_sublist) / sizeof(subopt_entry_t), "--mode"); break; case 'V': print_version(program_name, VERSION, 0, true); rc = EXIT_SUCCESS; goto error_exit; case '?': fprintf(stdout, helpText, program_name); rc = EXIT_INFO; goto error_exit; case OP_USAGE: fprintf(stderr, usageText, program_name); goto error_exit; case OP_HANDLED: break; } if (optind < argc) { const char *remaining_arg = argv[optind++]; /* NOTE: A bug in the libpopt version checked source_image, which rendered the subsequent source_image test useless. */ if (source_name != NULL) { report( stderr, "%s: Source specified in option %s and as %s\n", program_name, source_name, remaining_arg ); goto error_exit; } if (opts.source_image == INPUT_DEVICE) source_name = fillout_device_name(remaining_arg); else source_name = strdup(remaining_arg); if (optind < argc) { report( stderr, "%s: Source specified in previously %s and %s\n", program_name, source_name, remaining_arg ); goto error_exit; } } if (opts.debug_level == 3) { cdio_loglevel_default = CDIO_LOG_INFO; } else if (opts.debug_level >= 4) { cdio_loglevel_default = CDIO_LOG_DEBUG; } if (opts.read_mode == READ_MODE_UNINIT) { report( stderr, "%s: Need to give a read mode " "(audio, m1f1, m1f2, m2f1, m2f2, or auto)\n", program_name ); rc = 10; goto error_exit; } /* Check consistency between start_lsn, end_lsn and num_sectors. */ if (opts.nohexdump && opts.hexdump != 2) { report( stderr, "%s: don't give both --hexdump and --no-hexdump together\n", program_name ); rc = 11; goto error_exit; } if (opts.nohexdump) opts.hexdump = 0; if (opts.start_lsn == CDIO_INVALID_LSN) { /* Maybe we derive the start from the end and num sectors. */ if (opts.end_lsn == CDIO_INVALID_LSN) { /* No start or end LSN, so use 0 for the start */ opts.start_lsn = 0; if (opts.num_sectors == 0) opts.num_sectors = 1; } else if (opts.num_sectors != 0) { if (opts.end_lsn <= opts.num_sectors) { report( stderr, "%s: end LSN (%lu) needs to be greater than " " the sector to read (%lu)\n", program_name, (unsigned long) opts.end_lsn, (unsigned long) opts.num_sectors ); rc = 12; goto error_exit; } opts.start_lsn = opts.end_lsn - opts.num_sectors + 1; } } /* opts.start_lsn has been set somehow or we've aborted. */ if (opts.end_lsn == CDIO_INVALID_LSN) { if (0 == opts.num_sectors) opts.num_sectors = 1; opts.end_lsn = opts.start_lsn + opts.num_sectors - 1; } else { /* We were given an end lsn. */ if (opts.end_lsn < opts.start_lsn) { report( stderr, "%s: end LSN (%lu) needs to be grater than start LSN (%lu)\n", program_name, (unsigned long) opts.start_lsn, (unsigned long) opts.end_lsn ); rc = 13; goto error_exit; } if (opts.num_sectors != opts.end_lsn - opts.start_lsn + 1) if (opts.num_sectors != 0) { report( stderr, "%s: inconsistency between start LSN (%lu), end (%lu), " "and count (%d)\n", program_name, (unsigned long) opts.start_lsn, (unsigned long) opts.end_lsn, opts.num_sectors ); rc = 14; goto error_exit; } opts.num_sectors = opts.end_lsn - opts.start_lsn + 1; } return true; error_exit: free(program_name); exit(rc); } static void log_handler (cdio_log_level_t level, const char message[]) { if (level == CDIO_LOG_DEBUG && opts.debug_level < 2) return; if (level == CDIO_LOG_INFO && opts.debug_level < 1) return; if (level == CDIO_LOG_WARN && opts.debug_level < 0) return; gl_default_cdio_log_handler (level, message); } static void init(void) { opts.debug_level = 0; opts.start_lsn = CDIO_INVALID_LSN; opts.end_lsn = CDIO_INVALID_LSN; opts.num_sectors = 0; opts.read_mode = READ_MODE_UNINIT; opts.source_image = INPUT_UNKNOWN; opts.hexdump = 2; /* Not set. */ gl_default_cdio_log_handler = cdio_log_set_handler (log_handler); } int main(int argc, char *argv[]) { uint8_t buffer[CDIO_CD_FRAMESIZE_RAW] = { 0, }; unsigned int blocklen=CDIO_CD_FRAMESIZE_RAW; CdIo *p_cdio=NULL; int output_fd=-1; FILE *output_stream; init(); /* Parse our arguments; every option seen by `parse_opt' will be reflected in `arguments'. */ parse_options(argc, argv); print_version(program_name, VERSION, opts.no_header, opts.version_only); p_cdio = open_input(source_name, opts.source_image, opts.access_mode); if (opts.output_file!=NULL) { /* If hexdump not explicitly set, then don't produce hexdump when writing to a file. */ if (opts.hexdump == 2) opts.hexdump = 0; output_fd = open(opts.output_file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644); if (-1 == output_fd) { err_exit("Error opening output file %s: %s\n", opts.output_file, strerror(errno)); } } else /* If we are writing to stdout, then the default is to produce a hexdump. */ if (opts.hexdump == 2) opts.hexdump = 1; for ( ; opts.start_lsn <= opts.end_lsn; opts.start_lsn++ ) { switch (opts.read_mode) { case READ_AUDIO: case READ_M1F1: case READ_M1F2: case READ_M2F1: case READ_M2F2: if (DRIVER_OP_SUCCESS != cdio_read_sector(p_cdio, &buffer, opts.start_lsn, (cdio_read_mode_t) opts.read_mode)) { report( stderr, "error reading block %u\n", (unsigned int) opts.start_lsn ); blocklen = 0; } else { switch (opts.read_mode) { case READ_M1F1: blocklen=CDIO_CD_FRAMESIZE; break; case READ_M1F2: blocklen=M2RAW_SECTOR_SIZE; break; case READ_M2F1: blocklen=CDIO_CD_FRAMESIZE; break; case READ_M2F2: blocklen=M2F2_SECTOR_SIZE; break; default: ; } } break; case READ_ANY: { driver_id_t driver_id = cdio_get_driver_id(p_cdio); if (cdio_is_device(source_name, driver_id)) { if (DRIVER_OP_SUCCESS != mmc_read_sectors(p_cdio, &buffer, opts.start_lsn, CDIO_MMC_READ_TYPE_ANY, 1)) { report( stderr, "error reading block %u\n", (unsigned int) opts.start_lsn ); blocklen = 0; } } else { err_exit( "%s: mode 'any' must be used with a real CD-ROM, not an image file.\n", program_name); } } break; case READ_MODE_UNINIT: err_exit("%s: Reading mode not set\n", program_name); break; } if (!opts.output_file) { output_stream = stdout; } else { output_stream = fdopen(output_fd, "w"); } if (opts.hexdump) hexdump(output_stream, buffer, blocklen, opts.just_hex); else if (opts.output_file) { ssize_t bytes_ret; bytes_ret = write(output_fd, buffer, blocklen); (void)bytes_ret; /* Silence unused warnings */ } else { unsigned int i; for (i=0; i libcdio-2.2.0/src/cdda-player.c000066400000000000000000001423661474051130400162530ustar00rootroot00000000000000/* Copyright (C) 2005-2012, 2017, 2019, 2021 Rocky Bernstein Adapted from Gerd Knorr's player.c program Copyright (C) 1997, 1998 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_CDDB #include #endif #include #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_CURSES_H # include #else # ifdef HAVE_NCURSES_H #include # else # ifdef HAVE_NCURSES_NCURSES_H # include # else # error "You need or extern TERMINAL *cur_term; #include #include #include #include #include #include "cddb.h" #include "getopt.h" static WINDOW * cur_window = NULL; static void action(const char *psz_action); static void display_cdinfo(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track); static void display_tracks(void); static void get_cddb_track_info(track_t i_track); static void get_cdtext_track_info(track_t i_track); static void get_track_info(track_t i_track); static bool play_track(track_t t1, track_t t2); static CdIo_t *p_cdio_global; /* libcdio handle */ static driver_id_t driver_id = DRIVER_DEVICE; static int b_sig = false; /* set on some signals */ /* cdrom data */ static track_t i_first_track_global; static track_t i_last_track; static track_t i_first_audio_track; static track_t i_last_audio_track; static track_t i_last_display_track = CDIO_INVALID_TRACK; static track_t i_tracks_global; static msf_t toc[CDIO_CDROM_LEADOUT_TRACK+1]; static cdio_subchannel_t sub; /* subchannel last time read */ static int i_data; /* # of data tracks present ? */ static int start_track = 0; static int stop_track = 0; static int one_track = 0; static int i_vol_port = 5; /* If 5, retrieve volume port. Otherwise the port number 0..3 of a working volume port and 4 for no working port. */ /* settings which can be set from the command or interactively. */ static bool b_cd = false; static bool auto_mode = false; static bool b_verbose = false; static bool debug = false; static bool b_interactive = true; static bool b_prefer_cdtext = true; #ifdef CDDB_ADDED static bool b_cddb = false; /* CDDB database present */ #endif static bool b_db = false; /* we have a database at all */ static bool b_record = false; /* we have a record for static the inserted CD */ static bool b_all_tracks = false; /* True if we display all tracks*/ static int8_t i_volume_level = -1; /* Valid range is 0..100 */ static char *psz_device_global=NULL; static char *psz_program; /* Info about songs and titles. The 0 entry will contain the disc info. */ typedef struct { char title[80]; char artist[80]; char length[8]; char ext_data[80]; bool b_cdtext; /* true if from CD-Text, false if from CDDB */ } cd_track_info_rec_t; static cd_track_info_rec_t cd_info[CDIO_CD_MAX_TRACKS+2]; static char title[80]; static char artist[80]; static char genre[40]; static char category[40]; static char year[5]; static bool b_cdtext_title; /* true if from CD-Text, false if from CDDB */ static bool b_cdtext_artist; /* true if from CD-Text, false if from CDDB */ static bool b_cdtext_genre; /* true if from CD-Text, false if from CDDB */ #ifdef CDTEXT_CATEGORY_ADDED static bool b_cdtext_category; /* true if from CD-Text, false if from CDDB */ #endif static bool b_cdtext_year; /* true if from CD-Text, false if from CDDB */ static cdio_audio_volume_t audio_volume; #ifdef HAVE_CDDB static cddb_conn_t *p_conn = NULL; static cddb_disc_t *p_cddb_disc = NULL; static int i_cddb_matches = 0; #endif #define MAX_KEY_STR 50 static const char key_bindings[][MAX_KEY_STR] = { " right play / next track", " left previous track", " up/down 10 sec forward / back", " 1-9 jump to track 1-9", " 0 jump to track 10", " F1-F20 jump to track 11-30", " ", " k, h, ? show this key help", " l, toggle listing all tracks", " e eject", " c close tray", " p, space pause / resume", " s stop", " q, ^C quit", " x quit and continue playing", " a toggle auto-mode", " - decrease volume level", " + increase volume level", }; static const unsigned int i_key_bindings = sizeof(key_bindings) / MAX_KEY_STR; /* ---------------------------------------------------------------------- */ /* tty stuff */ typedef enum { LINE_STATUS = 0, LINE_CDINFO = 1, LINE_ARTIST = 3, LINE_CDNAME = 4, LINE_GENRE = 5, LINE_YEAR = 6, LINE_TRACK_PREV = 8, LINE_TRACK_TITLE = 9, LINE_TRACK_ARTIST = 10, LINE_TRACK_NEXT = 11, } track_line_t; static unsigned int LINE_ACTION = 25; static unsigned int COLS_LAST; static char psz_action_line[300] = ""; static int rounded_div(unsigned int i_a, unsigned int i_b) { const unsigned int i_b_half=i_b/2; return ((i_a)+i_b_half)/i_b; } /** Curses window initialization. */ static void tty_raw(void) { if (!b_interactive) return; if (!cur_window) cur_window = initscr(); cbreak(); clear(); noecho(); #ifdef HAVE_KEYPAD keypad(stdscr,1); #endif getmaxyx(stdscr, LINE_ACTION, COLS_LAST); LINE_ACTION--; refresh(); } /** Curses window finalization. */ static void tty_restore(void) { if (!b_interactive) return; endwin(); } #define UNUSED(x) (void)(x) /* Called when window is resized. */ static void sigwinch(int dummy) { UNUSED(dummy); tty_restore(); tty_raw(); action(NULL); } /* Signal handler - Ctrl-C and others. */ static void ctrlc(int signal_num) { b_sig = true; } /* Timed wait on an event. */ static int select_wait(int sec) { struct timeval tv; fd_set se; FD_ZERO(&se); FD_SET(STDIN_FILENO, &se); tv.tv_sec = sec; tv.tv_usec = 0; return select(1,&se,NULL,NULL,&tv); } /* ---------------------------------------------------------------------- */ /* Display the action line. */ static void action(const char *psz_action) { if (!b_interactive) { if (b_verbose && psz_action) fprintf(stderr,"action: %s\n", psz_action); return; } if (!psz_action) ; else if (psz_action && strlen(psz_action)) snprintf(psz_action_line, sizeof(psz_action_line), "action : %s", psz_action); else snprintf(psz_action_line, sizeof(psz_action_line), "%s", "" ); mvprintw(LINE_ACTION, 0, "%s", psz_action_line); clrtoeol(); refresh(); } /* Display an error message.. */ static void xperror(const char *psz_msg) { char line[80]; if (!b_interactive) { if (b_verbose) { fprintf(stderr, "error: "); perror(psz_msg); } return; } if (b_verbose) { snprintf(line, sizeof(line), "%s: %s", psz_msg, strerror(errno)); attron(A_STANDOUT); mvprintw(LINE_ACTION, 0, (char *) "error : %s", line); attroff(A_STANDOUT); clrtoeol(); refresh(); select_wait(3); action(""); } } static void finish(const char *psz_msg, int rc) { if (b_interactive) { attron(A_STANDOUT); mvprintw(LINE_ACTION, 0, (char *) "%s, exiting...\n", psz_msg); attroff(A_STANDOUT); clrtoeol(); refresh(); } tty_restore(); if (cur_term) del_curterm(cur_term); cur_window = NULL; #ifdef HAVE_CDDB if (p_conn) cddb_destroy(p_conn); cddb_disc_destroy(p_cddb_disc); libcddb_shutdown(); #endif /*HAVE_CDDB*/ cdio_destroy (p_cdio_global); free (psz_device_global); exit (rc); } /* ---------------------------------------------------------------------- */ /* Set all audio channels to level. level is assumed to be in the range 0..100. */ static bool set_volume_level(CdIo_t *p_cdio, uint8_t i_level) { const unsigned int i_new_level= rounded_div(i_level*256, 100); unsigned int i; driver_return_code_t rc; for (i=0; i<=3; i++) { audio_volume.level[i] = i_new_level; } rc = cdio_audio_set_volume(p_cdio, &audio_volume); if ( DRIVER_OP_SUCCESS != rc ) { /* If we can't do a get volume, audio_volume.level is used as a second-best guess. But if this set failed restore it to an invalid value so we don't get confused and think that this was set. */ for (i=0; i<=3; i++) { audio_volume.level[i] = 0; } } else { /* Set i_vol_port so volume levels set above will get used. */ i_vol_port=0; } return rc; } /* Subtract one from the volume level. If we are at the minimum value, * nothing is done. We used to wrap at the boundaries but this is probably wrong because is assumes someone: * looks at the display while listening, * knows that 99 is the maximum value. See issue #33333 If the volume level is undefined, then this means we could not get the current value and we'll' set it to 50 the midway point. Return the status of setting the volume level. */ static bool decrease_volume_level(CdIo_t *p_cdio) { if (i_volume_level == -1) i_volume_level = 51; if (i_volume_level <= 0) i_volume_level = 1; return set_volume_level(p_cdio, --i_volume_level); } /* Add 1 to the volume level. If we are at the maximum value, nothing is done. We used to wrap at the boundaries but this is probably wrong because is assumes someone: * looks at the display while listening, * knows that 99 is the maximum value. See issue #33333 If volume level is undefined, then this means we could not get the current value and we'll' set it to 50 the midway point. Return the status of setting the volume level. */ static bool increase_volume_level(CdIo_t *p_cdio) { if (i_volume_level == -1) i_volume_level = 49; if (i_volume_level <= 0) i_volume_level = 0; if (i_volume_level > 98) i_volume_level = 98; return set_volume_level(p_cdio, ++i_volume_level); } /** Stop playing audio CD */ static bool cd_stop(CdIo_t *p_cdio) { bool b_ok = true; if (b_cd && p_cdio) { action("stop..."); i_last_audio_track = CDIO_INVALID_TRACK; b_ok = DRIVER_OP_SUCCESS == cdio_audio_stop(p_cdio); if ( !b_ok ) xperror("stop"); if (b_all_tracks) display_tracks(); } return b_ok; } /** Eject CD */ static bool cd_eject(void) { bool b_ok = true; if (p_cdio_global) { cd_stop(p_cdio_global); action("eject..."); b_ok = DRIVER_OP_SUCCESS == cdio_eject_media(&p_cdio_global); if (!b_ok) xperror("eject"); b_cd = false; cdio_destroy (p_cdio_global); p_cdio_global = NULL; } return b_ok; } /** Close CD tray */ static bool cd_close(const char *psz_device) { bool b_ok = true; if (!b_cd) { action("close..."); b_ok = DRIVER_OP_SUCCESS == cdio_close_tray(psz_device, &driver_id); if (!b_ok) xperror("close"); } return b_ok; } /** Pause playing audio CD */ static bool cd_pause(CdIo_t *p_cdio) { bool b_ok = true; if (sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) { b_ok = DRIVER_OP_SUCCESS == cdio_audio_pause(p_cdio); if (!b_ok) xperror("pause"); } return b_ok; } /** Get status/track/position info of an audio CD */ static bool read_subchannel(CdIo_t *p_cdio) { bool b_ok = true; if (!p_cdio) return false; b_ok = DRIVER_OP_SUCCESS == cdio_audio_read_subchannel(p_cdio, &sub); if (!b_ok) { xperror("read subchannel"); b_cd = 0; } if (auto_mode && sub.audio_status == CDIO_MMC_READ_SUB_ST_COMPLETED) cd_eject(); return b_ok; } #ifdef HAVE_CDDB /** This routine is called by vcd routines on error. Setup is done by init_input_plugin. */ static void cddb_log_handler (cddb_log_level_t level, const char message[]) { switch (level) { case CDDB_LOG_DEBUG: case CDDB_LOG_INFO: if (!b_verbose) return; /* Fall through if to warn case */ case CDDB_LOG_WARN: case CDDB_LOG_ERROR: case CDDB_LOG_CRITICAL: default: xperror(message); break; } /* gl_default_cdio_log_handler (level, message); */ } #endif /* HAVE_CDDB */ static void get_cddb_disc_info(CdIo_t *p_cdio) { #ifdef HAVE_CDDB b_db = init_cddb(p_cdio, &p_conn, &p_cddb_disc, xperror, i_first_track_global, i_tracks_global, &i_cddb_matches); if (b_db) { int i_year; i_year = atoi(year); cddb_disc_set_artist(p_cddb_disc, artist); cddb_disc_set_title(p_cddb_disc, title); cddb_disc_set_genre(p_cddb_disc, genre); cddb_disc_set_year(p_cddb_disc, i_year); } #endif /* HAVE_CDDB */ return; } #define add_cdtext_disc_info(format_str, info_field, FIELD) \ if (cdtext_get_const(p_cdtext, FIELD, 0) && !strlen(info_field)) { \ snprintf(info_field, sizeof(info_field), format_str, \ cdtext_get_const(p_cdtext, FIELD, 0)); \ b_cdtext_ ## info_field = true; \ } static void get_cdtext_disc_info(CdIo_t *p_cdio) { cdtext_t *p_cdtext = cdio_get_cdtext(p_cdio); if (p_cdtext) { add_cdtext_disc_info("%s", title, CDTEXT_FIELD_TITLE); add_cdtext_disc_info("%s", artist, CDTEXT_FIELD_PERFORMER); add_cdtext_disc_info("%s", genre, CDTEXT_FIELD_GENRE); } } static void get_disc_info(CdIo_t *p_cdio) { b_db = false; if (b_prefer_cdtext) { get_cdtext_disc_info(p_cdio); get_cddb_disc_info(p_cdio); } else { get_cddb_disc_info(p_cdio); get_cdtext_disc_info(p_cdio); } } /** Read CD TOC and set CD information. */ static void read_toc(CdIo_t *p_cdio) { track_t i; action("read toc..."); memset(cd_info, 0, sizeof(cd_info)); title[0] = artist[0] = genre[0] = category[0] = year[0] = '\0'; i_first_track_global = cdio_get_first_track_num(p_cdio); i_last_track = cdio_get_last_track_num(p_cdio); i_tracks_global = cdio_get_num_tracks(p_cdio); i_first_audio_track = i_first_track_global; i_last_audio_track = i_last_track; cdio_audio_get_volume(p_cdio, &audio_volume); for (i_vol_port=0; i_vol_port<4; i_vol_port++) { if (audio_volume.level[i_vol_port] > 0) break; } if ( CDIO_INVALID_TRACK == i_first_track_global || CDIO_INVALID_TRACK == i_last_track ) { xperror("read toc header"); b_cd = false; b_record = false; i_last_display_track = CDIO_INVALID_TRACK; } else { b_cd = true; i_data = 0; get_disc_info(p_cdio); for (i = i_first_track_global; i <= i_last_track+1; i++) { int s; if ( !cdio_get_track_msf(p_cdio, i, &(toc[i])) ) { xperror("read toc entry"); b_cd = false; return; } if ( TRACK_FORMAT_AUDIO == cdio_get_track_format(p_cdio, i) ) { if (i != i_first_track_global) { s = cdio_audio_get_msf_seconds(&toc[i]) - cdio_audio_get_msf_seconds(&toc[i-1]); snprintf(cd_info[i-1].length, sizeof(cd_info[0].length), "%02d:%02d", (uint8_t) (s / CDIO_CD_SECS_PER_MIN), (uint8_t) (s % CDIO_CD_SECS_PER_MIN)); } } else { if ((i != i_last_track+1) ) { i_data++; if (i == i_first_track_global) { if (i == i_last_track) i_first_audio_track = CDIO_CDROM_LEADOUT_TRACK; else i_first_audio_track++; } } } get_track_info(i); } b_record = true; read_subchannel(p_cdio); if (auto_mode && sub.audio_status != CDIO_MMC_READ_SUB_ST_PLAY) play_track(1, CDIO_CDROM_LEADOUT_TRACK); } action(""); if (!b_all_tracks) display_cdinfo(p_cdio, i_tracks_global, i_first_track_global); } /** Play an audio track. */ static bool play_track(track_t i_start_track, track_t i_end_track) { bool b_ok = true; char line[80]; if (!b_cd) { read_toc(p_cdio_global); } read_subchannel(p_cdio_global); if (!b_cd || i_first_track_global == CDIO_CDROM_LEADOUT_TRACK) return false; if (debug) fprintf(stderr,"play tracks: %d-%d => ", i_start_track, i_end_track-1); if (i_start_track < i_first_track_global) i_start_track = i_first_track_global; if (i_start_track > i_last_audio_track) i_start_track = i_last_audio_track; if (i_end_track < i_first_track_global) i_end_track = i_first_track_global; if (i_end_track > i_last_audio_track) i_end_track = i_last_audio_track; i_end_track++; if (debug) fprintf(stderr,"%d-%d\n",i_start_track, i_end_track-1); cd_pause(p_cdio_global); snprintf(line, sizeof(line), "play track %d to track %d.", i_start_track, i_end_track-1); action(line); b_ok = (DRIVER_OP_SUCCESS == cdio_audio_play_msf(p_cdio_global, &(toc[i_start_track]), &(toc[i_end_track])) ); if (!b_ok) xperror("play"); return b_ok; } static void skip(int diff) { msf_t start_msf; int sec; read_subchannel(p_cdio_global); if (!b_cd || i_first_track_global == CDIO_CDROM_LEADOUT_TRACK) return; sec = cdio_audio_get_msf_seconds(&sub.abs_addr); sec += diff; if (sec < 0) sec = 0; start_msf.m = cdio_to_bcd8(sec / CDIO_CD_SECS_PER_MIN); start_msf.s = cdio_to_bcd8(sec % CDIO_CD_SECS_PER_MIN); start_msf.f = 0; cd_pause(p_cdio_global); if ( DRIVER_OP_SUCCESS != cdio_audio_play_msf(p_cdio_global, &start_msf, &(toc[i_last_audio_track])) ) xperror("play"); } static bool toggle_pause(void) { bool b_ok = true; if (!b_cd) return false; if (CDIO_MMC_READ_SUB_ST_PAUSED == sub.audio_status) { b_ok = DRIVER_OP_SUCCESS != cdio_audio_resume(p_cdio_global); if (!b_ok) xperror("resume"); } else { b_ok = DRIVER_OP_SUCCESS != cdio_audio_pause(p_cdio_global); if (!b_ok) xperror("pause"); } return b_ok; } /** Update windows with status and possibly track info. This used in interactive playing not batch mode. */ static void display_status(bool b_status_only) { char line[80]; if (!b_interactive) return; if (!b_cd) { snprintf(line, sizeof(line), "no CD in drive (%s)", psz_device_global); } else if (i_first_track_global == CDIO_CDROM_LEADOUT_TRACK) { snprintf(line, sizeof(line), "CD has only data tracks"); } else if (sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED || sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) { cdio_audio_get_volume(p_cdio_global, &audio_volume); if (i_vol_port < 4) { i_volume_level = rounded_div(audio_volume.level[i_vol_port]*100, 256); snprintf(line, sizeof(line), "track %2d - %02x:%02x of %s (%02x:%02x abs) %s volume: %d", sub.track, sub.rel_addr.m, sub.rel_addr.s, cd_info[sub.track].length, sub.abs_addr.m, sub.abs_addr.s, mmc_audio_state2str(sub.audio_status), i_volume_level); } else snprintf(line, sizeof(line), "track %2d - %02x:%02x of %s (%02x:%02x abs) %s", sub.track, sub.rel_addr.m, sub.rel_addr.s, cd_info[sub.track].length, sub.abs_addr.m, sub.abs_addr.s, mmc_audio_state2str(sub.audio_status)); } else { snprintf(line, sizeof(line), "%s", mmc_audio_state2str(sub.audio_status)); } action(NULL); mvprintw(LINE_STATUS, 0, (char *) "status%s: %s", auto_mode ? "*" : " ", line); clrtoeol(); if ( !b_status_only && b_db && i_last_display_track != sub.track && (sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED || sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) && b_cd) { if (b_all_tracks) display_tracks(); else { const cd_track_info_rec_t *p_cd_info = &cd_info[sub.track]; i_last_display_track = sub.track; if (i_first_audio_track != sub.track && strlen(cd_info[sub.track-1].title)) { const cd_track_info_rec_t *p_cd_info_track = &cd_info[sub.track-1]; mvprintw(LINE_TRACK_PREV, 0, (char *) " track %2d title : %s [%s]", sub.track-1, p_cd_info->title, p_cd_info_track->b_cdtext ? "CD-Text" : "CDDB"); clrtoeol(); } else { mvprintw(LINE_TRACK_PREV, 0, (char *) "%s",""); clrtoeol(); } if (strlen(p_cd_info->title)) { mvprintw(LINE_TRACK_TITLE, 0, (char *) ">track %2d title : %s [%s]", sub.track, p_cd_info->title, (char *) (p_cd_info->b_cdtext ? "CD-Text" : "CDDB")); clrtoeol(); } if (strlen(p_cd_info->artist)) { mvprintw(LINE_TRACK_ARTIST, 0, (char *) ">track %2d artist: %s [%s]", sub.track, p_cd_info->artist, p_cd_info->b_cdtext ? "CD-Text" : "CDDB"); clrtoeol(); } if (i_last_audio_track != sub.track && strlen(cd_info[sub.track+1].title)) { const cd_track_info_rec_t *p_cd_info_track = &cd_info[sub.track+1]; mvprintw(LINE_TRACK_NEXT, 0, (char *) " track %2d title : %s [%s]", sub.track+1, p_cd_info_track->title, p_cd_info->b_cdtext ? "CD-Text" : "CDDB"); clrtoeol(); } else { mvprintw(LINE_TRACK_NEXT, 0, (char *) "%s",""); clrtoeol(); } clrtobot(); } } action(NULL); /* Redisplay action line. */ } static void get_cddb_track_info(track_t i_track) { #ifdef HAVE_CDDB cddb_track_t *t = cddb_disc_get_track(p_cddb_disc, i_track - i_first_track_global); if (t) { cddb_track_set_title(t, title); cddb_track_set_artist(t, artist); } #else ; #endif } #define add_cdtext_track_info(format_str, info_field, FIELD) \ if (cdtext_get_const(p_cdtext, FIELD, i_track)) { \ snprintf(cd_info[i_track].info_field, \ sizeof(cd_info[i_track].info_field), \ format_str, cdtext_get_const(p_cdtext, FIELD, i_track)); \ cd_info[i_track].b_cdtext = true; \ } static void get_cdtext_track_info(track_t i_track) { cdtext_t *p_cdtext = cdio_get_cdtext(p_cdio_global); if (NULL != p_cdtext) { add_cdtext_track_info("%s", title, CDTEXT_FIELD_TITLE); add_cdtext_track_info("%s", artist, CDTEXT_FIELD_PERFORMER); } } static void get_track_info(track_t i_track) { if (b_prefer_cdtext) { get_cdtext_track_info(i_track); get_cddb_track_info(i_track); } else { get_cddb_track_info(i_track); get_cdtext_track_info(i_track); } } #define display_line(LINE_NO, COL_NO, format_str, field) \ if (field != NULL && field[0]) { \ mvprintw(LINE_NO, COL_NO, (char *) format_str " [%s]", \ field, \ b_cdtext_ ## field ? "CD-Text": "CDDB"); \ clrtoeol(); \ } static void display_cdinfo(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) { int len; char line[80]; if (!b_interactive) return; if (!b_cd) snprintf(line, sizeof(line), "-"); else { len = snprintf(line, sizeof(line), "%2u tracks (%02x:%02x min)", (unsigned int) i_last_track, toc[i_last_track+1].m, toc[i_last_track+1].s); if (i_data && i_first_track != CDIO_CDROM_LEADOUT_TRACK) snprintf(line+len, sizeof(line)-len, ", audio=%u-%u", (unsigned int) i_first_audio_track, (unsigned int) i_last_audio_track); display_line(LINE_ARTIST, 0, "CD Artist : %s", artist); display_line(LINE_CDNAME, 0, "CD Title : %s", title); display_line(LINE_GENRE, 0, "CD Genre : %s", genre); display_line(LINE_YEAR, 0, "CD Year : %s", year); } mvprintw(LINE_CDINFO, 0, (char *) "CD info: %s", line); clrtoeol(); action(NULL); } /* ---------------------------------------------------------------------- */ static void usage(char *prog) { fprintf(stderr, "%s is a simple curses CD player. It can pick up artist,\n" "CD name and song title from CD-Text info on the CD or\n" "via CDDB.\n" "\n" "usage: %s [options] [device]\n" "\n" "default for to search for a CD-ROM device with a CD-DA loaded\n" "\n" "These command line options available:\n" " -h print this help\n" " -k print key mapping\n" " -a start up in auto-mode\n" " -d debug\n" " -v verbose\n" "\n" "for non-interactive use (only one) of these:\n" " -l list tracks\n" " -c print cover (PostScript to stdout)\n" " -C close CD-ROM tray. If you use this option,\n" " a CD-ROM device name must be specified.\n" " -p play the whole CD\n" " -t n play track >n<\n" " -t a-b play all tracks between a and b (inclusive)\n" " -L set volume level\n" " -s stop playing\n" " -S list audio subchannel information\n" " -e eject cdrom\n" "\n" "That's all. Oh, maybe a few words more about the auto-mode. This\n" "is the 'dont-touch-any-key' feature. You load a CD, player starts\n" "to play it, and when it is done it ejects the CD. Start it that\n" "way on a spare console and forget about it...\n" "\n" "(c) 1997-98 Gerd Knorr \n" "(c) 2005-2006, 2017 Rocky Bernstein \n" , prog, prog); } static void print_keys(void) { unsigned int i; for (i=0; i < i_key_bindings; i++) fprintf(stderr, "%s\n", key_bindings[i]); } static void keypress_wait(CdIo_t *p_cdio) { action("press any key to continue"); while (1 != select_wait(b_cd ? 1 : 5)) { read_subchannel(p_cdio); display_status(true); } (void) getch(); clrtobot(); action(NULL); if (!b_all_tracks) display_cdinfo(p_cdio, i_tracks_global, i_first_track_global); i_last_display_track = CDIO_INVALID_TRACK; } static void list_keys(void) { unsigned int i; for (i=0; i < i_key_bindings; i++) { mvprintw(LINE_TRACK_PREV+i, 0, (char *) "%s", key_bindings[i]); clrtoeol(); } keypress_wait(p_cdio_global); } static void display_tracks(void) { track_t i; int i_line=0; int s; if (b_record) { i_line=LINE_TRACK_PREV - 1; for (i = i_first_track_global; i <= i_last_track; i++) { char line[200]=""; s = cdio_audio_get_msf_seconds(&toc[i+1]) - cdio_audio_get_msf_seconds(&toc[i]); read_subchannel(p_cdio_global); snprintf(line, sizeof(line), "%2d %02d:%02d %s ", i, s / CDIO_CD_SECS_PER_MIN, s % CDIO_CD_SECS_PER_MIN, ( ( sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY || sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED ) && sub.track == i ) ? "->" : " |"); if (b_record) { if ( strlen(cd_info[i].title) ) strcat(line, cd_info[i].title); if ( strlen(cd_info[i].artist) > 0 ) { if (strlen(cd_info[i].title)) strcat(line, " / "); strcat(line, cd_info[i].artist); } } if (sub.track == i) { attron(A_STANDOUT); mvprintw(i_line++, 0, "%s", line); attroff(A_STANDOUT); } else mvprintw(i_line++, 0, "%s", line); clrtoeol(); } } } /* * PostScript 8bit latin1 handling * stolen from mpage output -- please don't ask me how this works... */ #define ENCODING_TRICKS \ "/reencsmalldict 12 dict def\n" \ "/ReEncodeSmall { reencsmalldict begin\n" \ "/newcodesandnames exch def /newfontname exch def\n" \ "/basefontname exch def\n" \ "/basefontdict basefontname findfont def\n" \ "/newfont basefontdict maxlength dict def\n" \ "basefontdict { exch dup /FID ne { dup /Encoding eq\n" \ "{ exch dup length array copy newfont 3 1 roll put }\n" \ "{ exch newfont 3 1 roll put }\n" \ "ifelse }\n" \ "{ pop pop }\n" \ "ifelse } forall\n" \ "newfont /FontName newfontname put\n" \ "newcodesandnames aload pop newcodesandnames length 2 idiv\n" \ "{ newfont /Encoding get 3 1 roll put } repeat\n" \ "newfontname newfont definefont pop end } def\n" \ "/charvec [\n" \ "026 /Scaron\n" \ "027 /Ydieresis\n" \ "028 /Zcaron\n" \ "029 /scaron\n" \ "030 /trademark\n" \ "031 /zcaron\n" \ "032 /space\n" \ "033 /exclam\n" \ "034 /quotedbl\n" \ "035 /numbersign\n" \ "036 /dollar\n" \ "037 /percent\n" \ "038 /ampersand\n" \ "039 /quoteright\n" \ "040 /parenleft\n" \ "041 /parenright\n" \ "042 /asterisk\n" \ "043 /plus\n" \ "044 /comma\n" \ "045 /minus\n" \ "046 /period\n" \ "047 /slash\n" \ "048 /zero\n" \ "049 /one\n" \ "050 /two\n" \ "051 /three\n" \ "052 /four\n" \ "053 /five\n" \ "054 /six\n" \ "055 /seven\n" \ "056 /eight\n" \ "057 /nine\n" \ "058 /colon\n" \ "059 /semicolon\n" \ "060 /less\n" \ "061 /equal\n" \ "062 /greater\n" \ "063 /question\n" \ "064 /at\n" \ "065 /A\n" \ "066 /B\n" \ "067 /C\n" \ "068 /D\n" \ "069 /E\n" \ "070 /F\n" \ "071 /G\n" \ "072 /H\n" \ "073 /I\n" \ "074 /J\n" \ "075 /K\n" \ "076 /L\n" \ "077 /M\n" \ "078 /N\n" \ "079 /O\n" \ "080 /P\n" \ "081 /Q\n" \ "082 /R\n" \ "083 /S\n" \ "084 /T\n" \ "085 /U\n" \ "086 /V\n" \ "087 /W\n" \ "088 /X\n" \ "089 /Y\n" \ "090 /Z\n" \ "091 /bracketleft\n" \ "092 /backslash\n" \ "093 /bracketright\n" \ "094 /asciicircum\n" \ "095 /underscore\n" \ "096 /quoteleft\n" \ "097 /a\n" \ "098 /b\n" \ "099 /c\n" \ "100 /d\n" \ "101 /e\n" \ "102 /f\n" \ "103 /g\n" \ "104 /h\n" \ "105 /i\n" \ "106 /j\n" \ "107 /k\n" \ "108 /l\n" \ "109 /m\n" \ "110 /n\n" \ "111 /o\n" \ "112 /p\n" \ "113 /q\n" \ "114 /r\n" \ "115 /s\n" \ "116 /t\n" \ "117 /u\n" \ "118 /v\n" \ "119 /w\n" \ "120 /x\n" \ "121 /y\n" \ "122 /z\n" \ "123 /braceleft\n" \ "124 /bar\n" \ "125 /braceright\n" \ "126 /asciitilde\n" \ "127 /.notdef\n" \ "128 /fraction\n" \ "129 /florin\n" \ "130 /quotesingle\n" \ "131 /quotedblleft\n" \ "132 /guilsinglleft\n" \ "133 /guilsinglright\n" \ "134 /fi\n" \ "135 /fl\n" \ "136 /endash\n" \ "137 /dagger\n" \ "138 /daggerdbl\n" \ "139 /bullet\n" \ "140 /quotesinglbase\n" \ "141 /quotedblbase\n" \ "142 /quotedblright\n" \ "143 /ellipsis\n" \ "144 /dotlessi\n" \ "145 /grave\n" \ "146 /acute\n" \ "147 /circumflex\n" \ "148 /tilde\n" \ "149 /oe\n" \ "150 /breve\n" \ "151 /dotaccent\n" \ "152 /perthousand\n" \ "153 /emdash\n" \ "154 /ring\n" \ "155 /Lslash\n" \ "156 /OE\n" \ "157 /hungarumlaut\n" \ "158 /ogonek\n" \ "159 /caron\n" \ "160 /lslash\n" \ "161 /exclamdown\n" \ "162 /cent\n" \ "163 /sterling\n" \ "164 /currency\n" \ "165 /yen\n" \ "166 /brokenbar\n" \ "167 /section\n" \ "168 /dieresis\n" \ "169 /copyright\n" \ "170 /ordfeminine\n" \ "171 /guillemotleft\n" \ "172 /logicalnot\n" \ "173 /hyphen\n" \ "174 /registered\n" \ "175 /macron\n" \ "176 /degree\n" \ "177 /plusminus\n" \ "178 /twosuperior\n" \ "179 /threesuperior\n" \ "180 /acute\n" \ "181 /mu\n" \ "182 /paragraph\n" \ "183 /periodcentered\n" \ "184 /cedilla\n" \ "185 /onesuperior\n" \ "186 /ordmasculine\n" \ "187 /guillemotright\n" \ "188 /onequarter\n" \ "189 /onehalf\n" \ "190 /threequarters\n" \ "191 /questiondown\n" \ "192 /Agrave\n" \ "193 /Aacute\n" \ "194 /Acircumflex\n" \ "195 /Atilde\n" \ "196 /Adieresis\n" \ "197 /Aring\n" \ "198 /AE\n" \ "199 /Ccedilla\n" \ "200 /Egrave\n" \ "201 /Eacute\n" \ "202 /Ecircumflex\n" \ "203 /Edieresis\n" \ "204 /Igrave\n" \ "205 /Iacute\n" \ "206 /Icircumflex\n" \ "207 /Idieresis\n" \ "208 /Eth\n" \ "209 /Ntilde\n" \ "210 /Ograve\n" \ "211 /Oacute\n" \ "212 /Ocircumflex\n" \ "213 /Otilde\n" \ "214 /Odieresis\n" \ "215 /multiply\n" \ "216 /Oslash\n" \ "217 /Ugrave\n" \ "218 /Uacute\n" \ "219 /Ucircumflex\n" \ "220 /Udieresis\n" \ "221 /Yacute\n" \ "222 /Thorn\n" \ "223 /germandbls\n" \ "224 /agrave\n" \ "225 /aacute\n" \ "226 /acircumflex\n" \ "227 /atilde\n" \ "228 /adieresis\n" \ "229 /aring\n" \ "230 /ae\n" \ "231 /ccedilla\n" \ "232 /egrave\n" \ "233 /eacute\n" \ "234 /ecircumflex\n" \ "235 /edieresis\n" \ "236 /igrave\n" \ "237 /iacute\n" \ "238 /icircumflex\n" \ "239 /idieresis\n" \ "240 /eth\n" \ "241 /ntilde\n" \ "242 /ograve\n" \ "243 /oacute\n" \ "244 /ocircumflex\n" \ "245 /otilde\n" \ "246 /odieresis\n" \ "247 /divide\n" \ "248 /oslash\n" \ "249 /ugrave\n" \ "250 /uacute\n" \ "251 /ucircumflex\n" \ "252 /udieresis\n" \ "253 /yacute\n" \ "254 /thorn\n" \ "255 /ydieresis\n" \ "] def" static void ps_list_tracks(void) { int i,s,y,sy; if (!b_record) return; printf("%%!PS-Adobe-2.0\n"); /* encoding tricks */ puts(ENCODING_TRICKS); printf("/Times /TimesLatin1 charvec ReEncodeSmall\n"); printf("/Helvetica /HelveticaLatin1 charvec ReEncodeSmall\n"); /* Spaces */ printf("0 setlinewidth\n"); printf(" 100 100 moveto\n"); printf(" 390 0 rlineto\n"); printf(" 0 330 rlineto\n"); printf("-390 0 rlineto\n"); printf("closepath stroke\n"); printf(" 100 100 moveto\n"); printf("-16 0 rlineto\n"); printf(" 0 330 rlineto\n"); printf("422 0 rlineto\n"); printf(" 0 -330 rlineto\n"); printf("closepath stroke\n"); /* Title */ printf("/TimesLatin1 findfont 24 scalefont setfont\n"); printf("120 400 moveto (%s) show\n", title); printf("/TimesLatin1 findfont 18 scalefont setfont\n"); printf("120 375 moveto (%s) show\n", artist); /* List */ sy = 250 / i_last_track; if (sy > 14) sy = 14; printf("/labelfont /TimesLatin1 findfont %d scalefont def\n",sy-2); printf("/timefont /Courier findfont %d scalefont def\n",sy-2); y = 350; for (i = i_first_track_global; i <= i_last_track; i++, y -= sy) { s = cdio_audio_get_msf_seconds(&toc[i+1]) - cdio_audio_get_msf_seconds(&toc[i]); printf("labelfont setfont\n"); printf("120 %d moveto (%d) show\n", y, i); { char line[200]=""; if ( strlen(cd_info[i].title) ) strcat(line, cd_info[i].title); if ( strlen(cd_info[i].artist) > 0 ) { if (strlen(cd_info[i].title)) strcat(line, " / "); strcat(line, cd_info[i].artist); } printf("150 %d moveto (%s) show\n", y, line); } printf("timefont setfont\n"); printf("420 %d moveto (%2d:%02d) show\n", y, s / CDIO_CD_SECS_PER_MIN, s % CDIO_CD_SECS_PER_MIN); } /* Seitenbanner */ printf("/HelveticaLatin1 findfont 12 scalefont setfont\n"); printf(" 97 105 moveto (%s: %s) 90 rotate show -90 rotate\n", artist, title); printf("493 425 moveto (%s: %s) -90 rotate show 90 rotate\n", artist, title); printf("showpage\n"); } static void list_tracks(void) { int i,s; if (!b_record) return; printf("Title : %s\n", title); printf("Artist: %s\n", artist); for (i = i_first_track_global; i <= i_last_track; i++) { s = cdio_audio_get_msf_seconds(&toc[i+1]) - cdio_audio_get_msf_seconds(&toc[i]); printf("%2d: %s [%d seconds]\n", i, cd_info[i].title, s); } } typedef enum { NO_OP=0, PLAY_CD=1, PLAY_TRACK=2, STOP_PLAYING=3, EJECT_CD=4, CLOSE_CD=5, SET_VOLUME=6, LIST_SUBCHANNEL=7, LIST_KEYS=8, LIST_TRACKS=9, PS_LIST_TRACKS=10, TOGGLE_PAUSE=11, EXIT_PROGRAM=12 } cd_operation_t; int main(int argc, char *argv[]) { int c, nostop=0; char *h; int i_rc = 0; cd_operation_t cd_op = NO_OP; /* operation to do in non-interactive mode */ psz_program = strrchr(argv[0],'/'); psz_program = psz_program ? psz_program+1 : argv[0]; memset(&cddb_opts, 0, sizeof(cddb_opts)); cdio_loglevel_default = CDIO_LOG_WARN; /* parse options */ while ( 1 ) { if (-1 == (c = getopt(argc, argv, "acCdehkplL:sSt:vx"))) break; switch (c) { case 'v': b_verbose = true; if (cdio_loglevel_default > CDIO_LOG_INFO) cdio_loglevel_default = CDIO_LOG_INFO; break; case 'd': debug = 1; if (cdio_loglevel_default > CDIO_LOG_DEBUG) cdio_loglevel_default = CDIO_LOG_DEBUG; break; case 'a': auto_mode = 1; break; case 'L': i_volume_level = atoi(optarg); cd_op = SET_VOLUME; b_interactive = false; break; case 't': if (NULL != (h = strchr(optarg,'-'))) { *h = 0; start_track = atoi(optarg); stop_track = atoi(h+1)+1; if (0 == start_track) start_track = 1; if (1 == stop_track) stop_track = CDIO_CDROM_LEADOUT_TRACK; } else { start_track = atoi(optarg); stop_track = start_track+1; one_track = 1; } b_interactive = false; cd_op = PLAY_TRACK; break; case 'p': b_interactive = false; cd_op = PLAY_CD; break; case 'l': b_interactive = false; cd_op = LIST_TRACKS; break; case 'C': b_interactive = false; cd_op = CLOSE_CD; break; case 'c': b_interactive = false; cd_op = PS_LIST_TRACKS; break; case 's': b_interactive = false; cd_op = STOP_PLAYING; break; case 'S': b_interactive = false; cd_op = LIST_SUBCHANNEL; break; case 'e': b_interactive = false; cd_op = EJECT_CD; break; case 'k': print_keys(); exit(1); case 'h': usage(psz_program); exit(1); default: usage(psz_program); exit(1); } } if (argc > optind) { psz_device_global = strdup(argv[optind]); } else { char **ppsz_cdda_drives=NULL; char **ppsz_all_cd_drives = cdio_get_devices_ret(&driver_id); if (!ppsz_all_cd_drives) { fprintf(stderr, "Can't find a CD-ROM drive\n"); exit(2); } ppsz_cdda_drives = cdio_get_devices_with_cap(ppsz_all_cd_drives, CDIO_FS_AUDIO, false); if (!ppsz_cdda_drives || !ppsz_cdda_drives[0]) { fprintf(stderr, "Can't find a CD-ROM drive with a CD-DA in it\n"); cdio_free_device_list(ppsz_all_cd_drives); exit(3); } psz_device_global = strdup(ppsz_cdda_drives[0]); cdio_free_device_list(ppsz_all_cd_drives); cdio_free_device_list(ppsz_cdda_drives); } if (!b_interactive) { b_sig = true; nostop=1; } tty_raw(); signal(SIGINT,ctrlc); signal(SIGQUIT,ctrlc); signal(SIGTERM,ctrlc); signal(SIGHUP,ctrlc); signal(SIGWINCH, sigwinch); if (CLOSE_CD != cd_op) { /* open device */ if (b_verbose) fprintf(stderr, "open %s... ", psz_device_global); p_cdio_global = cdio_open (psz_device_global, driver_id); if (!p_cdio_global && cd_op != EJECT_CD) { cd_close(psz_device_global); p_cdio_global = cdio_open (psz_device_global, driver_id); } if (p_cdio_global && b_verbose) fprintf(stderr,"ok\n"); } if (b_interactive) { #ifdef HAVE_CDDB cddb_log_set_handler (cddb_log_handler); #else ; #endif } else { b_sig = true; nostop=1; if (EJECT_CD == cd_op) { i_rc = cd_eject() ? 0 : 1; } else if (STOP_PLAYING == cd_op) { b_cd = true; i_rc = cd_stop(p_cdio_global) ? 0 : 1; goto done; } else { switch (cd_op) { case PS_LIST_TRACKS: case LIST_TRACKS: case PLAY_TRACK: read_toc(p_cdio_global); default: break; } if (p_cdio_global) switch (cd_op) { case STOP_PLAYING: b_cd = true; i_rc = cd_stop(p_cdio_global) ? 0 : 1; break; case EJECT_CD: /* Should have been handled above. */ cd_eject(); break; case LIST_TRACKS: list_tracks(); break; case PS_LIST_TRACKS: ps_list_tracks(); break; case PLAY_TRACK: /* play just this one track */ if (b_record) { printf("%s / %s\n", artist, title); if (one_track) printf("%s\n", cd_info[start_track].title); } i_rc = play_track(start_track, stop_track) ? 0 : 1; break; case PLAY_CD: if (b_record) printf("%s / %s\n", artist, title); play_track(1,CDIO_CDROM_LEADOUT_TRACK); break; case SET_VOLUME: i_rc = set_volume_level(p_cdio_global, i_volume_level); break; case LIST_SUBCHANNEL: if (read_subchannel(p_cdio_global)) { if (sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED || sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) { { printf("track %2d - %02x:%02x (%02x:%02x abs) ", sub.track, sub.rel_addr.m, sub.rel_addr.s, sub.abs_addr.m, sub.abs_addr.s); } } printf("drive state: %s\n", mmc_audio_state2str(sub.audio_status)); } else { i_rc = 1; } break; case CLOSE_CD: /* Handled below */ case LIST_KEYS: case TOGGLE_PAUSE: case EXIT_PROGRAM: case NO_OP: break; } else if (CLOSE_CD == cd_op) { i_rc = (DRIVER_OP_SUCCESS == cdio_close_tray(psz_device_global, NULL)) ? 0 : 1; } else { fprintf(stderr,"no CD in drive (%s)\n", psz_device_global); } } } /* Play all tracks *unless* we have a play or paused status already. */ read_subchannel(p_cdio_global); if (sub.audio_status != CDIO_MMC_READ_SUB_ST_PAUSED && sub.audio_status != CDIO_MMC_READ_SUB_ST_PLAY) play_track(1, CDIO_CDROM_LEADOUT_TRACK); while ( !b_sig ) { int key; if (!b_cd) read_toc(p_cdio_global); read_subchannel(p_cdio_global); display_status(false); if (1 == select_wait(b_cd ? 1 : 5)) { switch (key = getch()) { case '-': decrease_volume_level(p_cdio_global); break; case '+': increase_volume_level(p_cdio_global); break; case 'A': case 'a': auto_mode = !auto_mode; break; case 'X': case 'x': nostop=1; /* fall through */ case 'Q': case 'q': b_sig = true; break; case 'E': case 'e': cd_eject(); break; case 's': cd_stop(p_cdio_global); break; case 'C': case 'c': cd_close(psz_device_global); break; case 'L': case 'l': b_all_tracks = !b_all_tracks; if (b_all_tracks) display_tracks(); else { i_last_display_track = CDIO_INVALID_TRACK; display_cdinfo(p_cdio_global, i_tracks_global, i_first_track_global); } break; case 'K': case 'k': case 'h': case 'H': case '?': list_keys(); break; case ' ': case 'P': case 'p': toggle_pause(); break; case KEY_RIGHT: if (b_cd && (sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED || sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY)) play_track(sub.track+1, CDIO_CDROM_LEADOUT_TRACK); else play_track(1,CDIO_CDROM_LEADOUT_TRACK); break; case KEY_LEFT: if (b_cd && (sub.audio_status == CDIO_MMC_READ_SUB_ST_PAUSED || sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY)) play_track(sub.track-1,CDIO_CDROM_LEADOUT_TRACK); break; case KEY_UP: if (b_cd && sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) skip(10); break; case KEY_DOWN: if (b_cd && sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) skip(-10); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': play_track(key - '0', CDIO_CDROM_LEADOUT_TRACK); break; case '0': play_track(10, CDIO_CDROM_LEADOUT_TRACK); break; case KEY_F(1): case KEY_F(2): case KEY_F(3): case KEY_F(4): case KEY_F(5): case KEY_F(6): case KEY_F(7): case KEY_F(8): case KEY_F(9): case KEY_F(10): case KEY_F(11): case KEY_F(12): case KEY_F(13): case KEY_F(14): case KEY_F(15): case KEY_F(16): case KEY_F(17): case KEY_F(18): case KEY_F(19): case KEY_F(20): play_track(key - KEY_F(1) + 11, CDIO_CDROM_LEADOUT_TRACK); break; } } } if (!nostop) cd_stop(p_cdio_global); tty_restore(); done: finish("bye", i_rc); return 0; /* keep compiler happy */ } libcdio-2.2.0/src/cddb.c000066400000000000000000000072621474051130400147550ustar00rootroot00000000000000/* Copyright (C) 2005, 2008, 2009, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include "cddb.h" cddb_opts_t cddb_opts; /*! Returns the sum of the decimal digits in a number. Eg. 1955 = 20 */ static int cddb_dec_digit_sum(int n) { int ret=0; for (;;) { ret += n%10; n = n/10; if (!n) return ret; } } /*! Compute the CDDB disk ID for an Audio disk. This is a funny checksum consisting of the concatenation of 3 things: the sum of the decimal digits of sizes of all tracks, the total length of the disk, and the number of tracks. */ uint32_t cddb_discid(CdIo_t *p_cdio, track_t i_tracks) { int i,t,n=0; msf_t start_msf; msf_t msf; for (i = 1; i <= i_tracks; i++) { cdio_get_track_msf(p_cdio, i, &msf); n += cddb_dec_digit_sum(cdio_audio_get_msf_seconds(&msf)); } cdio_get_track_msf(p_cdio, 1, &start_msf); cdio_get_track_msf(p_cdio, CDIO_CDROM_LEADOUT_TRACK, &msf); t = cdio_audio_get_msf_seconds(&msf)-cdio_audio_get_msf_seconds(&start_msf); return ((n % 0xff) << 24 | t << 8 | i_tracks); } #ifdef HAVE_CDDB bool init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn, cddb_disc_t **pp_cddb_disc, error_fn_t errmsg, track_t i_first_track, track_t i_tracks, int *i_cddb_matches) { track_t i; *pp_conn = cddb_new(); *pp_cddb_disc = NULL; if (!*pp_conn) { errmsg("unable to initialize libcddb"); return false; } if (NULL == cddb_opts.email) cddb_set_email_address(*pp_conn, "me@home"); else cddb_set_email_address(*pp_conn, cddb_opts.email); if (NULL == cddb_opts.server) cddb_set_server_name(*pp_conn, "gnudb.gnudb.org"); else cddb_set_server_name(*pp_conn, cddb_opts.server); if (cddb_opts.timeout >= 0) cddb_set_timeout(*pp_conn, cddb_opts.timeout); cddb_set_server_port(*pp_conn, cddb_opts.port); if (cddb_opts.http) cddb_http_enable(*pp_conn); else cddb_http_disable(*pp_conn); if (NULL != cddb_opts.cachedir) cddb_cache_set_dir(*pp_conn, cddb_opts.cachedir); if (cddb_opts.disable_cache) cddb_cache_disable(*pp_conn); *pp_cddb_disc = cddb_disc_new(); if (!*pp_cddb_disc) { errmsg("unable to create CDDB disc structure"); cddb_destroy(*pp_conn); return false; } for(i = 0; i < i_tracks; i++) { cddb_track_t *t = cddb_track_new(); cddb_track_set_frame_offset(t, cdio_get_track_lba(p_cdio, i+i_first_track)); cddb_disc_add_track(*pp_cddb_disc, t); } cddb_disc_set_length(*pp_cddb_disc, cdio_get_track_lba(p_cdio, CDIO_CDROM_LEADOUT_TRACK) / CDIO_CD_FRAMES_PER_SEC); if (!cddb_disc_calc_discid(*pp_cddb_disc)) { errmsg("libcddb calc discid failed."); cddb_destroy(*pp_conn); return false; } *i_cddb_matches = cddb_query(*pp_conn, *pp_cddb_disc); if (-1 == *i_cddb_matches) errmsg(cddb_error_str(cddb_errno(*pp_conn))); cddb_read(*pp_conn, *pp_cddb_disc); return true; } #endif /*HAVE_CDDB*/ libcdio-2.2.0/src/cddb.h000066400000000000000000000034031474051130400147530ustar00rootroot00000000000000/* $Id: cddb.h,v 1.6 2008/06/25 08:01:54 rocky Exp $ Copyright (C) 2005, 2007, 2008, 2009 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ typedef struct cddb_opts_s { char *email; /* email to report to CDDB server. */ char *server; /* CDDB server to contact */ int port; /* port number to contact CDDB server. */ int http; /* 1 if use http proxy */ int timeout; bool disable_cache; /* If set the below is meaningless. */ char *cachedir; } cddb_opts_t; extern cddb_opts_t cddb_opts; /*! Compute the CDDB disk ID for an Audio disk. This is a funny checksum consisting of the concatenation of 3 things: the sum of the decimal digits of sizes of all tracks, the total length of the disk, and the number of tracks. */ uint32_t cddb_discid(CdIo_t *p_cdio, track_t i_tracks); #ifdef HAVE_CDDB #include typedef void (*error_fn_t) (const char *msg); bool init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn, cddb_disc_t **pp_cddb_disc, error_fn_t errmsg, track_t i_first_track, track_t i_tracks, int *i_cddb_matches); #endif libcdio-2.2.0/src/cdinfo-linux.c000066400000000000000000000571301474051130400164570ustar00rootroot00000000000000/* $Id: cdinfo-linux.c,v 1.4 2008/04/14 17:30:27 karl Exp $ Copyright (C) 2003,2008 Rocky Bernstein Copyright (C) 1996,1997,1998 Gerd Knorr and Heiko Eifeldt 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* CD Info - prints various information about a CD, and detects the type of the CD. usage: cdinfo [options] [ dev ] */ #define PROGRAM_NAME "CD Info" #define CDINFO_VERSION "2.0" #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef __linux__ # include # include # if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,50) # include # endif #endif #include #include #include #ifdef ENABLE_NLS #include # include # define _(String) dgettext ("cdinfo", String) #else /* Stubs that do something close enough. */ # define _(String) (String) #endif /* The following test is to work around the gross typo in systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE is defined to 0, not 1. */ #if !EXIT_FAILURE # undef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif /* Used by `main' to communicate with `parse_opt'. And global options */ struct arguments { bool show_tracks; bool show_ioctl; bool show_analysis; int debug_level; bool silent; } opts; #define DEBUG 1 #if DEBUG #define dbg_print(level, s, args...) \ if (opts.debug_level >= level) \ fprintf(stderr, "%s: "s, __func__ , ##args) #else #define dbg_print(level, s, args...) #endif #define err_exit(fmt, args...) \ fprintf(stderr, "%s: "fmt, program_name, ##args); \ myexit(EXIT_FAILURE) /* Subject: -65- How can I read an IRIX (EFS) CD-ROM on a machine which doesn't use EFS? Date: 18 Jun 1995 00:00:01 EST You want 'efslook', at ftp://viz.tamu.edu/pub/sgi/software/efslook.tar.gz. and ! Robert E. Seastrom 's software (with source ! code) for using an SGI CD-ROM on a Macintosh is at ! ftp://bifrost.seastrom.com/pub/mac/CDROM-Jumpstart.sit151.hqx. */ #define FS_NO_DATA 0 /* audio only */ #define FS_HIGH_SIERRA 1 #define FS_ISO_9660 2 #define FS_INTERACTIVE 3 #define FS_HFS 4 #define FS_UFS 5 #define FS_EXT2 6 #define FS_ISO_HFS 7 /* both hfs & isofs filesystem */ #define FS_ISO_9660_INTERACTIVE 8 /* both CD-RTOS and isofs filesystem */ #define FS_3DO 9 #define FS_UNKNOWN 15 #define FS_MASK 15 #define XA 16 #define MULTISESSION 32 #define PHOTO_CD 64 #define HIDDEN_TRACK 128 #define CDTV 256 #define BOOTABLE 512 #define VIDEOCDI 1024 #define ROCKRIDGE 2048 #define JOLIET 4096 /* Some interesting sector numbers. */ #define ISO_SUPERBLOCK_SECTOR 16 #define UFS_SUPERBLOCK_SECTOR 4 #define BOOT_SECTOR 17 #define VCD_INFO_SECTOR 150 #if 0 #define STRONG "\033[1m" #define NORMAL "\033[0m" #else #define STRONG "__________________________________\n" #define NORMAL "" #endif typedef struct signature { unsigned int buf_num; unsigned int offset; const char *sig_str; const char *description; } signature_t; #define IS_ISOFS 0 #define IS_CD_I 1 #define IS_CDTV 2 #define IS_CD_RTOS 3 #define IS_HS 4 #define IS_BRIDGE 5 #define IS_XA 6 #define IS_PHOTO_CD 7 #define IS_EXT2 8 #define IS_UFS 9 #define IS_BOOTABLE 10 #define IS_VIDEO_CD 11 static signature_t sigs[] = { /* Buff off look for description */ {0, 1, "CD001", "ISO 9660"}, {0, 1, "CD-I", "CD-I"}, {0, 8, "CDTV", "CDTV"}, {0, 8, "CD-RTOS", "CD-RTOS"}, {0, 9, "CDROM", "HIGH SIERRA"}, {0, 16, "CD-BRIDGE", "BRIDGE"}, {0, 1024, "CD-XA001", "XA"}, {1, 64, "PPPPHHHHOOOOTTTTOOOO____CCCCDDDD", "PHOTO CD"}, {1, 0x438, "\x53\xef", "EXT2 FS"}, {2, 1372, "\x54\x19\x01\x0", "UFS"}, {3, 7, "EL TORITO", "BOOTABLE"}, {4, 0, "VIDEO_CD", "VIDEO CD"}, { 0 } }; int filehandle; /* Handle of /dev/>cdrom< */ int rc; /* return code */ int i,j; /* index */ int isofs_size = 0; /* size of session */ int start_track; /* first sector of track */ int ms_offset; /* multisession offset found by track-walking */ int data_start; /* start of data area */ int joliet_level = 0; char buffer[6][CDIO_CD_FRAMESIZE_RAW]; /* for CD-Data */ CdIo *img; track_t num_tracks; track_t first_track_num; struct cdrom_tocentry *toc[CDIO_CDROM_LEADOUT_TRACK+1]; /* TOC-entries */ struct cdrom_mcn mcn; struct cdrom_multisession ms; struct cdrom_subchnl sub; int first_data = -1; /* # of first data track */ int num_data = 0; /* # of data tracks */ int first_audio = -1; /* # of first audio track */ int num_audio = 0; /* # of audio tracks */ char *devname = NULL; char *program_name; const char *argp_program_version = PROGRAM_NAME CDINFO_VERSION; const char *argp_program_bug_address = "rocky@gnu.org"; /* Program documentation. */ const char doc[] = PROGRAM_NAME " -- Get information about a Compact Disk or CD image."; /* A description of the arguments we accept. */ const char args_doc[] = "[DEVICE or DISK-IMAGE]"; static struct argp_option options[] = { {"debug", 'd', "LEVEL", 0, "Set debugging to LEVEL"}, {"quiet", 'q', 0, 0, "Don't produce any output" }, {"silent", 's', 0, OPTION_ALIAS }, {"notracks", 'T', 0, 0, "Don't show track information"}, {"noanalyze",'A', 0, 0, "Don't filesystem analysis"}, {"noioctl", 'I', 0, 0, "Don't show ioctl() information"}, { 0 } }; /* Parse a single option. */ static error_t parse_opt (int key, char *arg, struct argp_state *state) { /* Get the INPUT argument from `argp_parse', which we know is a pointer to our arguments structure. */ struct arguments *arguments = state->input; switch (key) { case 'q': case 's': arguments->silent = 1; break; case 'd': /* Default debug level is 1. */ arguments->debug_level = arg ? atol(arg): 1; break; case 'I': arguments->show_ioctl = false; break; case 'T': arguments->show_tracks = false; break; case 'A': arguments->show_analysis = false; break; case ARGP_KEY_ARG: /* Let the next case parse it. */ return ARGP_ERR_UNKNOWN; break; case ARGP_KEY_ARGS: { /* Check that only one device given. If so, handle it. */ unsigned int num_remaining_args = state->argc - state->next; char **remaining_args = state->argv + state->next; if (num_remaining_args > 1) { argp_usage (state); } if (0 == strncmp(remaining_args[0],"/dev/",5)) devname = remaining_args[0]; else { devname=malloc(6+strlen(remaining_args[0])); sprintf(devname,"/dev/%s", remaining_args[0]); } } break; default: return ARGP_ERR_UNKNOWN; } return 0; } static void print_version (void) { printf( _("CD Info %s | (c) 2003 Gerd Knorr, Heiko Eifeldt & R. Bernstein\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ PARTICULAR PURPOSE.\n\ "), CDINFO_VERSION); } /* ------------------------------------------------------------------------ */ /* some ISO 9660 fiddling */ static int read_block(int superblock, uint32_t offset, uint8_t bufnum, bool is_green) { memset(buffer[bufnum], 0, CDIO_CD_FRAMESIZE); dbg_print(2, "about to read sector %u\n", offset+superblock); if (cdio_read_mode2_sector(img, buffer[bufnum], offset+superblock, !is_green)) return -1; /* For now compare with what we get the old way.... */ if (0 > lseek(filehandle, CDIO_CD_FRAMESIZE*(offset+superblock), SEEK_SET)) return -1; memset(buffer[5],0,CDIO_CD_FRAMESIZE); if (0 > read(filehandle,buffer[5], CDIO_CD_FRAMESIZE)) return -1; if (memcmp(buffer[bufnum], buffer[5], CDIO_CD_FRAMESIZE) != 0) { dbg_print(0, "libcdio conversion problem in reading super, buf %d\n", bufnum); } return 0; } static bool is_it(int num) { signature_t *sigp; /* TODO: check that num < largest sig. */ sigp = &sigs[num]; int len = strlen(sigp->sig_str); return 0 == memcmp(&buffer[sigp->buf_num][sigp->offset], sigp->sig_str, len); } static int is_hfs(void) { return (0 == memcmp(&buffer[1][512],"PM",2)) || (0 == memcmp(&buffer[1][512],"TS",2)) || (0 == memcmp(&buffer[1][1024], "BD",2)); } static int is_3do(void) { return (0 == memcmp(&buffer[1][0],"\x01\x5a\x5a\x5a\x5a\x5a\x01", 7)) && (0 == memcmp(&buffer[1][40], "CD-ROM", 6)); } static int is_joliet(void) { return 2 == buffer[3][0] && buffer[3][88] == 0x25 && buffer[3][89] == 0x2f; } /* ISO 9660 volume space in M2F1_SECTOR_SIZE byte units */ static int get_size(void) { return ((buffer[0][80] & 0xff) | ((buffer[0][81] & 0xff) << 8) | ((buffer[0][82] & 0xff) << 16) | ((buffer[0][83] & 0xff) << 24)); } static int get_joliet_level( void ) { switch (buffer[3][90]) { case 0x40: return 1; case 0x43: return 2; case 0x45: return 3; } return 0; } #define is_it_dbg(sig) \ if (is_it(sig)) printf("%s, ", sigs[sig].description) static int guess_filesystem(int start_session, bool is_green) { int ret = 0; if (read_block(ISO_SUPERBLOCK_SECTOR, start_session, 0, is_green) < 0) return FS_UNKNOWN; if (opts.debug_level > 0) { /* buffer is defined */ is_it_dbg(IS_CD_I); is_it_dbg(IS_CD_RTOS); is_it_dbg(IS_ISOFS); is_it_dbg(IS_HS); is_it_dbg(IS_BRIDGE); is_it_dbg(IS_XA); is_it_dbg(IS_CDTV); puts(""); } /* filesystem */ if (is_it(IS_CD_I) && is_it(IS_CD_RTOS) && !is_it(IS_BRIDGE) && !is_it(IS_XA)) { return FS_INTERACTIVE; } else { /* read sector 0 ONLY, when NO greenbook CD-I !!!! */ if (read_block(0, start_session, 1, true) < 0) return ret; if (opts.debug_level > 0) { /* buffer[1] is defined */ is_it_dbg(IS_PHOTO_CD); if (is_hfs()) printf("HFS, "); is_it_dbg(IS_EXT2); if (is_3do()) printf("3DO, "); puts(""); } if (is_it(IS_HS)) ret |= FS_HIGH_SIERRA; else if (is_it(IS_ISOFS)) { if (is_it(IS_CD_RTOS) && is_it(IS_BRIDGE)) ret = FS_ISO_9660_INTERACTIVE; else if (is_hfs()) ret = FS_ISO_HFS; else ret = FS_ISO_9660; isofs_size = get_size(); #if 0 if (is_rockridge()) ret |= ROCKRIDGE; #endif if (read_block(BOOT_SECTOR, start_session, 3, true) < 0) return ret; if (opts.debug_level > 0) { /* buffer[3] is defined */ if (is_joliet()) printf("JOLIET, "); puts(""); is_it_dbg(IS_BOOTABLE); puts(""); } if (is_joliet()) { joliet_level = get_joliet_level(); ret |= JOLIET; } if (is_it(IS_BOOTABLE)) ret |= BOOTABLE; if (is_it(IS_BRIDGE) && is_it(IS_XA) && is_it(IS_ISOFS) && is_it(IS_CD_RTOS) && !is_it(IS_PHOTO_CD)) { if (read_block(VCD_INFO_SECTOR, start_session, 4, true) < 0) return ret; if (opts.debug_level > 0) { /* buffer[4] is defined */ is_it_dbg(IS_VIDEO_CD); puts(""); } if (is_it(IS_VIDEO_CD)) ret |= VIDEOCDI; } } else if (is_hfs()) ret |= FS_HFS; else if (is_it(IS_EXT2)) ret |= FS_EXT2; else if (is_3do()) ret |= FS_3DO; else { if (read_block(UFS_SUPERBLOCK_SECTOR, start_session, 2, true) < 0) return ret; if (opts.debug_level > 0) { /* buffer[2] is defined */ is_it_dbg(IS_UFS); puts(""); } if (is_it(IS_UFS)) ret |= FS_UFS; else ret |= FS_UNKNOWN; } } /* other checks */ if (is_it(IS_XA)) ret |= XA; if (is_it(IS_PHOTO_CD)) ret |= PHOTO_CD; if (is_it(IS_CDTV)) ret |= CDTV; return ret; } static void myexit(int rc) { close(filehandle); cdio_destroy(img); exit(rc); } /* ------------------------------------------------------------------------ */ /* CDDB */ /* Returns the sum of the decimal digits in a number. Eg. 1955 = 20 */ static int cddb_dec_digit_sum(int n) { int ret=0; for (;;) { ret += n%10; n = n/10; if (!n) return ret; } } /* Return the number of seconds (discarding frame portion) of an MSF */ static inline unsigned int msf_seconds(msf_t *msf) { return cdio_from_bcd8(msf->m)*60 + cdio_from_bcd8(msf->s); } /* Compute the CDDB disk ID for an Audio disk. This is a funny checksum consisting of the concatenation of 3 things: the sum of the decimal digits of sizes of all tracks, the total length of the disk, and the number of tracks. */ static unsigned long cddb_discid() { int i,t,n=0; msf_t start_msf; msf_t msf; for (i = 1; i <= num_tracks; i++) { cdio_get_track_msf(img, i, &msf); n += cddb_dec_digit_sum(msf_seconds(&msf)); } cdio_get_track_msf(img, 1, &start_msf); cdio_get_track_msf(img, CDIO_CDROM_LEADOUT_TRACK, &msf); t = msf_seconds(&msf) - msf_seconds(&start_msf); return ((n % 0xff) << 24 | t << 8 | num_tracks); } /* CDIO logging routines */ static cdio_log_handler_t gl_default_log_handler = NULL; static void _log_handler (cdio_log_level_t level, const char message[]) { if (level == CDIO_LOG_DEBUG && opts.debug_level < 2) return; if (level == CDIO_LOG_INFO && opts.debug_level < 1) return; if (level == CDIO_LOG_WARN && opts.silent) return; gl_default_log_handler (level, message); } static void print_analysis(int fs, int num_audio) { int need_lf; switch(fs & FS_MASK) { case FS_NO_DATA: if (num_audio > 0) printf("Audio CD, CDDB disc ID is %08lx\n", cddb_discid()); break; case FS_ISO_9660: printf("CD-ROM with ISO 9660 filesystem"); if (fs & JOLIET) printf(" and joliet extension level %d", joliet_level); if (fs & ROCKRIDGE) printf(" and rockridge extensions"); printf("\n"); break; case FS_ISO_9660_INTERACTIVE: printf("CD-ROM with CD-RTOS and ISO 9660 filesystem\n"); break; case FS_HIGH_SIERRA: printf("CD-ROM with High Sierra filesystem\n"); break; case FS_INTERACTIVE: printf("CD-Interactive%s\n", num_audio > 0 ? "/Ready" : ""); break; case FS_HFS: printf("CD-ROM with Macintosh HFS\n"); break; case FS_ISO_HFS: printf("CD-ROM with both Macintosh HFS and ISO 9660 filesystem\n"); break; case FS_UFS: printf("CD-ROM with Unix UFS\n"); break; case FS_EXT2: printf("CD-ROM with Linux second extended filesystem\n"); break; case FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); break; case FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; } switch(fs & FS_MASK) { case FS_ISO_9660: case FS_ISO_9660_INTERACTIVE: case FS_ISO_HFS: printf("ISO 9660: %i blocks, label `%.32s'\n", isofs_size, buffer[0]+40); break; } need_lf = 0; if (first_data == 1 && num_audio > 0) need_lf += printf("mixed mode CD "); if (fs & XA) need_lf += printf("XA sectors "); if (fs & MULTISESSION) need_lf += printf("Multisession, offset = %i ",ms_offset); if (fs & HIDDEN_TRACK) need_lf += printf("Hidden Track "); if (fs & PHOTO_CD) need_lf += printf("%sPhoto CD ", num_audio > 0 ? " Portfolio " : ""); if (fs & CDTV) need_lf += printf("Commodore CDTV "); if (first_data > 1) need_lf += printf("CD-Plus/Extra "); if (fs & BOOTABLE) need_lf += printf("bootable CD "); if (fs & VIDEOCDI && num_audio == 0) need_lf += printf("Video CD "); if (need_lf) puts(""); } /* ------------------------------------------------------------------------ */ /* Our argp parser. */ static struct argp argp = { options, parse_opt, args_doc, doc }; int main(int argc, char *argv[]) { int fs=0; gl_default_log_handler = cdio_log_set_handler (_log_handler); program_name = strrchr(argv[0],'/'); program_name = program_name ? program_name+1 : argv[0]; /* Default option values. */ opts.silent = false; opts.debug_level = 0; opts.show_tracks = true; opts.show_ioctl = true; opts.show_analysis = true; /* Parse our arguments; every option seen by `parse_opt' will be reflected in `arguments'. */ argp_parse (&argp, argc, argv, 0, 0, &opts); print_version(); if (devname==NULL) { devname=strdup(cdio_get_default_device(img)); } img = cdio_open (devname, DRIVER_UNKNOWN); /* open device */ filehandle = open(devname,O_RDONLY); if (filehandle == -1) { err_exit("%s: %s\n", devname, strerror(errno)); } first_track_num = cdio_get_first_track_num(img); num_tracks = cdio_get_num_tracks(img); if (opts.show_tracks) { printf(STRONG "Track List (%i - %i)\n" NORMAL, first_track_num, num_tracks); printf(" nr: MSF LSN Ctrl Adr Type\n"); } /* Read and possibly print track information. */ for (i = first_track_num; i <= CDIO_CDROM_LEADOUT_TRACK; i++) { msf_t msf; toc[i] = malloc(sizeof(struct cdrom_tocentry)); if (toc[i] == NULL) { err_exit("out of memory"); } memset(toc[i],0,sizeof(struct cdrom_tocentry)); toc[i]->cdte_track = i; toc[i]->cdte_format = CDROM_MSF; if (ioctl(filehandle,CDROMREADTOCENTRY,toc[i])) { err_exit("read TOC entry ioctl failed for track %i, give up\n", i); } if (!cdio_get_track_msf(img, i, &msf)) { err_exit("cdio_track_msf for track %i failed, I give up.\n", i); } if (opts.show_tracks) { printf("%3d: %2.2x:%2.2x:%2.2x (%06d) 0x%x 0x%x %s%s\n", (int) i, msf.m, msf.s, msf.f, cdio_msf_to_lsn(&msf), (int)toc[i]->cdte_ctrl, (int)toc[i]->cdte_adr, track_format2str[cdio_get_track_format(img, i)], CDIO_CDROM_LEADOUT_TRACK == i ? " (leadout)" : ""); } if (i == CDIO_CDROM_LEADOUT_TRACK) break; if (TRACK_FORMAT_DATA == cdio_get_track_format(img, i)) { num_data++; if (-1 == first_data) first_data = i; } else { num_audio++; if (-1 == first_audio) first_audio = i; } /* skip to leadout */ if (i == num_tracks) i = CDIO_CDROM_LEADOUT_TRACK-1; } if (opts.show_ioctl) { printf(STRONG "What ioctl's report...\n" NORMAL); /* get mcn */ printf("Get MCN : "); fflush(stdout); if (ioctl(filehandle,CDROM_GET_MCN, &mcn)) printf("FAILED\n"); else printf("%s\n",mcn.medium_catalog_number); /* get disk status */ printf("disc status : "); fflush(stdout); switch (ioctl(filehandle,CDROM_DISC_STATUS,0)) { case CDS_NO_INFO: printf("no info\n"); break; case CDS_NO_DISC: printf("no disc\n"); break; case CDS_AUDIO: printf("audio\n"); break; case CDS_DATA_1: printf("data mode 1\n"); break; case CDS_DATA_2: printf("data mode 2\n"); break; case CDS_XA_2_1: printf("XA mode 1\n"); break; case CDS_XA_2_2: printf("XA mode 2\n"); break; default: printf("unknown (failed?)\n"); } /* get multisession */ printf("multisession: "); fflush(stdout); ms.addr_format = CDROM_LBA; if (ioctl(filehandle,CDROMMULTISESSION,&ms)) printf("FAILED\n"); else printf("%d%s\n",ms.addr.lba,ms.xa_flag?" XA":""); /* get audio status from subchnl */ printf("audio status: "); fflush(stdout); sub.cdsc_format = CDROM_MSF; if (ioctl(filehandle,CDROMSUBCHNL,&sub)) printf("FAILED\n"); else { switch (sub.cdsc_audiostatus) { case CDROM_AUDIO_INVALID: printf("invalid\n"); break; case CDROM_AUDIO_PLAY: printf("playing"); break; case CDROM_AUDIO_PAUSED: printf("paused"); break; case CDROM_AUDIO_COMPLETED: printf("completed\n"); break; case CDROM_AUDIO_ERROR: printf("error\n"); break; case CDROM_AUDIO_NO_STATUS: printf("no status\n"); break; default: printf("Oops: unknown\n"); } if (sub.cdsc_audiostatus == CDROM_AUDIO_PLAY || sub.cdsc_audiostatus == CDROM_AUDIO_PAUSED) { printf(" at: %02d:%02d abs / %02d:%02d track %d\n", sub.cdsc_absaddr.msf.minute, sub.cdsc_absaddr.msf.second, sub.cdsc_reladdr.msf.minute, sub.cdsc_reladdr.msf.second, sub.cdsc_trk); } } } if (opts.show_analysis) { printf(STRONG "try to find out what sort of CD this is\n" NORMAL); /* try to find out what sort of CD we have */ if (0 == num_data) { /* no data track, may be a "real" audio CD or hidden track CD */ msf_t msf; cdio_get_track_msf(img, 1, &msf); start_track = cdio_msf_to_lsn(&msf); /* CD-I/Ready says start_track <= 30*75 then CDDA */ if (start_track > 100 /* 100 is just a guess */) { fs = guess_filesystem(0, false); if ((fs & FS_MASK) != FS_UNKNOWN) fs |= HIDDEN_TRACK; else { fs &= ~FS_MASK; /* del filesystem info */ printf("Oops: %i unused sectors at start, but hidden track check failed.\n",start_track); } } print_analysis(fs, num_audio); } else { /* we have data track(s) */ for (j = 2, i = first_data; i <= num_tracks; i++) { msf_t msf; track_format_t track_format = cdio_get_track_format(img, i); cdio_get_track_msf(img, i, &msf); switch ( track_format ) { case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: case TRACK_FORMAT_DATA: case TRACK_FORMAT_PSX: ; } start_track = (i == 1) ? 0 : cdio_msf_to_lsn(&msf); /* save the start of the data area */ if (i == first_data) data_start = start_track; /* skip tracks which belong to the current walked session */ if (start_track < data_start + isofs_size) continue; fs = guess_filesystem(start_track, cdio_get_track_green(img, i)); if (i > 1) { /* track is beyond last session -> new session found */ ms_offset = start_track; printf("session #%d starts at track %2i, LSN: %6i," " ISO 9660 blocks: %6i\n", j++, i, start_track, isofs_size); printf("ISO 9660: %i blocks, label `%.32s'\n", isofs_size, buffer[0]+40); fs |= MULTISESSION; } else { print_analysis(fs, num_audio); } if (!(((fs & FS_MASK) == FS_ISO_9660 || (fs & FS_MASK) == FS_ISO_HFS || /* (fs & FS_MASK) == FS_ISO_9660_INTERACTIVE) && (fs & XA))) */ (fs & FS_MASK) == FS_ISO_9660_INTERACTIVE))) break; /* no method for non-iso9660 multisessions */ } } } myexit(EXIT_SUCCESS); /* Not reached:*/ return(EXIT_SUCCESS); } libcdio-2.2.0/src/getopt.c000066400000000000000000001021571474051130400153620ustar00rootroot00000000000000/* Getopt for GNU. NOTE: getopt is part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #include extern int getopt (int argc, char *const *argv, const char *optstring); /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #include #ifdef _LIBC # include #else # define _(msgid) (msgid) #endif #if defined _LIBC # include #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" #include "getopt_int.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Keep a global copy of all internal members of getopt_data. */ static struct _getopt_data getopt_data; #ifndef __GNU_LIBRARY__ /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (const char *_VarName); #endif #endif /* not __GNU_LIBRARY__ */ #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (d->__nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv, struct _getopt_data *d) { int bottom = d->__first_nonopt; int middle = d->__last_nonopt; int top = d->optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, d->__nonoption_flags_max_len), '\0', top + 1 - d->__nonoption_flags_max_len); d->__nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ d->__first_nonopt += (d->optind - d->__last_nonopt); d->__last_nonopt = d->optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (int argc, char *const *argv, const char *optstring, struct _getopt_data *d, int posixly_correct) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ d->__first_nonopt = d->__last_nonopt = d->optind; d->__nextchar = NULL; d->__posixly_correct = posixly_correct | !!getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { d->__ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { d->__ordering = REQUIRE_ORDER; ++optstring; } else if (d->__posixly_correct) d->__ordering = REQUIRE_ORDER; else d->__ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (!d->__posixly_correct && argc == __libc_argc && argv == __libc_argv) { if (d->__nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') d->__nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = d->__nonoption_flags_max_len = strlen (orig_str); if (d->__nonoption_flags_max_len < argc) d->__nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (d->__nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) d->__nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', d->__nonoption_flags_max_len - len); } } d->__nonoption_flags_len = d->__nonoption_flags_max_len; } else d->__nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal_r (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only, struct _getopt_data *d, int posixly_correct) { int print_errors = d->opterr; if (argc < 1) return -1; d->optarg = NULL; if (d->optind == 0 || !d->__initialized) { if (d->optind == 0) d->optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct); d->__initialized = 1; } else if (optstring[0] == '-' || optstring[0] == '+') optstring++; if (optstring[0] == ':') print_errors = 0; /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ || (d->optind < d->__nonoption_flags_len \ && __getopt_nonoption_flags[d->optind] == '1')) #else # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') #endif if (d->__nextchar == NULL || *d->__nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (d->__last_nonopt > d->optind) d->__last_nonopt = d->optind; if (d->__first_nonopt > d->optind) d->__first_nonopt = d->optind; if (d->__ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__last_nonopt != d->optind) d->__first_nonopt = d->optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (d->optind < argc && NONOPTION_P) d->optind++; d->__last_nonopt = d->optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (d->optind != argc && !strcmp (argv[d->optind], "--")) { d->optind++; if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__first_nonopt == d->__last_nonopt) d->__first_nonopt = d->optind; d->__last_nonopt = argc; d->optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (d->optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (d->__first_nonopt != d->__last_nonopt) d->optind = d->__first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (d->__ordering == REQUIRE_ORDER) return -1; d->optarg = argv[d->optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ d->__nextchar = (argv[d->optind] + 1 + (longopts != NULL && argv[d->optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[d->optind][1] == '-' || (long_only && (argv[d->optind][2] || !strchr (optstring, argv[d->optind][1]))))) { char *nameend; unsigned int namelen; const struct option *p; const struct option *pfound = NULL; struct option_list { const struct option *p; struct option_list *next; } *ambig_list = NULL; int exact = 0; int indfound = -1; int option_index; for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; namelen = nameend - d->__nextchar; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, namelen)) { if (namelen == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) { /* Second or later nonexact match found. */ struct option_list *newp = alloca (sizeof (*newp)); newp->p = p; newp->next = ambig_list; ambig_list = newp; } } if (ambig_list != NULL && !exact) { if (print_errors) { struct option_list first; first.p = pfound; first.next = ambig_list; ambig_list = &first; #if defined _LIBC char *buf = NULL; size_t buflen = 0; FILE *fp = open_memstream (&buf, &buflen); if (fp != NULL) { fprintf (fp, _("%s: option '%s' is ambiguous; possibilities:"), argv[0], argv[d->optind]); do { fprintf (fp, " '--%s'", ambig_list->p->name); ambig_list = ambig_list->next; } while (ambig_list != NULL); fputc_unlocked ('\n', fp); if (__builtin_expect (fclose (fp) != EOF, 1)) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } } #else fprintf (stderr, _("%s: option '%s' is ambiguous; possibilities:"), argv[0], argv[d->optind]); do { fprintf (stderr, " '--%s'", ambig_list->p->name); ambig_list = ambig_list->next; } while (ambig_list != NULL); fputc ('\n', stderr); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; d->optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; d->optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC char *buf; int n; #endif if (argv[d->optind - 1][1] == '-') { /* --option */ #if defined _LIBC n = __asprintf (&buf, _("\ %s: option '--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option '--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC n = __asprintf (&buf, _("\ %s: option '%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option '%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #endif } #if defined _LIBC if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC char *buf; if (__asprintf (&buf, _("\ %s: option '--%s' requires an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option '--%s' requires an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[d->optind][1] == '-' || strchr (optstring, *d->__nextchar) == NULL) { if (print_errors) { #if defined _LIBC char *buf; int n; #endif if (argv[d->optind][1] == '-') { /* --option */ #if defined _LIBC n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"), argv[0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option '--%s'\n"), argv[0], d->__nextchar); #endif } else { /* +option or -option */ #if defined _LIBC n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option '%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #endif } #if defined _LIBC if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar = (char *) ""; d->optind++; d->optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *d->__nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*d->__nextchar == '\0') ++d->optind; if (temp == NULL || c == ':' || c == ';') { if (print_errors) { #if defined _LIBC char *buf; int n; #endif #if defined _LIBC n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c); #endif #if defined _LIBC if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; if (longopts == NULL) goto no_longs; /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { #if defined _LIBC char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- '%c'\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- '%c'\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `d->optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC char *buf; if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"), argv[0], d->optarg) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"), argv[0], d->optarg); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC char *buf; if (__asprintf (&buf, _("\ %s: option '-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("\ %s: option '-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC char *buf; if (__asprintf (&buf, _("\ %s: option '-W %s' requires an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("\ %s: option '-W %s' requires an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); return optstring[0] == ':' ? ':' : '?'; } } else d->optarg = NULL; d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } no_longs: d->__nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; d->optind++; } else d->optarg = NULL; d->__nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { #if defined _LIBC char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- '%c'\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- '%c'\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; d->__nextchar = NULL; } } return c; } } int _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct) { int result; getopt_data.optind = optind; getopt_data.opterr = opterr; result = _getopt_internal_r (argc, argv, optstring, longopts, longind, long_only, &getopt_data, posixly_correct); optind = getopt_data.optind; optarg = getopt_data.optarg; optopt = getopt_data.optopt; return result; } int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0, 0); } #ifdef _LIBC int __posix_getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0, 1); } #endif #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value '%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ libcdio-2.2.0/src/getopt.h000066400000000000000000000156111474051130400153650ustar00rootroot00000000000000/* Declarations for getopt. Copyright (C) 1989-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif #ifdef __KLIBC__ /* OS/2 kLIBC has already getopt(). So to avoid name clash, rename them here. */ #define optarg libcdio_optarg #define optind libcdio_optind #define opterr libcdio_opterr #define optopt libcdio_optopt #define getopt libcdio_getopt #define getopt_long libcdio_getopt_long #define getopt_long_only libcdio_getopt_long_only #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifdef __GNU_LIBRARY__ /* 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. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; # if defined __need_getopt && defined __USE_POSIX2 \ && !defined __USE_POSIX_IMPLICITLY && !defined __USE_GNU /* The GNU getopt has more functionality than the standard version. The additional functionality can be disable at runtime. This redirection helps to also do this at runtime. */ # ifdef __REDIRECT extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv, const char *__shortopts), __posix_getopt); # else extern int __posix_getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; # define getopt __posix_getopt # endif # endif #else /* not __GNU_LIBRARY__ */ extern int getopt (int argc, char *const *argv, const char *optstring); #endif /* __GNU_LIBRARY__ */ #ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ libcdio-2.2.0/src/getopt1.c000066400000000000000000000111161474051130400154350ustar00rootroot00000000000000/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifdef HAVE_CONFIG_H #include #endif #ifdef _LIBC # include #else # include "getopt.h" #endif #include "getopt_int.h" #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 0, 0); } int _getopt_long_r (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 0, d, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 1, 0); } int _getopt_long_only_r (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, d, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ libcdio-2.2.0/src/getopt_int.h000066400000000000000000000111631474051130400162350ustar00rootroot00000000000000/* Internal declarations for getopt. Copyright (C) 1989-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_INT_H #define _GETOPT_INT_H 1 extern int _getopt_internal (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int posixly_correct); /* Reentrant versions which can handle parsing multiple argument vectors at the same time. */ /* Data type for reentrant functions. */ struct _getopt_data { /* These have exactly the same meaning as the corresponding global variables, except that they are used for the reentrant versions of getopt. */ int optind; int opterr; int optopt; char *optarg; /* Internal members. */ /* True if the internal members have been initialized. */ int __initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ char *__nextchar; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } __ordering; /* If the POSIXLY_CORRECT environment variable is set. */ int __posixly_correct; /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ int __first_nonopt; int __last_nonopt; #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; # endif }; /* The initializer is necessary to set OPTIND and OPTERR to their default values and to clear the initialization flag. */ #define _GETOPT_DATA_INITIALIZER { 1, 1 } extern int _getopt_internal_r (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, struct _getopt_data *__data, int posixly_correct); extern int _getopt_long_r (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); extern int _getopt_long_only_r (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); #endif /* getopt_int.h */ libcdio-2.2.0/src/iso-info.c000066400000000000000000000362661474051130400156120ustar00rootroot00000000000000/* Copyright (C) 2004-2006, 2008, 2012-2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* ISO Info - prints various information about a ISO 9660 image. */ #include "getopt.h" #include "util.h" #undef err_exit #define err_exit(fmt, args...) \ report (stderr, "%s: "fmt, program_name, ##args); \ iso9660_close(p_iso); \ if (NULL != program_name) free(program_name); \ if (NULL != source_name) free(source_name); \ return(EXIT_FAILURE); #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include #include #include #include #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ALLOCA_H #include #endif #ifdef HAVE_INTTYPES_H #include #endif #if 0 #define STRONG "\033[1m" #define NORMAL "\033[0m" #else #define STRONG "__________________________________\n" #define NORMAL "" #endif /* TODO: Find a better place from where cd-info can read it too. */ /* ECMA-119 allows only a depth of 8 directories. Nobody obeys. Rock Ridge allows path length 1023. This would be max depth 512. */ #define CDIO_MAX_DIR_RECURSION 512 /* Used by `main' to communicate with `parse_opt'. And global options */ static struct arguments { uint32_t debug_level; int version_only; int silent; int no_header; int no_joliet; int no_xa; int no_rock_ridge; int print_iso9660; int print_udf; int print_iso9660_short; int64_t show_rock_ridge; } opts; /* Configuration option codes */ enum { OP_HANDLED = 0, OP_USAGE, /* These are the remaining configuration options */ OP_VERSION, }; /* Parse a all options. */ static bool parse_options (int argc, char *argv[]) { int opt; int rc = EXIT_FAILURE; static const char helpText[] = "Usage: %s [OPTION...]\n" " -d, --debug=UINT Set debugging to LEVEL\n" " -i, --input[=FILE] Filename to read ISO-9960 image from\n" " -f Generate output similar to 'find . -print'\n" " -l, --iso9660 output similar to 'ls -lR' for an ISO 9660 fs\n" " -U, --udf output similar to 'ls -lR' for a UDF fs\n" " --no-header Don't display header and copyright (for regression\n" #ifdef HAVE_JOLIET " --no-joliet Don't use Joliet-extension information\n" #endif /*HAVE_JOLIET*/ " --no-rock-ridge Don't use Rock-Ridge-extension information\n" " --no-xa Don't use XA-extension information\n" " -r --show-rock-ridge UINT Show if image uses Rock-Ridge extensions\n" " A maximum of UINT files will be considered.\n" " Use 0 for all files.\n" " -q, --quiet Don't produce warning output\n" " -V, --version display version and copyright information and exit\n" "\n" "Help options:\n" " -?, --help Show this help message\n" " --usage Display brief usage message\n"; static const char usageText[] = "Usage: %s [-i|--input FILE] [-f] [-l|--iso9660] [-U|--udf]\n" " [--no-header] [--no-joliet] [--no-rock-ridge] [--show-rock-ridge] [--no-xa] [-q|--quiet]\n" " [-d|--debug INT] [-V|--version] [-?|--help] [--usage]\n"; static const char optionsString[] = "d:i::flUqV?"; static const struct option optionsTable[] = { {"debug", required_argument, NULL, 'd'}, {"input", optional_argument, NULL, 'i'}, {"iso9660", no_argument, NULL, 'l'}, {"udf", no_argument, NULL, 'U'}, {"no-header", no_argument, &opts.no_header, 1 }, #ifdef HAVE_JOLIET {"no-joliet", no_argument, &opts.no_joliet, 1 }, #endif /*HAVE_JOLIET*/ {"no-rock-ridge", no_argument, &opts.no_rock_ridge, 1 }, {"no-xa", no_argument, &opts.no_xa, 1 }, {"quiet", no_argument, NULL, 'q'}, {"show-rock-ridge", required_argument, NULL, 'r' }, {"version", no_argument, NULL, 'V'}, {"help", no_argument, NULL, '?' }, {"usage", no_argument, NULL, OP_USAGE }, { NULL, 0, NULL, 0 } }; program_name = strrchr(argv[0],'/'); program_name = program_name ? strdup(program_name+1) : strdup(argv[0]); while ((opt = getopt_long(argc, argv, optionsString, optionsTable, NULL)) >= 0) { switch (opt) { case 'd': opts.debug_level = atoi(optarg); break; case 'i': if (optarg != NULL) { if (NULL != source_name) free(source_name); source_name = strdup(optarg); break; } case 'f': opts.print_iso9660_short = 1; break; case 'l': opts.print_iso9660 = 1; break; case 'U': opts.print_udf = 1; break; case 'q': opts.silent = 1; break; case 'r': opts.show_rock_ridge = atoll(optarg); break; case 'V': opts.version_only = 1; break; case '?': fprintf(stdout, helpText, program_name); rc = EXIT_INFO; goto error_exit; case OP_USAGE: fprintf(stderr, usageText, program_name); rc = EXIT_INFO; goto error_exit; case OP_HANDLED: break; } } if (optind < argc) { const char *remaining_arg = argv[optind++]; if ( optind < argc ) { report( stderr, "%s: Source specified in previously %s and %s\n", program_name, source_name, remaining_arg ); goto error_exit; } if (NULL != source_name) free(source_name); source_name = strdup(remaining_arg); } return true; error_exit: free(program_name); exit(rc); } /* CDIO logging routines */ static void _log_handler (cdio_log_level_t level, const char message[]) { if (level == CDIO_LOG_DEBUG && opts.debug_level < 2) return; if (level == CDIO_LOG_INFO && opts.debug_level < 1) return; if (level == CDIO_LOG_WARN && opts.silent) return; if (level == CDIO_LOG_ERROR) { // print an error like default, but *don't* exit. fprintf (stderr, "**ERROR: %s\n", message); fflush (stderr); return; } gl_default_cdio_log_handler (level, message); } static void print_iso9660_recurse (iso9660_t *p_iso, const char psz_path[], unsigned int rec_counter) { CdioISO9660FileList_t *entlist; CdioISO9660DirList_t *p_dirlist = iso9660_dirlist_new(); CdioListNode_t *entnode; uint8_t i_joliet_level = iso9660_ifs_get_joliet_level(p_iso); char *translated_name = (char *) alloca(4096); size_t translated_name_size = 4096; entlist = iso9660_ifs_readdir (p_iso, psz_path); if (opts.print_iso9660) { printf ("%s:\n", psz_path); } if (NULL == entlist) { iso9660_dirlist_free(p_dirlist); report( stderr, "Error getting above directory information\n" ); return; } rec_counter++; if (rec_counter > CDIO_MAX_DIR_RECURSION) { iso9660_dirlist_free(p_dirlist); iso9660_filelist_free(entlist); report( stderr, "Directory recursion too deep. ISO most probably damaged.\n" ); return; } /* Iterate over files in this directory */ _CDIO_LIST_FOREACH (entnode, entlist) { iso9660_stat_t *p_statbuf = _cdio_list_node_data (entnode); char *psz_iso_name = p_statbuf->filename; char _fullname[4096] = { 0, }; if (strlen(psz_iso_name) >= translated_name_size) { translated_name_size = strlen(psz_iso_name)+1; } if (yep != p_statbuf->rr.b3_rock || 1 == opts.no_rock_ridge) { iso9660_name_translate_ext(psz_iso_name, translated_name, i_joliet_level); snprintf (_fullname, sizeof (_fullname), "%s%s", psz_path, translated_name); } else { snprintf (_fullname, sizeof (_fullname), "%s%s", psz_path, psz_iso_name); } strncat (_fullname, "/", sizeof(_fullname) - strlen(_fullname) - 1); if (p_statbuf->type == _STAT_DIR && strcmp (psz_iso_name, ".") && strcmp (psz_iso_name, "..")) _cdio_list_append (p_dirlist, strdup (_fullname)); if (opts.print_iso9660) { print_fs_attrs(p_statbuf, 0 == opts.no_rock_ridge, iso9660_ifs_is_xa(p_iso) && 0 == opts.no_xa, psz_iso_name, translated_name); } else { if ( strcmp (psz_iso_name, ".") && strcmp (psz_iso_name, "..")) printf("%9" PRIu64 " %s%s\n", p_statbuf->total_size, psz_path, yep == p_statbuf->rr.b3_rock ? psz_iso_name : translated_name); } } iso9660_filelist_free(entlist); if (opts.print_iso9660) { printf ("\n"); } /* Now recurse over the directories. */ _CDIO_LIST_FOREACH (entnode, p_dirlist) { char *_fullname = _cdio_list_node_data (entnode); print_iso9660_recurse (p_iso, _fullname, rec_counter); } iso9660_dirlist_free(p_dirlist); } static void print_iso9660_fs (iso9660_t *iso) { print_iso9660_recurse (iso, "/", 0); } static void print_udf_file_info(const udf_dirent_t *p_udf_dirent, const char* psz_dirname, const char *psz_filename) { time_t mod_time = udf_get_modification_time(p_udf_dirent); char date_str[30]; char psz_mode[11]="invalid"; const char *psz_fname= psz_filename ? psz_filename : udf_get_filename(p_udf_dirent); if (!opts.print_iso9660) { if (strcmp(psz_dirname, ".") != 0) { printf("%9lu ", (long unsigned int) udf_get_file_length(p_udf_dirent)); printf("/%s", psz_dirname); printf("%s\n", *psz_fname ? psz_fname : "/"); } return; } /* Print directory attributes*/ printf("%s ", udf_mode_string(udf_get_posix_filemode(p_udf_dirent), psz_mode)); /* fake uid/gid */ printf("0 0 "); printf("%3d ", udf_get_link_count(p_udf_dirent)); printf("%9lu ", (long unsigned int) udf_get_file_length(p_udf_dirent)); strftime(date_str, sizeof(date_str), "%b %d %Y %H:%M:%S ", localtime(&mod_time)); printf("%s %s", date_str, *psz_fname ? psz_fname : "/"); printf("\n"); } static void list_udf_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const char *psz_path) { if (!p_udf_dirent) return; if (opts.print_iso9660) { printf ("\n/%s:\n", psz_path); } print_udf_file_info(p_udf_dirent, psz_path, "."); while (udf_readdir(p_udf_dirent)) { if (udf_is_dir(p_udf_dirent)) { udf_dirent_t *p_udf_dirent2 = udf_opendir(p_udf_dirent); if (p_udf_dirent2) { const char *psz_dirname = udf_get_filename(p_udf_dirent); const unsigned int i_newlen=2 + strlen(psz_path) + strlen(psz_dirname); char *psz_newpath = calloc(1, sizeof(char)*i_newlen); snprintf(psz_newpath, i_newlen, "%s%s/", psz_path, psz_dirname); list_udf_files(p_udf, p_udf_dirent2, psz_newpath); free(psz_newpath); } } else { print_udf_file_info(p_udf_dirent, psz_path, NULL); } } } static int print_udf_fs (void) { udf_t *p_udf; p_udf = udf_open (source_name); if (NULL == p_udf) { fprintf(stderr, "Sorry, couldn't open %s as something using UDF\n", source_name); return 1; } else { udf_dirent_t *p_udf_root = udf_get_root(p_udf, true, 0); if (NULL == p_udf_root) { fprintf(stderr, "Sorry, couldn't find / in %s\n", source_name); return 1; } list_udf_files(p_udf, p_udf_root, ""); } udf_close(p_udf); return 0; } /* Initialize global variables. */ static void init(void) { gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler); /* Default option values. */ opts.silent = false; opts.no_header = false; opts.no_joliet = 0; opts.no_rock_ridge = 0; opts.no_xa = 0; opts.debug_level = 0; opts.print_iso9660 = 0; opts.print_iso9660_short = 0; opts.show_rock_ridge = -1; } #define print_vd_info(title, fn) \ if (fn(p_iso, &psz_str)) { \ printf(title ": %s\n", psz_str); \ } \ free(psz_str); \ psz_str = NULL; /* ------------------------------------------------------------------------ */ int main(int argc, char *argv[]) { iso9660_t *p_iso=NULL; iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL; init(); /* Parse our arguments; every option seen by `parse_opt' will be reflected in `arguments'. */ parse_options(argc, argv); print_version(program_name, CDIO_VERSION, opts.no_header, opts.version_only); if (opts.debug_level == 3) { cdio_loglevel_default = CDIO_LOG_INFO; } else if (opts.debug_level >= 4) { cdio_loglevel_default = CDIO_LOG_DEBUG; } if (source_name==NULL) { err_exit("No input device given/found%s\n", ""); } if (opts.no_joliet) { iso_extension_mask &= ~ISO_EXTENSION_JOLIET; } p_iso = iso9660_open_ext (source_name, iso_extension_mask); if (p_iso==NULL) { err_exit("Error in opening ISO-9660 image%s\n", ""); } if (opts.silent == 0) { char *psz_str = NULL; uint8_t u_joliet_level = iso9660_ifs_get_joliet_level(p_iso); printf(STRONG "ISO 9660 image: %s\n", source_name); print_vd_info("Application ", iso9660_ifs_get_application_id); print_vd_info("Preparer ", iso9660_ifs_get_preparer_id); print_vd_info("Publisher ", iso9660_ifs_get_publisher_id); print_vd_info("System ", iso9660_ifs_get_system_id); print_vd_info("Volume ", iso9660_ifs_get_volume_id); print_vd_info("Volume Set ", iso9660_ifs_get_volumeset_id); if (opts.show_rock_ridge >= 0) { switch (iso9660_have_rr(p_iso, (uint64_t) opts.show_rock_ridge)) { case yep: printf("Rock Ridge : yes\n"); break; case nope: printf("Rock Ridge : no\n"); break; case dunno: printf("Rock Ridge : possibly not\n"); } } if (u_joliet_level == 0) { printf("No Joliet extensions\n"); } else { printf("Joliet Level: %u\n", u_joliet_level); } } if (opts.print_iso9660 || opts.print_iso9660_short) { printf(STRONG "ISO-9660 Information\n" NORMAL); if (opts.print_iso9660 && opts.print_iso9660_short) { printf("Note: both -f and -l options given -- " "-l (long listing) takes precidence\n"); } print_iso9660_fs(p_iso); } else if (opts.print_udf) { print_udf_fs(); } free(source_name); iso9660_close(p_iso); /* Not reached:*/ free(program_name); return(EXIT_SUCCESS); } libcdio-2.2.0/src/iso-info.help2man000066400000000000000000000003551474051130400170640ustar00rootroot00000000000000[NAME] iso-info \- shows Information about an ISO 9660 image [SEE ALSO] \&\f(CWcd-info(1)\fR for information about an ISO-9660 image. \&\f(CWcd-read(1)\fR to read portions of an ISO 9660 image. [AUTHOR] Rocky Bernstein libcdio-2.2.0/src/iso-read.c000066400000000000000000000245541474051130400155670ustar00rootroot00000000000000/* Copyright (C) 2004-2006, 2008, 2012-2013, 2017-2018, 2021 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Program to read ISO-9660 images. */ #include "util.h" #include "portable.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "getopt.h" #define CEILING(x, y) ((x+(y-1))/y) /* Used by `main' to communicate with `parse_opt'. And global options */ static struct arguments { char *file_name; char *output_file; char *iso9660_image; int debug_level; int no_header; int ignore; int udf; } opts; /* Parse a options. */ static bool parse_options (int argc, char *argv[]) { int opt; int rc = EXIT_FAILURE; /* Configuration option codes */ enum { OP_HANDLED = 0, OP_VERSION=1, OP_USAGE }; static const char helpText[] = "Usage: %s [OPTION...]\n" " -d, --debug=INT Set debugging to LEVEL.\n" " -i, --image=FILE Read from ISO-9660 image. This option is mandatory\n" " -e, --extract=FILE Extract FILE from ISO-9660 image. This option is\n" " mandatory.\n" " -k, --ignore Ignore read error(s), i.e. keep going\n" " --no-header Don't display header and copyright (for\n" " regression testing)\n" " -o, --output-file=FILE Output file. This option is mandatory.\n" " -U --udf Contents are in UDF format\n" " -V, --version display version and copyright information and exit\n" "\n" "Help options:\n" " -?, --help Show this help message\n" " --usage Display brief usage message\n"; static const char usageText[] = "Usage: %s [-d|--debug INT] [-i|--image FILE] [-e|--extract FILE]\n" " [--no-header] [-o|--output-file FILE] [-U|--udf]\n" " [-V|--version] [-?|--help] [--usage]\n"; /* Command-line options */ static const char* optionsString = "d:i:e:o:VUk?"; static const struct option optionsTable[] = { {"debug", required_argument, NULL, 'd' }, {"image", required_argument, NULL, 'i' }, {"extract", required_argument, NULL, 'e' }, {"no-header", no_argument, &opts.no_header, 1 }, {"ignore", no_argument, &opts.ignore, 'k' }, {"output-file", required_argument, NULL, 'o' }, {"udf", no_argument, &opts.udf, 'U' }, {"version", no_argument, NULL, 'V' }, {"help", no_argument, NULL, '?' }, {"usage", no_argument, NULL, OP_USAGE }, { NULL, 0, NULL, 0 } }; program_name = strrchr(argv[0],'/'); program_name = program_name ? strdup(program_name+1) : strdup(argv[0]); while ((opt = getopt_long(argc, argv, optionsString, optionsTable, NULL)) != -1) switch (opt) { case 'd': opts.debug_level = atoi(optarg); break; case 'i': opts.iso9660_image = strdup(optarg); break; case 'k': opts.ignore = 1; break; case 'e': opts.file_name = strdup(optarg); break; case 'o': opts.output_file = strdup(optarg); break; case 'U': opts.udf = 1; break; case 'V': print_version(program_name, CDIO_VERSION, 0, true); rc = EXIT_SUCCESS; goto error_exit; case '?': fprintf(stdout, helpText, program_name); rc = EXIT_INFO; goto error_exit; case OP_USAGE: fprintf(stderr, usageText, program_name); rc = EXIT_INFO; goto error_exit; case OP_HANDLED: break; } if (optind < argc) { const char *remaining_arg = argv[optind++]; if (opts.iso9660_image != NULL) { report( stderr, "%s: Source specified as --image %s and as %s\n", program_name, opts.iso9660_image, remaining_arg ); goto error_exit; } opts.iso9660_image = strdup(remaining_arg); if (optind < argc ) { report( stderr, "%s: use only one unnamed argument for the ISO 9660 " "image name\n", program_name ); goto error_exit; } } if (NULL == opts.iso9660_image) { report( stderr, "%s: you need to specify an ISO-9660 image name.\n", program_name ); report( stderr, "%s: Use option --image or try --help.\n", program_name ); goto error_exit; } if (NULL == opts.file_name) { report( stderr, "%s: you need to specify a filename to extract.\n", program_name ); report( stderr, "%s: Use option --extract or try --help.\n", program_name ); goto error_exit; } if (NULL == opts.output_file) { report( stderr, "%s: you need to specify a place write filename extraction to.\n", program_name ); report( stderr, "%s: Use option --output-file or try --help.\n", program_name ); goto error_exit; } return true; error_exit: free(program_name); exit(rc); } static void init(void) { opts.debug_level = 0; opts.ignore = 0; opts.file_name = NULL; opts.output_file = NULL; opts.iso9660_image = NULL; } static int read_iso_file(const char *iso_name, const char *src, FILE *outfd, size_t *bytes_written) { iso9660_stat_t *statbuf; uint64_t i; iso9660_t *iso; iso = iso9660_open_ext (iso_name, ISO_EXTENSION_ALL); if (NULL == iso) { report(stderr, "%s: Sorry, couldn't open ISO-9660 image file '%s'.\n", program_name, iso_name); return 1; } statbuf = iso9660_ifs_stat_translate (iso, src); if (NULL == statbuf) { report(stderr, "%s: Could not get ISO-9660 file information out of %s" " for file %s.\n", program_name, iso_name, src); report(stderr, "%s: iso-info may be able to show the contents of %s.\n", program_name, iso_name); iso9660_close(iso); return 2; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ for (i = 0; i < statbuf->total_size; i += ISO_BLOCKSIZE) { char buf[ISO_BLOCKSIZE]; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (iso, buf, statbuf->lsn + (i / ISO_BLOCKSIZE), 1) ) { report(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) statbuf->lsn + (i / ISO_BLOCKSIZE)); if (!opts.ignore) return 4; } fwrite (buf, ISO_BLOCKSIZE, 1, outfd); if (ferror (outfd)) { perror ("fwrite()"); iso9660_stat_free(statbuf); iso9660_close(iso); return 5; } } iso9660_close(iso); *bytes_written = statbuf->total_size; iso9660_stat_free(statbuf); return 0; } static int read_udf_file(const char *iso_name, const char *src, FILE *outfd, size_t *bytes_written) { udf_t *p_udf; p_udf = udf_open (iso_name); if (NULL == p_udf) { fprintf(stderr, "Sorry, couldn't open %s as something using UDF\n", iso_name); return 1; } else { udf_dirent_t *p_udf_root = udf_get_root(p_udf, true, 0); udf_dirent_t *p_udf_file = NULL; if (NULL == p_udf_root) { fprintf(stderr, "Sorry, couldn't find / in %s\n", iso_name); return 1; } p_udf_file = udf_fopen(p_udf_root, src); if (!p_udf_file) { fprintf(stderr, "Sorry, couldn't find %s in %s\n", src, iso_name); udf_dirent_free(p_udf_root); return 2; } { uint64_t i_file_length = udf_get_file_length(p_udf_file); const unsigned int i_blocks = (unsigned int) CEILING(i_file_length, UDF_BLOCKSIZE); unsigned int i; for (i = 0; i < i_blocks ; i++) { char buf[UDF_BLOCKSIZE] = {'\0',}; ssize_t i_read = udf_read_block(p_udf_file, buf, 1); if ( i_read < 0 ) { fprintf(stderr, "Error reading UDF file %s at block %u\n", src, i); free(p_udf_file); udf_dirent_free(p_udf_root); return 4; } fwrite (buf, i_read, 1, outfd); if (ferror (outfd)) { perror ("fwrite()"); free(p_udf_file); udf_dirent_free(p_udf_root); return 5; } } free(p_udf_file); udf_dirent_free(p_udf_root); udf_close(p_udf); *bytes_written = i_file_length; } } return 0; } int main(int argc, char *argv[]) { FILE *outfd; int ret; size_t bytes_written = 0; init(); /* Parse our arguments; every option seen by `parse_opt' will be reflected in `arguments'. */ if (!parse_options(argc, argv)) { report(stderr, "error while parsing command line - try --help\n"); return 2; } if (!(outfd = fopen (opts.output_file, "wb"))) { report(stderr, "%s: Could not open %s for writing: %s\n", program_name, opts.output_file, strerror(errno)); return 3; } if (opts.udf) { ret = read_udf_file (opts.iso9660_image, opts.file_name, outfd, &bytes_written); } else { ret = read_iso_file (opts.iso9660_image, opts.file_name, outfd, &bytes_written); } if (ret != 0) { fclose (outfd); return ret; } fflush (outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (outfd), bytes_written)) perror ("ftruncate()"); fclose (outfd); return 0; } libcdio-2.2.0/src/iso-read.help2man000066400000000000000000000003501474051130400170370ustar00rootroot00000000000000[NAME] iso-read \- reads portions of an ISO 9660 image [SEE ALSO] \&\f(CWiso-info(1)\fR for information about an ISO-9660 image. \&\f(CWcd-read(1)\fR to read portions of an ISO 9660 image. [AUTHOR] Rocky Bernstein libcdio-2.2.0/src/mmc-tool.c000066400000000000000000000344731474051130400156140ustar00rootroot00000000000000/* Copyright (C) 2006, 2008, 2010-2011, 2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* A program to using the MMC interface to list CD and drive features from the MMC GET_CONFIGURATION command . */ #include "util.h" #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include #include #include "getopt.h" /* Configuration option codes */ typedef enum { OPT_HANDLED = 0, OPT_USAGE, OPT_DRIVE_CAP, OPT_VERSION, } option_t; typedef enum { /* These are the remaining configuration options */ OP_FINISHED = 0, OP_BLOCKSIZE, OP_CLOSETRAY, OP_EJECT, OP_IDLE, OP_INQUIRY, OP_MODE_SENSE_2A, OP_MCN, OP_SPEED, } operation_enum_t; typedef struct { operation_enum_t op; union { long int i_num; char * psz; } arg; } operation_t; enum { MAX_OPS = 10 }; static unsigned int last_op = 0; static operation_t operation[MAX_OPS] = { {OP_FINISHED, {0}} }; static void push_op(operation_t *p_op) { if (last_op < MAX_OPS) { memcpy(&operation[last_op], p_op, sizeof(operation_t)); last_op++; } } /* Parse command-line options. */ static bool parse_options (int argc, char *argv[]) { int opt; int rc = EXIT_FAILURE; operation_t op; int i_blocksize = 0; static const char helpText[] = "Usage: %s [OPTION...]\n" " Issues libcdio Multimedia commands. Operations occur in the order\n" " in which the options are given and a given operation may appear\n" " more than once to have it run more than once.\n" "options: \n" " -b, --blocksize[=INT] set blocksize. If no block size or a \n" " zero blocksize is given we return the\n" " current setting.\n" " -C, --drive-cap [6|10] print mode sense 2a data\n" " using 6-byte or 10-byte form\n" " -c, --close drive close drive via ALLOW_MEDIUM_REMOVAL\n" " -e, --eject [drive] eject drive via ALLOW_MEDIUM_REMOVAL\n" " and a MMC START/STOP command\n" " -I, --idle set CD-ROM to idle or power down\n" " via MMC START/STOP command\n" " -i, --inquiry print HW info via INQUIRY\n" " -m, --mcn get media catalog number (AKA UPC)\n" " -s, --speed-KB=INT Set drive speed to SPEED K bytes/sec\n" " Note: 1x = 176 KB/s \n" " -S, --speed-X=INT Set drive speed to INT X\n" " Note: 1x = 176 KB/s \n" " -V, --version display version and copyright information\n" " and exit\n" "\n" "Help options:\n" " -?, --help Show this help message\n" " --usage Display brief usage message\n"; static const char usageText[] = "Usage: %s [-b|--blocksize[=INT]] [-m|--mcn]\n" " [-I|--idle] [-I|inquiry] [-m[-s|--speed-KB INT]\n" " [-V|--version] [-?|--help] [--usage]\n"; /* Command-line options */ static const char optionsString[] = "b::c:C::e::Iis:V?"; const struct option optionsTable[] = { {"blocksize", optional_argument, &i_blocksize, 'b' }, {"close", required_argument, NULL, 'c'}, {"drive-cap", optional_argument, NULL, 'C'}, {"eject", optional_argument, NULL, 'e'}, {"idle", no_argument, NULL, 'I'}, {"inquiry", no_argument, NULL, 'i'}, {"mcn", no_argument, NULL, 'm'}, {"speed-KB", required_argument, NULL, 's'}, {"speed-X", required_argument, NULL, 'S'}, {"version", no_argument, NULL, 'V'}, {"help", no_argument, NULL, '?' }, {"usage", no_argument, NULL, OPT_USAGE }, { NULL, 0, NULL, 0 } }; while ((opt = getopt_long(argc, argv, optionsString, optionsTable, NULL)) >= 0) switch (opt) { case 'b': op.op = OP_BLOCKSIZE; op.arg.i_num = i_blocksize; push_op(&op); break; case 'C': op.arg.i_num = optarg ? atoi(optarg) : 10; switch (op.arg.i_num) { case 10: op.op = OP_MODE_SENSE_2A; op.arg.i_num = 10; push_op(&op); break; case 6: op.op = OP_MODE_SENSE_2A; op.arg.i_num = 6; push_op(&op); break; default: report( stderr, "%s: Expecting 6 or 10 or nothing\n", program_name ); } break; case 'c': op.op = OP_CLOSETRAY; op.arg.psz = strdup(optarg); push_op(&op); break; case 'e': op.op = OP_EJECT; op.arg.psz=NULL; if (optarg) op.arg.psz = strdup(optarg); push_op(&op); break; case 'i': op.op = OP_INQUIRY; op.arg.psz=NULL; push_op(&op); break; case 'I': op.op = OP_IDLE; op.arg.psz=NULL; push_op(&op); break; case 'm': op.op = OP_MCN; op.arg.psz=NULL; push_op(&op); break; case 's': op.op = OP_SPEED; op.arg.i_num=atoi(optarg); push_op(&op); break; case 'S': op.op = OP_SPEED; op.arg.i_num=176 * atoi(optarg); push_op(&op); break; case 'V': print_version(program_name, VERSION, 0, true); rc = EXIT_SUCCESS; goto error_exit; case '?': fprintf(stdout, helpText, program_name); goto error_exit; case OPT_USAGE: fprintf(stderr, usageText, program_name); goto error_exit; case OPT_HANDLED: break; } if (optind < argc) { const char *remaining_arg = argv[optind++]; if (source_name != NULL) { report( stderr, "%s: Source specified in option %s and as %s\n", program_name, source_name, remaining_arg ); goto error_exit; } source_name = strdup(remaining_arg); if (optind < argc) { report( stderr, "%s: Source specified in previously %s and %s\n", program_name, source_name, remaining_arg ); free(source_name); goto error_exit; } } return true; error_exit: free(program_name); exit(rc); } static void _log_handler (cdio_log_level_t level, const char message[]) { if (level == CDIO_LOG_ERROR) { // print an error like default, but *don't* exit. fprintf (stderr, "**ERROR: %s\n", message); fflush (stderr); return; } gl_default_cdio_log_handler (level, message); } static void init(const char *argv0) { gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler); program_name = strrchr(argv0,'/'); program_name = program_name ? strdup(program_name+1) : strdup(argv0); } static void print_mode_sense (unsigned int i_mmc_size, const uint8_t buf[30]) { printf("Mode sense %d information\n", i_mmc_size); if (buf[2] & 0x01) { printf("\tReads CD-R media.\n"); } if (buf[2] & 0x02) { printf("\tReads CD-RW media.\n"); } if (buf[2] & 0x04) { printf("\tReads fixed-packet tracks when Addressing type is method 2.\n"); } if (buf[2] & 0x08) { printf("\tReads DVD ROM media.\n"); } if (buf[2] & 0x10) { printf("\tReads DVD-R media.\n"); } if (buf[2] & 0x20) { printf("\tReads DVD-RAM media.\n"); } if (buf[2] & 0x40) { printf("\tReads DVD-RAM media.\n"); } if (buf[3] & 0x01) { printf("\tWrites CD-R media.\n"); } if (buf[3] & 0x02) { printf("\tWrites CD-RW media.\n"); } if (buf[3] & 0x04) { printf("\tSupports emulation write.\n"); } if (buf[3] & 0x10) { printf("\tWrites DVD-R media.\n"); } if (buf[3] & 0x20) { printf("\tWrites DVD-RAM media.\n"); } if (buf[4] & 0x01) { printf("\tCan play audio.\n"); } if (buf[4] & 0x02) { printf("\tDelivers composition A/V stream.\n"); } if (buf[4] & 0x04) { printf("\tSupports digital output on port 2.\n"); } if (buf[4] & 0x08) { printf("\tSupports digital output on port 1.\n"); } if (buf[4] & 0x10) { printf("\tReads Mode-2 form 1 (e.g. XA) media.\n"); } if (buf[4] & 0x20) { printf("\tReads Mode-2 form 2 media.\n"); } if (buf[4] & 0x40) { printf("\tReads multi-session CD media.\n"); } if (buf[4] & 0x80) { printf("\tSupports Buffer under-run free recording on CD-R/RW media.\n"); } if (buf[4] & 0x01) { printf("\tCan read audio data with READ CD.\n"); } if (buf[4] & 0x02) { printf("\tREAD CD data stream is accurate.\n"); } if (buf[5] & 0x04) { printf("\tReads R-W subchannel information.\n"); } if (buf[5] & 0x08) { printf("\tReads de-interleaved R-W subchannel.\n"); } if (buf[5] & 0x10) { printf("\tSupports C2 error pointers.\n"); } if (buf[5] & 0x20) { printf("\tReads ISRC information.\n"); } if (buf[5] & 0x40) { printf("\tReads ISRC informaton.\n"); } if (buf[5] & 0x40) { printf("\tReads media catalog number (MCN also known as UPC).\n"); } if (buf[5] & 0x80) { printf("\tReads bar codes.\n"); } if (buf[6] & 0x01) { printf("\tPREVENT/ALLOW may lock media.\n"); } printf("\tLock state is %slocked.\n", (buf[6] & 0x02) ? "" : "un"); printf("\tPREVENT/ALLOW jumper is %spresent.\n", (buf[6] & 0x04) ? "": "not "); if (buf[6] & 0x08) { printf("\tEjects media with START STOP UNIT.\n"); } { const unsigned int i_load_type = (buf[6]>>5 & 0x07); printf("\tLoading mechanism type is %d: ", i_load_type); switch (buf[6]>>5 & 0x07) { case 0: printf("caddy type loading mechanism.\n"); break; case 1: printf("tray type loading mechanism.\n"); break; case 2: printf("popup type loading mechanism.\n"); break; case 3: printf("reserved\n"); break; case 4: printf("changer with individually changeable discs.\n"); break; case 5: printf("changer using Magazine mechanism.\n"); break; case 6: printf("changer using Magazine mechanism.\n"); break; default: printf("Invalid.\n"); break; } } if (buf[7] & 0x01) { printf("\tVolume controls each channel separately.\n"); } if (buf[7] & 0x02) { printf("\tHas a changer that supports disc present reporting.\n"); } if (buf[7] & 0x04) { printf("\tCan load empty slot in changer.\n"); } if (buf[7] & 0x08) { printf("\tSide change capable.\n"); } if (buf[7] & 0x10) { printf("\tReads raw R-W subchannel information from lead in.\n"); } { const unsigned int i_speed_Kbs = CDIO_MMC_GETPOS_LEN16(buf, 8); printf("\tMaximum read speed is %d K bytes/sec (about %dX)\n", i_speed_Kbs, i_speed_Kbs / 176) ; } printf("\tNumber of Volume levels is %d\n", CDIO_MMC_GETPOS_LEN16(buf, 10)); printf("\tBuffers size for data is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 12)); printf("\tCurrent read speed is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 14)); printf("\tMaximum write speed is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 18)); printf("\tCurrent write speed is %d KB\n", CDIO_MMC_GETPOS_LEN16(buf, 28)); } int main(int argc, char *argv[]) { CdIo_t *p_cdio; driver_return_code_t rc = DRIVER_OP_SUCCESS; unsigned int i; init(argv[0]); parse_options(argc, argv); p_cdio = cdio_open (source_name, DRIVER_DEVICE); if (NULL == p_cdio) { printf("Couldn't find CD\n"); rc = 1; goto exit; } for (i=0; i < last_op; i++) { const operation_t *p_op = &operation[i]; switch (p_op->op) { case OP_SPEED: rc = mmc_set_speed(p_cdio, p_op->arg.i_num, 0); report(stdout, "%s (mmc_set_speed): %s\n", program_name, cdio_driver_errmsg(rc)); break; case OP_BLOCKSIZE: if (p_op->arg.i_num) { driver_return_code_t blocksize_rc = mmc_set_blocksize(p_cdio, p_op->arg.i_num); report(stdout, "%s (mmc_set_blocksize): %s\n", program_name, cdio_driver_errmsg(blocksize_rc)); } else { int i_blocksize = mmc_get_blocksize(p_cdio); if (i_blocksize > 0) { report(stdout, "%s (mmc_get_blocksize): %d\n", program_name, i_blocksize); } else { report(stdout, "%s (mmc_get_blocksize): can't retrieve.\n", program_name); } } break; case OP_MODE_SENSE_2A: { uint8_t buf[30] = { 0, }; /* Place to hold returned data */ if (p_op->arg.i_num == 10) { rc = mmc_mode_sense_10(p_cdio, buf, sizeof(buf), CDIO_MMC_CAPABILITIES_PAGE); } else { rc = mmc_mode_sense_6(p_cdio, buf, sizeof(buf), CDIO_MMC_CAPABILITIES_PAGE); } if (DRIVER_OP_SUCCESS == rc) { print_mode_sense(p_op->arg.i_num, buf); } else { report(stdout, "%s (mmc_mode_sense 2a - drive_cap %d): %s\n", program_name, p_op->arg.i_num, cdio_driver_errmsg(rc)); } } break; case OP_CLOSETRAY: rc = mmc_close_tray(p_cdio); report(stdout, "%s (mmc_close_tray): %s\n", program_name, cdio_driver_errmsg(rc)); free(p_op->arg.psz); break; case OP_EJECT: rc = mmc_eject_media(p_cdio); report(stdout, "%s (mmc_eject_media): %s\n", program_name, cdio_driver_errmsg(rc)); if (p_op->arg.psz) free(p_op->arg.psz); break; case OP_IDLE: rc = mmc_start_stop_unit(p_cdio, false, false, true, 0); report(stdout, "%s (mmc_start_stop_media - powerdown): %s\n", program_name, cdio_driver_errmsg(rc)); break; case OP_INQUIRY: { cdio_hwinfo_t hw_info = { "", "", ""}; if (mmc_get_hwinfo(p_cdio, &hw_info)) { printf("%-8s: %s\n%-8s: %s\n%-8s: %s\n", "Vendor" , hw_info.psz_vendor, "Model" , hw_info.psz_model, "Revision", hw_info.psz_revision); } else { report(stdout, "%s (mmc_gpcmd_inquiry error)\n", program_name); } } break; case OP_MCN: { char *psz_mcn = mmc_get_mcn(p_cdio); if (psz_mcn) { report(stdout, "%s (mmc_get_mcn): %s\n", program_name, psz_mcn); cdio_free(psz_mcn); } else report(stdout, "%s (mmc_get_mcn): can't retrieve\n", program_name); } break; default: ; } } exit: free(source_name); free(program_name); cdio_destroy(p_cdio); return rc; } libcdio-2.2.0/src/util.c000066400000000000000000000434441474051130400150400ustar00rootroot00000000000000/* Copyright (C) 2003-2010, 2012-2014, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Miscellaneous things common to standalone programs. */ #include "util.h" #include #include #ifdef HAVE_SYS_STAT_H # include #endif /* MSYS 1.0.10 with MinGW 3.4.2 (and perhaps others) don't have S_ISSOCK() or S_ISLNK() macros, so we'll roll our own. */ #if !defined(HAVE_S_ISSOCK) && !defined(S_ISSOCK) #define S_ISSOCK(st_mode) ((((st_mode)) & 0170000) == (0140000)) #endif #if !defined(HAVE_S_ISLNK) && !defined(S_ISLNK) #define S_ISLNK(st_mode) ((((st_mode)) & 0170000) == (0010000)) #endif cdio_log_handler_t gl_default_cdio_log_handler = NULL; char *source_name = NULL; char *program_name; void myexit(CdIo_t *cdio, int rc) { if (NULL != cdio) cdio_destroy(cdio); if (NULL != program_name) free(program_name); if (NULL != source_name) free(source_name); exit(rc); } void print_version (char *prog_name, const char *version, int no_header, bool version_only) { if (no_header == 0) { report( stdout, "%s version %s\n" "Copyright (c) 2003-2005, 2007-2008, 2011-2015, 2017, 2025 " "R. Bernstein\n", prog_name, version); report( stdout, _("This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ PARTICULAR PURPOSE.\n\ ")); } if (version_only) { char *default_device; const driver_id_t *driver_id_p; for (driver_id_p=cdio_drivers; *driver_id_p!=DRIVER_UNKNOWN; driver_id_p++) { if (cdio_have_driver(*driver_id_p)) { report( stdout, "Have driver: %s\n", cdio_driver_describe(*driver_id_p)); } } default_device=cdio_get_default_device(NULL); if (default_device) report( stdout, "Default CD-ROM device: %s\n", default_device); else report( stdout, "No CD-ROM device found.\n"); free(prog_name); exit(EXIT_INFO); } } /*! Device input routine. If successful we return an open CdIo_t pointer. On error the program exits. */ CdIo_t * open_input(const char *psz_source, source_image_t source_image, const char *psz_access_mode) { CdIo_t *p_cdio = NULL; switch (source_image) { case INPUT_UNKNOWN: case INPUT_AUTO: p_cdio = cdio_open_am (psz_source, DRIVER_UNKNOWN, psz_access_mode); if (!p_cdio) { if (psz_source) { err_exit("Error in automatically selecting driver for input %s.\n", psz_source); } else { err_exit("%s", "Error in automatically selecting driver.\n"); } } break; case INPUT_DEVICE: p_cdio = cdio_open_am (psz_source, DRIVER_DEVICE, psz_access_mode); if (!p_cdio) { if (psz_source) { err_exit("Cannot use CD-ROM device %s. Is a CD loaded?\n", psz_source); } else { err_exit("%s", "Cannot find a CD-ROM with a CD loaded.\n"); } } break; case INPUT_BIN: p_cdio = cdio_open_am (psz_source, DRIVER_BINCUE, psz_access_mode); if (!p_cdio) { if (psz_source) { err_exit("%s: Error in opening CDRWin BIN/CUE image for BIN" " input %s\n", psz_source); } else { err_exit("%s", "Cannot find CDRWin BIN/CUE image.\n"); } } break; case INPUT_CUE: p_cdio = cdio_open_cue(psz_source); if (p_cdio==NULL) { if (psz_source) { err_exit("%s: Error in opening CDRWin BIN/CUE image for CUE" " input %s\n", psz_source); } else { err_exit("%s", "Cannot find CDRWin BIN/CUE image.\n"); } } break; case INPUT_NRG: p_cdio = cdio_open_am (psz_source, DRIVER_NRG, psz_access_mode); if (p_cdio==NULL) { if (psz_source) { err_exit("Error in opening Nero NRG image for input %s\n", psz_source); } else { err_exit("%s", "Cannot find Nero NRG image.\n"); } } break; case INPUT_CDRDAO: p_cdio = cdio_open_am (psz_source, DRIVER_CDRDAO, psz_access_mode); if (p_cdio==NULL) { if (psz_source) { err_exit("Error in opening cdrdao TOC with input %s.\n", psz_source); } else { err_exit("%s", "Cannot find cdrdao TOC image.\n"); } } break; } return p_cdio; } #define DEV_PREFIX "/dev/" char * fillout_device_name(const char *device_name) { #if defined(HAVE_WIN32_CDROM) || defined(HAVE_OS2_CDROM) return strdup(device_name); #else unsigned int prefix_len = strlen(DEV_PREFIX); if (!device_name) return NULL; if (0 == strncmp(device_name, DEV_PREFIX, prefix_len)) return strdup(device_name); else { char *full_device_name = (char*) calloc(1, strlen(device_name)+prefix_len); report( stdout, full_device_name, DEV_PREFIX "%s", device_name); return full_device_name; } #endif } /*! Prints out SCSI-MMC drive features */ void print_mmc_drive_features(CdIo_t *p_cdio) { int i_status; /* Result of SCSI MMC command */ uint8_t buf[65530] = { 0, }; /* Place to hold returned data */ mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Block */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); cdb.field[1] = CDIO_MMC_GET_CONF_ALL_FEATURES; cdb.field[3] = 0x0; i_status = mmc_run_cmd(p_cdio, 0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { uint8_t *p; uint32_t i_data; uint8_t *p_max = buf + sizeof(buf); i_data = (unsigned int) CDIO_MMC_GET_LEN32(buf); /* set to first sense feature code, and then walk through the masks */ p = buf + 8; while( (p < &(buf[i_data])) && (p < p_max) ) { uint16_t i_feature; uint8_t i_feature_additional = p[3]; i_feature = CDIO_MMC_GET_LEN16(p); { const char *feature_str = mmc_feature2str(i_feature); report( stdout, "%s Feature\n", feature_str); switch( i_feature ) { case CDIO_MMC_FEATURE_PROFILE_LIST: { uint8_t *q; for ( q = p+4 ; q < p + i_feature_additional ; q += 4 ) { int i_profile=CDIO_MMC_GET_LEN16(q); const char *feature_profile_str = mmc_feature_profile2str(i_profile); report( stdout, "\t%s", feature_profile_str ); if (q[2] & 1) { report( stdout, " - on"); } report( stdout, "\n"); } report( stdout, "\n"); break; } case CDIO_MMC_FEATURE_CORE: { uint8_t *q = p+4; uint32_t i_interface_standard = CDIO_MMC_GET_LEN32(q); switch(i_interface_standard) { case CDIO_MMC_FEATURE_INTERFACE_UNSPECIFIED: report( stdout, "\tunspecified interface\n"); break; case CDIO_MMC_FEATURE_INTERFACE_SCSI: report( stdout, "\tSCSI interface\n"); break; case CDIO_MMC_FEATURE_INTERFACE_ATAPI: report( stdout, "\tATAPI interface\n"); break; case CDIO_MMC_FEATURE_INTERFACE_IEEE_1394: report( stdout, "\tIEEE 1394 interface\n"); break; case CDIO_MMC_FEATURE_INTERFACE_IEEE_1394A: report( stdout, "\tIEEE 1394A interface\n"); break; case CDIO_MMC_FEATURE_INTERFACE_FIBRE_CH: report( stdout, "\tFibre Channel interface\n"); } report( stdout, "\n"); break; } case CDIO_MMC_FEATURE_MORPHING: report( stdout, "\tOperational Change Request/Notification %ssupported\n", (p[4] & 2) ? "": "not " ); report( stdout, "\t%synchronous GET EVENT/STATUS NOTIFICATION " "supported\n", (p[4] & 1) ? "As": "S" ); report( stdout, "\n"); break; ; case CDIO_MMC_FEATURE_REMOVABLE_MEDIUM: switch(p[4] >> 5) { case 0: report( stdout, "\tCaddy/Slot type loading mechanism\n" ); break; case 1: report( stdout, "\tTray type loading mechanism\n" ); break; case 2: report( stdout, "\tPop-up type loading mechanism\n"); break; case 4: report( stdout, "\tEmbedded changer with individually changeable discs\n"); break; case 5: report( stdout, "\tEmbedded changer using a magazine mechanism\n" ); break; default: report( stdout, "\tUnknown changer mechanism\n" ); } report( stdout, "\tcan%s eject the medium or magazine via the normal " "START/STOP command\n", (p[4] & 8) ? "": "not" ); report( stdout, "\tcan%s be locked into the Logical Unit\n", (p[4] & 1) ? "": "not" ); report( stdout, "\n" ); break; case CDIO_MMC_FEATURE_CD_READ: report( stdout, "\tC2 Error pointers are %ssupported\n", (p[4] & 2) ? "": "not " ); report( stdout, "\tCD-Text is %ssupported\n", (p[4] & 1) ? "": "not " ); report( stdout, "\n" ); break; case CDIO_MMC_FEATURE_ENHANCED_DEFECT: report( stdout, "\t%s-DRM mode is supported\n", (p[4] & 1) ? "DRT": "Persistent" ); report( stdout, "\n" ); break; case CDIO_MMC_FEATURE_CDDA_EXT_PLAY: report( stdout, "\tSCAN command is %ssupported\n", (p[4] & 4) ? "": "not "); report( stdout, "\taudio channels can %sbe muted separately\n", (p[4] & 2) ? "": "not "); report( stdout, "\taudio channels can %shave separate volume levels\n", (p[4] & 1) ? "": "not "); { uint8_t *q = p+6; uint16_t i_vol_levels = CDIO_MMC_GET_LEN16(q); report( stdout, "\t%d volume levels can be set\n", i_vol_levels ); } report( stdout, "\n"); break; case CDIO_MMC_FEATURE_DVD_CSS: #if 0 report( stdout, "\tMedium does%s have Content Scrambling (CSS/CPPM)\n", (p[2] & 1) ? "": "not " ); #endif report( stdout, "\tCSS version %d\n", p[7] ); report( stdout, "\t\n"); break; case CDIO_MMC_FEATURE_LU_SN: { uint8_t i_serial = *(p+3); char serial[257] = { '\0', }; memcpy(serial, p+4, i_serial ); report( stdout, "\t%s\n\n", serial ); break; } default: report( stdout, "\n"); break; } } p += i_feature_additional + 4; } } else { report( stdout, "Didn't get all feature codes\n"); } } /* Prints out drive capabilities */ void print_drive_capabilities(cdio_drive_read_cap_t i_read_cap, cdio_drive_write_cap_t i_write_cap, cdio_drive_misc_cap_t i_misc_cap) { if (CDIO_DRIVE_CAP_ERROR == i_misc_cap) { report( stdout, "Error in getting drive hardware properties\n"); } else if (CDIO_DRIVE_CAP_UNKNOWN == i_misc_cap) { report( stdout, "Uknown drive hardware properties\n"); } else { report( stdout, _("Hardware : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_FILE ? "Disk Image" : "CD-ROM or DVD"); report( stdout, _("Can eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_EJECT ? "Yes" : "No" ); report( stdout, _("Can close tray : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_CLOSE_TRAY ? "Yes" : "No" ); report( stdout, _("Can disable manual eject : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_LOCK ? "Yes" : "No" ); report( stdout, _("Can select juke-box disc : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_DISC ? "Yes" : "No" ); report( stdout, _("Can set drive speed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_SELECT_SPEED ? "Yes" : "No" ); #ifdef FIXME report( stdout, _("Can detect if CD changed : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED ? "Yes" : "No" ); #endif report( stdout, _("Can read multiple sessions (e.g. PhotoCD) : %s\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_MULTI_SESSION ? "Yes" : "No" ); report( stdout, _("Can hard reset device : %s\n\n"), i_misc_cap & CDIO_DRIVE_CAP_MISC_RESET ? "Yes" : "No" ); } if (CDIO_DRIVE_CAP_ERROR == i_read_cap) { report( stdout, "Error in getting drive reading properties\n" ); } else if (CDIO_DRIVE_CAP_UNKNOWN == i_misc_cap) { report( stdout, "Uknown drive reading properties\n" ); } else { report( stdout, "Reading....\n"); report( stdout, _(" Can read Mode 2 Form 1 : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_MODE2_FORM1 ? "Yes" : "No" ); report( stdout, _(" Can read Mode 2 Form 2 : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_MODE2_FORM2 ? "Yes" : "No" ); report( stdout, _(" Can read (S)VCD (i.e. Mode 2 Form 1/2) : %s\n"), i_read_cap & (CDIO_DRIVE_CAP_READ_MODE2_FORM1|CDIO_DRIVE_CAP_READ_MODE2_FORM2) ? "Yes" : "No" ); report( stdout, _(" Can read C2 Errors : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_C2_ERRS ? "Yes" : "No" ); report( stdout, _(" Can read IRSC : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_ISRC ? "Yes" : "No" ); report( stdout, _(" Can read Media Channel Number (or UPC) : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_MCN ? "Yes" : "No" ); report( stdout, _(" Can play audio : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_AUDIO ? "Yes" : "No" ); report( stdout, _(" Can read CD-DA : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_DA ? "Yes" : "No" ); report( stdout, _(" Can read CD-R : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_R ? "Yes" : "No" ); report( stdout, _(" Can read CD-RW : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_CD_RW ? "Yes" : "No" ); report( stdout, _(" Can read DVD-ROM : %s\n"), i_read_cap & CDIO_DRIVE_CAP_READ_DVD_ROM ? "Yes" : "No" ); } if (CDIO_DRIVE_CAP_ERROR == i_write_cap) { report( stdout, "Error in getting drive writing properties\n" ); } else if (CDIO_DRIVE_CAP_UNKNOWN == i_misc_cap) { report( stdout, "Uknown drive writing properties\n" ); } else { report( stdout, "\nWriting....\n"); #ifdef FIXED report( stdout, _(" Can write using Burn Proof : %s\n"), i_write_cap & CDIO_DRIVE_CAP_WRITE_BURN_PROOF ? "Yes" : "No" ); #endif report( stdout, _(" Can write CD-RW : %s\n"), i_write_cap & CDIO_DRIVE_CAP_WRITE_CD_RW ? "Yes" : "No" ); report( stdout, _(" Can write DVD-R : %s\n"), i_write_cap & CDIO_DRIVE_CAP_WRITE_DVD_R ? "Yes" : "No" ); report( stdout, _(" Can write DVD-RAM : %s\n"), i_write_cap & CDIO_DRIVE_CAP_WRITE_DVD_RAM ? "Yes" : "No" ); report( stdout, _(" Can write DVD-RW : %s\n"), i_write_cap & CDIO_DRIVE_CAP_WRITE_DVD_RW ? "Yes" : "No" ); report( stdout, _(" Can write DVD+RW : %s\n"), i_write_cap & CDIO_DRIVE_CAP_WRITE_DVD_RPW ? "Yes" : "No" ); } } /*! Common place for output routine. In some environments, like XBOX, it may not be desireable to send output to stdout and stderr. */ void report (FILE *stream, const char *psz_format, ...) { va_list args; va_start (args, psz_format); #ifdef _XBOX OutputDebugString(psz_format, args); #else vfprintf (stream, psz_format, args); #endif va_end(args); } /* Prints "ls"-like file attributes */ void print_fs_attrs(iso9660_stat_t *p_statbuf, bool b_rock, bool b_xa, const char *psz_name_untranslated, const char *psz_name_translated) { char date_str[30]; double total_size, m2f2_size; #ifdef HAVE_ROCK if (yep == p_statbuf->rr.b3_rock && b_rock) { total_size = (double) (S_ISLNK(p_statbuf->rr.st_mode) ? strlen(p_statbuf->rr.psz_symlink) : p_statbuf->total_size ); report ( stdout, " %s %3d %d %d [LSN %6lu] %9.f", iso9660_get_rock_attr_str (p_statbuf->rr.st_mode), p_statbuf->rr.st_nlinks, p_statbuf->rr.st_uid, p_statbuf->rr.st_gid, (long unsigned int) p_statbuf->lsn, total_size ); } else #endif if (b_xa) { report ( stdout, " %s %d %d [fn %.2d] [LSN %6lu] ", iso9660_get_xa_attr_str (p_statbuf->xa.attributes), uint16_from_be (p_statbuf->xa.user_id), uint16_from_be (p_statbuf->xa.group_id), p_statbuf->xa.filenum, (long unsigned int) p_statbuf->lsn ); total_size = (double) p_statbuf->total_size; if (uint16_from_be(p_statbuf->xa.attributes) & XA_ATTR_MODE2FORM2) { m2f2_size = (double) CDIO_EXTENT_BLOCKS(p_statbuf->total_size) * M2F2_SECTOR_SIZE; report ( stdout, "%9.f (%9.f)", m2f2_size, total_size ); } else report (stdout, "%9.f", total_size); } else { total_size = (double) p_statbuf->total_size; report ( stdout," %c [LSN %6lu] %9.f", (p_statbuf->type == _STAT_DIR) ? 'd' : '-', (long unsigned int) p_statbuf->lsn, total_size ); } if (yep == p_statbuf->rr.b3_rock && b_rock) { struct tm tm; strftime(date_str, sizeof(date_str), "%b %d %Y %H:%M:%S ", &p_statbuf->tm); /* Now try the proper field for mtime: attributes */ if (p_statbuf->rr.modify.b_used) { if (p_statbuf->rr.modify.b_longdate) { iso9660_get_ltime(&p_statbuf->rr.modify.t.ltime, &tm); } else { iso9660_get_dtime(&p_statbuf->rr.modify.t.dtime, true, &tm); } strftime(date_str, sizeof(date_str), "%b %d %Y %H:%M:%S ", &tm); } report (stdout," %s %s", date_str, psz_name_untranslated ); if (S_ISLNK(p_statbuf->rr.st_mode)) { report(stdout, " -> %s", p_statbuf->rr.psz_symlink); } } else { strftime(date_str, sizeof(date_str), "%b %d %Y %H:%M:%S ", &p_statbuf->tm); report (stdout," %s %s", date_str, psz_name_translated); } report(stdout, "\n"); } libcdio-2.2.0/src/util.h000066400000000000000000000076311474051130400150430ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012, 2024 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Miscellaneous things common to standalone programs. */ #ifndef UTIL_H #define UTIL_H #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif #include #include #include #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_STDARG_H /* Get a definition for va_list. */ #include #endif /* FreeBSD 4 has getopt in unistd.h. So we include that before getopt.h */ #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_GETOPT_H #include #endif #ifdef ENABLE_NLS # include # include # define _(String) dgettext ("cdinfo", String) #else /* Stubs that do something close enough. */ # define _(String) (String) #endif /* The following test is to work around the gross typo in systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE is defined to 0, not 1. */ #if !EXIT_FAILURE # undef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif #ifndef EXIT_INFO # define EXIT_INFO 100 #endif #define DEBUG 1 #if DEBUG #define dbg_print(level, s, ...) \ if (opts.debug_level >= level) \ report(stderr, "%s: "s, __func__ , __VA_ARGS__) #else #define dbg_print(level, s, args...) #endif #define err_exit(fmt, ...) \ report(stderr, "%s: "fmt, program_name, __VA_ARGS__); \ myexit(p_cdio, EXIT_FAILURE) typedef enum { INPUT_AUTO, INPUT_DEVICE, INPUT_BIN, INPUT_CUE, INPUT_NRG, INPUT_CDRDAO, INPUT_UNKNOWN } source_image_t; extern char *source_name; extern char *program_name; extern cdio_log_handler_t gl_default_cdio_log_handler; /*! Common error exit routine which frees p_cdio. rc is the return code to pass to exit. */ void myexit(CdIo_t *p_cdio, int rc); /*! Print our version string */ void print_version (char *psz_program, const char *psz_version, int no_header, bool version_only); /*! Device input routine. If successful we return an open CdIo_t pointer. On error the program exits. */ CdIo_t * open_input(const char *psz_source, source_image_t source_image, const char *psz_access_mode); /*! On Unixish OS's we fill out the device name, from a short name. For example cdrom might become /dev/cdrom. */ char *fillout_device_name(const char *device_name); /*! Prints out SCSI-MMC drive features */ void print_mmc_drive_features(CdIo *p_cdio); /*! Prints out drive capabilities */ void print_drive_capabilities(cdio_drive_read_cap_t p_read_cap, cdio_drive_write_cap_t p_write_cap, cdio_drive_misc_cap_t p_misc_cap); /*! Common place for output routine. In some environments, like XBOX, it may not be desireable to send output to stdout and stderr. */ void report (FILE *stream, const char *psz_format, ...); /* Prints "ls"-like file attributes */ void print_fs_attrs(iso9660_stat_t *p_statbuf, bool b_rock, bool b_xa, const char *psz_name_untranslated, const char *psz_name_translated); #endif /* UTIL_H */ libcdio-2.2.0/test/000077500000000000000000000000001474051130400140765ustar00rootroot00000000000000libcdio-2.2.0/test/.gitignore000066400000000000000000000010031474051130400160600ustar00rootroot00000000000000/*.dump /*.exe /*.exe.stackdump /*.o /*~ /.deps /.libs /Makefile /Makefile.in /cdda-1.raw /cdda-2.raw /cdda-good.raw /cdda-jitter.raw /cdda-underrun.raw /cdda.bin /check_common_fn /check_cue.sh /check_iso.sh /check_iso_read.sh /check_nrg.sh /check_sizeof /check_udf.sh /isofs-m1.bin /test_lib_driver_util /testassert /testassert.core /testbincue /testdefault /testgetdevices /testischar /testiso9660 /testisocd /testisocd2 /testisocd_joliet /testisorr /testlinux /testnrg /testpregap /testsolaris /testtoc /testudf libcdio-2.2.0/test/Makefile.am000066400000000000000000000133231474051130400161340ustar00rootroot00000000000000# Copyright (C) 2003-2006, 2008-2013, 2017 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #################################################### # Things for regression testing #################################################### # # .PHONY: test check-short check-iso_read_large check-iso-read-terse \ make-executable clean-local-check check-leaks SUBDIRS = data driver hack = check_sizeof testassert testgetdevices testischar \ testisocd testisocd2 testisocd_joliet testiso9660 \ testisorr test_lib_driver_util testudf \ testpregap DATA_DIR = @abs_top_srcdir@/test/data AM_CPPFLAGS = $(LIBCDIO_CFLAGS) $(LIBISO9660_CFLAGS) -DDATA_DIR=\"$(DATA_DIR)\" check_sizeof_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testassert_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) testgetdevices_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) testischar_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testiso9660_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testisocd_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testisocd2_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testisocd_joliet_LDADD= $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testisorr_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testudf_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) test_lib_driver_util_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) testpregap_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh check_udf.sh \ check_iso.sh check_bad_iso.sh check_multiextent.sh \ check_fuzzyiso.sh check_opts.sh check_deep_directory.sh \ check_iso_read.sh check_cdtext.sh check_udf.sh: @abs_top_builddir@/example/extract$(EXEEXT) @abs_top_builddir@/example/extract$(EXEEXT): $(MAKE) -C @abs_top_builddir@/example extract$(EXEEXT) check_PROGRAMS = $(hack) check_DATA = vcd_demo.right vcd_demo_vcdinfo.right \ videocd.right multiextent.right \ cdda.right cdda_4_5.right deep_directory.right \ isofs-m1.right isofs-m1-no-rr.right isofs-m1-test2.right \ check_opts0.right check_opts1.right check_opts2.right \ check_opts3.right check_opts4.right check_opts5.right \ check_opts6.right check_opts7.right \ isofs-m1-read.right cdda-read.right \ copying.right copying-rr.right \ joliet.right joliet-nojoliet.right \ malformed.right malformed2.right \ copying.gpl copying-rr.gpl copying-rr-mingw.right \ cdtext.right cdtext-libburnia.right EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \ check_common_fn check_cue.sh.in check_nrg.sh.in \ check_legal.regex \ check_iso.sh.in \ check_iso_read.sh.in TESTS = $(check_PROGRAMS) $(check_SCRIPTS) XFAIL_TESTS = testassert MOSTLYCLEANFILES = \ core core.* *.dump cdda-orig.wav cdda-try.wav *.raw \ *file?s-read.txt exampleIso*.iso* #: run regression tests. "test" is the same thing as "check" test: check-am #: Run all tests without bloated output check-short: @$(MAKE) check 2>&1 | ruby @abs_top_srcdir@/make-check-filter.rb #: Run 5GB ISO 9660 read test # Stripped down greatly from automakes check-TESTS check-iso-read-large: @if ./check_iso_read.sh 5000; then \ echo test of 5M iso_read succeeded; \ elif test $? -ne 77; then \ echo iso_read large file test failed; \ else \ echo iso_read large file test skipped; \ fi #: Run 5GB ISO 9660 read test without some of the bloated output check-iso-read-large-terse: @$(MAKE) check-iso-read-large 2>&1 | ruby @abs_top_srcdir@/make-check-filter.rb # This is a really bad hack to make sure check_nrg and check_cue.sh # are executable. Automake will remake check_nrg.sh and check_cue.sh # but not run the configure default commands for them to make sure # they are executable. You know it would be nice one could just set # permissions and mode when it makes the files. I'm sure there's some # cleaner a way to do this, but frankly I've wasted far too much of my # life the crappy automess system that I've really lost interest in # learning any more of this awful system than I need to. check-am: make-executable make-executable: check_nrg.sh check_cue.sh @chmod +x *.sh @if test ! -f cdda.bin -a ! -s cdda.bin ; then \ test -L cdda.bin && $(RM) cdda.bin ; \ $(LN_S) $(abs_top_srcdir)/test/data/cdda.bin cdda.bin ; \ fi @if test ! -f @abs_top_builddir@/test/data/isofs-m1.bin -a ! -s @abs_top_builddir@/test/data/isofs-m1.bin ; then \ test -L isofs-m1.bin && $(RM) isofs-m1.bin ; \ $(LN_S) $(abs_top_srcdir)/test/data/isofs-m1.bin @abs_top_builddir@/test/data/isofs-m1.bin ; \ fi @if test ! -f @abs_top_builddir@/test/data/isofs-m1.cue -a ! -s isofs-m1.cue -a ! -f @abs_top_builddir@/test/data/isofs-m1.cue; then \ test -L isofs-m1.bin && $(RM) isofs-m1.cue ; \ $(LN_S) $(abs_top_srcdir)/test/data/isofs-m1.cue @abs_top_builddir@/test/data/isofs-m1.cue ; \ fi clean-local: clean-local-check clean-local-check: -rm -rf exampleIso*.iso.prep *.log *.trs *.orig *.rej #: run valgrind on C programs check-leaks: $(check_PROGRAMS) for p in $(check_PROGRAMS); do \ valgrind ./$$p; \ done libcdio-2.2.0/test/README.multiextent000066400000000000000000000030211474051130400173330ustar00rootroot00000000000000check_multiextent.sh uses three different ISOs with nearly identical content. All three images exercise libcdio's capability to present multiple extents with the same names as one single file. They were produced by a GNU xorriso binary which was built for an artificially small extent size, so that the payload file of 55 KB is split into seven extents. Normally multiple extents emerge only for data files of 4 GiB or larger. test/data/multi_extent_8k.iso is a minimally sized xorriso image without a Joliet tree, so that libcdio will choose to interpret the Rock Ridge information of the ISO 9660 tree. test/data/multi_extent_8k_emul_toc_padded.iso is a xorriso image with the same content as multi_extent_8k.iso but larger size, because two default properties of a native xorriso run have not been disabled when it was produced. These properties are: - a second superblock which would survive when another session would be added and so would provide an opportunity to mount the state of the first session. This would also enable xorriso to show a history of all sessions if more than one is present. - traditional end padding of 300 KiB which would prevent the Linux readahead bug which can cause i/o errors when the ISO is presented to Linux on a CD that was written with write type Track-At-Once. test/data/multi_extent_8k_joliet.iso is much like multi_extent_8k.iso but does not offer Rock Ridge information in its ISO 9660 tree. Instead it contains a Joliet tree which libcdio prefers over ISO 9660. libcdio-2.2.0/test/cdda-mcn.right000066400000000000000000000007431474051130400166070ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DA CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? Channels Premphasis? 1: 00:02:00 000000 audio false yes 0 no 170: 00:09:64 000589 leadout (1 MB raw, 1 MB formatted) Media Catalog Number (MCN): 123456789ABCD Last CD Session LSN: not supported by drive/driver audio status: not implemented __________________________________ CD Analysis Report CD-TEXT for Disc: CD-TEXT for Track 1: libcdio-2.2.0/test/cdda-read.right000066400000000000000000000160441474051130400167460ustar00rootroot000000000000000x0000: 0000 0000 0000 0000 0000 0000 0000 0000 0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 0x0030: 0000 0000 0000 0000 0000 0000 0000 0000 0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 0x0050: 0000 0000 0000 0000 0000 0000 0000 0000 0x0060: 0000 0000 0000 0000 0000 0000 0000 0000 0x0070: 0000 0000 0000 0000 0000 0000 0000 0000 0x0080: 0000 0000 0000 0000 0000 0000 0000 0000 0x0090: 0000 0000 0000 0000 0000 0000 0000 0000 0x00a0: 0000 0000 0000 0000 0000 0000 0000 0000 0x00b0: 0000 0000 0000 0000 0000 0000 0000 0000 0x00c0: 0000 0000 0000 0000 0000 0000 0000 0000 0x00d0: 0000 0000 0000 0000 0000 0000 0000 0000 0x00e0: 0000 0000 0000 0000 0000 0000 0000 0000 0x00f0: 0000 0000 0000 0000 0000 0000 0000 0000 0x0100: 0000 0000 0000 0000 0000 0000 0000 0000 0x0110: 0000 0000 0000 0000 0000 0000 0000 0000 0x0120: 0000 0000 0000 0000 0000 0000 0000 0000 0x0130: 0000 0000 0000 0000 0000 0000 0000 0000 0x0140: 0000 0000 0000 0000 0000 0000 0000 0000 0x0150: 0000 0000 0000 0000 0000 0000 0000 0000 0x0160: 0000 0000 0000 0000 0000 0000 0000 0000 0x0170: 0000 0000 0000 0000 0000 0000 0000 0000 0x0180: 0000 0000 0000 0000 0000 0000 0000 0000 0x0190: 0000 0000 0000 0000 0000 0000 0000 0000 0x01a0: 0000 0000 0000 0000 0000 0000 0000 0000 0x01b0: 0000 0000 0000 0000 0000 0000 0000 0000 0x01c0: 0000 0000 0000 0000 0000 0000 0000 0000 0x01d0: 0000 0000 0000 0000 0000 0000 0000 0000 0x01e0: 0000 0000 0000 0000 0000 0000 0000 0000 0x01f0: 0000 0000 0000 0000 0000 0000 0000 0000 0x0200: 0000 0000 0000 0000 0000 0000 0000 0000 0x0210: 0000 0000 0000 0000 0000 0000 0000 0000 0x0220: 0000 0000 0000 0000 0000 0000 0000 0000 0x0230: 0000 0000 0000 0000 0000 0000 0000 0000 0x0240: 0000 0000 0000 0000 0000 0000 0000 0000 0x0250: 0000 0000 0000 0000 0000 0000 0000 0000 0x0260: 0000 0000 0000 0000 0000 0000 0000 0000 0x0270: 0000 0000 0000 0000 0000 0000 0000 0000 0x0280: 0000 0000 0000 0000 0000 0000 0000 0000 0x0290: 0000 0000 0000 0000 0000 0000 0000 0000 0x02a0: 0000 0000 0000 0000 0000 0000 0000 0000 0x02b0: 0000 0000 0000 0000 0000 0000 0000 0000 0x02c0: 0000 0000 0000 0000 0000 0000 0000 0000 0x02d0: 0000 0000 0000 0000 0000 0000 0000 0000 0x02e0: 0000 0000 0000 0000 0000 0000 0000 0000 0x02f0: 0000 0000 0000 0000 0000 0000 0000 0000 0x0300: 0000 0000 0000 0000 0000 0000 0000 0000 0x0310: 0000 0000 0000 0000 0000 0000 0000 0000 0x0320: 0000 0000 0000 0000 0000 0000 0000 0000 0x0330: 0000 0000 0000 0000 0000 0000 0000 0000 0x0340: 0000 0000 0000 0000 0000 0000 0000 0000 0x0350: 0000 0000 0000 0000 0000 0000 0000 0000 0x0360: 0000 0000 0000 0000 0000 0000 0000 0000 0x0370: 0000 0000 0000 0000 0000 0000 0000 0000 0x0380: 0000 0000 0000 0000 0000 0000 0000 0000 0x0390: 0000 0000 0000 0000 0000 0000 0000 0000 0x03a0: 0000 0000 0000 0000 0000 0000 0000 0000 0x03b0: 0000 0000 0000 0000 0000 0000 0000 0000 0x03c0: 0000 0000 0000 0000 0000 0000 0000 0000 0x03d0: 0000 0000 0000 0000 0000 0000 0000 0000 0x03e0: 0000 0000 0000 0000 0000 0000 0000 0000 0x03f0: 0000 0000 0000 0000 0000 0000 0000 0000 0x0400: 0000 0000 0000 0000 0000 0000 0000 0000 0x0410: 0000 0000 0000 0000 0000 0000 0000 0000 0x0420: 0000 0000 0000 0000 0000 0000 0000 0000 0x0430: 0000 0000 0000 0000 0000 0000 0000 0000 0x0440: 0000 0000 0000 0000 0000 0000 0000 0000 0x0450: 0000 0000 0000 0000 0000 0000 0000 0000 0x0460: 0000 0000 0000 0000 0000 0000 0000 0000 0x0470: 0000 0000 0000 0000 0000 0000 0000 0000 0x0480: 0000 0000 0000 0000 f0ff 0000 f0ff 0000 0x0490: e3ff f0ff e3ff f0ff d8ff e3ff d8ff e3ff 0x04a0: dfff e8ff dfff e8ff f5ff fcff f5ff fcff 0x04b0: 0700 0c00 0700 0c00 1500 1800 1500 1800 0x04c0: 2000 1100 2000 1100 2800 0b00 2800 0b00 0x04d0: 1d00 0500 1d00 0500 1300 0000 1300 0000 0x04e0: 0a00 0b00 0a00 0b00 1200 1300 1200 1300 0x04f0: 1800 1900 1800 1900 0c00 0d00 0c00 0d00 0x0500: 0200 0300 0200 0300 e9ff faff e9ff faff 0x0510: d5ff f2ff d5ff f2ff b5ff dbff b5ff dbff 0x0520: 9cff c8ff 9cff c8ff a9ff c9ff a9ff c9ff 0x0530: c4ff daff c4ff daff eaff f8ff eaff f8ff 0x0540: 1900 1000 1900 1000 3e00 2300 3e00 2300 0x0550: 6b00 3100 6b00 3100 8d00 3b00 8d00 3b00 0x0560: 7600 4200 7600 4200 6100 3600 6100 3600 0x0570: 3e00 2b00 3e00 2b00 1000 1100 1000 1100 0x0580: eaff fbff eaff fbff cbff e9ff cbff e9ff 0x0590: b2ff daff b2ff daff ceff deff ceff deff 0x05a0: e5ff f1ff e5ff f1ff f8ff 0000 f8ff 0000 0x05b0: 0700 0c00 0700 0c00 1300 1500 1300 1500 0x05c0: 0c00 0b00 0c00 0b00 e6ff f2ff e6ff f2ff 0x05d0: c7ff ddff c7ff ddff aeff ccff aeff ccff 0x05e0: 8aff bfff 8aff bfff 6eff b5ff 6eff b5ff 0x05f0: 99ff ceff 99ff ceff d0ff e3ff d0ff e3ff 0x0600: 0e00 0400 0e00 0400 8000 3e00 8000 3e00 0x0610: da00 6c00 da00 6c00 1f01 8f00 1f01 8f00 0x0620: 4201 a900 4201 a900 2901 9b00 2901 9b00 0x0630: d000 6d00 d000 6d00 7100 3500 7100 3500 0x0640: 0000 0600 0000 0600 64ff bfff 64ff bfff 0x0650: e7fe 86ff e7fe 86ff a7fe 59ff a7fe 59ff 0x0660: 98fe 47ff 98fe 47ff b1fe 4bff b1fe 4bff 0x0670: eafe 71ff eafe 71ff 5cff a2ff 5cff a2ff 0x0680: ceff ebff ceff ebff 3c00 2600 3c00 2600 0x0690: 9400 5500 9400 5500 d900 7900 d900 7900 0x06a0: bd00 6400 bd00 6400 a300 5100 a300 5100 0x06b0: 5f00 3000 5f00 3000 1300 1400 1300 1400 0x06c0: 0700 fcff 0700 fcff 0d00 f8ff 0d00 f8ff 0x06d0: 1100 0400 1100 0400 4300 1d00 4300 1d00 0x06e0: 6a00 3000 6a00 3000 8800 3e00 8800 3e00 0x06f0: 8e00 4800 8e00 4800 6000 2f00 6000 2f00 0x0700: e9ff f9ff e9ff f9ff 88ff cdff 88ff cdff 0x0710: 3bff 9aff 3bff 9aff ecfe 72ff ecfe 72ff 0x0720: d2fe 63ff d2fe 63ff 01ff 79ff 01ff 79ff 0x0730: 2bff 8cff 2bff 8cff 83ff bdff 83ff bdff 0x0740: fcff f5ff fcff f5ff 5e00 3200 5e00 3200 0x0750: ac00 6200 ac00 6200 e800 8700 e800 8700 0x0760: 0501 8200 0501 8200 d800 6b00 d800 6b00 0x0770: 9d00 5600 9d00 5600 6a00 4300 6a00 4300 0x0780: 3e00 2200 3e00 2200 1900 0600 1900 0600 0x0790: eaff efff eaff efff e4ff ecff e4ff ecff 0x07a0: dfff e9ff dfff e9ff bbff e6ff bbff e6ff 0x07b0: 9eff d3ff 9eff d3ff 77ff c4ff 77ff c4ff 0x07c0: 39ff a8ff 39ff a8ff 19ff 92ff 19ff 92ff 0x07d0: 22ff 91ff 22ff 91ff 5cff b1ff 5cff b1ff 0x07e0: cdff ecff cdff ecff 7500 3c00 7500 3c00 0x07f0: 1101 8c00 1101 8c00 8b01 ca00 8b01 ca00 0x0800: e701 f900 e701 f900 da01 fb00 da01 fb00 0x0810: 6401 b800 6401 b800 8a00 4500 8a00 4500 0x0820: 92ff c4ff 92ff c4ff 8efe 4cff 8efe 4cff 0x0830: a6fd cdfe a6fd cdfe 09fd 7afe 09fd 7afe 0x0840: 21fd 8cfe 21fd 8cfe 9dfd d2fe 9dfd d2fe 0x0850: b3fe 67ff b3fe 67ff 3000 1600 3000 1600 0x0860: e801 e800 e801 e800 4503 8f01 4503 8f01 0x0870: 3004 2102 3004 2102 2404 1f02 2404 1f02 0x0880: 4f03 a201 4f03 a201 b801 cf00 b801 cf00 0x0890: e4ff e4ff e4ff e4ff bafd d7fe bafd d7fe 0x08a0: 00fc 01fe 00fc 01fe 60fb abfd 60fb abfd 0x08b0: 5efb 9cfd 5efb 9cfd 32fc 11fe 32fc 11fe 0x08c0: d5fd c7fe d5fd c7fe 0100 0e00 0100 0e00 0x08d0: 0102 1701 0102 1701 9803 e901 9803 e901 0x08e0: d404 8b02 d404 8b02 ea04 8f02 ea04 8f02 0x08f0: d803 fc01 d803 fc01 4802 2a01 4802 2a01 0x0900: 2100 0e00 2100 0e00 20fe 07ff 20fe 07ff 0x0910: 86fc 35fe 86fc 35fe acfb c3fd acfb c3fd 0x0920: c0fb ddfd c0fb ddfd b5fc 40fe b5fc 40fe libcdio-2.2.0/test/cdda.bin000066400000000000000000025532401474051130400154760ustar00rootroot00000000000000    ( (   >#>#k1k1;;vBvBa6a6>+>+   nn>>llBB))mmq5q5ddYYGGKKqq\\<&<&UUyyddQQ_0_0 CCj0j0>>HH`/`/;;rrccyy++^2^2bbkkVVjCjC>">"ww99""\\u<u<ddEELL z z!!gg00EE0!0!$$OO``^^22H*H*!!  55@@F2F288\\ZZvJvJ`3`3NNPP@ @ **ff((ll&&MM**XXGG VV66QQQQ  __^^TTffQQqqEECC""44UUdWdW===%=%QQ ::H\H\xxv^v^||[[__ppV4V4I}I}!!aarrbb[,[,MMnnWWBBe/e/WW??vv44EE;;MMl7l7]]ee.1.1SQSQUUnnbbDDccU2U2lIlI55/!/!55NNzzaa9w9wnene++oJoJ    = X= Xd *d *ThThQQ}v}vqqxxq q 44CC`K`KHH@@ddgg[[**iitt@@b b TTeeCCVVYBYBnn""\E\E[[9*9* ``@@3%3%KhKhvv#Tk |    O <O <}+plkkkEEmm__HH??||XX>>cc11'Q'Q%%   + + B BgvgvnnUUHH}}33 W WZ Z  : : v v' ' NNii==JJ$F$FI)I) _ _**; ; $$EEJJkkK?K?j,j,MMXXii rr8+8+8877g2g2LL__$$WWllHH;;eeee''IIff ccCC  22%0%0''ssdd((nCnCllUUT1T1}I}IDD11CCXXooiiDDmmqqggBB88~~^^\:\:  !!vv44EE||;;,,eeee^^ss@@zz^^ s sFFkk{{   " "gpgpuuBB77ccrJrJL L c Zc Zl= l= P P   v v,|,|"",,88((bb      e+e+OO  33AAAuAuUUOOn4n4M-M-77__ 66  cScSbb%A%AKSKSoo%}%}  II| |   II33HHll#k#k[[ADAD55))""  !p !p m=m= A A - -{{$P$P>>bLbLNN__jjII*> *>   L L     {{LL   A A??rr+F+FyyJvJvTPTPWW  hh22**||VuVunnYY4X4X  dd  s\s\rr>>MMTT|(|(l$l$//  ((^[ ^[ g g w )w )uueeqqmm,,ZZxfxf  c|c|M M ? d? dnn4:4:x#x#pp??@@KK00 % %GG  11 y y33llVVFFhhOvOv99BBJJ\\PcPcff@@dd%%   @ @UUBB8 8   qq((,y,y "("(B B   Z0Z0LL     11[[GG@>@>~e~e*8*8  n n   kkPP**LLe e   p p } } M M r r [J[J$$ ^ ^[[MMJJ##y>y>}}tt&&VV>>--  #j#jXXBB= = wwx<x<\2\2C)C){{aa??BBPP88jju =u = ) ) X XaaGGiWiWFFqqJJ~~ ss * *C'C'ww  tjtjcc4T4TyfyfggGG88TT::==UU66ll##EEwwvv b bR -R -##@ @ qq77""99..;;9944""  ==  77 X X ffuu7 7 P P FF   @@2n2nII+=+=DDooZZy y p p ((  ]]IIRR""h`h`ccuuN$N$uuII~~>p>p%M%Mss0 0 MMiyiy..ii>55x jx jnn9911}}[3[3tt))::OO;;y y DwDwY Y   ~ ~ jjnnII!B!BLL M MMM<< 7 7 ) ) FFMDMD< < W W 7 7 nnhhKK))MMT T P P7*7***"Q"QNN  77 ((((111ۜ1ۜwQwQkk W W  hh. . e e   ::~4~4**ccZZBB? ?   ; ; t t uH uH + + v v F F   Y8Y8>>ߵߵ_D_DVqVqR R "W"W))<(<(ff  ''h&h&xx;;hQhQhh.. X XkkFUFU&&      Gq Gq F F qqppMMUU@ @   AnAnvv  z3z3FFooOO^^l\l\++E E     zzLLdd55uuvv44/"/"sDsDEyEyz z \\ wwQQBBssyy  KE KE        ##mm""LLY(Y(((s 3s 3    zzkkgSgSxxr Tr TB;B;||YYHHvv<>qqss&&KKpmpm  ' ' ll????11@M@Moo  xxook k hh;;: C: C  //  e.e.nnzzv(v(??ttKKqq    R!R!p p ttll..qWqWdddd//__p p #V#V..(.(.&_&_7f7frrgg 8181""+I+I88qqH H # #     ZZ2255NN//II22II<<    f f   ) )    xx]B]BUrUr|؅|؅6611YY7 7 ;;((..5+5+1#'1#'. . susuqqD)D)--] ]   | | MM;;==$$EEjpjpd d U U c c ?Z ?Z ''ffSS*~*~_C_C55886 6 dd. . > e> e{{UUxx55S S hhii X X   m mD@D@z^z^--H)H)l)l)P,P,XX1919YYjjKKmmF/F/ 11{{''    [[a-a-,^ ,^ y2y2UU?b?bNN77"""" MM T T  $ $  #T#TWWdd--vjvjVkVk::VVHHJJrrggGGPP88JJ==YY]]))==TT]]X cX cx Yx Y@ @ N N x x MM88;;ZZ11%%QQ   { {nTnTPPLLEEuuii ` `    tt i i5544zz  ODODaaOO' ' ""ffggmsms$I$IRV RV K K %9%9% % aa @@};};>>&&||CpCpjjccG[G[ ccwwoOoOvv    1n1nd ;d ;JJll55..hhTO TO BB~~y y F F vv(A(A( ( aaVRVR tt"@"@ZZiiC C &&""  $$/ z/ zRRccӊӊHyHyZZqqWWC C ;!;!$$!!V gV g44KK((xx**UU  qqJJ==::}}TT\\||FFCC!!A JA J  f f p p qwqw&&,V,V//u u 99!A!A""N N d d ''D^D^J۫J۫ l lJJ * *D2D2g-g-$$4 4 VV"Ԑ"ԐRyRyݡݡ88{{EE  {{((    ) )9966c~c~**DD||004141qq{{Q Q = =         wi wi E ERR]]ߔߔwDwDffLL  D2D2&&(( # #II" " f f f#f#7s7s    @ @ D6D6nOnO S S88YY  G G V V 6: 6:  qqffUU0F0FOOqq}}  > > HH--  E E gg]]ppp}p}??xxvvy (y (  DDkk,^,^**K)K)tstsyyllYYbbAAAABB+ |+ |3 3 **rrKK55//]] a ai6i6zzqq  R R    - -GAGAHH//# !# !( ( AAHwHwEXEXFF))((rJrJ,,UfUfvv : :  ` ` 9 9 P P ( (;;DD))DDQQ ++]]  i Yi Y: : ::AZAZqqqqeep=p=JJ  wx wx   r r p-p-llt{t{ q qPP..pp  uu--  nnSS[[<<445]5]@@  , , //g g ~ ~ ! ! *i*ibbnn ii``xxnnxx((&&$ $ MM  ''JJG`G`}}MMwcwcB B 8b8b}}    IIvv --++||@@WW[[d d ""J J   mKmKKKAA||bbn n EE##~b~b  $ /$ /**DDhhyyNNCC((??h Sh S--6)6) E Eff7w7wGGrrIILLvv  %%tQ tQ 00&&mmjj-F-FVl V uh h uu  " q8K oH  ))5050 Ѵ ѴDәDәa.a.]]  H H..o1o1#+#+ww] ] ""p@p@BB    88  9 9 ~ L~ L   ee33??CCbbwawa66yy99t t E E   q q ~Z ~Z Y Y q5 q5  f fjj((ffyy&&  **%%%%$$   %b%bYY / / * * 9 9%q%qTT[[V#V#hEhEm m   ; ; j j D D   PnPn))7W7Woo | | e e ll     //**kkJfJfJJ EzEz<<jj__YY;k;k{{xxWWcOcOSSGGuu ww''[[MM~~44w w I;I;r%r%  q q Y Y iihh,,kk//CCY1Y1 \ \  a a   --"{"{xxPPjNjNxxPP!!o`o`uuiieeeeMMMMww|X|X66UUd d ?dEobbXX D  u*  (   {n{nDDcULLGvGvA{ p{ < m< mY Y PPAA m mAkAk--( @( @ v v 8 8  QQVVAAN N SSWW$ $ iiXX55V V 3 3 [h[h>J >J   ~~IIttU}U}{{DDjj > >SbSbvv.q.qynyn m mz z t t    4V4V4J4J`%`%JJnnPPvvN(N(jj \ \&&4 4  h h..NNggddk k % % CCv jv j33''׋׋;;SSUU??  $$!!CC ^^++iiJJ{{   e eee>>FFuGuGx.x.AxAx 00rrLL ' '  **Cj Cj  ,6,6hhMMPPeeOO  eeR R t#pt#pK! K!   * * aa77885$5$MM 7 7  hh(&(&2< 2< /N/N%%  }}vvBBԩԩGGww--""  h3h3a~t j 8 |8 |ww'@o=ppxxRRWWW5W5^^//66;;^ @^ @  i v qL    ' ' J J H ARl\ 11nn6f6f  : : pp""!!774 4 LL 2y2yLLQQaa99SS    ppZZ|y|y@@``.. o o  ; ; y y..MpMpbb@@&&55BBGG  + + ((V V  p/p/6*tz5XX55qa8[7GG ~ ~W PW PGG  ##__ 99ZUZU  ||3J_w 66>>*Z-gGt66HH__22PP : :  ??aa66) ) dd~<~<[[WW77vvbbtt        ))??ACAC99mmzz3F3FKKddQQmm &&ffKKMMaa_}_}ddjj  b? b?   b b  @@ww''--BB3O3O        xxOhOhppLLkk  Au Au     00))CC``ssk k   RRp p jjL}L}DGDG..5 5 DPDPpp( ( ShShKK##22**ff2Y2Y<<*<*G>G__**bb''""  VV/ / * *  X X >; >; h h xt xt 33VzVzZZQ Q --JJ5ت5تڣڣ99: : Z)Z)G.G.,,$$kk++UUvvPPTTGdGd)) z z6 6 T {T {'k'kii C C  O O _ _   [[KKUU55؎؎C"C"jBjBll  LL  9% 9%  %%DSDSUUjj;;w w   e e     G G?-?-m]m]   { {, ,   -2 -2 | |      # D# D      ? U? Uee::ff""FF      f f d  d  GG00gg<<ee''5T5Tzzhh^^66,,;;qq''....``rrWW--xx<<VKVK;;DD" " hh  ?6?6iiݦʽۦʽ""00TT : :wW wW WW))y y ??~~ + +""ppZ Z   ++\~\~ssvbvb''WW         D D4 4 __KK!!!!$h$hxx b b TeTeI&I&F F 66?? KK}F}FEiEinn33{{jAjA[[~~tt܄܄RR : :?? II_2_2U8U8rr~~**CKCK   C C   M< M< r r r6 r6     p p   $ $     [ [  k kFFc c [[vvPP991v1vqqGGhh??2h2hgg  zGzG ||rr-4-4ppqq>>TT^^pp*-*-wwmm    T T   mm  ! ! ::'m'm}}{{U"U"ttss*I*IPPMMSS & &3%3%^^QQEE````$$NNtt/"/"eeNN88rraa// \\;;KK   3 3\? \? d'd' a a    ` ` ddjhjhTT>q>q t t> > ! !  ' "' "--NNCCjjRRr r  Y Y / /  tt$$ee!Z!Z~~FFgFgFII Q Q@ @ fD fD Pz Pz  ++OO^^??LLWWVLVL 22f0f0UUQQ33HHii33>=>=PP[[[[PP2W2W,,N N < <   99  55  3# 3# B FB F\\  L L   WW    7*7*/ / v v ~~<<II<><>KK6!6!'<'<""rrBB33VV11޶޶OoOo]q]q44߳'' ݿ ݿ``PP55aa^^00^^ ppaxax v v   ""%%~'~'*|*|++. . Y1"Y1"3c$3c$;6"&;6"&h7&h7&6&6&3$3$|/!|/!))m#m#BlBlZZ]]3"3"MMOZOZ}}   JJA(A(bbEE##ո]׸] ̪ ̪ҹҹ߫//>>FF{ߠ{ߠ}}~"~"[ѳ[ѳiɰiɰYY0B0B{¥{¥LLؿΪݿΪ > >II  ``]],,RRQ Q |Y |Y rr!!m&dm&d**<-<-. . |. |. m/h!m/h!0["0["1=#1=#F2#F2#%3$%3$ 3# 3#M0"M0"O-O-`'`' ! !cc  ~ ~   6 6 ' ' 88dd00HH$$22ooTT<Ϡ<ϠƩƩqq--Վڎr0r0ooIDIDX[X[{={=ZZ?l?lTT;;>>55( (   ffB\B\00  S S   K K C k C k     y Xy Xg~g~22BByy{/{/66CC99oommR3R3ooFFsjsjyyDD NNss44UUI I aaH"H"j j   XlXl##7a7ao / o / zh zh   3 3 t  t        DDffoo663d3d::hhffv)v)BBzz--izizyyVOVO]]ppB3B3==FF.:.:rrii44h h     %b%b]V]V  6 6 ]]33@2@2++ff F FN N aQ aQ n n  , , ZZDD2g2gcc66TT;;``44L L nn&&>ZZnn.b.bppbb~ ~ IISSll{s{s99YY;B;B YYZZ ""]&]&{{yy``h h       %7%7@'@'mmFF5!5!VV A A   ItItx1x1PQPQg g   l l 99aa==  bGbGjjtt{{ffGGDDq0q0s[s[& & zzPPܟܟssZ؎Z؎((ݎݎ__Q Q ,,QQxxNNuuX-X-  UU#5#5)U)U- !- !a1#a1#3%3%4&4&/6+'/6+'P7?(P7?(9@)9@) ;* ;*c=,c=,s@.s@.A/A/B/B/@.@.;+;+4&4&-C!-C!%%NNkmkm    *f *f     L L vv;Z;Z!!nnQ}Q}ҞHΞH'l'l*M*M7Ɔ7Ɔ8˞8˞ЋЋ;;ݧܧ2ͤ2ͤgɪgɪf>QAQA& &   $7 $7 +O+Oss  **3'3'>4.>4.*EJ3*EJ3E3E3Ci2Ci2=u-=u-4&4&*?*?jj    4 4 O O   K. K.  $$UU//wwhwhw}'}'IIٹٹKӛKӛXX_ɘ_ɘ/{/{mmggggnnғғagag}}hh'['[--cco o ==bb55vv  C C B}B}GG!!||iiFFaamm==FFDeDe-j-jkrkrO>O>G G      hJhJ   7 7 w1w1   <J<Jii66##==dd @@88 @~@~>>AA,ߑ,ߑާާb b <<001f1f!!jjhh~~oo8"8"88ll]] : :<<##      pX pX !!%%(=(=_)+_)+w(Ow(O(&(&##!!  l!gl!g>">"#|#|1$"1$"l$<l$<p#p#!!mm} } s s / / WW%%=M=Mg>g> eeAA B B==fڝfڝ--&&55}}(X(X@@_ފ_ ۱u^u^GG__rvrvRDRD8 8 ::``ddT T   y y   m- m-   8X 8X g g   Gk Gk ))ZZ66MMpp   EEF 5F 5_ _ aa+ + 22  ;;TTMM55@ @ dSdSOO W W  knkn  eeN N Zr>r - -## ## &&E)E) ," ,"@.#@.#R/B$R/B$s/$s/$.#.#-"-"+!+!); ); I(I(&&%%o#[o#[    @ @h6h6UzUz99))ff!!##((DDO԰O԰&&hYhYc8c8xxXX\\EE''LL%%kkAA  GG[[%%L pL p   G G } } [ [ < < 8 8   . . !5!5e e f f   >b>bfefeCC^^;;xxXX::;;GG::XXzFzFllaa%w%w. . ||cLcL tt  r!r!ss l l HH||>>,,rrq q 0u 0u   H2 H2 00]]PPWW==}}ll uu=A=AYYggzz2K2KCC>>]]qTqT$|$|__mm00I I }}WcWc   a a  MBMB?? t tv v w w kkraraMM     99S S **99aa~~!(!(s$s$77> > &&c"c"J J BBQQ??oo]K]KJJuJuJAaAarrAAUAUAWWff ffMM@@zz ..jj22,,`<`<KcKc**uAuA.. KK  /2/2GG \ \ 44II "t"tEESSnn$$+"+",S#,S#''''xxO4O444&C&CKKIIJBJBgg4 4 gg  i7i7hh SSmmXX::++00++33kk\\ ..ccvv>  >    . . N N ~E ~E   kk mmnn] Y] YCCa)a)/!/! ! !00 ||99}}))ZZhhPP55YXYXii55??@@ososooBBbb K K QzQz&&A dA d" q " q     +s +s  FF  QQ    ""n n yoyoMM@ @ T_ T_ 8 8   D D 3 3 v v h h __7-7-Y Y HH]]F\F\GG66#T#T..==??)q)q>>yy'a'aaa{{&&yyttMMff[[``KKOIOI::5p5pFgFg00DD O O % % # # z z g gpp^^))FFDDTSTS*T*TvvGGll       p p776F6Fpp/x/x\\<<==|y|y||MMxx22HAHA  O O > > g g 4  4  IIjTjT00\\C 7C 7   x x 88~-~-' I' I^^TPTP UU:5:5{{7L7LnnttWWV\V\'m'm&F&FSS((ee::$$:[:[66gg++aa m m    OO11##%%""{{  OO  ( (   ()()II::O O = =   nt nt GG9 ^9 ^5L5LSSvv\\nnXX``QQDD@@YY ] ]i+i+@E@E((bbjj2*2*AA]+]+gg;;}}00 bUbUGGoPoP[ [ ''gg0x0x``& & uu66--@@[[hh_q_qAAi i c c XX22:: a a  wwaaxx{{\\   KK}y}yX X //EE-4-4~~EE W W Y Y     a a tt$$9-9-uu_]_]__ AA--R9R9KKuupqpq##HHt!t!ff  <<--NN__P?P?++ppSSCC   y y B B NNuuVV%%|:|:55""  , , ]  ]  [ [ l  l   zSzS_1_1  \ \   --p p 4 4 nngg\Z\ZYY33bb,,nn W WNN E E=d=dUUzz++XXr}r}SSII))KaKa]]33pp3p3p{^{^@@SS0055r{r{YOYO  y~y~> >  "v  wPP  @ 2@ 2Jj#uI~\\..YY,""  K  K  Ij&EE;;XiXi00JJ[L[Lkk4s4s&&iiaaZZ22rree/R>11\\66~[ce+UURR7vI]$]jj?\?\**BBXnXn77TTL%L%,,i i    Z Z xxJnJnoo0077ccSSWWiYiY^^ JJ##ffAA  // F F H H _ _ > ?>0"c9c9y;Z9Fp2p2t t SSII;; >> jj~~tt,, ( (" j " j         & &I[I[++[[22))|3|3BB%%  %F%Fyy>>||KKssXX''33 @ @88`` ` K ` K m m WW11``DD  nnYY$$  uDuD$$:<:<~~ccnn||k k w # w #    _  _ : :  ]]  FFll22bbP|P|TT-n-n} } } i} iBB6600 ..++wwNN PP**  UU((nhnhOO] ]   a A a A G X G X  nn4.4.R&R&k k t t //NN    SS / /ee55  uuAhAhAAVV&&B:B:GG~]~]DD]]..{*{*gg44//cc}}  ::   d d H H mm\\      b b 4 4 "h"hKK  + l + l {  {    n n O O ` ` / /  cca a IIdd||vv!!vvKK0s0s  77[[8q8q[[00AARRddVVII..{{uuNNiiYY66--22popo GG!!11>S >S nnT@T@33,,HHGG++XX;; ~ ~r r dndnZj Zj  SSoaoaKKYY0 0  i i   H H     *8 *8  l  l h h k k H H ^r^rQMQM| 4 | 4   SSUU=}=}jj] ] ^  ^  (( ll}}ii XXGGp6p6 qMqMFF\\9]9]eeddQfQf@@==11;;r r \\<<``eePPQQ     3 3 Q Q P P - -     OOmm--llVV  dd!h!hVV88O{O{JJ||f$f$!!mm:: ododttQQ00 >>__YHYH6 '6 's y s y O O     |&|&##SdSd!!__rrllhhEE9a9aii2Y2Ymm Y YppVV\\&&00vv??[[dd]]FFEEz#z#cYcYLLEEE E   @ @ R R  [ [aa"'"'88II++jj1o1ojj>>/3/3}}MM||55pjpjPP   ) ) ( ( ((mm[[ddHH  g g V V l 0 l 0 qqzzQNQNRR=X=Xvv**ffIxIxb b ^ ^ ~Q~QcUcU11mm||o&o&PPAAdd--aa, ", "L  L  W W O j O j  PPkkWW##DXDX Q Q $$  i i g g %%rrj2j2  7X7X d d;;((``55qqAAvvEE222;2;RReeNNd4d4bb22qq!!SSC C xxhh&&==%%\ \  A A . .%%w%w%]$]${{  = =    k k   h h   x x *C*CF.F...PP''UqUq?y?yLޕLޕ}7}7xx"I"I{Y{YfBfB==26261717ޖ__ߞߞl\l\?[?[ii88vlvlhhEENxNx   9 9 ~N~N%%WWqq{|{|V1V1JHJH;-;-77]+]+   yyvv##~~DDuu kk==qq  xXxX--iidܯdܯtt޸KK""))ff  SSRR00 A A   7 7  o o     y y  tYtY^^DDIISS]]_F_F8i8iuXuXvvll!!UU- - 44DDRnRnJJggRRSS!!KKZZ!!; ; XXBB+C+Cx ` x ` ""ff__uu ` `   r r       ppPPOO``""KKkk%%lZlZPPZZ  3E3EOOppHzHzUU"  "  p p ! ! XXzz^^ ZZ{~{~ffJ)J)yyNNLL##II66**jdjd''jjjjvvUUGG=E=E{{v(v(;;AAUU"Q"QA$A$##[[GGwwLLRRoo    &&8811  QQ>>p[p[ewew;; ``RR((7u7u99qsqsVV;;UUeevvHH \\DDllEE++e e l c l c *  *  TOTO<<,,4%4%k[k[&_&_C`C`Y_Y_ImIm00""}} +"+" O OHHBB**;;EEkk##^5^5 77bbOOLMLMMM@@66EEhh??WWtKtKooe ~e ~3 3 eiei))$$jjYY""S#S##T #T # # _ _ uu[C[C R R nnh h   gygyK6rY5ލ5ލٸ܈ٸܕt٭m)߿l/I/I''zz?c?cHHGfGf664400>->-??   HHjjii,3,3uSuSyy0202,,0!0!))[ti@nFF   n0$7==+V+V66x#x# nnddVV\\88e3e3hhtt''HH{{""YYTT??)u)uYY bb''0 0 LL H P H P S S J T J T i i ""  ==DDPPaaj~j~ttuuD D GG.. 0404MMo;>;bb``scscrrc c 77LL$$oo ))QQ``/./.00 GG 5 5 V VVVIIUUPP44GGFF""55HH\\ D>D>  t B t B " "  PPUU;;u?u?NN L L ??SS$$&K&KXX] W ] W RR{ { ##hhz3z3NN m  m VV00ss4Q4Qw w /g/gLvLvHH((  vvss^b^b3~3~__f f @@XX}}ccSSFMFMttiwiwllm9m9??yy33008!8!77jqjq? ?  ss$#$#*)*)/I-/I-10100I/0I/,T+,T+'&'&2" 2" yyKK|}|}1414#)#)vv ,f,f^>^66 dddd  i - i - 88$$HeHe  4+4+ l l a a  7  7 ccDDQQffeoeo /N/N H H   X X W % W % <<ggp7p7++,,^^1B1BBJBJz6z6GtGt88MbMb~~/7/76Q6QaLaLQQ77gsgs22jMjM##TTss2 2  00pp<<:: mmSSpNpN:: z  z @@ll{{FF UU@@%%AA77??$$I;I;SSwwEnEn&9&9||mzmzaQaQ..7/7/EGEG` } ` }   \\(>  hhtt&&PaPa%%OO}}h.h. % %XkXk?N?NlqlqRRmm. .   ccnnuu??&&yy\\GGN9N9RTRTRR!!NNNN3333}c}cLLYY A%A%&&',',55EoEo:: & &,, 66CCDDeeEE!!L L n e n e ++ # # p  p  9 9 &l&l R9R9O O 22RRRBRB22ss%%ee11\\66HUHU~~ssj j ZZss vZvZfIfI?"?"wTwT{c{cXIXI  C5C5A+A+KKo o F F _v_vll  & = & = #R#RQQ//DKDK55IIcc S S Q 3 Q 3 <<d d  " "{{jjhh   [[   a a ;;rr;;UUkkJ%J% t t * * <<8r8ruNuNopop\\OO----yZyZqkqkkiki&@&@EGEGaaGGYY##55 * * X X 88MSMS00__TOTOnn}}/p/pkwkwSS""?I?I i  i l l Q Q ee\\ ??,,jjii 66SSss{t{t))116K6K_k_kuuAA||#2#2  rre0e0d)d)JJVV    d d 33  CCO O --00ll66\\RtRt1[1[uEuEvXvX<.<.CCttttGG<<vvJ4J4vv))KK88^^++/B/BDKDK|T|Trr""JJ%^%^))PrPr$x$x55cUcUyynOnOXXMMBB B B g g ''rrNENEX+X+ ]  ] rrbWbW $ $ ddxqxqeCeCKKsTsT''8 * 8 * i i ..--}[}[YYNN22{{<><>C C o@o@iiz z 88xmxmfUfUCC)){{/j/jejej~~oo==8 ~ 8 ~ i  i  C}C}RRBNBN DD^^$($(QQ\\ddOeOe@@2a2a{{zz ' ' vv__,1,15 5 U!U!;;11 [ [ //\\ s sz z JJvvKKZZJgJgAAyyg g 3 3   $$;o;olqlqvPvP}}//Y^Y^JJ~~wwAA  O)O)oowwoo[[~~::]g]g[[0 0 <<kk00,,N7N7igig__ oo 2  2 ))ZKZKK K WW@z@znn__z3z3'' m`m`EE^^&V&Vff<<}}H/H/wwv8v8f f HH``NN<<MM$I$IPPRR]]~~"";;brbrtt$`$`@@uuxxzz9 G9 GuuR0R0oo  MMUeUenn!!44hh,,..\\AAzzeehh77Z5Z5>>eeggPmPmDD++vvAA.F.F==mmlleqeq__..!!AAhhbbLlLl  eeQcQccc'J'JnnHHzzg g U U % % y y   22F F a a x x **{{tt44##E E J J   rrIMIM++jjllaa } }JJ]qUs:-XX;Rkg((33{FS j2SS||e'e')e,ll n<)){{ `pN^88+F+Fii   w'w'&&II\\}}m&m&dd??VV55  ,  ,    CC&&}}||CCggaa^^% % g g L L   ''\\ffttwwTT==@@3 3 ! ! ( y ( y u o u o %  %    LLGNGNDD??rr[[++[[t't'CC&&PP[[6633rrTfx1eeQw[t 5522aaTDTD]]::CC PP<< Y Y==rrkk==ff,,VVZZ??ddeeW!6=wcIIRR >>ii]"]" 7 7ffg.g.kklls s <<^L^L,?,?wwJ J H H ==FF1%1%J>|M|MXXss>>^^u]u]$$    66hhc' c' Q Q ] { ] { 6 6 IIww44wOwOII ||pp__;";"+2+2,z,zbbRR ! !qqgg::**4{4{##}}cAcA33JJ||66H&H&887!7! g g @ @  IIbb<<KKHH(e(e  __.. _ _ ,,bbC@C@w w q M q M 4 E 4 E 99JJ##&&==$$/M/M++JJe2e277TXTX<<,,$$<v>99LL$$""  hhQQ..Y.Y.ANANh3h3@9@9R-R-;A;A++]H]H6C6C>m>mi%i%ee77 ,^,^"~"~    p p = = aa``yyHHA/A/}}22  x x 5 5 UU..ZZ==1h1h((D+D+88hhggWW//@E@E - -7W7W33:.:.TT=:=: hh''XCXC    <> jj'r'r@f@fyy..wwnnRR!!KK:q:qWWss%%ww -f-fYYRRff``II::tTtT}E}Eoo ) ) M 7 M 7  # #XvXv"G"G77 j jKKgg++AA;;==YY!!  X X   LL^6^6zz66eemm))99//tt88UU^^ggm\m\LNLNnknk008&8&66<>^^99((\ \ A A K 6K 6  ||AA : :   Q Q   t t y y    %%!!##    , , A Ah:h:;;ee4242XXZZ||AAIIttOO22^^jj<0<0^^11>>ccWWSSKKEE&&33jjECECcscsvv9v: Zu;E;E::NNS n*J2B2B^[L_ cchhd'd'tK^#l/ZNNVVR R iiqqn n u u @ @ **IIJJ++I1I1==WWNN  R TR T.}.}E E L S L S 1^1^[{[{ees]s]zz33P0P0BBRRMYMYssxx]]CCQfQf_J_J**bby.y.44(( F F  >%>%.S.S++%P%P##""".". V V     +_+_@0@0/5/5 S S# # ;;99__{${$ Y Y&^&^TTrr<<ww4444RRp6p6nMnMZZ>> !!SSMM{{**22  //' ' J J r r p p ] ] l l | | g g t t \ \ ' ' A A mm99ww!!OSOSrr]]GG,,77(({{::YjYjn2n2wowovv--5N5N88!M!M[[ddWrWr2277GGFMFM,,]]]']'DDJJee  ssPP44|w|w,F,F. . R  R  p p V Y V Y " 2 " 2 ` ` q, q, b b ::BB          F F hhHHxfxf""hh(h(hLL7755ppE~E~$J$JRRRfRfgg::>W>Waavcvc::gg))ooyy__tt%%}s}s--]]JJyy//    e=e=~Z~ZDUDU%% k k)o)o,z,zXKXKUUrr55nnS.S.uuXXww~~ffmLmLe/e/i'i'\\;;ll8l8l#"#"  CCrr__bb PP#?#?XXSSOOX}X}55nn\Z\Zt t XX'&'& L L2q2q * *__UsUs__g@g@77W W JJrr88RXRXZZ;*;*  ``  ? ?    ww d dI I J  J  --rr99""     =m=m~ S~ S WW5r5reeXX,,/33JMcuu^^@@Ed7&`6uuZZ{R{R  __ZZ77zaza//##BB&O&Onnoo{{ZZNN""r'r'\\o o  p  p 11>">"    O O   7  7   q qq qQ wQ w  O [O [    @ @ 's'shhbbhh))OO^^vvRRuu``gg ,,dcdclldd66>>ddDHDH1:1:%%;;..cc33xxpSpSU U l l   v v s s F F ( (  h 6h 6     { {O   \p    ]  ] K p K p  ja  9 D4040GGDDNNmmH|H|CC;;ffNNG!G!II0044  66dd66BB66  77"{"{vvcc44##((  HuHuMMV/V/((,!,! E Ez6z6DD|W|WPPAA||wwqqffpp--""(2(2^^oo22RR t tQ{Q{FF    6 6 SScciGiG''lluuAAu>u>X'X'ccr>r>ddPPDDllkSkShUhU//ee-/-/JJ>>00ww,?,?..ieie]q]q66j j 2 2 ,9 ,9   ''^"^"))LL|q|q  YSYSooZZkkdd''ccFF(([[&&s7s7##ee''MMRR99BB  ee` ` ss[[ppJJ-]-]LeLe44""gg88))8<8<]:]:xxccUUQQRwRw{{vv\\YYYYzzYYeeii#k#k~~**77gngnWW    M M ] ] :g:gDDvvnn""kk*b*bII  u R u R   Z Z_ _ 7 7 ##&&ff__}}FFvv//EE--TTOO " "]]y"y"iinnt_t_mm tt!!99U&U&xx,?,?--&&N:N:YYGG]J]J))hhVV[y [y ; ;     ppBB7$7$ooO O \;\;EEy$y$y@y@ II33!!M7M7//vvnn]]mGmG>>JJee@@ wwzzggAAvv>> d d,},}LL  **  LLNN66SSRRGgGgppUU11  xxHH55GG``EERRhhmmH&H&B5B5,,..zyzyVV1k1kEE,,RR#z#z009&9&==bb**ooEE@@qAqA %%ppss:7:7z_z_%%aaoobpbp!!??ffooPP!!jjZZ$$qqyiyi``11\B\B$$-v-v 1 1 mm  nnYYsszzjj]]Y.Y.[[*b*bff  **iiNN77~~22cucuQYQY ..&&D1D188uu$9$9$r$r??</>AbAbp}p}zz~o~o$$!!qqGGddvveeQQ;;$$IZIZS!S![[ SS2233rrhh8R8R  XXQ*Q*zqzq##f}f}==ipipxxwwXXQQdd,,ppRR##<<{x{xmm77  qq  L_L_))ppUUttllKK>>]]}Y}Y !!11kk55<<_A_A&&GG..uu::SS,,uu66&&{{  ~~}}RR22$$~~OOMlMljMjM  dKdKqEqE ee444"4"[[KK33}}ghghXX;;NfNfPTPT r rwwRROOf(f(^^qqV V jujuFFIIVEVE!!99ee%%"Z"ZNN%%pp::;n;njXjX""""55mmuuuuVV&&e=e=LLbMbM%%))v(v(\J\Ju u //iiYJYJ##ccXX@@ggJ?J?  "T"TUUhhOOo_o_#>#>NN,x,x  !!eeLL77HHckckw?w?gg<4<4ZZ]]++~E~EnhnhtRtRffddg6g6  iiPP``44ll;;\\<>II((wLwL&&eeddii1d1dkknn!!DZDZ}}OOAAJJPPNNLL;1;133%%(l(lOOmmII{{  LpLp**m^m^88NdNd^^DD00     T TCC[[OOPqPqmmd>d>::,M,M''  dd  ::9977]a]a1166ZZddww Y Y{{XXSSEE```2`2rr ? ?ss[[ppAAttFFddB1B1. . ] ] bIbI5599<<% % ??  aa"h"hy`y`||PP))11*}*}  ''88  pp]]""UU--iikk((nlnlccxx++JJee&&zMzM>J>J88))dd+J+JiiYoYo44  ^^bb\\s s ))""&&ddBBzzQQuu!H!Hmmbbxxtt--FF"7"7yyvv..3;3;cc(( ~~**FFrr--__AAddBB-w-w#n#nRRuu%~%~`v`v;o;ott11[[==.#.#<^<^88//ii  ll\\DDaa``ssL8L8wwAAWW0"0"44((  bb77''  E E ##pp..K;K;&&66//ppcc\\>>CC::ZZ gg,,ggUU]]xx JJVVPPjjkk~~SSuu--%-%-ll}} qq]`]`// < <%%%%__44%%HH__ l lggX X tt^^l:l:';';wwAGAG-f-f::((00xx66//..SSNN]]//77  MoMog*g*ff:g:g}}]]GG^Y^Y**<> Y:--44 ll66]#]#bbqqQQ WWTT))QQGG##4499DDSS{L{L44llm_m_**^+^+RRjjdd``!g!gmmcc4499aa==22..(^(^yzyz``UUyyO1O1;;]]GGMMuur>r>hh9911ll1@1@SS22++ ""ffNNIIJJL L   RF RF       ;- ;- Z Z eeOO~~77||rr99QQJJ"Z"Z..ssgg##KK,,aallzqzqGGUU>>ZZ)) O OCC++66SS$6$6M}M}DDuu))?=?=]]))0 0 s s     3 3 ii  88>>nnEEPP44VV<>jojo22II  5544bb((    E E %r %r W W     [[JDJDccc c ||22MMAAQQ;;F*F*6622NNY:Y:K,K, iiHHbYbYiWiWttf=f==q=q**4b4bLLLLrr]]DD++))--CCdvdvaaww) ) ]];;XXUU++((T}T}..@@""hh==gg[[uu44#^#^::NNUUmm@2@2zKzK{{I$I$bbu(u(@@2J2JWW))r=r=SvSv""QQddgg0808|(|(  //yOyOa'a'II)=)=  00CCt_t_aa99<>ffGGww,X,X - -zzUU%*%*55}}hh__GG'3'3""nnrrj j bbIIGG GGOO+E+EggLL##ZZGGmm$O$O--LLkk77OOoo||44}}00mmz=z=  HnHn##**!/!/%2%2f f UUrrC_C_kk33e e gg  v!v!CC``(J(JGGnnccTTgg[[MMeeDSDS,A,A9O9Orr00@@x@x@gghhHHccLL ? ?ll8W8W\\JJ]]||\\:b:bDD__((w=w=  //ZZ//.N.N//eejjUUz>z>||** &&%%(K(K<<^^EE&&@@HH`` ::!!33}}^^ggEE?v?vOO77vv  r"r"RR!!  ::!!  "<"<++]]#P#P((3g3gooY Y hh 88``}B}BHHRR~~??!!66VV77<<vvRMRMK?K?\V\VggNNMZMZ%%II>e>ehhnnQQV V FF[[OTOT    / /   ^ ^ \ \   N N DDVV H H++,Z,Zuu==KK+{+{))||+C+CCC>>ffjj v v((ZZ >>%%&&ff__,,,,b_b_**??||tt--NNMMHH1~1~xx  jj<<..pfpfRR,,;;QQZZeeC\C\66+F+FFqFqzzcc##]|]|eeoo{{VV!!bbj~j~ffBLBL+(+(OdOdgg^ ^ \\}}__::PPyy((AAPPV$V$U%U%NNSSa)a)vv  h/h/ccJ_J_y>J,["'Y\\\\ ~o00XXXXWHWH_4_4sSsS"|"|55IIww**CC66kk00 @@nnYY#{#{kk @ @ZZ99`J`J1Oo)PP66.Q.Quull< < vvQQ<<NN2R2Raacc&=&=d8d833 E EhThTnn,G,G``oocc66 a akk||44rrKK66e3e3zzuutNtNxwxwb6b6TTmN<g*A,@,@,P,P;[;[Fb9T-F!2++3Y3YIIYVTQNyBj7\7\#C#C"-"- * *|"|"ueueAA=(=(;;zz  ##TT]]v#v#hh((gg>n>nooggppddxxyyN1N1CC  7Y7Ycctt55XX22}9}9 . .>f>fFaFa++CCEE++wawateteOOHH00]]~(~(``ZZww``(?(?``TTppaa//uuffxxMM==  ||ElEl''!>!>HHyyP1P16644!C!Cbb<<55&&yydd*F*FMMVV>>qq*S*S115Y5Y6X6X%%>>TThh}}77TTnn88JJ;;__>>nn''44 k k;;::&/&/XX))Y:Y:\P\Pff|1|1gg))vv:b:b;m;m$$N9N9J$J$SSbb7N7N3[3[nnJJ66SS^B^Bzz``aaJJbb=_=_tt]]??__ h huu((>>RRddeehhllqqw-w-ll@@CCaaWW|/|/ppll6 6 88  MMXX99 l lyyRR44}}hhIIrr$L$LuuYYzz""&&\\vv??||pppypy  ]]ll{"{"NN,?,?}}EE,,>>''qq,,PP F F>o>opp  EE??^^LL3300KKDD\\  RRyy66GG++X0X0oo 33LL4 4 KKt\t\ugug\\~~EE00AAwwccAiAi$K$K11wwVV]]  3T3TXXtt||uu..MMPP5X5XCCrr-z-z~~ccZZD%D%66:R:RqqJJOO  {{a;JmJm 59`Ndt^^>>jjHH 5Y-~tRRttw2__hh\%\%F F AAZZgg119[9[=[=[/9/9  5c5cttCC66e_e_uulplp_Y_Y>,>,//8)8)JEJESRSRUSUSQ:Q:((,,>1>1GLGLYXYX22'.'.KK \ \!t!tEEuunn99HH Z Z%%[[CCddqqmmllmmpp''UU}}rrII**iiXX<<88GG**0R0RWKWKvvvvYCYCXX^^gGgGyyhhTTC!5 (/`<TT==ccSS[[ii77  oo::  zztlemw  gg'78 :&  T1J }TT44==WWnn~~ffTTHHttFFdd|N|N``_4_4JJLL**#>#>  66VV//22WW44?k?kss22@OMLJI66##00=CJPWMDD!!uaNx=^-E!2!2<< Y!W"V"L#C"9#0#0  ttaaNN;;HHee# ! 44f[PPPar r nn26tY} Zjjjjjjjd,MMccss^TKBp:`2O+?+?,,;;JJ))ffccJJHHYYyy__,,0K0K9Z9Z?Y?Y2X2X&W&WVV55``??..]]PPVVgg5i5i  CC!!|%|%KK33'9'9aa{'{'zz33yy!K!KCaCa=g=g'='=ooUUKKqq  9c9cdd55++uuEmEm##  ,a,aUUttPP1A1A  !!    uuKKAAGGmm99DDff^^@m@m&0&0*R*RQQ;;NNAAzzNzNzee((ssYYVVffuu**==@@33wwLL+l+l//NNJJ|$|$%%&@&@++HHOO}}IItt  ))/'/'/2/2*-*-!!YYttffiiyy!!NN{{eeGG e eJJnn}}{{kk@@YYtt]]ffRREE&&  ::;t;tcc""LLffppzzzz44ccEE;l;l1f1f(`(` J J44  FF``ZZccQQ]]"?"?NNPPPP.M.M  11>}>}[[!!||kk[[LL>q>qAmAmByByAA?q?q<]<](9(9mmII55!!t t jjddaaqq55aaaaMM99EEqq 5u5ugg9955SS-5-5     EE>q>qWWyyyyeeSSSSQQ^^WWOyOy7U7U!! mmII55!!MMyy==*i*i<u<u9a9a%M%M  ]]IIee55+a+a:}:}EyEy<u<u#A#A    !!   !!==IIEEAA==II(U(U2Q2Q9M9M=I=I?U?U?a?a>}>}<<9u9u5a5a0M0M+I+I&E&E!1!1 )) 5 5$A$A--   - -!I!I2U2U/a/a+M+M'9'9}}yyeeaammyyAA&]&]?y?yRR``iinnppoollggqqwwzzzzxxttnngg__WWOmOm7Y7Y"E"E Q Q-]-]6Y6Y<U<U/Q/Q#M#M}}IIyyppz z %%AA]]yymmYYEE11zz  !!MMyy % %AA%]%].i.i4u4uHHWWaaggZZNNCC9u9u/a/a&M&M.I.I3U3U6a6a7}7}VVmmmmkkWWEE5a5a--uuaa]]yy  %%AA"-"-    % %AA(M(M1Y1Y7e7e;q;q=m=m=i=i,U,UAA--))%%      ! !==99%% ! !== Y Y'e'e<q<q<m<m;Y;Y)E)E!! 11=]=]VVXXXXFF6i6i(E(E  }}iieeaa]]YYee        %%11==IIEEAA==99&U&U/q/qEEUU``ggkkllkkXXGG8i8i*E*EAA==995511==IIUUAA--  qqmmiieeaammyy   - -99*E*E#A#A==99EE$Q$Q(M(M*I*I*E*E)Q)Q'M'M$I$I!E!EAA==))%%!!-- 9 9 5 5!!    ))%%!!  ))55   libcdio-2.2.0/test/cdda.right000066400000000000000000000011471474051130400160330ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DA CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? Channels Premphasis? 1: 00:02:00 000000 audio false yes 2 no 170: 00:06:02 000302 leadout (693 KB raw, 693 KB formatted) Media Catalog Number (MCN): 0000010271955 Last CD Session LSN: not supported by drive/driver audio status: not implemented __________________________________ CD Analysis Report Language 0 'English': CD-TEXT for Disc: TITLE: Join us now we have the software PERFORMER: Richard Stallman CD-TEXT for Track 1: TITLE: Soft PERFORMER: Richard S libcdio-2.2.0/test/cdda_4_5.right000066400000000000000000000010111474051130400164700ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DA CD-ROM Track List (4 - 5) #: MSF LSN Type Green? Copy? Channels Premphasis? 4: 00:02:00 000000 audio false yes 2 no 5: 00:04:00 000150 audio false yes 2 no 170: 00:06:02 000302 leadout (693 KB raw, 693 KB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver audio status: not implemented __________________________________ CD Analysis Report No CD-TEXT on Disc. libcdio-2.2.0/test/cdtext-krosis.right000066400000000000000000000030401474051130400177350ustar00rootroot00000000000000 Language 0 'English': CD-TEXT for Disc: TITLE: A Memoir of Free Will PERFORMER: Krosis CD-TEXT for Track 1: TITLE: Gone But Not Forgotten PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905204 CD-TEXT for Track 2: TITLE: Insanity A Moniker Of Me PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905205 CD-TEXT for Track 3: TITLE: To Persist or Adhere PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905206 CD-TEXT for Track 4: TITLE: An Elegy for a Man Alive PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905207 CD-TEXT for Track 5: TITLE: Psychoticlysm PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905208 CD-TEXT for Track 6: TITLE: An Intramural Madness PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905209 CD-TEXT for Track 7: TITLE: Questions of a Holistic Divine PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905210 CD-TEXT for Track 8: TITLE: With Virtue I Am Free PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905211 CD-TEXT for Track 9: TITLE: Battles Are Won Within PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905212 CD-TEXT for Track 10: TITLE: A Memior of Free Will PERFORMER: Krosis SONGWRITER: Krosis COMPOSER: Krosis ARRANGER: Krosis ISRC: QM7281905213 libcdio-2.2.0/test/cdtext-libburnia.right000066400000000000000000000032441474051130400204000ustar00rootroot00000000000000 Language 0 'English': CD-TEXT for Disc: TITLE: Night Cats II PERFORMER: United Cat Orchestra SONGWRITER: Various Songwriters COMPOSER: Various Composers MESSAGE: For all our fans ARRANGER: Tom Cat UPC_EAN: 1234567890123 GENRE: Feline classic music DISC_ID: 1234567890 GENRE_CODE: 5 (Classical) CD-TEXT for Track 1: TITLE: Song of Joy PERFORMER: Felix and The Purrs SONGWRITER: Friedrich Schiller COMPOSER: Ludwig van Beethoven MESSAGE: Fritz and Louie once were punks ARRANGER: Tom Cat ISRC: XYBLG1101234 CD-TEXT for Track 2: TITLE: The Hunt PERFORMER: Catwalk Beauties SONGWRITER: Mother Nature COMPOSER: unknown ARRANGER: Tom Cat ISRC: XYBLG1100005 CD-TEXT for Track 3: TITLE: Mee Owwww PERFORMER: Mia Kitten SONGWRITER: Mia Kitten COMPOSER: Mia Kitten ARRANGER: Mia Kitten ISRC: XYBLG1100006 Language 1 'German': CD-TEXT for Disc: TITLE: Nachtkratz II PERFORMER: Vereinigtes Katzenorchester SONGWRITER: Verschiedene Liedschreiber COMPOSER: Verschiedene Komponisten MESSAGE: Für alle unsere Fans ARRANGER: Tom Cat UPC_EAN: 1234567890123 GENRE: Klassische Katzenmusik DISC_ID: 1234567890 GENRE_CODE: 5 (Classical) CD-TEXT for Track 1: TITLE: Freudenlied PERFORMER: Felix und Die Schnurrer SONGWRITER: Friedrich Schiller COMPOSER: Ludwig van Beethoven MESSAGE: Fritz und Louie waren einmal Punks ARRANGER: Tom Cat ISRC: XYBLG1101234 CD-TEXT for Track 2: TITLE: Die Jagd PERFORMER: Laufsteg Miezen SONGWRITER: Mutter Natur COMPOSER: unbekannt ARRANGER: Tom Cat ISRC: XYBLG1100005 CD-TEXT for Track 3: TITLE: Mie auu PERFORMER: Mia Kätzchen SONGWRITER: Mia Kätzchen COMPOSER: Mia Kätzchen ARRANGER: Mia Kätzchen ISRC: XYBLG1100006 libcdio-2.2.0/test/cdtext.right000066400000000000000000000034111474051130400164270ustar00rootroot00000000000000 Language 0 'English': CD-TEXT for Disc: TITLE: Joyful Nights PERFORMER: United Cat Orchestra SONGWRITER: Various Songwriters COMPOSER: Various Composers MESSAGE: For all our fans ARRANGER: Tom Cat UPC_EAN: 1234567890123 GENRE: Feline classic music DISC_ID: 1234567890 GENRE_CODE: 5 (Classical) CD-TEXT for Track 1: TITLE: Song of Joy PERFORMER: Felix and The Purrs SONGWRITER: Friedrich Schiller COMPOSER: Ludwig van Beethoven MESSAGE: Fritz and Louie once were punks ARRANGER: Tom Cat ISRC: XYBLG1101234 CD-TEXT for Track 2: TITLE: Humpty Dumpty PERFORMER: Catwalk Beauties SONGWRITER: Mother Goose COMPOSER: unknown MESSAGE: Pluck the goose ARRANGER: Tom Cat ISRC: XYBLG1100005 CD-TEXT for Track 3: TITLE: Mee Owwww PERFORMER: Mia Kitten SONGWRITER: Mia Kitten COMPOSER: Mia Kitten ARRANGER: Mia Kitten ISRC: XYBLG1100006 Language 1 'German': CD-TEXT for Disc: TITLE: Freudvolle Nächte PERFORMER: Vereinigtes Katzenorchester SONGWRITER: Verschiedene Liedschreiber COMPOSER: Verschiedene Komponisten MESSAGE: Für alle unsere Fans ARRANGER: Tom Cat UPC_EAN: 1234567890123 GENRE: Katzenhafte Klassik DISC_ID: 1234567890 GENRE_CODE: 5 (Classical) CD-TEXT for Track 1: TITLE: Lied der Freude PERFORMER: Felix und Die Schnurrer SONGWRITER: Friedrich Schiller COMPOSER: Ludwig van Beethoven MESSAGE: Fritz und Louie waren einmal Punks ARRANGER: Tom Cat ISRC: XYBLG1101234 CD-TEXT for Track 2: TITLE: Rubbeldiekatz PERFORMER: Katzengang Schönheiten SONGWRITER: Mutter Gans COMPOSER: unbekannt MESSAGE: Rupft die Gans ARRANGER: Tom Cat ISRC: XYBLG1100005 CD-TEXT for Track 3: TITLE: Mie auu PERFORMER: Mia Kätzchen SONGWRITER: Mia Kätzchen COMPOSER: Mia Kätzchen ARRANGER: Mia Kätzchen ISRC: XYBLG1100006 libcdio-2.2.0/test/check_bad_iso.sh000077500000000000000000000013171474051130400171740ustar00rootroot00000000000000#!/bin/sh if test -z $srcdir ; then srcdir=$(pwd) fi if test "X$top_builddir" = "X" ; then top_builddir=$(pwd)/.. fi . ${top_builddir}/test/check_common_fn if test ! -x ../src/iso-info ; then exit 77 fi BASE=$(basename $0 .sh) fname=bad-dir RC=0 opts="--quiet ${srcdir}/../test/data/${fname}.iso" cmdname=iso-info cmd=../src/iso-info if ! "${cmd}" --quiet --no-header ${opts} 2>&1 ; then echo "$0: unexpected failure" RC=1 fi opts="--quiet ${srcdir}/test/data/${fname}.iso --iso9660" if "${cmd}" --no-header ${opts} 2>&1 ; then ((RC+=1)) else echo "$0: expected failure" fi exit $RC #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_cd_read.sh000077500000000000000000000031011474051130400171460ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2003, 2005, 2008, 2010 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Tests to see that CD reading is correct (via cd-read). if test -z $srcdir ; then srcdir=`pwd` fi if test "X$top_builddir" = "X" ; then top_builddir=`pwd`/.. fi . ${top_builddir}/test/check_common_fn if test ! -x ../src/cd-read ; then exit 77 fi BASE=`basename $0 .sh` fname=cdda testnum=CD-DA opts="-c ${srcdir}/data/${fname}.cue --mode=red --just-hex --start=0" test_cd_read "$opts" ${fname}-read.dump ${srcdir}/${fname}-read.right RC=$? check_result $RC "cd-read CUE test $testnum" "cd-read $opts" fname=isofs-m1 testnum=MODE1 opts="-i ${srcdir}/data/${fname}.cue --mode m1f1 -s 26 -n 2" test_cd_read "$opts" ${fname}-read.dump ${srcdir}/${fname}-read.right RC=$? check_result $RC "cd-read CUE test $testnum" "$CD_READ $opts" exit $RC #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_cdtext.sh000077500000000000000000000040041474051130400170630ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2016 Leon Merten Lohse # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # if test "X$srcdir" = "X" ; then exit $SKIP_TEST_EXITCODE fi . $srcdir/check_common_fn CDTEXT_RAW=$srcdir/../example/cdtext-raw if test ! -x $CDTEXT_RAW ; then exit $SKIP_TEST_EXITCODE fi if test "X$DIFF" = "X" ; then exit $SKIP_TEST_EXITCODE fi if test "$DIFF" = "no"; then echo "$0: No diff(1) or cmp(1) found - cannot test ${cmdname}" exit $SKIP_TEST_EXITCODE fi test_cdtext_raw() { opts="$1" outfile="$2" rightfile="$3" if "${CDTEXT_RAW}" ${opts} >"${outfile}" 2>&1 ; then if $DIFF $DIFF_OPTS "${outfile}" "${rightfile}" ; then $RM "${outfile}" return 0 else return 3 fi else echo "$0 failed running: cdtext-raw ${opts}" return 2 fi } fname=cdtext opts="${srcdir}/data/${fname}.cdt" test_cdtext_raw "$opts" ${srcdir}/${fname}.dump ${srcdir}/${fname}.right RC=$? check_result $RC "CD-Text parser" "${CDTEXT_RAW} $opts" fname=cdtext-libburnia opts="${srcdir}/data/${fname}.cdt" test_cdtext_raw "$opts" ${srcdir}/${fname}.dump ${srcdir}/${fname}.right RC=$? check_result $RC "CD-Text libburnia roundtrip" "${CDTEXT_RAW} $opts" fname=cdtext-krosis opts="${srcdir}/data/${fname}.cdt" test_cdtext_raw "$opts" ${srcdir}/${fname}.dump ${srcdir}/${fname}.right RC=$? check_result $RC "CD-Text Krosis blanks + tab indicator" "${CDTEXT_RAW} $opts" exit 0 libcdio-2.2.0/test/check_common_fn.in000066400000000000000000000075571474051130400175540ustar00rootroot00000000000000# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 # Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Common routines and setup for regression testing. SKIP_TEST_EXITCODE=77 # Some output changes depending on TZ and locale. Set this so we get known # results TZ=CUT # both 'en_US' and 'en_US.utf8' might be defined on some platforms if locale -a >/dev/null 2>&1 ; then # Note: Solaris 10's shell can't handle $(..) so we use `...` LC_TIME=`locale -a | grep 'en_US' | grep -v 'utf8' | grep -v 'iso88591' &2>/dev/null` fi [ -z "$LC_TIME" ] && { LC_TIME=${LC_TIME:-en_US} }>/dev/null 2>&1 export TZ LC_TIME DIFF="@DIFF@" DIFF_OPTS="@DIFF_OPTS@" RM="@RM@" check_result() { RC=$1 shift msg=$1 shift cmdline="$cmd $*" if test $RC -ne 0 ; then if test $RC -ne $SKIP_TEST_EXITCODE ; then echo "$0: $msg failed." if test -n "$cmdline" ; then echo "$0: failed command:" echo " $cmdline" fi exit $RC else echo "-- $0: $msg skipped." fi else echo "-- $0: $msg ok." fi } test_common() { cmdname="$1" cmd="../src/${cmdname}@EXEEXT@" opts="$2" outfile="$3" rightfile="$4" if [ ! -x "${cmd}" ]; then echo "-- $0: No ${cmd}" return 1 fi cmdline="${cmd}" if "${cmd}" --no-header ${opts} >"${outfile}" 2>&1 ; then if test "@DIFF@" != no; then if @DIFF@ @DIFF_OPTS@ "${outfile}" "${rightfile}" ; then rm -f "${outfile}" return 0 else return 3 fi else echo "$0: No diff(1) or cmp(1) found - cannot test ${cmdname}" rm -f "${outfile}" return $SKIP_TEST_EXITCODE fi else echo "$0 failed running: ${cmdname} ${opts}" return 2 fi } test_cdinfo() { test_common cd-info "$@" } test_iso_info() { test_common iso-info "$@" } test_cd_read() { test_common cd-read "$@" } test_iso_read() { # not test_common, as we use an output file not stdout. opts="$1" outfile="$2" rightfile="$3" ISO_READ="../src/iso-read@EXEEXT@" if [ ! -x ${ISO_READ} ]; then echo "-- $0: No ${ISO_READ}" return 1 fi if "${ISO_READ}" ${opts} -o "${outfile}" 2>&1 ; then if test "@DIFF@" != no; then if @DIFF@ @DIFF_OPTS@ "${outfile}" "${rightfile}" ; then rm -f "${outfile}" return 0 else return 3 fi else echo "$0: No diff(1) or cmp(1) found - cannot test ${ISO_READ}" rm -f "${outfile}" return 77 fi else echo "$0 failed running: ${ISO_READ} ${opts} -o ${outfile}" return 2 fi } test_legal_header() { cmdname="$1" cmd="../src/${cmdname}@EXEEXT@" opts="$2" outfile="$3" if test "@GREP@" = no; then echo "$0: No grep(1) found - cannot test ${cmd}." echo "$0: Legal header test skipped." exit $SKIP_TEST_EXITCODE fi "${cmd}" ${opts} > ${outfile} 2>&1 while read line; do @GREP@ "${line}" ${outfile} >/dev/null 2>&1 if [ "$?" -ne 0 ] ; then echo "$0: Legal header test failed due to missing expected line:" echo " ${line}" echo "$0: Failed command:" echo " ${cmd} ${opts}" exit 4 fi done < ${srcdir}/check_legal.regex rm -f ${outfile} echo "-- $0: Legal header of ${cmd} ${opts} ok." } #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_cue.sh.in000077500000000000000000000074611474051130400167630ustar00rootroot00000000000000#!/bin/sh # Tests to see that BIN/CUE and cdrdao TOC file iamge reading is correct # (via cd-info). if test ! -d "@VCDINFO_LIBS@" ; then vcd_opt='--no-vcd' fi if test ! -d "$abs_top_srcdir" ; then abs_top_srcdir=@abs_top_srcdir@ fi if test ! -d "$top_builddir" ; then top_builddir=@abs_top_builddir@ fi . ${top_builddir}/test/check_common_fn CD_INFO=$abs_top_srcdir/src/cd-info if test ! -x $CD_INFO ; then exit 77 fi BASE=`basename $0 .sh` fname=cdda testnum=CD-DA for fname in cdda cdda_4_5 do if test "$fname" = cdda_4_5 then testnum=CD-DA-4-5 else testnum=CD-DA fi if test -f ${abs_top_srcdir}/test/data/${fname}.bin ; then opts="--quiet --no-device-info --cue-file ${abs_top_srcdir}/test/data/${fname}.cue --no-cddb" test_cdinfo "$opts" ${fname}.dump ${abs_top_srcdir}/test/${fname}.right RC=$? check_result $RC "cd-info CUE test $testnum" "${CD_INFO} $opts" opts="--quiet --no-device-info --bin-file ${abs_top_srcdir}/test/data/${fname}.bin --no-cddb" test_cdinfo "$opts" ${fname}.dump ${abs_top_srcdir}/test/${fname}.right RC=$? check_result $RC "cd-info BIN test $testnum" "${CD_INFO} $opts" else echo "-- Don't see BIN file ${abs_top_srcdir}/test/data/${fname}.bin. Test $testnum skipped." fi done fname=isofs-m1 if test -f ${abs_top_srcdir}/test/data/${fname}.bin ; then testnum='ISO 9660 mode1 CUE' if test -n "@HAVE_ROCK@"; then opts="-q --no-device-info --no-disc-mode --cue-file ${abs_top_srcdir}/test/data/${fname}.cue --iso9660" ( cd ${abs_top_srcdir}/test/ test_cdinfo "$opts" ${fname}.dump ${fname}.right RC=$? check_result $RC "cd-info Rock-Ridge CUE test $testnum" "${CD_INFO} $opts" ) else opts="-q --no-device-info --no-disc-mode --no-rock-ridge --cue-file ${abs_top_srcdir}/test/data/${fname}.cue --iso9660" ( cd ${abs_top_srcdir}/test/ test_cdinfo "$opts" ${fname}.dump ${fname}-no-rr.right RC=$? check_result $RC "cd-info no Rock-Ridge CUE test $testnum" "${CD_INFO} $opts" ) fi testnum='ISO 9660 mode1 TOC' if test -n "@HAVE_ROCK@"; then opts="-q --no-device-info --no-disc-mode --toc-file ${abs_top_srcdir}/test/data/${fname}.toc --iso9660" ( cd ${abs_top_srcdir}/test/ test_cdinfo "$opts" ${fname}.dump ${fname}-test2.right RC=$? check_result $RC "cd-info TOC test $testnum" "${CD_INFO} $opts" ) fi else echo "-- Don't see BIN file ${abs_top_srcdir}/test/data/${fname}.bin. Test $testnum skipped." fi fname=vcd_demo testnum='Video CD' if test -f ${abs_top_srcdir}/test/data/${fname}.bin ; then if test -z "@VCDINFO_LIBS@" ; then right=${abs_top_srcdir}/test/${fname}.right else right=${abs_top_srcdir}/test/${fname}_vcdinfo.right fi opts="-q --no-device-info --no-disc-mode -c ${abs_top_srcdir}/test/data/${fname}.cue --iso9660" test_cdinfo "$opts" ${fname}.dump $right RC=$? check_result $RC "cd-info CUE test $testnum" "${CD_INFO} $opts" opts="-q --no-device-info --no-disc-mode -t ${abs_top_srcdir}/test/data/${fname}.toc --iso9660" test_cdinfo "$opts" ${fname}.dump $right RC=$? check_result $RC "cd-info TOC test $testnum" "${CD_INFO} $opts" else echo "-- Don't see BIN file ${abs_top_srcdir}/test/data/${fname}.bin. Test $testnum skipped." fi fname=svcd_ogt_test_ntsc testnum='Super Video CD' if test -f ${abs_top_srcdir}/test/data/${fname}.bin ; then opts="-q --no-device-info --no-disc-mode --cue-file ${abs_top_srcdir}/test/data/${fname}.cue $vcd_opt --iso9660" test_cdinfo "$opts" ${fname}.dump ${abs_top_srcdir}/test/${fname}.right RC=$? check_result $RC "cd-info CUE test $testnum" "${CD_INFO} $opts" else echo "-- Don't see BIN file ${abs_top_srcdir}/test/data/${fname}.bin. Test $testnum skipped." fi exit $RC #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_deep_directory.sh000077500000000000000000000034121474051130400205730ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2020 Pete Batard # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Tests Rock Ridge deep directories (via iso-info and iso-read). if test -z "$srcdir" ; then srcdir=`pwd` fi if test "X$top_builddir" = "X" ; then top_builddir=`pwd`/.. fi . ${top_builddir}/test/check_common_fn if test ! -x ../src/iso-info ; then exit 77 fi if test ! -x ../src/iso-read ; then exit 77 fi BASE=`basename $0 .sh` fname=deep_directory # File listing iso_image="${srcdir}/data/deep-directory.iso" opts="--no-header --quiet -l ${iso_image}" test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right RC=$? check_result $RC 'Deep directory listing test' "$ISO_INFO $opts" # File dump and comparison opts="--ignore --image ${iso_image} --extract 1/2/3/4/5/6/7/8/8.txt" test_iso_read "$opts" ${fname} ${srcdir}/data/deep_directory1_file RC=$? check_result $RC 'Deep directory read test level 8' "$ISO_READ $opts" opts="--ignore --image ${iso_image} --extract 1/2/3/4/5/6/7/8/9/10/11/12/13/14/14.txt" test_iso_read "$opts" ${fname} ${srcdir}/data/deep_directory2_file RC=$? check_result $RC 'Deep directory read test level 14' "$ISO_READ $opts" exit $RC libcdio-2.2.0/test/check_fuzzyiso.sh000077500000000000000000000020011474051130400174650ustar00rootroot00000000000000#!/bin/sh #$Id: check_fuzzyiso.sh,v 1.6 2008/03/20 03:45:43 edsdead Exp $ if test "X$srcdir" = "X" ; then srcdir=`pwd` fi if test "X$top_srcdir" = "X" ; then top_srcdir=`pwd`/.. fi if test "X$top_builddir" = "X" ; then top_builddir=`pwd`/.. fi check_program="$top_builddir/example/isofuzzy" if test ! -x $check_program ; then exit 77 fi cd $srcdir; src_dir=`pwd` for file in $src_dir/data/*.bin $src_dir/data/*.iso $src_dir/data/*.nrg ; do case "$file" in $src_dir/data/p1.nrg | $src_dir/data/p1.bin | $src_dir/data/cdda.bin | $src_dir/data/cdda_4_5.bin | $src_dir/data/cdtextfile.bin | $src_dir/data/cdda-mcn.nrg | $src_dir/data/svcdgs.nrg | $src_dir/data/cdtext.bin | $src_dir/data/udf102.iso ) good_rc=1 ;; *) good_rc=0 ;; esac $check_program $file if test $? -ne $good_rc ; then echo "$0: failed running:" echo " $check_program $file" exit 1 fi done exit 0 #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_iso.sh.in000077500000000000000000000041111474051130400167660ustar00rootroot00000000000000#!@SHELL@ if test -z $srcdir ; then srcdir=$(pwd) fi if test "X$top_builddir" = "X" ; then top_builddir=$(pwd)/.. fi . ${top_builddir}/test/check_common_fn if test ! -x ../src/iso-info@EXEEXT@ ; then exit 77 fi BASE=$(basename $0 .sh) fname=copying opts="--quiet ${srcdir}/data/${fname}.iso --iso9660 " test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right RC=$? check_result $RC 'iso-info basic test' "$ISO_INFO $opts" opts="--ignore --image ${srcdir}/data/${fname}.iso --extract $fname " test_iso_read "$opts" ${fname} ${srcdir}/copying.gpl RC=$? check_result $RC 'iso-read basic test' "$ISO_READ $opts" if test -n "@HAVE_ROCK@"; then fname=copying-rr if test -n "@MINGW32@"; then right_file=${fname}-mingw.right else right_file=${fname}.right fi opts="--quiet ${srcdir}/data/${fname}.iso --iso9660 " test_iso_info "$opts" ${fname}.dump ${srcdir}/${right_file} RC=$? check_result $RC 'iso-info Rock Ridge test' "$ISO_INFO $opts" opts="--image ${srcdir}/data/${fname}.iso --extract COPYING" test_iso_read "$opts" ${fname} ${srcdir}/copying-rr.gpl RC=$? check_result $RC 'iso-read RR test' "$ISO_READ $opts" fi if test -n "@HAVE_JOLIET@" ; then BASE=$(basename $0 .sh) fname=joliet opts="--quiet ${srcdir}/data/${fname}.iso --iso9660 " test_iso_info "$opts" ${fname}-nojoliet.dump ${srcdir}/${fname}.right RC=$? check_result $RC 'iso-info Joliet test' "$cmdline" opts="--quiet ${srcdir}/data/${fname}.iso --iso9660 --no-joliet " test_iso_info "$opts" ${fname}-nojoliet.dump \ ${srcdir}/${fname}-nojoliet.right RC=$? check_result $RC 'iso-info --no-joliet test' "$cmdline" fi for fname in malformed malformed2; do opts="--quiet ${srcdir}/data/${fname}.iso -f " test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right BAD_RC=$? if test $BAD_RC -ne 0 ; then check_result 0 "iso-info $fname test" "$cmdline" else echo "$0: in $fname Expecting nonzero return" RC=1 fi done exit $RC #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_iso_read.sh.in000077500000000000000000000163031474051130400177670ustar00rootroot00000000000000#!/bin/sh # # check_iso_read.sh # # Author: Leo Baschy # Some small adaptions made to make it work in libcdio's test suite by # rocky. # # takes zero, one, or two optional parameters in any order # # ONE optional parameter: # an integer number for approximate size of .iso file in megabytes, # default is 1, for 1 megabyte, # to test approximately 5 gigabytes pass 5000 # # OTHER optional parameter: # the iso-read command you want to test, # default is iso-read, # has to be named iso-read to be recognized, # could be for example src/iso-read # # Set environment variable VERBOSE=1 for more verbose output RM='@RM@' VERBOSE=${VERBOSE:-0} # Run $@ capturing output. Show output on an error or if VERBOSE is # set. run_cmd() { output=`$@ 2>&1` if [ $? -ne 0 -o $VERBOSE -ne 0 ]; then echo >&2 -- $output fi } # Remove file $1 if that file exists rm_if_exists() { file=$1 [ -f $file ] && $RM $file } # Remove driectory $1 if that directory exists rmdir_if_exists() { dir=$1 [ -d $dir ] && $RM -r $dir } cleanup() { for i in 0 1 2 3 4 5 6 7 8 9 ; do rm_if_exists 1Mfile${i}s-read.txt done for file in exampleIso1M.iso exampleIso1M.iso.tar.gz; do rm_if_exists $file done rmdir_if_exists exampleIso1M.iso.prep } # in $1 or $2 accept integer number as total .iso size in megabytes case "$1" in [0-9]* ) size="$1" ;; *) case "$2" in [0-9]* ) size="$2" ;; *) size="1" ;; # default esac ;; esac # in $1 or $2 accept a different location for iso-read, # e.g. ~/libcdio/src/iso-read case "$1" in iso-read ) ISO_READ="$1" ;; *) case "$2" in iso-read ) ISO_READ="$2" ;; *) ISO_READ="../src/iso-read" ;; esac ;; esac if [ ! -x ${ISO_READ} ]; then echo "-- $0: No ${ISO_READ}. Skipping." exit 77 fi echo "-- Going to use ${ISO_READ}." echo "-- " `$ISO_READ --version` # pick for your system, # on a Mac mkisofs, otherwise people use newer genisoimage isomakingcommand="@ISO_MAKING_COMMAND@" if [ -z "$isomakingcommand" ] then echo "-- $0: Neither mkisofs nor genisoimage found. Skipping." exit 77 fi echo "-- Working with a $size megabyte large .iso file in $datadir ." isoname="exampleIso"$size"M.iso" prepdir="prep" if [ ! -f "$isoname" ] then echo "-- Going to use " `which "$isomakingcommand"` " to prepare $isoname in $isoname.$prepdir ." mkdir "$isoname.$prepdir" mkdir "$isoname.$prepdir"/mixed # a large file with many of the same characters that will compress well run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\060' > "$isoname.$prepdir/mixed/file0l.txt" # a small file we will want to iso-read echo "content of short text file #0 we are looking for" > "$isoname.$prepdir/mixed/file0s.txt" # a few times over now run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\061' > "$isoname.$prepdir/mixed/file1l.txt" echo "content of short text file #1 we are looking for" > "$isoname.$prepdir/mixed/fileOneSmall.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\062' > "$isoname.$prepdir/mixed/file2l.txt" echo "content of short text file #2 we are looking for" > "$isoname.$prepdir/mixed/file2small.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\063' > "$isoname.$prepdir/mixed/file3l.txt" echo "content of short text file #3 we are looking for" > "$isoname.$prepdir/mixed/file3ThreeSmall.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\064' > "$isoname.$prepdir/mixed/file4l.txt" echo "content of short text file #4 we are looking for" > "$isoname.$prepdir/mixed/fileFourS.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\065' > "$isoname.$prepdir/mixed/file5l.txt" echo "content of short text file #5 we are looking for" > "$isoname.$prepdir/mixed/file5small.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\066' > "$isoname.$prepdir/mixed/file6l.txt" echo "content of short text file #6 we are looking for" > "$isoname.$prepdir/mixed/file6s.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\067' > "$isoname.$prepdir/mixed/file7l.txt" echo "content of short text file #7 we are looking for" > "$isoname.$prepdir/mixed/fileSevenSmall.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\068' > "$isoname.$prepdir/mixed/file8l.txt" echo "content of short text file #8 we are looking for" > "$isoname.$prepdir/mixed/file8s.txt" run_cmd dd if=/dev/zero bs=1024 count=$size"00" | tr '\0' '\069' > "$isoname.$prepdir/mixed/file9l.txt" echo "content of short text file #9 we are looking for" > "$isoname.$prepdir/mixed/file9s.txt" # a potentially huge .iso file, whatever you wrote above run_cmd "$isomakingcommand" -r -J -T -f -V "EXAMPLEISO"$size"M" -o "$isoname" "$isoname.$prepdir" # if you want to archive a test file, this compressed one is much smaller, # seen 4KB instead of 1MB, seen 5MB instead of 5GB v_opt='' [ $VERBOSE -ne 0 ] && v_opt='-v' tar $v_opt -cf "$isoname.tar" "$isoname" gzip $v_opt -9 "$isoname.tar" else echo "-- Using existing $isoname ." fi # remind of disk space use # ls -al # du -h . echo " -- ---------------------------------------- -- Size $size megabyte .iso file read back: -- ---------------------------------------- " for i in 0 1 2 3 4 5 6 7 8 9 do echo "didn't read file #$i" > $size"Mfile"$i"s-read.txt" done # "$ISO_READ" -i "$isoname" -e "mixed/file0s.txt" -o $size"Mfile0s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/fileOneSmall.txt" -o $size"Mfile1s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/file2small.txt" -o $size"Mfile2s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/file3ThreeSmall.txt" -o $size"Mfile3s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/fileFourS.txt" -o $size"Mfile4s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/file5small.txt" -o $size"Mfile5s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/file6s.txt" -o $size"Mfile6s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/fileSevenSmall.txt" -o $size"Mfile7s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/file8s.txt" -o $size"Mfile8s-read.txt" "$ISO_READ" -i "$isoname" -e "mixed/file9s.txt" -o $size"Mfile9s-read.txt" # anybad=0 for i in 0 1 2 3 4 5 6 7 8 9 do readback=`cat $size"Mfile"$i"s-read.txt"` if [ "$readback" = "content of short text file #$i we are looking for" ] then echo "-- file #$i read back OK: $readback" else anybad=1 echo "file #$i read DEFECT : $readback" fi done cleanup if [ $anybad -eq 0 ] then echo "-- $0: Overall success of $0 :)" else echo "$0: Overall FAILURE of $0 :(" fi exit $anybad # if it worked correctly you should see the lines we wrote into the short files: # # content of short text file #i we are looking for # # IF however defect https://savannah.gnu.org/bugs/?39373 is still # in effect you might see lines such as: # 111111111111111111111111111111111111 # # furthermore, IF however defect https://savannah.gnu.org/bugs/?39354 is still # in effect you might see lines such as: # # iso-read: Could not get ISO-9660 file information out of $isoname for file mixed/file2small.txt. # iso-read: iso-info may be able to show the contents of $isoname. libcdio-2.2.0/test/check_legal.regex000066400000000000000000000003221474051130400173500ustar00rootroot00000000000000cd-info.* version [0-9] ^Copyright (c) 20 Bernstein ^This is free software; see the source for copying conditions\.$ ^There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A$ ^PARTICULAR PURPOSE\.$ libcdio-2.2.0/test/check_multiextent.sh000077500000000000000000000036541474051130400201640ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2020 Pete Batard # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Tests multiextents (via iso-info and iso-read). if test -z "$srcdir" ; then srcdir=`pwd` fi if test "X$top_builddir" = "X" ; then top_builddir=`pwd`/.. fi . ${top_builddir}/test/check_common_fn if test ! -x ../src/iso-info ; then exit 77 fi if test ! -x ../src/iso-read ; then exit 77 fi BASE=`basename $0 .sh` for i in multi_extent_8k.iso \ multi_extent_8k_emul_toc_padded.iso \ multi_extent_8k_joliet.iso do if test "$i" = multi_extent_8k.iso then fname=multiextent aspect="ISO9660+RockRidge" elif test "$i" = multi_extent_8k_emul_toc_padded.iso then fname=multiextent_emultocpad aspect="ISO9660+RockRidge+EmulTOC+Padding" else fname=multiextent_joliet aspect="Joliet" fi # File listing iso_image="${srcdir}/data/${i}" opts="--no-header --quiet -l ${iso_image}" test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right RC=$? check_result $RC "$aspect"' multiextent listing test' "$ISO_INFO $opts" # File dump and comparison opts="--ignore --image ${iso_image} --extract multi_extent_file" test_iso_read "$opts" ${fname} ${srcdir}/data/multi_extent_file RC=$? check_result $RC "$aspect"' multiextent read test' "$ISO_READ $opts" done exit $RC libcdio-2.2.0/test/check_nrg.sh.in000077500000000000000000000035661474051130400167770ustar00rootroot00000000000000#!/bin/sh #$Id: check_nrg.sh.in,v 1.17 2007/12/28 02:11:01 rocky Exp $ if test "@VCDINFO_LIBS@X" != "X" ; then vcd_opt='--no-vcd' fi if test "X$srcdir" = "X" ; then srcdir=`pwd` fi if test "X$top_srcdir" = "X" ; then top_srcdir=`pwd`/.. fi if test "X$top_builddir" = "X" ; then top_builddir=`pwd`/.. fi . ${top_builddir}/test/check_common_fn if test ! -x $top_srcdir/src/cd-info ; then exit 77 fi BASE=`basename $0 .sh` test_name=videocd opts="--quiet --no-device-info --nrg-file ${srcdir}/data/${test_name}.nrg $vcd_opt --iso9660" test_cdinfo "$opts" ${test_name}.dump ${srcdir}/${test_name}.right RC=$? check_result $RC 'cd-info NRG test 1' "${CD_INFO} $opts" BASE=`basename $0 .sh` nrg_file=${srcdir}/data/monvoisin.nrg if test -f $nrg_file ; then test_cdinfo "-q --no-device-info --nrg-file $nrg_file $vcd_opt --iso9660 " \ monvoisin.dump ${srcdir}/monvoisin.right RC=$? check_result $RC 'cd-info NRG test 2' else echo "-- Don't see NRG file ${nrg_file}. Test skipped." exit 0 fi test_name='svcdgs' nrg_file=${srcdir}/data/${test_name}.nrg opts="-q --no-device-info --nrg-file $nrg_file $vcd_opt --iso9660" if test -f $nrg_file ; then test_cdinfo "$opts" ${test_name}.dump ${srcdir}/${test_name}.right RC=$? check_result $RC "cd-info NRG $test_name" "${CD_INFO} $opts" else echo "-- Don't see NRG file ${nrg_file}. Test skipped." exit $SKIP_TEST_EXITCODE fi test_name='cdda-mcn' nrg_file=${srcdir}/data/${test_name}.nrg opts="-q --no-device-info --nrg-file $nrg_file --no-cddb" if test -f $nrg_file ; then test_cdinfo "$opts" ${test_name}.dump ${srcdir}/${test_name}.right RC=$? check_result $RC "cd-info NRG $test_name" "${CD_INFO} $opts" exit $RC else echo "-- Don't see NRG file ${nrg_file}. Test skipped." exit $SKIP_TEST_EXITCODE fi #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_opts.sh000077500000000000000000000015751474051130400165670ustar00rootroot00000000000000#!/bin/sh #$Id: check_opts.sh,v 1.10 2007/12/28 02:11:01 rocky Exp $ # Check cd-info options if test -z "$srcdir" ; then srcdir=`pwd` fi if test "X$top_builddir" = "X" ; then top_builddir=`pwd`/.. fi . ${top_builddir}/test/check_common_fn if test ! -x ../src/cd-info ; then exit 77 fi BASE=`basename $0 .sh` fname=isofs-m1 i=0 for opt in '-T' '--no-tracks' '-A' '--no-analyze' '-I' '--no-ioctl' \ '-q' '--quiet' ; do testname=${BASE}$i opts="--no-device-info --cue-file ${srcdir}/data/${fname}.cue $opt --quiet" test_cdinfo "$opts" ${testname}.dump ${srcdir}/${testname}.right RC=$? check_result $RC "cd-info option test $opt" "../src/cd-info $opts" i=`expr $i + 1` done test_legal_header cd-info "${srcdir}/data/${fname}.cue" cd-info_legal.dump exit $RC #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/check_opts0.right000066400000000000000000000010231474051130400173330ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : libcdio-2.2.0/test/check_opts1.right000066400000000000000000000010231474051130400173340ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : libcdio-2.2.0/test/check_opts2.right000066400000000000000000000005251474051130400173430ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver libcdio-2.2.0/test/check_opts3.right000066400000000000000000000005251474051130400173440ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver libcdio-2.2.0/test/check_opts4.right000066400000000000000000000012761474051130400173510ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : libcdio-2.2.0/test/check_opts5.right000066400000000000000000000012761474051130400173520ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : libcdio-2.2.0/test/check_opts6.right000066400000000000000000000012761474051130400173530ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : libcdio-2.2.0/test/check_opts7.right000066400000000000000000000012761474051130400173540ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : libcdio-2.2.0/test/check_sizeof.c000066400000000000000000000042251474051130400167010ustar00rootroot00000000000000/* Copyright (C) 2001, 2008, 2011 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDIO_H #include #endif #include #include #include /* Private headers */ #include "iso9660_private.h" #define CHECK_SIZEOF(typnam) { \ printf ("-- checking sizeof (%s) ...", #typnam); \ if (sizeof (typnam) != (typnam##_SIZEOF)) { \ printf ("failed!\n==> sizeof (%s) == %d (but should be %d)\n", \ #typnam, (int)sizeof(typnam), (int)(typnam##_SIZEOF)); \ fail++; \ } else printf ("ok!\n"); \ } #define CHECK_SIZEOF_STRUCT(typnam) { \ printf ("-- checking sizeof (struct %s) ...", #typnam); \ if (sizeof (struct typnam) != (struct_##typnam##_SIZEOF)) { \ printf ("failed!\n==> sizeof (struct %s) == %d (but should be %d)\n", \ #typnam, (int)sizeof(struct typnam), (int)(struct_##typnam##_SIZEOF)); \ fail++; \ } else printf ("ok!\n"); \ } int main (int argc, const char *argv[]) { unsigned fail = 0; /* */ CHECK_SIZEOF(msf_t); /* "iso9660_private.h" */ CHECK_SIZEOF(iso_volume_descriptor_t); CHECK_SIZEOF(iso9660_pvd_t); CHECK_SIZEOF(iso_path_table_t); CHECK_SIZEOF(iso9660_dir_t); #define iso9660_xa_t_SIZEOF 14 /* xa.h */ CHECK_SIZEOF(iso9660_xa_t); if (fail) return 1; return 0; } libcdio-2.2.0/test/check_udf.sh.in000077500000000000000000000026711474051130400167630ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2012 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Tests to see that CD reading is correct (via cd-read). if test "X$abs_top_srcdir" = "X" ; then abs_top_srcdir=@abs_top_srcdir@ fi if test "X$top_builddir" = "X" ; then top_builddir=@abs_top_builddir@ fi if test ! -x $top_builddir/example/extract ; then exit 77 fi . ${top_builddir}/test/check_common_fn extract_dir=/tmp/udf-$$ if test -d $extract_dir ; then rm -fr $extract_dir fi udf_iso=$abs_top_srcdir/test/data/test-udf1.iso extract_program=$top_builddir/example/extract cmd="$extract_program $udf_iso $extract_dir" $cmd RC=$? check_result $RC "$cmd" if test $RC -eq 0 ; then rm -fr $extract_dir fi exit $RC #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: *** libcdio-2.2.0/test/copying-rr-mingw.right000066400000000000000000000020761474051130400203520ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: dr-xr-xr-x 4 0 0 [LSN 23] 2048 Oct 22 2004 02:21:14 . dr-xr-xr-x 2 0 0 [LSN 23] 2048 Oct 22 2004 02:21:14 .. dr-xr-xr-x 2 0 0 [LSN 24] 2048 Mar 05 2005 16:12:25 copy -r-xr-xr-x 1 0 0 [LSN 27] 0 Mar 05 2005 15:26:00 Copy2 -r--r--r-- 1 0 0 [LSN 27] 17992 Mar 05 2005 15:25:51 COPYING -r--r--r-- 1 0 0 [LSN 36] 0 Mar 05 2005 15:32:05 fd0 dr-xr-xr-x 2 0 0 [LSN 25] 2048 Mar 05 2005 16:12:25 tmp cr--r--r-- 1 0 0 [LSN 36] 0 Mar 05 2005 15:31:42 zero /copy/: dr-xr-xr-x 2 0 0 [LSN 24] 2048 Mar 05 2005 16:12:25 . dr-xr-xr-x 4 0 0 [LSN 23] 2048 Mar 05 2005 16:12:25 .. -r-xr-xr-x 1 0 0 [LSN 36] 0 Mar 05 2005 15:27:05 COPYING /tmp/: dr-xr-xr-x 2 0 0 [LSN 25] 2048 Mar 05 2005 16:12:25 . dr-xr-xr-x 4 0 0 [LSN 23] 2048 Mar 05 2005 16:12:25 .. -r-xr-xr-x 1 0 0 [LSN 36] 0 Mar 05 2005 15:51:05 COPYING libcdio-2.2.0/test/copying-rr.gpl000066400000000000000000000431101474051130400166720ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libcdio-2.2.0/test/copying-rr.right000066400000000000000000000021271474051130400172300ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: dr-xr-xr-x 4 0 0 [LSN 23] 2048 Oct 22 2004 02:21:14 . dr-xr-xr-x 2 0 0 [LSN 23] 2048 Oct 22 2004 02:21:14 .. dr-xr-xr-x 2 0 0 [LSN 24] 2048 Mar 05 2005 16:12:25 copy lr-xr-xr-x 1 0 0 [LSN 27] 7 Mar 05 2005 15:26:00 Copy2 -> COPYING -r--r--r-- 1 0 0 [LSN 27] 17992 Mar 05 2005 15:25:51 COPYING br--r--r-- 1 0 0 [LSN 36] 0 Mar 05 2005 15:32:05 fd0 dr-xr-xr-x 2 0 0 [LSN 25] 2048 Mar 05 2005 16:12:25 tmp cr--r--r-- 1 0 0 [LSN 36] 0 Mar 05 2005 15:31:42 zero /copy/: dr-xr-xr-x 2 0 0 [LSN 24] 2048 Mar 05 2005 16:12:25 . dr-xr-xr-x 4 0 0 [LSN 23] 2048 Mar 05 2005 16:12:25 .. lr-xr-xr-x 1 0 0 [LSN 36] 10 Mar 05 2005 15:27:05 COPYING -> ../COPYING /tmp/: dr-xr-xr-x 2 0 0 [LSN 25] 2048 Mar 05 2005 16:12:25 . dr-xr-xr-x 4 0 0 [LSN 23] 2048 Mar 05 2005 16:12:25 .. lr-xr-xr-x 1 0 0 [LSN 36] 18 Mar 05 2005 15:51:05 COPYING -> ../copying/COPYING libcdio-2.2.0/test/copying.gpl000066400000000000000000000431221474051130400162540ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libcdio-2.2.0/test/copying.right000066400000000000000000000003341474051130400166050ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: d [LSN 23] 2048 Jan 05 2006 21:50:19 . d [LSN 23] 2048 Jan 05 2006 21:50:19 .. - [LSN 24] 18002 Jan 05 2006 21:46:30 copying libcdio-2.2.0/test/data/000077500000000000000000000000001474051130400150075ustar00rootroot00000000000000libcdio-2.2.0/test/data/.gitignore000066400000000000000000000000331474051130400167730ustar00rootroot00000000000000/*~ /Makefile /Makefile.in libcdio-2.2.0/test/data/Makefile.am000066400000000000000000000021671474051130400170510ustar00rootroot00000000000000check_DATA = \ bad-cat1.cue \ bad-cat1.toc \ bad-cat2.cue \ bad-cat2.toc \ bad-cat3.cue \ bad-cat3.toc \ bad-dir.iso \ bad-file.toc \ bad-mode1.cue \ bad-mode1.toc \ bad-msf-1.cue \ bad-msf-1.toc \ bad-msf-2.cue \ bad-msf-2.toc \ bad-msf-3.cue \ bad-msf-3.toc \ cdda.bin \ cdda.cue \ cdda_4_5.bin \ cdda_4_5.cue \ copying-rr.iso \ copying.iso \ data1.toc \ data2.toc \ deep-directory.iso \ deep_directory1_file \ deep_directory2_file \ isofs-m1.bin \ isofs-m1.cue \ isofs-m1.toc \ joliet.iso \ malformed.iso \ malformed2.iso \ multi_extent_8k.iso \ multi_extent_file \ p1.bin \ p1.cue \ p1.nrg \ t1.toc \ t2.toc \ t3.toc \ t4.toc \ t5.toc \ t6.toc \ t7.toc \ t8.toc \ t9.toc \ t10.toc \ vcd2.toc \ videocd.nrg \ cdtext.toc \ data5.toc \ data6.toc \ data7.toc \ test-udf1.iso \ udf102.iso \ cdtext.cdt \ cdtext-krosis.cdt \ cdtext-libburnia.cdt EXTRA_DIST = $(check_DATA) libcdio-2.2.0/test/data/bad-cat1.cue000066400000000000000000000002731474051130400170630ustar00rootroot00000000000000REM $Id: bad-cat1.cue,v 1.1 2004/07/12 03:59:59 rocky Exp $ REM test catalog number - no catalog after word CATALOG CATALOG FILE "cdda.bin" BINARY TRACK 01 AUDIO INDEX 01 00:00:00 libcdio-2.2.0/test/data/bad-cat1.toc000066400000000000000000000002461474051130400170740ustar00rootroot00000000000000// $Id: bad-cat1.toc,v 1.1 2004/05/08 20:36:02 rocky Exp $ // test catalog number - no catalog after word CATALOG CATALOG TRACK AUDIO NO COPY FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/bad-cat2.cue000066400000000000000000000002751474051130400170660ustar00rootroot00000000000000REM $Id: bad-cat2.cue,v 1.1 2004/07/09 20:47:08 rocky Exp $ REM test catalog number. -- not enough digits CATALOG "167890123" FILE "cdda.bin" BINARY TRACK 01 AUDIO INDEX 01 00:00:00 libcdio-2.2.0/test/data/bad-cat2.toc000066400000000000000000000002761474051130400171000ustar00rootroot00000000000000// $Id: bad-cat2.toc,v 1.2 2004/07/09 20:47:08 rocky Exp $ // test catalog number. -- not enough digits CATALOG 167890123 // Should be 13 digits TRACK AUDIO NO COPY FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/bad-cat3.cue000066400000000000000000000003031474051130400170570ustar00rootroot00000000000000REM $Id: bad-cat3.cue,v 1.2 2004/07/10 01:18:02 rocky Exp $ REM test catalog number. -- invalid decimal digit CATALOG 123456789b123 FILE "cdda.bin" BINARY TRACK 01 AUDIO INDEX 01 00:00:00 libcdio-2.2.0/test/data/bad-cat3.toc000066400000000000000000000002571474051130400171000ustar00rootroot00000000000000// $Id: bad-cat3.toc,v 1.1 2004/05/08 20:36:02 rocky Exp $ // test catalog number - non-digit catalog name CATALOG "123456789A123" TRACK AUDIO NO COPY FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/bad-dir.iso000066400000000000000000001400001474051130400170200ustar00rootroot00000000000000#CD001LINUX CDROM  "u -  GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM 2017092217451500 2017092217451500 00000000000000002017092217451500  CD001@"u - "u - ///////////////////////////@libcdio-2.2.0/test/data/bad-file.toc000066400000000000000000000003141474051130400171570ustar00rootroot00000000000000// $Id: bad-file.toc,v 1.1 2005/01/23 00:45:57 rocky Exp $ // XA disk // CD_ROM_XA TRACK MODE2_FORM2 FILE "foo.bin" 00:00:00 00:13:57 TRACK MODE2_FORM1 PREGAP 0:2:0 FILE "foo.bin" 00:20:71 00:00:00 libcdio-2.2.0/test/data/bad-mode1.cue000066400000000000000000000002511474051130400172340ustar00rootroot00000000000000REM $Id: bad-mode1.cue,v 1.1 2004/07/10 01:18:02 rocky Exp $ REM "MODE1_FORM45" is not a valid mode. FILE "cdda.bin" BINARY TRACK 01 MODE3_FORM1 INDEX 01 00:00:00 libcdio-2.2.0/test/data/bad-mode1.toc000066400000000000000000000002151474051130400172450ustar00rootroot00000000000000// $Id: bad-mode1.toc,v 1.1 2004/05/07 10:57:50 rocky Exp $ CD_DA TRACK MODE1_FORM45 // "MODE1_FORM45" is not a valid mode. SILENCE 10:0:0 libcdio-2.2.0/test/data/bad-msf-1.cue000066400000000000000000000002671474051130400171610ustar00rootroot00000000000000REM $Id: bad-msf-1.cue,v 1.1 2004/07/12 03:57:28 rocky Exp $ REM bad MSF in second field - frame should be less than 75 FILE "cdda.bin" BINARY TRACK 01 AUDIO INDEX 01 00:00:100 libcdio-2.2.0/test/data/bad-msf-1.toc000066400000000000000000000003111474051130400171600ustar00rootroot00000000000000// $Id: bad-msf-1.toc,v 1.1 2004/05/07 10:57:50 rocky Exp $ // bad MSF in second field TRACK AUDIO NO COPY // so that all CTL flags are 0 FILE "cdda.bin" 0:0:75 // frame should be less than 75 libcdio-2.2.0/test/data/bad-msf-2.cue000066400000000000000000000002701474051130400171540ustar00rootroot00000000000000REM $Id: bad-msf-2.cue,v 1.1 2004/07/10 01:18:02 rocky Exp $ REM bad MSF in second field - seconds should be less than 60 FILE "cdda.bin" BINARY TRACK 01 AUDIO INDEX 01 00:90:00 libcdio-2.2.0/test/data/bad-msf-2.toc000066400000000000000000000003131474051130400171630ustar00rootroot00000000000000// $Id: bad-msf-2.toc,v 1.1 2004/05/07 10:57:50 rocky Exp $ // bad MSF in second field TRACK AUDIO NO COPY // so that all CTL flags are 0 FILE "cdda.bin" 0:60:0 // seconds should be less than 60 libcdio-2.2.0/test/data/bad-msf-3.cue000066400000000000000000000002271474051130400171570ustar00rootroot00000000000000REM $Id: bad-msf-3.cue,v 1.1 2004/07/12 03:58:55 rocky Exp $ REM bad MSF in second field FILE "cdda.bin" BINARY TRACK 01 AUDIO INDEX 01 xx:yy:0 libcdio-2.2.0/test/data/bad-msf-3.toc000066400000000000000000000002771474051130400171750ustar00rootroot00000000000000// $Id: bad-msf-3.toc,v 1.1 2004/07/10 01:18:02 rocky Exp $ // bad MSF in second field TRACK AUDIO NO COPY // so that all CTL flags are 0 FILE "cdda.bin" xx:yy:zz // Should be digits libcdio-2.2.0/test/data/cdda.bin000066400000000000000000025532401474051130400164070ustar00rootroot00000000000000    ( (   >#>#k1k1;;vBvBa6a6>+>+   nn>>llBB))mmq5q5ddYYGGKKqq\\<&<&UUyyddQQ_0_0 CCj0j0>>HH`/`/;;rrccyy++^2^2bbkkVVjCjC>">"ww99""\\u<u<ddEELL z z!!gg00EE0!0!$$OO``^^22H*H*!!  55@@F2F288\\ZZvJvJ`3`3NNPP@ @ **ff((ll&&MM**XXGG VV66QQQQ  __^^TTffQQqqEECC""44UUdWdW===%=%QQ ::H\H\xxv^v^||[[__ppV4V4I}I}!!aarrbb[,[,MMnnWWBBe/e/WW??vv44EE;;MMl7l7]]ee.1.1SQSQUUnnbbDDccU2U2lIlI55/!/!55NNzzaa9w9wnene++oJoJ    = X= Xd *d *ThThQQ}v}vqqxxq q 44CC`K`KHH@@ddgg[[**iitt@@b b TTeeCCVVYBYBnn""\E\E[[9*9* ``@@3%3%KhKhvv#Tk |    O <O <}+plkkkEEmm__HH??||XX>>cc11'Q'Q%%   + + B BgvgvnnUUHH}}33 W WZ Z  : : v v' ' NNii==JJ$F$FI)I) _ _**; ; $$EEJJkkK?K?j,j,MMXXii rr8+8+8877g2g2LL__$$WWllHH;;eeee''IIff ccCC  22%0%0''ssdd((nCnCllUUT1T1}I}IDD11CCXXooiiDDmmqqggBB88~~^^\:\:  !!vv44EE||;;,,eeee^^ss@@zz^^ s sFFkk{{   " "gpgpuuBB77ccrJrJL L c Zc Zl= l= P P   v v,|,|"",,88((bb      e+e+OO  33AAAuAuUUOOn4n4M-M-77__ 66  cScSbb%A%AKSKSoo%}%}  II| |   II33HHll#k#k[[ADAD55))""  !p !p m=m= A A - -{{$P$P>>bLbLNN__jjII*> *>   L L     {{LL   A A??rr+F+FyyJvJvTPTPWW  hh22**||VuVunnYY4X4X  dd  s\s\rr>>MMTT|(|(l$l$//  ((^[ ^[ g g w )w )uueeqqmm,,ZZxfxf  c|c|M M ? d? dnn4:4:x#x#pp??@@KK00 % %GG  11 y y33llVVFFhhOvOv99BBJJ\\PcPcff@@dd%%   @ @UUBB8 8   qq((,y,y "("(B B   Z0Z0LL     11[[GG@>@>~e~e*8*8  n n   kkPP**LLe e   p p } } M M r r [J[J$$ ^ ^[[MMJJ##y>y>}}tt&&VV>>--  #j#jXXBB= = wwx<x<\2\2C)C){{aa??BBPP88jju =u = ) ) X XaaGGiWiWFFqqJJ~~ ss * *C'C'ww  tjtjcc4T4TyfyfggGG88TT::==UU66ll##EEwwvv b bR -R -##@ @ qq77""99..;;9944""  ==  77 X X ffuu7 7 P P FF   @@2n2nII+=+=DDooZZy y p p ((  ]]IIRR""h`h`ccuuN$N$uuII~~>p>p%M%Mss0 0 MMiyiy..ii>55x jx jnn9911}}[3[3tt))::OO;;y y DwDwY Y   ~ ~ jjnnII!B!BLL M MMM<< 7 7 ) ) FFMDMD< < W W 7 7 nnhhKK))MMT T P P7*7***"Q"QNN  77 ((((111ۜ1ۜwQwQkk W W  hh. . e e   ::~4~4**ccZZBB? ?   ; ; t t uH uH + + v v F F   Y8Y8>>ߵߵ_D_DVqVqR R "W"W))<(<(ff  ''h&h&xx;;hQhQhh.. X XkkFUFU&&      Gq Gq F F qqppMMUU@ @   AnAnvv  z3z3FFooOO^^l\l\++E E     zzLLdd55uuvv44/"/"sDsDEyEyz z \\ wwQQBBssyy  KE KE        ##mm""LLY(Y(((s 3s 3    zzkkgSgSxxr Tr TB;B;||YYHHvv<>qqss&&KKpmpm  ' ' ll????11@M@Moo  xxook k hh;;: C: C  //  e.e.nnzzv(v(??ttKKqq    R!R!p p ttll..qWqWdddd//__p p #V#V..(.(.&_&_7f7frrgg 8181""+I+I88qqH H # #     ZZ2255NN//II22II<<    f f   ) )    xx]B]BUrUr|؅|؅6611YY7 7 ;;((..5+5+1#'1#'. . susuqqD)D)--] ]   | | MM;;==$$EEjpjpd d U U c c ?Z ?Z ''ffSS*~*~_C_C55886 6 dd. . > e> e{{UUxx55S S hhii X X   m mD@D@z^z^--H)H)l)l)P,P,XX1919YYjjKKmmF/F/ 11{{''    [[a-a-,^ ,^ y2y2UU?b?bNN77"""" MM T T  $ $  #T#TWWdd--vjvjVkVk::VVHHJJrrggGGPP88JJ==YY]]))==TT]]X cX cx Yx Y@ @ N N x x MM88;;ZZ11%%QQ   { {nTnTPPLLEEuuii ` `    tt i i5544zz  ODODaaOO' ' ""ffggmsms$I$IRV RV K K %9%9% % aa @@};};>>&&||CpCpjjccG[G[ ccwwoOoOvv    1n1nd ;d ;JJll55..hhTO TO BB~~y y F F vv(A(A( ( aaVRVR tt"@"@ZZiiC C &&""  $$/ z/ zRRccӊӊHyHyZZqqWWC C ;!;!$$!!V gV g44KK((xx**UU  qqJJ==::}}TT\\||FFCC!!A JA J  f f p p qwqw&&,V,V//u u 99!A!A""N N d d ''D^D^J۫J۫ l lJJ * *D2D2g-g-$$4 4 VV"Ԑ"ԐRyRyݡݡ88{{EE  {{((    ) )9966c~c~**DD||004141qq{{Q Q = =         wi wi E ERR]]ߔߔwDwDffLL  D2D2&&(( # #II" " f f f#f#7s7s    @ @ D6D6nOnO S S88YY  G G V V 6: 6:  qqffUU0F0FOOqq}}  > > HH--  E E gg]]ppp}p}??xxvvy (y (  DDkk,^,^**K)K)tstsyyllYYbbAAAABB+ |+ |3 3 **rrKK55//]] a ai6i6zzqq  R R    - -GAGAHH//# !# !( ( AAHwHwEXEXFF))((rJrJ,,UfUfvv : :  ` ` 9 9 P P ( (;;DD))DDQQ ++]]  i Yi Y: : ::AZAZqqqqeep=p=JJ  wx wx   r r p-p-llt{t{ q qPP..pp  uu--  nnSS[[<<445]5]@@  , , //g g ~ ~ ! ! *i*ibbnn ii``xxnnxx((&&$ $ MM  ''JJG`G`}}MMwcwcB B 8b8b}}    IIvv --++||@@WW[[d d ""J J   mKmKKKAA||bbn n EE##~b~b  $ /$ /**DDhhyyNNCC((??h Sh S--6)6) E Eff7w7wGGrrIILLvv  %%tQ tQ 00&&mmjj-F-FVl V uh h uu  " q8K oH  ))5050 Ѵ ѴDәDәa.a.]]  H H..o1o1#+#+ww] ] ""p@p@BB    88  9 9 ~ L~ L   ee33??CCbbwawa66yy99t t E E   q q ~Z ~Z Y Y q5 q5  f fjj((ffyy&&  **%%%%$$   %b%bYY / / * * 9 9%q%qTT[[V#V#hEhEm m   ; ; j j D D   PnPn))7W7Woo | | e e ll     //**kkJfJfJJ EzEz<<jj__YY;k;k{{xxWWcOcOSSGGuu ww''[[MM~~44w w I;I;r%r%  q q Y Y iihh,,kk//CCY1Y1 \ \  a a   --"{"{xxPPjNjNxxPP!!o`o`uuiieeeeMMMMww|X|X66UUd d ?dEobbXX D  u*  (   {n{nDDcULLGvGvA{ p{ < m< mY Y PPAA m mAkAk--( @( @ v v 8 8  QQVVAAN N SSWW$ $ iiXX55V V 3 3 [h[h>J >J   ~~IIttU}U}{{DDjj > >SbSbvv.q.qynyn m mz z t t    4V4V4J4J`%`%JJnnPPvvN(N(jj \ \&&4 4  h h..NNggddk k % % CCv jv j33''׋׋;;SSUU??  $$!!CC ^^++iiJJ{{   e eee>>FFuGuGx.x.AxAx 00rrLL ' '  **Cj Cj  ,6,6hhMMPPeeOO  eeR R t#pt#pK! K!   * * aa77885$5$MM 7 7  hh(&(&2< 2< /N/N%%  }}vvBBԩԩGGww--""  h3h3a~t j 8 |8 |ww'@o=ppxxRRWWW5W5^^//66;;^ @^ @  i v qL    ' ' J J H ARl\ 11nn6f6f  : : pp""!!774 4 LL 2y2yLLQQaa99SS    ppZZ|y|y@@``.. o o  ; ; y y..MpMpbb@@&&55BBGG  + + ((V V  p/p/6*tz5XX55qa8[7GG ~ ~W PW PGG  ##__ 99ZUZU  ||3J_w 66>>*Z-gGt66HH__22PP : :  ??aa66) ) dd~<~<[[WW77vvbbtt        ))??ACAC99mmzz3F3FKKddQQmm &&ffKKMMaa_}_}ddjj  b? b?   b b  @@ww''--BB3O3O        xxOhOhppLLkk  Au Au     00))CC``ssk k   RRp p jjL}L}DGDG..5 5 DPDPpp( ( ShShKK##22**ff2Y2Y<<*<*G>G__**bb''""  VV/ / * *  X X >; >; h h xt xt 33VzVzZZQ Q --JJ5ت5تڣڣ99: : Z)Z)G.G.,,$$kk++UUvvPPTTGdGd)) z z6 6 T {T {'k'kii C C  O O _ _   [[KKUU55؎؎C"C"jBjBll  LL  9% 9%  %%DSDSUUjj;;w w   e e     G G?-?-m]m]   { {, ,   -2 -2 | |      # D# D      ? U? Uee::ff""FF      f f d  d  GG00gg<<ee''5T5Tzzhh^^66,,;;qq''....``rrWW--xx<<VKVK;;DD" " hh  ?6?6iiݦʽۦʽ""00TT : :wW wW WW))y y ??~~ + +""ppZ Z   ++\~\~ssvbvb''WW         D D4 4 __KK!!!!$h$hxx b b TeTeI&I&F F 66?? KK}F}FEiEinn33{{jAjA[[~~tt܄܄RR : :?? II_2_2U8U8rr~~**CKCK   C C   M< M< r r r6 r6     p p   $ $     [ [  k kFFc c [[vvPP991v1vqqGGhh??2h2hgg  zGzG ||rr-4-4ppqq>>TT^^pp*-*-wwmm    T T   mm  ! ! ::'m'm}}{{U"U"ttss*I*IPPMMSS & &3%3%^^QQEE````$$NNtt/"/"eeNN88rraa// \\;;KK   3 3\? \? d'd' a a    ` ` ddjhjhTT>q>q t t> > ! !  ' "' "--NNCCjjRRr r  Y Y / /  tt$$ee!Z!Z~~FFgFgFII Q Q@ @ fD fD Pz Pz  ++OO^^??LLWWVLVL 22f0f0UUQQ33HHii33>=>=PP[[[[PP2W2W,,N N < <   99  55  3# 3# B FB F\\  L L   WW    7*7*/ / v v ~~<<II<><>KK6!6!'<'<""rrBB33VV11޶޶OoOo]q]q44߳'' ݿ ݿ``PP55aa^^00^^ ppaxax v v   ""%%~'~'*|*|++. . Y1"Y1"3c$3c$;6"&;6"&h7&h7&6&6&3$3$|/!|/!))m#m#BlBlZZ]]3"3"MMOZOZ}}   JJA(A(bbEE##ո]׸] ̪ ̪ҹҹ߫//>>FF{ߠ{ߠ}}~"~"[ѳ[ѳiɰiɰYY0B0B{¥{¥LLؿΪݿΪ > >II  ``]],,RRQ Q |Y |Y rr!!m&dm&d**<-<-. . |. |. m/h!m/h!0["0["1=#1=#F2#F2#%3$%3$ 3# 3#M0"M0"O-O-`'`' ! !cc  ~ ~   6 6 ' ' 88dd00HH$$22ooTT<Ϡ<ϠƩƩqq--Վڎr0r0ooIDIDX[X[{={=ZZ?l?lTT;;>>55( (   ffB\B\00  S S   K K C k C k     y Xy Xg~g~22BByy{/{/66CC99oommR3R3ooFFsjsjyyDD NNss44UUI I aaH"H"j j   XlXl##7a7ao / o / zh zh   3 3 t  t        DDffoo663d3d::hhffv)v)BBzz--izizyyVOVO]]ppB3B3==FF.:.:rrii44h h     %b%b]V]V  6 6 ]]33@2@2++ff F FN N aQ aQ n n  , , ZZDD2g2gcc66TT;;``44L L nn&&>ZZnn.b.bppbb~ ~ IISSll{s{s99YY;B;B YYZZ ""]&]&{{yy``h h       %7%7@'@'mmFF5!5!VV A A   ItItx1x1PQPQg g   l l 99aa==  bGbGjjtt{{ffGGDDq0q0s[s[& & zzPPܟܟssZ؎Z؎((ݎݎ__Q Q ,,QQxxNNuuX-X-  UU#5#5)U)U- !- !a1#a1#3%3%4&4&/6+'/6+'P7?(P7?(9@)9@) ;* ;*c=,c=,s@.s@.A/A/B/B/@.@.;+;+4&4&-C!-C!%%NNkmkm    *f *f     L L vv;Z;Z!!nnQ}Q}ҞHΞH'l'l*M*M7Ɔ7Ɔ8˞8˞ЋЋ;;ݧܧ2ͤ2ͤgɪgɪf>QAQA& &   $7 $7 +O+Oss  **3'3'>4.>4.*EJ3*EJ3E3E3Ci2Ci2=u-=u-4&4&*?*?jj    4 4 O O   K. K.  $$UU//wwhwhw}'}'IIٹٹKӛKӛXX_ɘ_ɘ/{/{mmggggnnғғagag}}hh'['[--cco o ==bb55vv  C C B}B}GG!!||iiFFaamm==FFDeDe-j-jkrkrO>O>G G      hJhJ   7 7 w1w1   <J<Jii66##==dd @@88 @~@~>>AA,ߑ,ߑާާb b <<001f1f!!jjhh~~oo8"8"88ll]] : :<<##      pX pX !!%%(=(=_)+_)+w(Ow(O(&(&##!!  l!gl!g>">"#|#|1$"1$"l$<l$<p#p#!!mm} } s s / / WW%%=M=Mg>g> eeAA B B==fڝfڝ--&&55}}(X(X@@_ފ_ ۱u^u^GG__rvrvRDRD8 8 ::``ddT T   y y   m- m-   8X 8X g g   Gk Gk ))ZZ66MMpp   EEF 5F 5_ _ aa+ + 22  ;;TTMM55@ @ dSdSOO W W  knkn  eeN N Zr>r - -## ## &&E)E) ," ,"@.#@.#R/B$R/B$s/$s/$.#.#-"-"+!+!); ); I(I(&&%%o#[o#[    @ @h6h6UzUz99))ff!!##((DDO԰O԰&&hYhYc8c8xxXX\\EE''LL%%kkAA  GG[[%%L pL p   G G } } [ [ < < 8 8   . . !5!5e e f f   >b>bfefeCC^^;;xxXX::;;GG::XXzFzFllaa%w%w. . ||cLcL tt  r!r!ss l l HH||>>,,rrq q 0u 0u   H2 H2 00]]PPWW==}}ll uu=A=AYYggzz2K2KCC>>]]qTqT$|$|__mm00I I }}WcWc   a a  MBMB?? t tv v w w kkraraMM     99S S **99aa~~!(!(s$s$77> > &&c"c"J J BBQQ??oo]K]KJJuJuJAaAarrAAUAUAWWff ffMM@@zz ..jj22,,`<`<KcKc**uAuA.. KK  /2/2GG \ \ 44II "t"tEESSnn$$+"+",S#,S#''''xxO4O444&C&CKKIIJBJBgg4 4 gg  i7i7hh SSmmXX::++00++33kk\\ ..ccvv>  >    . . N N ~E ~E   kk mmnn] Y] YCCa)a)/!/! ! !00 ||99}}))ZZhhPP55YXYXii55??@@ososooBBbb K K QzQz&&A dA d" q " q     +s +s  FF  QQ    ""n n yoyoMM@ @ T_ T_ 8 8   D D 3 3 v v h h __7-7-Y Y HH]]F\F\GG66#T#T..==??)q)q>>yy'a'aaa{{&&yyttMMff[[``KKOIOI::5p5pFgFg00DD O O % % # # z z g gpp^^))FFDDTSTS*T*TvvGGll       p p776F6Fpp/x/x\\<<==|y|y||MMxx22HAHA  O O > > g g 4  4  IIjTjT00\\C 7C 7   x x 88~-~-' I' I^^TPTP UU:5:5{{7L7LnnttWWV\V\'m'm&F&FSS((ee::$$:[:[66gg++aa m m    OO11##%%""{{  OO  ( (   ()()II::O O = =   nt nt GG9 ^9 ^5L5LSSvv\\nnXX``QQDD@@YY ] ]i+i+@E@E((bbjj2*2*AA]+]+gg;;}}00 bUbUGGoPoP[ [ ''gg0x0x``& & uu66--@@[[hh_q_qAAi i c c XX22:: a a  wwaaxx{{\\   KK}y}yX X //EE-4-4~~EE W W Y Y     a a tt$$9-9-uu_]_]__ AA--R9R9KKuupqpq##HHt!t!ff  <<--NN__P?P?++ppSSCC   y y B B NNuuVV%%|:|:55""  , , ]  ]  [ [ l  l   zSzS_1_1  \ \   --p p 4 4 nngg\Z\ZYY33bb,,nn W WNN E E=d=dUUzz++XXr}r}SSII))KaKa]]33pp3p3p{^{^@@SS0055r{r{YOYO  y~y~> >  "v  wPP  @ 2@ 2Jj#uI~\\..YY,""  K  K  Ij&EE;;XiXi00JJ[L[Lkk4s4s&&iiaaZZ22rree/R>11\\66~[ce+UURR7vI]$]jj?\?\**BBXnXn77TTL%L%,,i i    Z Z xxJnJnoo0077ccSSWWiYiY^^ JJ##ffAA  // F F H H _ _ > ?>0"c9c9y;Z9Fp2p2t t SSII;; >> jj~~tt,, ( (" j " j         & &I[I[++[[22))|3|3BB%%  %F%Fyy>>||KKssXX''33 @ @88`` ` K ` K m m WW11``DD  nnYY$$  uDuD$$:<:<~~ccnn||k k w # w #    _  _ : :  ]]  FFll22bbP|P|TT-n-n} } } i} iBB6600 ..++wwNN PP**  UU((nhnhOO] ]   a A a A G X G X  nn4.4.R&R&k k t t //NN    SS / /ee55  uuAhAhAAVV&&B:B:GG~]~]DD]]..{*{*gg44//cc}}  ::   d d H H mm\\      b b 4 4 "h"hKK  + l + l {  {    n n O O ` ` / /  cca a IIdd||vv!!vvKK0s0s  77[[8q8q[[00AARRddVVII..{{uuNNiiYY66--22popo GG!!11>S >S nnT@T@33,,HHGG++XX;; ~ ~r r dndnZj Zj  SSoaoaKKYY0 0  i i   H H     *8 *8  l  l h h k k H H ^r^rQMQM| 4 | 4   SSUU=}=}jj] ] ^  ^  (( ll}}ii XXGGp6p6 qMqMFF\\9]9]eeddQfQf@@==11;;r r \\<<``eePPQQ     3 3 Q Q P P - -     OOmm--llVV  dd!h!hVV88O{O{JJ||f$f$!!mm:: ododttQQ00 >>__YHYH6 '6 's y s y O O     |&|&##SdSd!!__rrllhhEE9a9aii2Y2Ymm Y YppVV\\&&00vv??[[dd]]FFEEz#z#cYcYLLEEE E   @ @ R R  [ [aa"'"'88II++jj1o1ojj>>/3/3}}MM||55pjpjPP   ) ) ( ( ((mm[[ddHH  g g V V l 0 l 0 qqzzQNQNRR=X=Xvv**ffIxIxb b ^ ^ ~Q~QcUcU11mm||o&o&PPAAdd--aa, ", "L  L  W W O j O j  PPkkWW##DXDX Q Q $$  i i g g %%rrj2j2  7X7X d d;;((``55qqAAvvEE222;2;RReeNNd4d4bb22qq!!SSC C xxhh&&==%%\ \  A A . .%%w%w%]$]${{  = =    k k   h h   x x *C*CF.F...PP''UqUq?y?yLޕLޕ}7}7xx"I"I{Y{YfBfB==26261717ޖ__ߞߞl\l\?[?[ii88vlvlhhEENxNx   9 9 ~N~N%%WWqq{|{|V1V1JHJH;-;-77]+]+   yyvv##~~DDuu kk==qq  xXxX--iidܯdܯtt޸KK""))ff  SSRR00 A A   7 7  o o     y y  tYtY^^DDIISS]]_F_F8i8iuXuXvvll!!UU- - 44DDRnRnJJggRRSS!!KKZZ!!; ; XXBB+C+Cx ` x ` ""ff__uu ` `   r r       ppPPOO``""KKkk%%lZlZPPZZ  3E3EOOppHzHzUU"  "  p p ! ! XXzz^^ ZZ{~{~ffJ)J)yyNNLL##II66**jdjd''jjjjvvUUGG=E=E{{v(v(;;AAUU"Q"QA$A$##[[GGwwLLRRoo    &&8811  QQ>>p[p[ewew;; ``RR((7u7u99qsqsVV;;UUeevvHH \\DDllEE++e e l c l c *  *  TOTO<<,,4%4%k[k[&_&_C`C`Y_Y_ImIm00""}} +"+" O OHHBB**;;EEkk##^5^5 77bbOOLMLMMM@@66EEhh??WWtKtKooe ~e ~3 3 eiei))$$jjYY""S#S##T #T # # _ _ uu[C[C R R nnh h   gygyK6rY5ލ5ލٸ܈ٸܕt٭m)߿l/I/I''zz?c?cHHGfGf664400>->-??   HHjjii,3,3uSuSyy0202,,0!0!))[ti@nFF   n0$7==+V+V66x#x# nnddVV\\88e3e3hhtt''HH{{""YYTT??)u)uYY bb''0 0 LL H P H P S S J T J T i i ""  ==DDPPaaj~j~ttuuD D GG.. 0404MMo;>;bb``scscrrc c 77LL$$oo ))QQ``/./.00 GG 5 5 V VVVIIUUPP44GGFF""55HH\\ D>D>  t B t B " "  PPUU;;u?u?NN L L ??SS$$&K&KXX] W ] W RR{ { ##hhz3z3NN m  m VV00ss4Q4Qw w /g/gLvLvHH((  vvss^b^b3~3~__f f @@XX}}ccSSFMFMttiwiwllm9m9??yy33008!8!77jqjq? ?  ss$#$#*)*)/I-/I-10100I/0I/,T+,T+'&'&2" 2" yyKK|}|}1414#)#)vv ,f,f^>^66 dddd  i - i - 88$$HeHe  4+4+ l l a a  7  7 ccDDQQffeoeo /N/N H H   X X W % W % <<ggp7p7++,,^^1B1BBJBJz6z6GtGt88MbMb~~/7/76Q6QaLaLQQ77gsgs22jMjM##TTss2 2  00pp<<:: mmSSpNpN:: z  z @@ll{{FF UU@@%%AA77??$$I;I;SSwwEnEn&9&9||mzmzaQaQ..7/7/EGEG` } ` }   \\(>  hhtt&&PaPa%%OO}}h.h. % %XkXk?N?NlqlqRRmm. .   ccnnuu??&&yy\\GGN9N9RTRTRR!!NNNN3333}c}cLLYY A%A%&&',',55EoEo:: & &,, 66CCDDeeEE!!L L n e n e ++ # # p  p  9 9 &l&l R9R9O O 22RRRBRB22ss%%ee11\\66HUHU~~ssj j ZZss vZvZfIfI?"?"wTwT{c{cXIXI  C5C5A+A+KKo o F F _v_vll  & = & = #R#RQQ//DKDK55IIcc S S Q 3 Q 3 <<d d  " "{{jjhh   [[   a a ;;rr;;UUkkJ%J% t t * * <<8r8ruNuNopop\\OO----yZyZqkqkkiki&@&@EGEGaaGGYY##55 * * X X 88MSMS00__TOTOnn}}/p/pkwkwSS""?I?I i  i l l Q Q ee\\ ??,,jjii 66SSss{t{t))116K6K_k_kuuAA||#2#2  rre0e0d)d)JJVV    d d 33  CCO O --00ll66\\RtRt1[1[uEuEvXvX<.<.CCttttGG<<vvJ4J4vv))KK88^^++/B/BDKDK|T|Trr""JJ%^%^))PrPr$x$x55cUcUyynOnOXXMMBB B B g g ''rrNENEX+X+ ]  ] rrbWbW $ $ ddxqxqeCeCKKsTsT''8 * 8 * i i ..--}[}[YYNN22{{<><>C C o@o@iiz z 88xmxmfUfUCC)){{/j/jejej~~oo==8 ~ 8 ~ i  i  C}C}RRBNBN DD^^$($(QQ\\ddOeOe@@2a2a{{zz ' ' vv__,1,15 5 U!U!;;11 [ [ //\\ s sz z JJvvKKZZJgJgAAyyg g 3 3   $$;o;olqlqvPvP}}//Y^Y^JJ~~wwAA  O)O)oowwoo[[~~::]g]g[[0 0 <<kk00,,N7N7igig__ oo 2  2 ))ZKZKK K WW@z@znn__z3z3'' m`m`EE^^&V&Vff<<}}H/H/wwv8v8f f HH``NN<<MM$I$IPPRR]]~~"";;brbrtt$`$`@@uuxxzz9 G9 GuuR0R0oo  MMUeUenn!!44hh,,..\\AAzzeehh77Z5Z5>>eeggPmPmDD++vvAA.F.F==mmlleqeq__..!!AAhhbbLlLl  eeQcQccc'J'JnnHHzzg g U U % % y y   22F F a a x x **{{tt44##E E J J   rrIMIM++jjllaa } }JJ]qUs:-XX;Rkg((33{FS j2SS||e'e')e,ll n<)){{ `pN^88+F+Fii   w'w'&&II\\}}m&m&dd??VV55  ,  ,    CC&&}}||CCggaa^^% % g g L L   ''\\ffttwwTT==@@3 3 ! ! ( y ( y u o u o %  %    LLGNGNDD??rr[[++[[t't'CC&&PP[[6633rrTfx1eeQw[t 5522aaTDTD]]::CC PP<< Y Y==rrkk==ff,,VVZZ??ddeeW!6=wcIIRR >>ii]"]" 7 7ffg.g.kklls s <<^L^L,?,?wwJ J H H ==FF1%1%J>|M|MXXss>>^^u]u]$$    66hhc' c' Q Q ] { ] { 6 6 IIww44wOwOII ||pp__;";"+2+2,z,zbbRR ! !qqgg::**4{4{##}}cAcA33JJ||66H&H&887!7! g g @ @  IIbb<<KKHH(e(e  __.. _ _ ,,bbC@C@w w q M q M 4 E 4 E 99JJ##&&==$$/M/M++JJe2e277TXTX<<,,$$<v>99LL$$""  hhQQ..Y.Y.ANANh3h3@9@9R-R-;A;A++]H]H6C6C>m>mi%i%ee77 ,^,^"~"~    p p = = aa``yyHHA/A/}}22  x x 5 5 UU..ZZ==1h1h((D+D+88hhggWW//@E@E - -7W7W33:.:.TT=:=: hh''XCXC    <> jj'r'r@f@fyy..wwnnRR!!KK:q:qWWss%%ww -f-fYYRRff``II::tTtT}E}Eoo ) ) M 7 M 7  # #XvXv"G"G77 j jKKgg++AA;;==YY!!  X X   LL^6^6zz66eemm))99//tt88UU^^ggm\m\LNLNnknk008&8&66<>^^99((\ \ A A K 6K 6  ||AA : :   Q Q   t t y y    %%!!##    , , A Ah:h:;;ee4242XXZZ||AAIIttOO22^^jj<0<0^^11>>ccWWSSKKEE&&33jjECECcscsvv9v: Zu;E;E::NNS n*J2B2B^[L_ cchhd'd'tK^#l/ZNNVVR R iiqqn n u u @ @ **IIJJ++I1I1==WWNN  R TR T.}.}E E L S L S 1^1^[{[{ees]s]zz33P0P0BBRRMYMYssxx]]CCQfQf_J_J**bby.y.44(( F F  >%>%.S.S++%P%P##""".". V V     +_+_@0@0/5/5 S S# # ;;99__{${$ Y Y&^&^TTrr<<ww4444RRp6p6nMnMZZ>> !!SSMM{{**22  //' ' J J r r p p ] ] l l | | g g t t \ \ ' ' A A mm99ww!!OSOSrr]]GG,,77(({{::YjYjn2n2wowovv--5N5N88!M!M[[ddWrWr2277GGFMFM,,]]]']'DDJJee  ssPP44|w|w,F,F. . R  R  p p V Y V Y " 2 " 2 ` ` q, q, b b ::BB          F F hhHHxfxf""hh(h(hLL7755ppE~E~$J$JRRRfRfgg::>W>Waavcvc::gg))ooyy__tt%%}s}s--]]JJyy//    e=e=~Z~ZDUDU%% k k)o)o,z,zXKXKUUrr55nnS.S.uuXXww~~ffmLmLe/e/i'i'\\;;ll8l8l#"#"  CCrr__bb PP#?#?XXSSOOX}X}55nn\Z\Zt t XX'&'& L L2q2q * *__UsUs__g@g@77W W JJrr88RXRXZZ;*;*  ``  ? ?    ww d dI I J  J  --rr99""     =m=m~ S~ S WW5r5reeXX,,/33JMcuu^^@@Ed7&`6uuZZ{R{R  __ZZ77zaza//##BB&O&Onnoo{{ZZNN""r'r'\\o o  p  p 11>">"    O O   7  7   q qq qQ wQ w  O [O [    @ @ 's'shhbbhh))OO^^vvRRuu``gg ,,dcdclldd66>>ddDHDH1:1:%%;;..cc33xxpSpSU U l l   v v s s F F ( (  h 6h 6     { {O   \p    ]  ] K p K p  ja  9 D4040GGDDNNmmH|H|CC;;ffNNG!G!II0044  66dd66BB66  77"{"{vvcc44##((  HuHuMMV/V/((,!,! E Ez6z6DD|W|WPPAA||wwqqffpp--""(2(2^^oo22RR t tQ{Q{FF    6 6 SScciGiG''lluuAAu>u>X'X'ccr>r>ddPPDDllkSkShUhU//ee-/-/JJ>>00ww,?,?..ieie]q]q66j j 2 2 ,9 ,9   ''^"^"))LL|q|q  YSYSooZZkkdd''ccFF(([[&&s7s7##ee''MMRR99BB  ee` ` ss[[ppJJ-]-]LeLe44""gg88))8<8<]:]:xxccUUQQRwRw{{vv\\YYYYzzYYeeii#k#k~~**77gngnWW    M M ] ] :g:gDDvvnn""kk*b*bII  u R u R   Z Z_ _ 7 7 ##&&ff__}}FFvv//EE--TTOO " "]]y"y"iinnt_t_mm tt!!99U&U&xx,?,?--&&N:N:YYGG]J]J))hhVV[y [y ; ;     ppBB7$7$ooO O \;\;EEy$y$y@y@ II33!!M7M7//vvnn]]mGmG>>JJee@@ wwzzggAAvv>> d d,},}LL  **  LLNN66SSRRGgGgppUU11  xxHH55GG``EERRhhmmH&H&B5B5,,..zyzyVV1k1kEE,,RR#z#z009&9&==bb**ooEE@@qAqA %%ppss:7:7z_z_%%aaoobpbp!!??ffooPP!!jjZZ$$qqyiyi``11\B\B$$-v-v 1 1 mm  nnYYsszzjj]]Y.Y.[[*b*bff  **iiNN77~~22cucuQYQY ..&&D1D188uu$9$9$r$r??</>AbAbp}p}zz~o~o$$!!qqGGddvveeQQ;;$$IZIZS!S![[ SS2233rrhh8R8R  XXQ*Q*zqzq##f}f}==ipipxxwwXXQQdd,,ppRR##<<{x{xmm77  qq  L_L_))ppUUttllKK>>]]}Y}Y !!11kk55<<_A_A&&GG..uu::SS,,uu66&&{{  ~~}}RR22$$~~OOMlMljMjM  dKdKqEqE ee444"4"[[KK33}}ghghXX;;NfNfPTPT r rwwRROOf(f(^^qqV V jujuFFIIVEVE!!99ee%%"Z"ZNN%%pp::;n;njXjX""""55mmuuuuVV&&e=e=LLbMbM%%))v(v(\J\Ju u //iiYJYJ##ccXX@@ggJ?J?  "T"TUUhhOOo_o_#>#>NN,x,x  !!eeLL77HHckckw?w?gg<4<4ZZ]]++~E~EnhnhtRtRffddg6g6  iiPP``44ll;;\\<>II((wLwL&&eeddii1d1dkknn!!DZDZ}}OOAAJJPPNNLL;1;133%%(l(lOOmmII{{  LpLp**m^m^88NdNd^^DD00     T TCC[[OOPqPqmmd>d>::,M,M''  dd  ::9977]a]a1166ZZddww Y Y{{XXSSEE```2`2rr ? ?ss[[ppAAttFFddB1B1. . ] ] bIbI5599<<% % ??  aa"h"hy`y`||PP))11*}*}  ''88  pp]]""UU--iikk((nlnlccxx++JJee&&zMzM>J>J88))dd+J+JiiYoYo44  ^^bb\\s s ))""&&ddBBzzQQuu!H!Hmmbbxxtt--FF"7"7yyvv..3;3;cc(( ~~**FFrr--__AAddBB-w-w#n#nRRuu%~%~`v`v;o;ott11[[==.#.#<^<^88//ii  ll\\DDaa``ssL8L8wwAAWW0"0"44((  bb77''  E E ##pp..K;K;&&66//ppcc\\>>CC::ZZ gg,,ggUU]]xx JJVVPPjjkk~~SSuu--%-%-ll}} qq]`]`// < <%%%%__44%%HH__ l lggX X tt^^l:l:';';wwAGAG-f-f::((00xx66//..SSNN]]//77  MoMog*g*ff:g:g}}]]GG^Y^Y**<> Y:--44 ll66]#]#bbqqQQ WWTT))QQGG##4499DDSS{L{L44llm_m_**^+^+RRjjdd``!g!gmmcc4499aa==22..(^(^yzyz``UUyyO1O1;;]]GGMMuur>r>hh9911ll1@1@SS22++ ""ffNNIIJJL L   RF RF       ;- ;- Z Z eeOO~~77||rr99QQJJ"Z"Z..ssgg##KK,,aallzqzqGGUU>>ZZ)) O OCC++66SS$6$6M}M}DDuu))?=?=]]))0 0 s s     3 3 ii  88>>nnEEPP44VV<>jojo22II  5544bb((    E E %r %r W W     [[JDJDccc c ||22MMAAQQ;;F*F*6622NNY:Y:K,K, iiHHbYbYiWiWttf=f==q=q**4b4bLLLLrr]]DD++))--CCdvdvaaww) ) ]];;XXUU++((T}T}..@@""hh==gg[[uu44#^#^::NNUUmm@2@2zKzK{{I$I$bbu(u(@@2J2JWW))r=r=SvSv""QQddgg0808|(|(  //yOyOa'a'II)=)=  00CCt_t_aa99<>ffGGww,X,X - -zzUU%*%*55}}hh__GG'3'3""nnrrj j bbIIGG GGOO+E+EggLL##ZZGGmm$O$O--LLkk77OOoo||44}}00mmz=z=  HnHn##**!/!/%2%2f f UUrrC_C_kk33e e gg  v!v!CC``(J(JGGnnccTTgg[[MMeeDSDS,A,A9O9Orr00@@x@x@gghhHHccLL ? ?ll8W8W\\JJ]]||\\:b:bDD__((w=w=  //ZZ//.N.N//eejjUUz>z>||** &&%%(K(K<<^^EE&&@@HH`` ::!!33}}^^ggEE?v?vOO77vv  r"r"RR!!  ::!!  "<"<++]]#P#P((3g3gooY Y hh 88``}B}BHHRR~~??!!66VV77<<vvRMRMK?K?\V\VggNNMZMZ%%II>e>ehhnnQQV V FF[[OTOT    / /   ^ ^ \ \   N N DDVV H H++,Z,Zuu==KK+{+{))||+C+CCC>>ffjj v v((ZZ >>%%&&ff__,,,,b_b_**??||tt--NNMMHH1~1~xx  jj<<..pfpfRR,,;;QQZZeeC\C\66+F+FFqFqzzcc##]|]|eeoo{{VV!!bbj~j~ffBLBL+(+(OdOdgg^ ^ \\}}__::PPyy((AAPPV$V$U%U%NNSSa)a)vv  h/h/ccJ_J_y>J,["'Y\\\\ ~o00XXXXWHWH_4_4sSsS"|"|55IIww**CC66kk00 @@nnYY#{#{kk @ @ZZ99`J`J1Oo)PP66.Q.Quull< < vvQQ<<NN2R2Raacc&=&=d8d833 E EhThTnn,G,G``oocc66 a akk||44rrKK66e3e3zzuutNtNxwxwb6b6TTmN<g*A,@,@,P,P;[;[Fb9T-F!2++3Y3YIIYVTQNyBj7\7\#C#C"-"- * *|"|"ueueAA=(=(;;zz  ##TT]]v#v#hh((gg>n>nooggppddxxyyN1N1CC  7Y7Ycctt55XX22}9}9 . .>f>fFaFa++CCEE++wawateteOOHH00]]~(~(``ZZww``(?(?``TTppaa//uuffxxMM==  ||ElEl''!>!>HHyyP1P16644!C!Cbb<<55&&yydd*F*FMMVV>>qq*S*S115Y5Y6X6X%%>>TThh}}77TTnn88JJ;;__>>nn''44 k k;;::&/&/XX))Y:Y:\P\Pff|1|1gg))vv:b:b;m;m$$N9N9J$J$SSbb7N7N3[3[nnJJ66SS^B^Bzz``aaJJbb=_=_tt]]??__ h huu((>>RRddeehhllqqw-w-ll@@CCaaWW|/|/ppll6 6 88  MMXX99 l lyyRR44}}hhIIrr$L$LuuYYzz""&&\\vv??||pppypy  ]]ll{"{"NN,?,?}}EE,,>>''qq,,PP F F>o>opp  EE??^^LL3300KKDD\\  RRyy66GG++X0X0oo 33LL4 4 KKt\t\ugug\\~~EE00AAwwccAiAi$K$K11wwVV]]  3T3TXXtt||uu..MMPP5X5XCCrr-z-z~~ccZZD%D%66:R:RqqJJOO  {{a;JmJm 59`Ndt^^>>jjHH 5Y-~tRRttw2__hh\%\%F F AAZZgg119[9[=[=[/9/9  5c5cttCC66e_e_uulplp_Y_Y>,>,//8)8)JEJESRSRUSUSQ:Q:((,,>1>1GLGLYXYX22'.'.KK \ \!t!tEEuunn99HH Z Z%%[[CCddqqmmllmmpp''UU}}rrII**iiXX<<88GG**0R0RWKWKvvvvYCYCXX^^gGgGyyhhTTC!5 (/`<TT==ccSS[[ii77  oo::  zztlemw  gg'78 :&  T1J }TT44==WWnn~~ffTTHHttFFdd|N|N``_4_4JJLL**#>#>  66VV//22WW44?k?kss22@OMLJI66##00=CJPWMDD!!uaNx=^-E!2!2<< Y!W"V"L#C"9#0#0  ttaaNN;;HHee# ! 44f[PPPar r nn26tY} Zjjjjjjjd,MMccss^TKBp:`2O+?+?,,;;JJ))ffccJJHHYYyy__,,0K0K9Z9Z?Y?Y2X2X&W&WVV55``??..]]PPVVgg5i5i  CC!!|%|%KK33'9'9aa{'{'zz33yy!K!KCaCa=g=g'='=ooUUKKqq  9c9cdd55++uuEmEm##  ,a,aUUttPP1A1A  !!    uuKKAAGGmm99DDff^^@m@m&0&0*R*RQQ;;NNAAzzNzNzee((ssYYVVffuu**==@@33wwLL+l+l//NNJJ|$|$%%&@&@++HHOO}}IItt  ))/'/'/2/2*-*-!!YYttffiiyy!!NN{{eeGG e eJJnn}}{{kk@@YYtt]]ffRREE&&  ::;t;tcc""LLffppzzzz44ccEE;l;l1f1f(`(` J J44  FF``ZZccQQ]]"?"?NNPPPP.M.M  11>}>}[[!!||kk[[LL>q>qAmAmByByAA?q?q<]<](9(9mmII55!!t t jjddaaqq55aaaaMM99EEqq 5u5ugg9955SS-5-5     EE>q>qWWyyyyeeSSSSQQ^^WWOyOy7U7U!! mmII55!!MMyy==*i*i<u<u9a9a%M%M  ]]IIee55+a+a:}:}EyEy<u<u#A#A    !!   !!==IIEEAA==II(U(U2Q2Q9M9M=I=I?U?U?a?a>}>}<<9u9u5a5a0M0M+I+I&E&E!1!1 )) 5 5$A$A--   - -!I!I2U2U/a/a+M+M'9'9}}yyeeaammyyAA&]&]?y?yRR``iinnppoollggqqwwzzzzxxttnngg__WWOmOm7Y7Y"E"E Q Q-]-]6Y6Y<U<U/Q/Q#M#M}}IIyyppz z %%AA]]yymmYYEE11zz  !!MMyy % %AA%]%].i.i4u4uHHWWaaggZZNNCC9u9u/a/a&M&M.I.I3U3U6a6a7}7}VVmmmmkkWWEE5a5a--uuaa]]yy  %%AA"-"-    % %AA(M(M1Y1Y7e7e;q;q=m=m=i=i,U,UAA--))%%      ! !==99%% ! !== Y Y'e'e<q<q<m<m;Y;Y)E)E!! 11=]=]VVXXXXFF6i6i(E(E  }}iieeaa]]YYee        %%11==IIEEAA==99&U&U/q/qEEUU``ggkkllkkXXGG8i8i*E*EAA==995511==IIUUAA--  qqmmiieeaammyy   - -99*E*E#A#A==99EE$Q$Q(M(M*I*I*E*E)Q)Q'M'M$I$I!E!EAA==))%%!!-- 9 9 5 5!!    ))%%!!  ))55   libcdio-2.2.0/test/data/cdda.cue000066400000000000000000000003341474051130400164000ustar00rootroot00000000000000TITLE "Join us now we have the software" CATALOG 0000010271955 PERFORMER "Richard Stallman" FILE "CDDA.BIN" BINARY TRACK 01 AUDIO TITLE "Soft" PERFORMER "Richard S" FLAGS DCP INDEX 01 00:00:00 libcdio-2.2.0/test/data/cdda.toc000066400000000000000000000001051474051130400164050ustar00rootroot00000000000000CD_DA // Track 1 TRACK AUDIO COPY DATAFILE "cdda.bin" #200 00:00:25 libcdio-2.2.0/test/data/cdda_4_5.bin000066400000000000000000025532401474051130400170560ustar00rootroot00000000000000    ( (   >#>#k1k1;;vBvBa6a6>+>+   nn>>llBB))mmq5q5ddYYGGKKqq\\<&<&UUyyddQQ_0_0 CCj0j0>>HH`/`/;;rrccyy++^2^2bbkkVVjCjC>">"ww99""\\u<u<ddEELL z z!!gg00EE0!0!$$OO``^^22H*H*!!  55@@F2F288\\ZZvJvJ`3`3NNPP@ @ **ff((ll&&MM**XXGG VV66QQQQ  __^^TTffQQqqEECC""44UUdWdW===%=%QQ ::H\H\xxv^v^||[[__ppV4V4I}I}!!aarrbb[,[,MMnnWWBBe/e/WW??vv44EE;;MMl7l7]]ee.1.1SQSQUUnnbbDDccU2U2lIlI55/!/!55NNzzaa9w9wnene++oJoJ    = X= Xd *d *ThThQQ}v}vqqxxq q 44CC`K`KHH@@ddgg[[**iitt@@b b TTeeCCVVYBYBnn""\E\E[[9*9* ``@@3%3%KhKhvv#Tk |    O <O <}+plkkkEEmm__HH??||XX>>cc11'Q'Q%%   + + B BgvgvnnUUHH}}33 W WZ Z  : : v v' ' NNii==JJ$F$FI)I) _ _**; ; $$EEJJkkK?K?j,j,MMXXii rr8+8+8877g2g2LL__$$WWllHH;;eeee''IIff ccCC  22%0%0''ssdd((nCnCllUUT1T1}I}IDD11CCXXooiiDDmmqqggBB88~~^^\:\:  !!vv44EE||;;,,eeee^^ss@@zz^^ s sFFkk{{   " "gpgpuuBB77ccrJrJL L c Zc Zl= l= P P   v v,|,|"",,88((bb      e+e+OO  33AAAuAuUUOOn4n4M-M-77__ 66  cScSbb%A%AKSKSoo%}%}  II| |   II33HHll#k#k[[ADAD55))""  !p !p m=m= A A - -{{$P$P>>bLbLNN__jjII*> *>   L L     {{LL   A A??rr+F+FyyJvJvTPTPWW  hh22**||VuVunnYY4X4X  dd  s\s\rr>>MMTT|(|(l$l$//  ((^[ ^[ g g w )w )uueeqqmm,,ZZxfxf  c|c|M M ? d? dnn4:4:x#x#pp??@@KK00 % %GG  11 y y33llVVFFhhOvOv99BBJJ\\PcPcff@@dd%%   @ @UUBB8 8   qq((,y,y "("(B B   Z0Z0LL     11[[GG@>@>~e~e*8*8  n n   kkPP**LLe e   p p } } M M r r [J[J$$ ^ ^[[MMJJ##y>y>}}tt&&VV>>--  #j#jXXBB= = wwx<x<\2\2C)C){{aa??BBPP88jju =u = ) ) X XaaGGiWiWFFqqJJ~~ ss * *C'C'ww  tjtjcc4T4TyfyfggGG88TT::==UU66ll##EEwwvv b bR -R -##@ @ qq77""99..;;9944""  ==  77 X X ffuu7 7 P P FF   @@2n2nII+=+=DDooZZy y p p ((  ]]IIRR""h`h`ccuuN$N$uuII~~>p>p%M%Mss0 0 MMiyiy..ii>55x jx jnn9911}}[3[3tt))::OO;;y y DwDwY Y   ~ ~ jjnnII!B!BLL M MMM<< 7 7 ) ) FFMDMD< < W W 7 7 nnhhKK))MMT T P P7*7***"Q"QNN  77 ((((111ۜ1ۜwQwQkk W W  hh. . e e   ::~4~4**ccZZBB? ?   ; ; t t uH uH + + v v F F   Y8Y8>>ߵߵ_D_DVqVqR R "W"W))<(<(ff  ''h&h&xx;;hQhQhh.. X XkkFUFU&&      Gq Gq F F qqppMMUU@ @   AnAnvv  z3z3FFooOO^^l\l\++E E     zzLLdd55uuvv44/"/"sDsDEyEyz z \\ wwQQBBssyy  KE KE        ##mm""LLY(Y(((s 3s 3    zzkkgSgSxxr Tr TB;B;||YYHHvv<>qqss&&KKpmpm  ' ' ll????11@M@Moo  xxook k hh;;: C: C  //  e.e.nnzzv(v(??ttKKqq    R!R!p p ttll..qWqWdddd//__p p #V#V..(.(.&_&_7f7frrgg 8181""+I+I88qqH H # #     ZZ2255NN//II22II<<    f f   ) )    xx]B]BUrUr|؅|؅6611YY7 7 ;;((..5+5+1#'1#'. . susuqqD)D)--] ]   | | MM;;==$$EEjpjpd d U U c c ?Z ?Z ''ffSS*~*~_C_C55886 6 dd. . > e> e{{UUxx55S S hhii X X   m mD@D@z^z^--H)H)l)l)P,P,XX1919YYjjKKmmF/F/ 11{{''    [[a-a-,^ ,^ y2y2UU?b?bNN77"""" MM T T  $ $  #T#TWWdd--vjvjVkVk::VVHHJJrrggGGPP88JJ==YY]]))==TT]]X cX cx Yx Y@ @ N N x x MM88;;ZZ11%%QQ   { {nTnTPPLLEEuuii ` `    tt i i5544zz  ODODaaOO' ' ""ffggmsms$I$IRV RV K K %9%9% % aa @@};};>>&&||CpCpjjccG[G[ ccwwoOoOvv    1n1nd ;d ;JJll55..hhTO TO BB~~y y F F vv(A(A( ( aaVRVR tt"@"@ZZiiC C &&""  $$/ z/ zRRccӊӊHyHyZZqqWWC C ;!;!$$!!V gV g44KK((xx**UU  qqJJ==::}}TT\\||FFCC!!A JA J  f f p p qwqw&&,V,V//u u 99!A!A""N N d d ''D^D^J۫J۫ l lJJ * *D2D2g-g-$$4 4 VV"Ԑ"ԐRyRyݡݡ88{{EE  {{((    ) )9966c~c~**DD||004141qq{{Q Q = =         wi wi E ERR]]ߔߔwDwDffLL  D2D2&&(( # #II" " f f f#f#7s7s    @ @ D6D6nOnO S S88YY  G G V V 6: 6:  qqffUU0F0FOOqq}}  > > HH--  E E gg]]ppp}p}??xxvvy (y (  DDkk,^,^**K)K)tstsyyllYYbbAAAABB+ |+ |3 3 **rrKK55//]] a ai6i6zzqq  R R    - -GAGAHH//# !# !( ( AAHwHwEXEXFF))((rJrJ,,UfUfvv : :  ` ` 9 9 P P ( (;;DD))DDQQ ++]]  i Yi Y: : ::AZAZqqqqeep=p=JJ  wx wx   r r p-p-llt{t{ q qPP..pp  uu--  nnSS[[<<445]5]@@  , , //g g ~ ~ ! ! *i*ibbnn ii``xxnnxx((&&$ $ MM  ''JJG`G`}}MMwcwcB B 8b8b}}    IIvv --++||@@WW[[d d ""J J   mKmKKKAA||bbn n EE##~b~b  $ /$ /**DDhhyyNNCC((??h Sh S--6)6) E Eff7w7wGGrrIILLvv  %%tQ tQ 00&&mmjj-F-FVl V uh h uu  " q8K oH  ))5050 Ѵ ѴDәDәa.a.]]  H H..o1o1#+#+ww] ] ""p@p@BB    88  9 9 ~ L~ L   ee33??CCbbwawa66yy99t t E E   q q ~Z ~Z Y Y q5 q5  f fjj((ffyy&&  **%%%%$$   %b%bYY / / * * 9 9%q%qTT[[V#V#hEhEm m   ; ; j j D D   PnPn))7W7Woo | | e e ll     //**kkJfJfJJ EzEz<<jj__YY;k;k{{xxWWcOcOSSGGuu ww''[[MM~~44w w I;I;r%r%  q q Y Y iihh,,kk//CCY1Y1 \ \  a a   --"{"{xxPPjNjNxxPP!!o`o`uuiieeeeMMMMww|X|X66UUd d ?dEobbXX D  u*  (   {n{nDDcULLGvGvA{ p{ < m< mY Y PPAA m mAkAk--( @( @ v v 8 8  QQVVAAN N SSWW$ $ iiXX55V V 3 3 [h[h>J >J   ~~IIttU}U}{{DDjj > >SbSbvv.q.qynyn m mz z t t    4V4V4J4J`%`%JJnnPPvvN(N(jj \ \&&4 4  h h..NNggddk k % % CCv jv j33''׋׋;;SSUU??  $$!!CC ^^++iiJJ{{   e eee>>FFuGuGx.x.AxAx 00rrLL ' '  **Cj Cj  ,6,6hhMMPPeeOO  eeR R t#pt#pK! K!   * * aa77885$5$MM 7 7  hh(&(&2< 2< /N/N%%  }}vvBBԩԩGGww--""  h3h3a~t j 8 |8 |ww'@o=ppxxRRWWW5W5^^//66;;^ @^ @  i v qL    ' ' J J H ARl\ 11nn6f6f  : : pp""!!774 4 LL 2y2yLLQQaa99SS    ppZZ|y|y@@``.. o o  ; ; y y..MpMpbb@@&&55BBGG  + + ((V V  p/p/6*tz5XX55qa8[7GG ~ ~W PW PGG  ##__ 99ZUZU  ||3J_w 66>>*Z-gGt66HH__22PP : :  ??aa66) ) dd~<~<[[WW77vvbbtt        ))??ACAC99mmzz3F3FKKddQQmm &&ffKKMMaa_}_}ddjj  b? b?   b b  @@ww''--BB3O3O        xxOhOhppLLkk  Au Au     00))CC``ssk k   RRp p jjL}L}DGDG..5 5 DPDPpp( ( ShShKK##22**ff2Y2Y<<*<*G>G__**bb''""  VV/ / * *  X X >; >; h h xt xt 33VzVzZZQ Q --JJ5ت5تڣڣ99: : Z)Z)G.G.,,$$kk++UUvvPPTTGdGd)) z z6 6 T {T {'k'kii C C  O O _ _   [[KKUU55؎؎C"C"jBjBll  LL  9% 9%  %%DSDSUUjj;;w w   e e     G G?-?-m]m]   { {, ,   -2 -2 | |      # D# D      ? U? Uee::ff""FF      f f d  d  GG00gg<<ee''5T5Tzzhh^^66,,;;qq''....``rrWW--xx<<VKVK;;DD" " hh  ?6?6iiݦʽۦʽ""00TT : :wW wW WW))y y ??~~ + +""ppZ Z   ++\~\~ssvbvb''WW         D D4 4 __KK!!!!$h$hxx b b TeTeI&I&F F 66?? KK}F}FEiEinn33{{jAjA[[~~tt܄܄RR : :?? II_2_2U8U8rr~~**CKCK   C C   M< M< r r r6 r6     p p   $ $     [ [  k kFFc c [[vvPP991v1vqqGGhh??2h2hgg  zGzG ||rr-4-4ppqq>>TT^^pp*-*-wwmm    T T   mm  ! ! ::'m'm}}{{U"U"ttss*I*IPPMMSS & &3%3%^^QQEE````$$NNtt/"/"eeNN88rraa// \\;;KK   3 3\? \? d'd' a a    ` ` ddjhjhTT>q>q t t> > ! !  ' "' "--NNCCjjRRr r  Y Y / /  tt$$ee!Z!Z~~FFgFgFII Q Q@ @ fD fD Pz Pz  ++OO^^??LLWWVLVL 22f0f0UUQQ33HHii33>=>=PP[[[[PP2W2W,,N N < <   99  55  3# 3# B FB F\\  L L   WW    7*7*/ / v v ~~<<II<><>KK6!6!'<'<""rrBB33VV11޶޶OoOo]q]q44߳'' ݿ ݿ``PP55aa^^00^^ ppaxax v v   ""%%~'~'*|*|++. . Y1"Y1"3c$3c$;6"&;6"&h7&h7&6&6&3$3$|/!|/!))m#m#BlBlZZ]]3"3"MMOZOZ}}   JJA(A(bbEE##ո]׸] ̪ ̪ҹҹ߫//>>FF{ߠ{ߠ}}~"~"[ѳ[ѳiɰiɰYY0B0B{¥{¥LLؿΪݿΪ > >II  ``]],,RRQ Q |Y |Y rr!!m&dm&d**<-<-. . |. |. m/h!m/h!0["0["1=#1=#F2#F2#%3$%3$ 3# 3#M0"M0"O-O-`'`' ! !cc  ~ ~   6 6 ' ' 88dd00HH$$22ooTT<Ϡ<ϠƩƩqq--Վڎr0r0ooIDIDX[X[{={=ZZ?l?lTT;;>>55( (   ffB\B\00  S S   K K C k C k     y Xy Xg~g~22BByy{/{/66CC99oommR3R3ooFFsjsjyyDD NNss44UUI I aaH"H"j j   XlXl##7a7ao / o / zh zh   3 3 t  t        DDffoo663d3d::hhffv)v)BBzz--izizyyVOVO]]ppB3B3==FF.:.:rrii44h h     %b%b]V]V  6 6 ]]33@2@2++ff F FN N aQ aQ n n  , , ZZDD2g2gcc66TT;;``44L L nn&&>ZZnn.b.bppbb~ ~ IISSll{s{s99YY;B;B YYZZ ""]&]&{{yy``h h       %7%7@'@'mmFF5!5!VV A A   ItItx1x1PQPQg g   l l 99aa==  bGbGjjtt{{ffGGDDq0q0s[s[& & zzPPܟܟssZ؎Z؎((ݎݎ__Q Q ,,QQxxNNuuX-X-  UU#5#5)U)U- !- !a1#a1#3%3%4&4&/6+'/6+'P7?(P7?(9@)9@) ;* ;*c=,c=,s@.s@.A/A/B/B/@.@.;+;+4&4&-C!-C!%%NNkmkm    *f *f     L L vv;Z;Z!!nnQ}Q}ҞHΞH'l'l*M*M7Ɔ7Ɔ8˞8˞ЋЋ;;ݧܧ2ͤ2ͤgɪgɪf>QAQA& &   $7 $7 +O+Oss  **3'3'>4.>4.*EJ3*EJ3E3E3Ci2Ci2=u-=u-4&4&*?*?jj    4 4 O O   K. K.  $$UU//wwhwhw}'}'IIٹٹKӛKӛXX_ɘ_ɘ/{/{mmggggnnғғagag}}hh'['[--cco o ==bb55vv  C C B}B}GG!!||iiFFaamm==FFDeDe-j-jkrkrO>O>G G      hJhJ   7 7 w1w1   <J<Jii66##==dd @@88 @~@~>>AA,ߑ,ߑާާb b <<001f1f!!jjhh~~oo8"8"88ll]] : :<<##      pX pX !!%%(=(=_)+_)+w(Ow(O(&(&##!!  l!gl!g>">"#|#|1$"1$"l$<l$<p#p#!!mm} } s s / / WW%%=M=Mg>g> eeAA B B==fڝfڝ--&&55}}(X(X@@_ފ_ ۱u^u^GG__rvrvRDRD8 8 ::``ddT T   y y   m- m-   8X 8X g g   Gk Gk ))ZZ66MMpp   EEF 5F 5_ _ aa+ + 22  ;;TTMM55@ @ dSdSOO W W  knkn  eeN N Zr>r - -## ## &&E)E) ," ,"@.#@.#R/B$R/B$s/$s/$.#.#-"-"+!+!); ); I(I(&&%%o#[o#[    @ @h6h6UzUz99))ff!!##((DDO԰O԰&&hYhYc8c8xxXX\\EE''LL%%kkAA  GG[[%%L pL p   G G } } [ [ < < 8 8   . . !5!5e e f f   >b>bfefeCC^^;;xxXX::;;GG::XXzFzFllaa%w%w. . ||cLcL tt  r!r!ss l l HH||>>,,rrq q 0u 0u   H2 H2 00]]PPWW==}}ll uu=A=AYYggzz2K2KCC>>]]qTqT$|$|__mm00I I }}WcWc   a a  MBMB?? t tv v w w kkraraMM     99S S **99aa~~!(!(s$s$77> > &&c"c"J J BBQQ??oo]K]KJJuJuJAaAarrAAUAUAWWff ffMM@@zz ..jj22,,`<`<KcKc**uAuA.. KK  /2/2GG \ \ 44II "t"tEESSnn$$+"+",S#,S#''''xxO4O444&C&CKKIIJBJBgg4 4 gg  i7i7hh SSmmXX::++00++33kk\\ ..ccvv>  >    . . N N ~E ~E   kk mmnn] Y] YCCa)a)/!/! ! !00 ||99}}))ZZhhPP55YXYXii55??@@ososooBBbb K K QzQz&&A dA d" q " q     +s +s  FF  QQ    ""n n yoyoMM@ @ T_ T_ 8 8   D D 3 3 v v h h __7-7-Y Y HH]]F\F\GG66#T#T..==??)q)q>>yy'a'aaa{{&&yyttMMff[[``KKOIOI::5p5pFgFg00DD O O % % # # z z g gpp^^))FFDDTSTS*T*TvvGGll       p p776F6Fpp/x/x\\<<==|y|y||MMxx22HAHA  O O > > g g 4  4  IIjTjT00\\C 7C 7   x x 88~-~-' I' I^^TPTP UU:5:5{{7L7LnnttWWV\V\'m'm&F&FSS((ee::$$:[:[66gg++aa m m    OO11##%%""{{  OO  ( (   ()()II::O O = =   nt nt GG9 ^9 ^5L5LSSvv\\nnXX``QQDD@@YY ] ]i+i+@E@E((bbjj2*2*AA]+]+gg;;}}00 bUbUGGoPoP[ [ ''gg0x0x``& & uu66--@@[[hh_q_qAAi i c c XX22:: a a  wwaaxx{{\\   KK}y}yX X //EE-4-4~~EE W W Y Y     a a tt$$9-9-uu_]_]__ AA--R9R9KKuupqpq##HHt!t!ff  <<--NN__P?P?++ppSSCC   y y B B NNuuVV%%|:|:55""  , , ]  ]  [ [ l  l   zSzS_1_1  \ \   --p p 4 4 nngg\Z\ZYY33bb,,nn W WNN E E=d=dUUzz++XXr}r}SSII))KaKa]]33pp3p3p{^{^@@SS0055r{r{YOYO  y~y~> >  "v  wPP  @ 2@ 2Jj#uI~\\..YY,""  K  K  Ij&EE;;XiXi00JJ[L[Lkk4s4s&&iiaaZZ22rree/R>11\\66~[ce+UURR7vI]$]jj?\?\**BBXnXn77TTL%L%,,i i    Z Z xxJnJnoo0077ccSSWWiYiY^^ JJ##ffAA  // F F H H _ _ > ?>0"c9c9y;Z9Fp2p2t t SSII;; >> jj~~tt,, ( (" j " j         & &I[I[++[[22))|3|3BB%%  %F%Fyy>>||KKssXX''33 @ @88`` ` K ` K m m WW11``DD  nnYY$$  uDuD$$:<:<~~ccnn||k k w # w #    _  _ : :  ]]  FFll22bbP|P|TT-n-n} } } i} iBB6600 ..++wwNN PP**  UU((nhnhOO] ]   a A a A G X G X  nn4.4.R&R&k k t t //NN    SS / /ee55  uuAhAhAAVV&&B:B:GG~]~]DD]]..{*{*gg44//cc}}  ::   d d H H mm\\      b b 4 4 "h"hKK  + l + l {  {    n n O O ` ` / /  cca a IIdd||vv!!vvKK0s0s  77[[8q8q[[00AARRddVVII..{{uuNNiiYY66--22popo GG!!11>S >S nnT@T@33,,HHGG++XX;; ~ ~r r dndnZj Zj  SSoaoaKKYY0 0  i i   H H     *8 *8  l  l h h k k H H ^r^rQMQM| 4 | 4   SSUU=}=}jj] ] ^  ^  (( ll}}ii XXGGp6p6 qMqMFF\\9]9]eeddQfQf@@==11;;r r \\<<``eePPQQ     3 3 Q Q P P - -     OOmm--llVV  dd!h!hVV88O{O{JJ||f$f$!!mm:: ododttQQ00 >>__YHYH6 '6 's y s y O O     |&|&##SdSd!!__rrllhhEE9a9aii2Y2Ymm Y YppVV\\&&00vv??[[dd]]FFEEz#z#cYcYLLEEE E   @ @ R R  [ [aa"'"'88II++jj1o1ojj>>/3/3}}MM||55pjpjPP   ) ) ( ( ((mm[[ddHH  g g V V l 0 l 0 qqzzQNQNRR=X=Xvv**ffIxIxb b ^ ^ ~Q~QcUcU11mm||o&o&PPAAdd--aa, ", "L  L  W W O j O j  PPkkWW##DXDX Q Q $$  i i g g %%rrj2j2  7X7X d d;;((``55qqAAvvEE222;2;RReeNNd4d4bb22qq!!SSC C xxhh&&==%%\ \  A A . .%%w%w%]$]${{  = =    k k   h h   x x *C*CF.F...PP''UqUq?y?yLޕLޕ}7}7xx"I"I{Y{YfBfB==26261717ޖ__ߞߞl\l\?[?[ii88vlvlhhEENxNx   9 9 ~N~N%%WWqq{|{|V1V1JHJH;-;-77]+]+   yyvv##~~DDuu kk==qq  xXxX--iidܯdܯtt޸KK""))ff  SSRR00 A A   7 7  o o     y y  tYtY^^DDIISS]]_F_F8i8iuXuXvvll!!UU- - 44DDRnRnJJggRRSS!!KKZZ!!; ; XXBB+C+Cx ` x ` ""ff__uu ` `   r r       ppPPOO``""KKkk%%lZlZPPZZ  3E3EOOppHzHzUU"  "  p p ! ! XXzz^^ ZZ{~{~ffJ)J)yyNNLL##II66**jdjd''jjjjvvUUGG=E=E{{v(v(;;AAUU"Q"QA$A$##[[GGwwLLRRoo    &&8811  QQ>>p[p[ewew;; ``RR((7u7u99qsqsVV;;UUeevvHH \\DDllEE++e e l c l c *  *  TOTO<<,,4%4%k[k[&_&_C`C`Y_Y_ImIm00""}} +"+" O OHHBB**;;EEkk##^5^5 77bbOOLMLMMM@@66EEhh??WWtKtKooe ~e ~3 3 eiei))$$jjYY""S#S##T #T # # _ _ uu[C[C R R nnh h   gygyK6rY5ލ5ލٸ܈ٸܕt٭m)߿l/I/I''zz?c?cHHGfGf664400>->-??   HHjjii,3,3uSuSyy0202,,0!0!))[ti@nFF   n0$7==+V+V66x#x# nnddVV\\88e3e3hhtt''HH{{""YYTT??)u)uYY bb''0 0 LL H P H P S S J T J T i i ""  ==DDPPaaj~j~ttuuD D GG.. 0404MMo;>;bb``scscrrc c 77LL$$oo ))QQ``/./.00 GG 5 5 V VVVIIUUPP44GGFF""55HH\\ D>D>  t B t B " "  PPUU;;u?u?NN L L ??SS$$&K&KXX] W ] W RR{ { ##hhz3z3NN m  m VV00ss4Q4Qw w /g/gLvLvHH((  vvss^b^b3~3~__f f @@XX}}ccSSFMFMttiwiwllm9m9??yy33008!8!77jqjq? ?  ss$#$#*)*)/I-/I-10100I/0I/,T+,T+'&'&2" 2" yyKK|}|}1414#)#)vv ,f,f^>^66 dddd  i - i - 88$$HeHe  4+4+ l l a a  7  7 ccDDQQffeoeo /N/N H H   X X W % W % <<ggp7p7++,,^^1B1BBJBJz6z6GtGt88MbMb~~/7/76Q6QaLaLQQ77gsgs22jMjM##TTss2 2  00pp<<:: mmSSpNpN:: z  z @@ll{{FF UU@@%%AA77??$$I;I;SSwwEnEn&9&9||mzmzaQaQ..7/7/EGEG` } ` }   \\(>  hhtt&&PaPa%%OO}}h.h. % %XkXk?N?NlqlqRRmm. .   ccnnuu??&&yy\\GGN9N9RTRTRR!!NNNN3333}c}cLLYY A%A%&&',',55EoEo:: & &,, 66CCDDeeEE!!L L n e n e ++ # # p  p  9 9 &l&l R9R9O O 22RRRBRB22ss%%ee11\\66HUHU~~ssj j ZZss vZvZfIfI?"?"wTwT{c{cXIXI  C5C5A+A+KKo o F F _v_vll  & = & = #R#RQQ//DKDK55IIcc S S Q 3 Q 3 <<d d  " "{{jjhh   [[   a a ;;rr;;UUkkJ%J% t t * * <<8r8ruNuNopop\\OO----yZyZqkqkkiki&@&@EGEGaaGGYY##55 * * X X 88MSMS00__TOTOnn}}/p/pkwkwSS""?I?I i  i l l Q Q ee\\ ??,,jjii 66SSss{t{t))116K6K_k_kuuAA||#2#2  rre0e0d)d)JJVV    d d 33  CCO O --00ll66\\RtRt1[1[uEuEvXvX<.<.CCttttGG<<vvJ4J4vv))KK88^^++/B/BDKDK|T|Trr""JJ%^%^))PrPr$x$x55cUcUyynOnOXXMMBB B B g g ''rrNENEX+X+ ]  ] rrbWbW $ $ ddxqxqeCeCKKsTsT''8 * 8 * i i ..--}[}[YYNN22{{<><>C C o@o@iiz z 88xmxmfUfUCC)){{/j/jejej~~oo==8 ~ 8 ~ i  i  C}C}RRBNBN DD^^$($(QQ\\ddOeOe@@2a2a{{zz ' ' vv__,1,15 5 U!U!;;11 [ [ //\\ s sz z JJvvKKZZJgJgAAyyg g 3 3   $$;o;olqlqvPvP}}//Y^Y^JJ~~wwAA  O)O)oowwoo[[~~::]g]g[[0 0 <<kk00,,N7N7igig__ oo 2  2 ))ZKZKK K WW@z@znn__z3z3'' m`m`EE^^&V&Vff<<}}H/H/wwv8v8f f HH``NN<<MM$I$IPPRR]]~~"";;brbrtt$`$`@@uuxxzz9 G9 GuuR0R0oo  MMUeUenn!!44hh,,..\\AAzzeehh77Z5Z5>>eeggPmPmDD++vvAA.F.F==mmlleqeq__..!!AAhhbbLlLl  eeQcQccc'J'JnnHHzzg g U U % % y y   22F F a a x x **{{tt44##E E J J   rrIMIM++jjllaa } }JJ]qUs:-XX;Rkg((33{FS j2SS||e'e')e,ll n<)){{ `pN^88+F+Fii   w'w'&&II\\}}m&m&dd??VV55  ,  ,    CC&&}}||CCggaa^^% % g g L L   ''\\ffttwwTT==@@3 3 ! ! ( y ( y u o u o %  %    LLGNGNDD??rr[[++[[t't'CC&&PP[[6633rrTfx1eeQw[t 5522aaTDTD]]::CC PP<< Y Y==rrkk==ff,,VVZZ??ddeeW!6=wcIIRR >>ii]"]" 7 7ffg.g.kklls s <<^L^L,?,?wwJ J H H ==FF1%1%J>|M|MXXss>>^^u]u]$$    66hhc' c' Q Q ] { ] { 6 6 IIww44wOwOII ||pp__;";"+2+2,z,zbbRR ! !qqgg::**4{4{##}}cAcA33JJ||66H&H&887!7! g g @ @  IIbb<<KKHH(e(e  __.. _ _ ,,bbC@C@w w q M q M 4 E 4 E 99JJ##&&==$$/M/M++JJe2e277TXTX<<,,$$<v>99LL$$""  hhQQ..Y.Y.ANANh3h3@9@9R-R-;A;A++]H]H6C6C>m>mi%i%ee77 ,^,^"~"~    p p = = aa``yyHHA/A/}}22  x x 5 5 UU..ZZ==1h1h((D+D+88hhggWW//@E@E - -7W7W33:.:.TT=:=: hh''XCXC    <> jj'r'r@f@fyy..wwnnRR!!KK:q:qWWss%%ww -f-fYYRRff``II::tTtT}E}Eoo ) ) M 7 M 7  # #XvXv"G"G77 j jKKgg++AA;;==YY!!  X X   LL^6^6zz66eemm))99//tt88UU^^ggm\m\LNLNnknk008&8&66<>^^99((\ \ A A K 6K 6  ||AA : :   Q Q   t t y y    %%!!##    , , A Ah:h:;;ee4242XXZZ||AAIIttOO22^^jj<0<0^^11>>ccWWSSKKEE&&33jjECECcscsvv9v: Zu;E;E::NNS n*J2B2B^[L_ cchhd'd'tK^#l/ZNNVVR R iiqqn n u u @ @ **IIJJ++I1I1==WWNN  R TR T.}.}E E L S L S 1^1^[{[{ees]s]zz33P0P0BBRRMYMYssxx]]CCQfQf_J_J**bby.y.44(( F F  >%>%.S.S++%P%P##""".". V V     +_+_@0@0/5/5 S S# # ;;99__{${$ Y Y&^&^TTrr<<ww4444RRp6p6nMnMZZ>> !!SSMM{{**22  //' ' J J r r p p ] ] l l | | g g t t \ \ ' ' A A mm99ww!!OSOSrr]]GG,,77(({{::YjYjn2n2wowovv--5N5N88!M!M[[ddWrWr2277GGFMFM,,]]]']'DDJJee  ssPP44|w|w,F,F. . R  R  p p V Y V Y " 2 " 2 ` ` q, q, b b ::BB          F F hhHHxfxf""hh(h(hLL7755ppE~E~$J$JRRRfRfgg::>W>Waavcvc::gg))ooyy__tt%%}s}s--]]JJyy//    e=e=~Z~ZDUDU%% k k)o)o,z,zXKXKUUrr55nnS.S.uuXXww~~ffmLmLe/e/i'i'\\;;ll8l8l#"#"  CCrr__bb PP#?#?XXSSOOX}X}55nn\Z\Zt t XX'&'& L L2q2q * *__UsUs__g@g@77W W JJrr88RXRXZZ;*;*  ``  ? ?    ww d dI I J  J  --rr99""     =m=m~ S~ S WW5r5reeXX,,/33JMcuu^^@@Ed7&`6uuZZ{R{R  __ZZ77zaza//##BB&O&Onnoo{{ZZNN""r'r'\\o o  p  p 11>">"    O O   7  7   q qq qQ wQ w  O [O [    @ @ 's'shhbbhh))OO^^vvRRuu``gg ,,dcdclldd66>>ddDHDH1:1:%%;;..cc33xxpSpSU U l l   v v s s F F ( (  h 6h 6     { {O   \p    ]  ] K p K p  ja  9 D4040GGDDNNmmH|H|CC;;ffNNG!G!II0044  66dd66BB66  77"{"{vvcc44##((  HuHuMMV/V/((,!,! E Ez6z6DD|W|WPPAA||wwqqffpp--""(2(2^^oo22RR t tQ{Q{FF    6 6 SScciGiG''lluuAAu>u>X'X'ccr>r>ddPPDDllkSkShUhU//ee-/-/JJ>>00ww,?,?..ieie]q]q66j j 2 2 ,9 ,9   ''^"^"))LL|q|q  YSYSooZZkkdd''ccFF(([[&&s7s7##ee''MMRR99BB  ee` ` ss[[ppJJ-]-]LeLe44""gg88))8<8<]:]:xxccUUQQRwRw{{vv\\YYYYzzYYeeii#k#k~~**77gngnWW    M M ] ] :g:gDDvvnn""kk*b*bII  u R u R   Z Z_ _ 7 7 ##&&ff__}}FFvv//EE--TTOO " "]]y"y"iinnt_t_mm tt!!99U&U&xx,?,?--&&N:N:YYGG]J]J))hhVV[y [y ; ;     ppBB7$7$ooO O \;\;EEy$y$y@y@ II33!!M7M7//vvnn]]mGmG>>JJee@@ wwzzggAAvv>> d d,},}LL  **  LLNN66SSRRGgGgppUU11  xxHH55GG``EERRhhmmH&H&B5B5,,..zyzyVV1k1kEE,,RR#z#z009&9&==bb**ooEE@@qAqA %%ppss:7:7z_z_%%aaoobpbp!!??ffooPP!!jjZZ$$qqyiyi``11\B\B$$-v-v 1 1 mm  nnYYsszzjj]]Y.Y.[[*b*bff  **iiNN77~~22cucuQYQY ..&&D1D188uu$9$9$r$r??</>AbAbp}p}zz~o~o$$!!qqGGddvveeQQ;;$$IZIZS!S![[ SS2233rrhh8R8R  XXQ*Q*zqzq##f}f}==ipipxxwwXXQQdd,,ppRR##<<{x{xmm77  qq  L_L_))ppUUttllKK>>]]}Y}Y !!11kk55<<_A_A&&GG..uu::SS,,uu66&&{{  ~~}}RR22$$~~OOMlMljMjM  dKdKqEqE ee444"4"[[KK33}}ghghXX;;NfNfPTPT r rwwRROOf(f(^^qqV V jujuFFIIVEVE!!99ee%%"Z"ZNN%%pp::;n;njXjX""""55mmuuuuVV&&e=e=LLbMbM%%))v(v(\J\Ju u //iiYJYJ##ccXX@@ggJ?J?  "T"TUUhhOOo_o_#>#>NN,x,x  !!eeLL77HHckckw?w?gg<4<4ZZ]]++~E~EnhnhtRtRffddg6g6  iiPP``44ll;;\\<>II((wLwL&&eeddii1d1dkknn!!DZDZ}}OOAAJJPPNNLL;1;133%%(l(lOOmmII{{  LpLp**m^m^88NdNd^^DD00     T TCC[[OOPqPqmmd>d>::,M,M''  dd  ::9977]a]a1166ZZddww Y Y{{XXSSEE```2`2rr ? ?ss[[ppAAttFFddB1B1. . ] ] bIbI5599<<% % ??  aa"h"hy`y`||PP))11*}*}  ''88  pp]]""UU--iikk((nlnlccxx++JJee&&zMzM>J>J88))dd+J+JiiYoYo44  ^^bb\\s s ))""&&ddBBzzQQuu!H!Hmmbbxxtt--FF"7"7yyvv..3;3;cc(( ~~**FFrr--__AAddBB-w-w#n#nRRuu%~%~`v`v;o;ott11[[==.#.#<^<^88//ii  ll\\DDaa``ssL8L8wwAAWW0"0"44((  bb77''  E E ##pp..K;K;&&66//ppcc\\>>CC::ZZ gg,,ggUU]]xx JJVVPPjjkk~~SSuu--%-%-ll}} qq]`]`// < <%%%%__44%%HH__ l lggX X tt^^l:l:';';wwAGAG-f-f::((00xx66//..SSNN]]//77  MoMog*g*ff:g:g}}]]GG^Y^Y**<> Y:--44 ll66]#]#bbqqQQ WWTT))QQGG##4499DDSS{L{L44llm_m_**^+^+RRjjdd``!g!gmmcc4499aa==22..(^(^yzyz``UUyyO1O1;;]]GGMMuur>r>hh9911ll1@1@SS22++ ""ffNNIIJJL L   RF RF       ;- ;- Z Z eeOO~~77||rr99QQJJ"Z"Z..ssgg##KK,,aallzqzqGGUU>>ZZ)) O OCC++66SS$6$6M}M}DDuu))?=?=]]))0 0 s s     3 3 ii  88>>nnEEPP44VV<>jojo22II  5544bb((    E E %r %r W W     [[JDJDccc c ||22MMAAQQ;;F*F*6622NNY:Y:K,K, iiHHbYbYiWiWttf=f==q=q**4b4bLLLLrr]]DD++))--CCdvdvaaww) ) ]];;XXUU++((T}T}..@@""hh==gg[[uu44#^#^::NNUUmm@2@2zKzK{{I$I$bbu(u(@@2J2JWW))r=r=SvSv""QQddgg0808|(|(  //yOyOa'a'II)=)=  00CCt_t_aa99<>ffGGww,X,X - -zzUU%*%*55}}hh__GG'3'3""nnrrj j bbIIGG GGOO+E+EggLL##ZZGGmm$O$O--LLkk77OOoo||44}}00mmz=z=  HnHn##**!/!/%2%2f f UUrrC_C_kk33e e gg  v!v!CC``(J(JGGnnccTTgg[[MMeeDSDS,A,A9O9Orr00@@x@x@gghhHHccLL ? ?ll8W8W\\JJ]]||\\:b:bDD__((w=w=  //ZZ//.N.N//eejjUUz>z>||** &&%%(K(K<<^^EE&&@@HH`` ::!!33}}^^ggEE?v?vOO77vv  r"r"RR!!  ::!!  "<"<++]]#P#P((3g3gooY Y hh 88``}B}BHHRR~~??!!66VV77<<vvRMRMK?K?\V\VggNNMZMZ%%II>e>ehhnnQQV V FF[[OTOT    / /   ^ ^ \ \   N N DDVV H H++,Z,Zuu==KK+{+{))||+C+CCC>>ffjj v v((ZZ >>%%&&ff__,,,,b_b_**??||tt--NNMMHH1~1~xx  jj<<..pfpfRR,,;;QQZZeeC\C\66+F+FFqFqzzcc##]|]|eeoo{{VV!!bbj~j~ffBLBL+(+(OdOdgg^ ^ \\}}__::PPyy((AAPPV$V$U%U%NNSSa)a)vv  h/h/ccJ_J_y>J,["'Y\\\\ ~o00XXXXWHWH_4_4sSsS"|"|55IIww**CC66kk00 @@nnYY#{#{kk @ @ZZ99`J`J1Oo)PP66.Q.Quull< < vvQQ<<NN2R2Raacc&=&=d8d833 E EhThTnn,G,G``oocc66 a akk||44rrKK66e3e3zzuutNtNxwxwb6b6TTmN<g*A,@,@,P,P;[;[Fb9T-F!2++3Y3YIIYVTQNyBj7\7\#C#C"-"- * *|"|"ueueAA=(=(;;zz  ##TT]]v#v#hh((gg>n>nooggppddxxyyN1N1CC  7Y7Ycctt55XX22}9}9 . .>f>fFaFa++CCEE++wawateteOOHH00]]~(~(``ZZww``(?(?``TTppaa//uuffxxMM==  ||ElEl''!>!>HHyyP1P16644!C!Cbb<<55&&yydd*F*FMMVV>>qq*S*S115Y5Y6X6X%%>>TThh}}77TTnn88JJ;;__>>nn''44 k k;;::&/&/XX))Y:Y:\P\Pff|1|1gg))vv:b:b;m;m$$N9N9J$J$SSbb7N7N3[3[nnJJ66SS^B^Bzz``aaJJbb=_=_tt]]??__ h huu((>>RRddeehhllqqw-w-ll@@CCaaWW|/|/ppll6 6 88  MMXX99 l lyyRR44}}hhIIrr$L$LuuYYzz""&&\\vv??||pppypy  ]]ll{"{"NN,?,?}}EE,,>>''qq,,PP F F>o>opp  EE??^^LL3300KKDD\\  RRyy66GG++X0X0oo 33LL4 4 KKt\t\ugug\\~~EE00AAwwccAiAi$K$K11wwVV]]  3T3TXXtt||uu..MMPP5X5XCCrr-z-z~~ccZZD%D%66:R:RqqJJOO  {{a;JmJm 59`Ndt^^>>jjHH 5Y-~tRRttw2__hh\%\%F F AAZZgg119[9[=[=[/9/9  5c5cttCC66e_e_uulplp_Y_Y>,>,//8)8)JEJESRSRUSUSQ:Q:((,,>1>1GLGLYXYX22'.'.KK \ \!t!tEEuunn99HH Z Z%%[[CCddqqmmllmmpp''UU}}rrII**iiXX<<88GG**0R0RWKWKvvvvYCYCXX^^gGgGyyhhTTC!5 (/`<TT==ccSS[[ii77  oo::  zztlemw  gg'78 :&  T1J }TT44==WWnn~~ffTTHHttFFdd|N|N``_4_4JJLL**#>#>  66VV//22WW44?k?kss22@OMLJI66##00=CJPWMDD!!uaNx=^-E!2!2<< Y!W"V"L#C"9#0#0  ttaaNN;;HHee# ! 44f[PPPar r nn26tY} Zjjjjjjjd,MMccss^TKBp:`2O+?+?,,;;JJ))ffccJJHHYYyy__,,0K0K9Z9Z?Y?Y2X2X&W&WVV55``??..]]PPVVgg5i5i  CC!!|%|%KK33'9'9aa{'{'zz33yy!K!KCaCa=g=g'='=ooUUKKqq  9c9cdd55++uuEmEm##  ,a,aUUttPP1A1A  !!    uuKKAAGGmm99DDff^^@m@m&0&0*R*RQQ;;NNAAzzNzNzee((ssYYVVffuu**==@@33wwLL+l+l//NNJJ|$|$%%&@&@++HHOO}}IItt  ))/'/'/2/2*-*-!!YYttffiiyy!!NN{{eeGG e eJJnn}}{{kk@@YYtt]]ffRREE&&  ::;t;tcc""LLffppzzzz44ccEE;l;l1f1f(`(` J J44  FF``ZZccQQ]]"?"?NNPPPP.M.M  11>}>}[[!!||kk[[LL>q>qAmAmByByAA?q?q<]<](9(9mmII55!!t t jjddaaqq55aaaaMM99EEqq 5u5ugg9955SS-5-5     EE>q>qWWyyyyeeSSSSQQ^^WWOyOy7U7U!! mmII55!!MMyy==*i*i<u<u9a9a%M%M  ]]IIee55+a+a:}:}EyEy<u<u#A#A    !!   !!==IIEEAA==II(U(U2Q2Q9M9M=I=I?U?U?a?a>}>}<<9u9u5a5a0M0M+I+I&E&E!1!1 )) 5 5$A$A--   - -!I!I2U2U/a/a+M+M'9'9}}yyeeaammyyAA&]&]?y?yRR``iinnppoollggqqwwzzzzxxttnngg__WWOmOm7Y7Y"E"E Q Q-]-]6Y6Y<U<U/Q/Q#M#M}}IIyyppz z %%AA]]yymmYYEE11zz  !!MMyy % %AA%]%].i.i4u4uHHWWaaggZZNNCC9u9u/a/a&M&M.I.I3U3U6a6a7}7}VVmmmmkkWWEE5a5a--uuaa]]yy  %%AA"-"-    % %AA(M(M1Y1Y7e7e;q;q=m=m=i=i,U,UAA--))%%      ! !==99%% ! !== Y Y'e'e<q<q<m<m;Y;Y)E)E!! 11=]=]VVXXXXFF6i6i(E(E  }}iieeaa]]YYee        %%11==IIEEAA==99&U&U/q/qEEUU``ggkkllkkXXGG8i8i*E*EAA==995511==IIUUAA--  qqmmiieeaammyy   - -99*E*E#A#A==99EE$Q$Q(M(M*I*I*E*E)Q)Q'M'M$I$I!E!EAA==))%%!!-- 9 9 5 5!!    ))%%!!  ))55   libcdio-2.2.0/test/data/cdda_4_5.cue000066400000000000000000000002061474051130400170450ustar00rootroot00000000000000FILE "cdda_4_5.bin" BINARY TRACK 04 AUDIO FLAGS DCP INDEX 01 00:00:00 TRACK 05 AUDIO FLAGS DCP INDEX 01 00:02:00 libcdio-2.2.0/test/data/cdtext-krosis.cdt000066400000000000000000000015161474051130400203110ustar00rootroot00000000000000A Memoir of _# Free WillGo[ne But Not F߀orgottenIns anity A MoniI'ker Of MeToҀ Persist or ;AdhereAn Elcegy for a Ma n AlivePsyc hoticlysmAn   Intramural  MadnessQues tions of a H`olistic DivineWith Virt` ue I Am Free!Battles Are  Won Within A Memior of R/  Free Willx0KrosisKrosis - Krosis G   Krosis b 1  ڄKrosis @ ԣ Ҏ!QM728190520,ˎ" 4QM728190521(# 05QM7281905\$ 206QM728190S%5207QM72819l&05208QM7281ƛ'905209QM7289(1905210QM72Hg)81905211QM7 *281905212QM +7281905213oC, _{- .hl. libcdio-2.2.0/test/data/cdtext-libburnia.cdt000066400000000000000000000031461474051130400207470ustar00rootroot00000000000000Night Cats I8: ISong of Jo yThe HuntMxee Owwww嵁United Cat OKM rchestraFelTix and The PnurrsCatwalky BeautiesMie a Kitten?` Various Songق writersFrie  drich Schill} erMother Na tureMia Kit3tenVarious Comp^ osersLudwigo van BeethovYenunknownMia KittennKTom CatTom Cat Mia KittengFor all our d9 fansFritz and Louie onc߱e were punksq`1234567890ZFeline cla ssic music This is not ! to be shown *"by CD playerظ#s$123456789012X% 3XYBLG11012@M& 34XYBLG1100' 005XYBLG110(0006͏)*+.x+ Nachtkratz ICKIFreudenliedDie JagdMA(ie auu)<Vereinigtes pKatzenorches.terFelix und Die SchnurzrerLaufsteg"   MiezenMia } Ktzchen Verschiedeney  Liedschreibɂ erFriedrich SchillerMu,%tter NaturMNia KtzchenVerschiedene o Komponisten?6Ludwig van BeethovenunUbekanntMia `KtzchenNTom CatTom Cat Mia KrntzchenFr alle unsere FansFriɅtz und LouieP6 waren einmarl Punks1234567890, KlassischeP! Katzenmusik7"##Dies solltenٍ$ CD-Spieler D%nicht anzeig&en.ގ'123456789012O(3XYBLG11012;V)34XYBLG1100f5*005XYBLG110+0006ڏ,_-+.?. blibcdio-2.2.0/test/data/cdtext.cdt000066400000000000000000000033011474051130400167730ustar00rootroot00000000000000Joyful Night sSong of JoC yHumpty DumC ptyMee Owww$rwnUnited Cat O0, rchestraFelvix and The PurrsCatwalkj  BeautiesMi a Kitten Various Songz writersFrie  drich SchillerMother Go  oseMia Kitt`enVarious Comp% osersLudwig⢃ van Beethov8enunknownMia Kitten*Tom CatTom {#CatTom CatMia KittenlFor all our X fansFritz a nd Louie oncЅe were punksPluck the gE ooseT1234567890 Feline cla#! ssic music3"This is not *ȍ# to be shown O$by CD playerߍ%s&123456789012䚎' 3XYBLG11012( 34XYBLG1100 ) 005XYBLG110C*0006+bB,-1;!- Freudvolle NchteLied der FreudeRul{bbeldiekatzǀMie auu0Vereinigtes zKatzenorchesBterFelix unúd Die SchnurÁ rerKatzenga꜁ ng SchnheitF enMia KtzcD henOƂ Verschiedenerr Liedschreib erFriedrichj҂ SchillerMu ނtter GansMip a Ktzchen6Verschiedene Komponisten4QLudwig van BeethovenunubekanntMia 8KtzchenTom CatTom CatTom CatMia KtzchenA\Fr alle unsere FansFri tz und Louieݕ  waren einma!l PunksRupfÅ"t die GansՌ#1234567890Eڇ$Katzenhaft%e Klassik+;&Dies solltenA' CD-Spieler ;(nicht anzeigN)en.*123456789012+3XYBLG11012,34XYBLG1100-005XYBLG110.0006/Q0-11 ?libcdio-2.2.0/test/data/cdtext.toc000066400000000000000000000017361474051130400170200ustar00rootroot00000000000000CD_DA // global CD-TEXT data CD_TEXT { // Mapping from language number (0..7) used in 'LANGUAGE' statements // to language code. /// LANGUAGE_MAP { /// 0 : EN // 9 is the code for ENGLISH, /// // I don't know any other language code, yet /// } // Language number should always start with 0 LANGUAGE 0 { // Required fields - at least all CD-TEXT CDs I've seen so far have them. TITLE "CD Title" PERFORMER "Performer" DISC_ID "XY12345" UPC_EAN "" // usually empty // Further possible items, all of them are optional ARRANGER "" SONGWRITER "" MESSAGE "" GENRE "" // I'm not sure if this should be really ascii data } } TRACK AUDIO // track specific CD-TEXT data CD_TEXT { LANGUAGE 0 { // if an item is defined for one track it should be defined for all tracks TITLE "Track Title" PERFORMER "Performer" ISRC "US-XX1-98-01234" ARRANGER "" SONGWRITER "" MESSAGE "" } } SILENCE 1:0:0 libcdio-2.2.0/test/data/copying-rr.iso000066400000000000000000013500001474051130400176130ustar00rootroot00000000000000CD001LINUX Rock Ridge Copy test """h  Rocky Bernstein K3b - Version 0.11.20 K3B THE CD KREATOR VERSION 0.11.20 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM 2005030511122500200503051112250000000000000000002005030511122500 CD001MKI Sat Mar 5 11:12:25 2005 mkisofs 2.01a17 -gui -graft-points -volid Rock Ridge Copy test -volset -appid K3B THE CD KREATOR VERSION 0.11.20 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM -publisher Rocky Bernstein -preparer K3b - Version 0.11.20 -sysid LINUX -volset-size 1 -volset-seqno 1 -sort .../k3bsESIfc.tmp -rational-rock -hide-list .../k3bZbi0Bb.tmp -full-iso9660-filenames -iso-level 1 -path-list .../k3bM5p0Sb.tmp .../dummydir0/COPYTMPCOPYTMPh SPRRPX$mAAmTFh i h CEfh RRPX$mAAmTFh i h ri COPYRRNM copyPX$mAAmTFi i i i 3COPY2.;1RRNM Copy2PX$mmSLCOPYINGTFi i i |HFFHi 3 COPYING.;1RRNM COPYINGPX$$$TFi 3i i ""$$i FD0.;1RRNMfd0PX$$aa$PNTFi i i /pi TMPRRNMtmpPX$mAAmTFi i i $$i *ZERO.;1RRNM zeroPX$$!!$PNTFi *i *i *fi RRPX$mAAmTFi i i fi RRPX$mAAmTFi i i $$i 3 COPYING.;1RRNM COPYINGPX$mmSLCOPYINGTFi i i fi RRPX$mAAmTFi i i fi RRPX$mAAmTFi i i $$i 3 COPYING.;1RRNM COPYINGPX$mmSLcopyingCOPYINGTFi 3i i 3ER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION. GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libcdio-2.2.0/test/data/copying.iso000066400000000000000000004000001474051130400171650ustar00rootroot00000000000000CD001LINUX CDROM @@ "E  MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2006010516501900200601051650190000000000000000002006010516501900 CD001MKI Thu Jan 5 16:50:19 2006 mkisofs 1.15a40 -o copying-new.iso COPYING"j2"j2,RFFRj. COPYING.;1 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libcdio-2.2.0/test/data/data1.toc000066400000000000000000000001741474051130400165120ustar00rootroot00000000000000// $Id: data1.toc,v 1.1 2004/05/08 20:36:02 rocky Exp $ // Just a single MODE1 track. CD_ROM TRACK MODE1 SILENCE 0:59:74 libcdio-2.2.0/test/data/data2.toc000066400000000000000000000002441474051130400165110ustar00rootroot00000000000000// $Id // MODE1 track followed by an AUDIO track CD_ROM TRACK MODE1 FILE "isofs-m1.bin" 00:00:00 ZERO 1:0:0 TRACK AUDIO PREGAP 0:2:0 FILE "cdda.bin" 00:00:00 libcdio-2.2.0/test/data/data5.toc000066400000000000000000000003231474051130400165120ustar00rootroot00000000000000// $Id: data5.toc,v 1.2 2005/01/23 00:45:57 rocky Exp $ // XA disk // CD_ROM_XA TRACK MODE2_FORM2 FILE "isofs-m1.bin" 00:00:00 00:01:57 TRACK MODE2_FORM1 PREGAP 0:2:0 FILE "isofs-m1.bin" 00:20:71 00:00:10 libcdio-2.2.0/test/data/data6.toc000066400000000000000000000002061474051130400165130ustar00rootroot00000000000000// $Id: data6.toc,v 1.2 2005/01/23 00:45:57 rocky Exp $ // MODE2 track // CD_ROM TRACK MODE2 FILE "isofs-m1.bin" 00:00:00 00:01:57 libcdio-2.2.0/test/data/data7.toc000066400000000000000000000004151474051130400165160ustar00rootroot00000000000000// $Id: data7.toc,v 1.2 2005/01/23 00:45:57 rocky Exp $ // Video CD // CD_ROM_XA TRACK MODE1 // ISO filesystem FILE "isofs-m1.bin" 00:00:00 00:03:57 TRACK MODE2_FORM_MIX // XA track with form 1 and form 2 sectors PREGAP 0:2:0 FILE "isofs-m1.bin" 00:20:71 00:00:00 libcdio-2.2.0/test/data/deep-directory.iso000066400000000000000000014100001474051130400204360ustar00rootroot00000000000000CD001Win32 ISO Label "x + MKISOFS ISO9660/HFS/UDF FILESYSTEM BUILDER & CDRECORD CD/DVD/BluRay CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2020052916332418202005291633241800000000000000002020052916332418 CD001MKI Fri May 29 16:33:24 2020 3.02a06 -l -r -V ISO Label -o D:\Projects\libcdio\test\data\deep-directory.iso C:\tmp\iso2 1RR_MOVED!2148"39#410$ 5 11% 6 12& 713 1RR_MOVED!2148"39#410$ 5 11% 6 12& 713x +SPRRPX,mAAmTFx +x +x +CE''nx +RRPX,mAAmTFx +x +x +t x1RRNM1PX,mAAm TFxxx x!RR_MOVEDRRNM rr_movedPX,mAAmTFx!x!x!REnx!RRPX,mAAmTFx!x!x!nx +RRPX,mAAmTFx +x +x +zx!14RRNM14PX,mAAmTFx.(x.(xRExx!8RRNM8PX,mAAmTFxxx:REnxRRPX,mAAmTFxxx:zx:RRPX,mAAmTFx:x:x:PL &&~((x8.TXT;1RRNM 8.txtPX,mm((TFxxxtx 29RRNM9PX,mAAmTFx 2x 2x 2nx 2RRPX,mAAmTFx 2x 2x 2nxRRPX,mAAmTFxxx:vx10RRNM10PX,mAAmTFxxxnxRRPX,mAAmTFxxxnx 2RRPX,mAAmTFx 2x 2x 2vx 11RRNM11PX,mAAmTFx x x nx RRPX,mAAmTFx x x nxRRPX,mAAmTFxxxvx%12RRNM12PX,mAAmTFx%x%x%nx%RRPX,mAAmTFx%x%x%nx RRPX,mAAmTFx x x vx13RRNM13PX,mAAmTFxxxnxRRPX,mAAmTFxxxnx%RRPX,mAAmTFx%x%x%))x-13.TXT;1RRNM 13.txtPX,mm))TFx-x-x-x.(14RRNM14PX,mAAmTFx.(x.(xCL nx.(RRPX,mAAmTFx.(x.(xzxRRPX,mAAmTFxxxPL **x14.TXT;1RRNM 14.txtPX,mm**TFxxxn xRRPX,mAAm TFxxx nx +RRPX,mAAmTFx +x +x +t!!x2RRNM2PX,mAAm!!TFxxxn!!xRRPX,mAAm!!TFxxxn xRRPX,mAAm TFxxx t""x#3RRNM3PX,mAAm""TFx#x#xn""x#RRPX,mAAm""TFx#x#xn!!xRRPX,mAAm!!TFxxxt##x#4RRNM4PX,mAAm##TFx#x#x#n##x#RRPX,mAAm##TFx#x#x#n""x#RRPX,mAAm""TFx#x#xt$$x#5RRNM5PX,mAAm$$TFx#x#x#n$$x#RRPX,mAAm$$TFx#x#x#n##x#RRPX,mAAm##TFx#x#x#t%%x"6RRNM6PX,mAAm%%TFx"x"x"n%%x"RRPX,mAAm%%TFx"x"x"n$$x#RRPX,mAAm$$TFx#x#x#t&&x:7RRNM7PX,mAAm&&TFx:x:x:n&&x:RRPX,mAAm&&TFx:x:x:n%%x"RRPX,mAAm%%TFx"x"x"~++x87.TXT;1RRNM 7.txtPX,mm++TFx8x8x8x8RRNM8PX,mAAmTFxxx:CL ER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.level 8level 13level 14level 7libcdio-2.2.0/test/data/deep_directory1_file000066400000000000000000000000071474051130400210100ustar00rootroot00000000000000level 8libcdio-2.2.0/test/data/deep_directory2_file000066400000000000000000000000101474051130400210030ustar00rootroot00000000000000level 14libcdio-2.2.0/test/data/isofs-m1.bin000066400000000000000000025532401474051130400171520ustar00rootroot00000000000000h+R5}&VA-.HDeCEC8kee¯C|6=v؅ugA5/evCgNu* ~TA(&`eCC+ z=Gh5=Ӹ&iA -9tD%evšCE(buN W]AgUTCeC$~ pG1+S}bV)[AT  &e5C ڇ!q\א2K?gA*~Au#͎e†CN[z Z}sA9~hje5_CD|S4J#d2VJbvަyA a3eC^|?:H/q d^AЈ{eCe0 BeByƋAn\ej¾CGSV=)Ȑdj1k$չ8A$Π2egCҡQ/X,t y` !@5A MI$eRCI$]Fo}ANcRey‹C"'}=CD001LINUX CDROM @@"g. MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING 2003042012291800200304201229180000000000000000002003042012291800 E)5_,HʼnZ\qօ$tY{Y{}b޶kJ}K2 Nq8=x/T ־MJZy]'=EtKK 3{/-?O91TThOahY\La:|GO$*qY*< ]Env9r*0M¡Bh` ~ԻBDfh1 3]l# MafCD001x բ U<[?m7Aw23KGqL-t$CwDxOv`"943MKI Sun Apr 20 12:29:18 2003 mkisofs 1.15a22 -R -o cdimage.raw /tmp/cdio-test dvrb~\ ,., " NJD4&66JBNF4\ZXBUFX;91?.'%"%!'#.-,!5vӯ#,0cYLEOLym e2an:([&+9O^uj3D et^\(C\ۺr<^iH,NuRDOC_xE67 <$Ar]f]leVNCZҡZrZ)w{W _OAG6xe\  <FhALi+[?r9KH}eCqj1p8HOu"j_b<yԾA[ 8e{CfBQʐe#g.SPRRPX$AATFg.g g.CEfg.RRPX$AATFg.g g.|HFFHf'5 COPYING.;1RRNM COPYINGPX$TFf'5g g pg 5DOCRRNMdocPX$AATFg 5g g 5ԡ [?hPs凈RC09J ɴMTj&f$~p;*iQk:QbrPh߸J%d7/$Cs&<&4i0;y&9n :`‡jvb_xϹ,(,Pl:\(?KzdhUJ!9j5~iƮe}X]&JV nкy2Ӵ3!4o9!6V_&>CM$fg 5RRPX$AATFg 5g g 5fg.RRPX$AATFg.g g.##g 5 README.TXT;1RRNMreadme.txtPX$TFg 5g g 5FU5kq> Q5'4qrCZ ɀlb,U&;BVLEgky8!Nn%窠),) !FS,bX"Riƛ4%R&Dᠩ۰sN}5 zcKg@E%vVlEo@Hp'3ڭ/UN4)}V,=p$´oo*.KM%&e>%ER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.47Q Ҙ5jKDɏMGi~v AN҂rĈiA K7+^{9>om}H4zz"2"Οv!4\"Jf71FI{Y̐2䖻2<_-y>aGpg&yN rI)e(]$ґC !i'GEwiOU)ʿX[K$gwMS_OO1P-; E 3M& GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for eacjxYu\k ~ %862L8Sn3IWpealqrX0-M  [CBWDdO01*mySU];o? #j2#>3&ÒMSIsPvt )Km3apO /5D`m81'y2VV@_ؐ>fG*K-E-a%çw% Q{995n;5Ҝ?Z`s_^9zE3T8jHQ3p@<'h author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuoua_xl3X8i$ ?8Lo^4c k)c\CƥxfQ\Y>x~S ̚D)]ΜP) ({o:ǧIz0k.*S loӐSv%ϨeDy`_'^IF{f8Q~L$$yX[H/mB~4jƃK',|NWm\r$$kNW\/jD ܩ 550"ڽaߋXyzaFZIP{tQ(sly and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute thJ?v77i֜:.sCȠ[ft)0^E {% `gu=;GU#g;aE5QQ9 cAT#6Ka%*AE&ƫ^ =qM6EWآq:wSKɁVO].Cڧܯ'4oq$%+v GvHU!F*NfpÑ7zP"G}թÓ߳8MHX B&)em as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executar|DL F$ J7lFK\kSۀx[Un(V cOJOu08WI^WCX^ܠ oHnJu(QxuC:/U b;ՊRƳJ0TifQL\cL\WݮX-nYWWBemҏʀĂ>zQ:M8शf<|qT"49dF|>>P0nPkjӮ!040mB0ble work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may n2 XQu҄.Fݱ 4 ;ڈ9v&b9W8:9h=Dfʫ=:mmR@t@Ua&]<}U;٪ +`y WA݀]W~cat+2[N.( yyFp݃Y!j!}I\A O\܉<3Ix0).'6*>E&J@m`32'c .^:`!o+V/j_4 )Q)QQ2LZ9t1+0K1ot impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents EM$W̖x 4  nUuπpx7;+,=ł(Ps;ӔKhn5/xYZd Copyright (C) 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 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License alonvd> |1[i,QAtF5M ff$`iG []7 p&ո }8Lq3lڳPqZ .KWQ*ljf-/1/@9eZ5þrlbJ5O^XSr<(Q@nߘ+lOvY9(4j?"g~3f,&\jlj#7 ᕤ0 y*oO?k]}vn~^L:mZTƒuY4g with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. #.l$k e۫pK[x/W8,¢?`cai34D|VDLhK.'}i?w$DWĽgZ0hG*v) kI4Gb 0SN 2)aN3EWg{&忢MoM0[X7eRxJnKElqe;]WF8\4sAYMt뙘>&Ueu8+7'\5 5This library is to encapsulate CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependant properties of a CD-ROM can use this library. Some support for disk image types like BIN/CUE and NRG is available, so applications that use this library also have the ability to read disc images as though they were CD's. Immediate uses are VCDImager, a navigation-capable Video CD plugin and CD-DA plugin for the media player xine. A sample utility, cdinfo, is included which displayings CD info. If libcddb (http://libcddb.sourceforge.net) is available, the cdinfo program will display CDDB matches on CD-DA discs. @?8i?]T,՞Z1 XzkZ-,LAMN\MmdEu2Q^ṁܬQ4k*|G35OC a!U|AP^D?QyKk s4mIlO6MΔ6\G N1.>?]|nGV~OdxI; m[WX[~ϕ䍬AȨgW qʲu;npTm{2C=qf۱?ζD X;6$9zW.Aj|09"uaeC}]l1"E7:],mAKwa^OeeCKfIՐ18l|a صA-eµCzc{9`.Π+2A ;He$lCf{f3U@wD͙̼}#Ay\xe9eȨA4PpGdXseYCPNaΐgC1vSbA[)e2CjD:^/qDx> < oAH;eC9 MCEfy1AC UP+=eJC5˨5(F*&rb~jTLA1aqL;e¨Ce_^ZGDOz9=q.AjgϮ^e/qC}d0&$6H>[pB^h8|Af1pweCsȓU I>QBC|qA=h7pe C¦a[t RP.N`r 0E\ A0(+fe3UCRN$qmwQ=KcGzA=n*oeŒC꼀J1[KRn2J܇A]MeVCfaM~;Sb!1>MA%8e#CppT `m@AieCFQR|>BUzݜEfz3%A8'JeECj*vVs,dFt 2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74X- 6C,~ie6)|b.Ky4YanC7 9,_N9 e 6)ܐb1S4`Ú@X y), RDe"f6) g4a# eFQ',ju,nJTFKe6)W.x4iNꃌn'G ,e:֠.e96)!`0P4paﳭA)=,!aZe-w6)γ4q?^A /~,Gx?e6)xjla4rQ\.}I,eH6)"tv̐f4s4 '\`L:h@,*{@2e6)W'CZ\.r4t GX&k,,$Pi x|e46)ҬIdˍ@4S :,aV5ee>KɓIs.i[r\Xhree>٘{1/eH؛libcdio-2.2.0/test/data/isofs-m1.cue000066400000000000000000000001411474051130400171370ustar00rootroot00000000000000CATALOG 0000012101954 FILE "ISOFS-M1.BIN" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 libcdio-2.2.0/test/data/isofs-m1.toc000066400000000000000000000000761474051130400171570ustar00rootroot00000000000000CD_ROM TRACK MODE1_RAW FILE "isofs-m1.bin" 00:00:00 00:00:00 libcdio-2.2.0/test/data/joliet.iso000066400000000000000000014300001474051130400170070ustar00rootroot00000000000000CD001LINUX K3b data project &&"E  Rocky Bernstein K3b - Version 0.11.12 K3B THE CD KREATOR VERSION 0.11.12 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM 2004102218445900200410221844590000000000000000002004102218445900 CD001LINUX K3b data project%/E00"E  Rocky Bernstein K3b - Version 0.11.12 K3B THE CD KREATOR VERSION 0.11.12 (C) 2003 SEBASTIAN TRUEG AND 2004102218445900200410221844590000000000000000002004102218445900 CD001MKI Fri Oct 22 18:44:59 2004 mkisofs 2.01a17 -gui -graft-points -volid K3b data project -volset -appid K3B THE CD KREATOR VERSION 0.11.12 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM -publisher Rocky Bernstein -preparer K3b - Version 0.11.12 -sysid LINUX -volset-size 1 -volset-seqno 1 -sort .../k3bQERxJa.tmp -joliet -hide-joliet-list .../k3b2BiYra.tmp -full-iso9660-filenames -follow-links -iso-level 2 -path-list .../k3b40QqIa.tmpLIBCDIOTESTLIBCDIOTEST libcdio!test libcdio!test"h ,;"h ,;(h ,;LIBCDIO"h ,;"h ,;,""HFFHh  COPYING.;1*++llh  README.;12--! !h README.LIBCDIO;1&h ,;TEST"h ,;"h ,;0//JJh4 ISOFS_M1.CUE;1"h ,;"h ,;0 h ,;libcdio" h ,;"h ,;0""HFFHh COPYING.++llh  README>--! !h README.libcdio*!!h ,;test"!!h ,;" h ,;://JJh4 isofs-m1.cue GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. The libcdio package contains a library which encapsulates CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. Also included is a library for working with ISO-9660 filesystems. Some support for disk image types like CDRWin's BIN/CUE format, cdrdao's TOC format, and Nero's NRG format are available. Therefore, applications that use this library also have the ability to read disc images as though they were CD's. Projects using libcdio are the Video CD authoring and ripping tools VCDImager (http://vcdimager.org), a navigation-capable Video CD plugin and CD-DA plugins for the media players xine (http://xinehq.de), videolan's vlc (http://videolan.org), and kiso, a KDE GUI for creating, extracting and editing of ISO-Images (http://kiso.sourceforge.net). Also included in the libcdio package is a utility program cd-info which displays CD information: number of tracks, CD-format and if possible basic information about the format. If libcddb (http://libcdddb.sourceforge.net) is available, the cd-info program will display CDDB matches on CD-DA discs. And if a new enough version of libvcdinfo is available (from the vcdimager project), then cd-info shows basic VCD information. Other utility programs in the libcdio package are cd-read, for performing low-level block reading of a CD or CD image, iso-info for displaying ISO-9660 information from an ISO-9660 image, and iso-read for extracting files from an ISO-9660 image. At present, there is no support for directing CD Audio control, e.g. playing, stopping, or pausing of a CD-CA where the blocks are not actually read into the computer. Nor is there any support for writing CD's. Nor is there any support for reading or writing DVDs. For some of these, there are other libraries (e.g. libdi, libscg, or libdvdread) may be helpful. I'm not theoretically opposed to putting support like this into libcdio. However at present there are already many gaps in this library so narrowing its scope in order to focus on these things I think is a good idea. $Id: joliet.iso,v 1.1 2004/10/28 11:13:40 rocky Exp $ If you check out the source from CVS run ./autogen.sh then follow as below, except you don't need to run ./configure. To compile the source: ./configure MAKE=gmake make make check make install # may have to do this as root If you have problems linking libcdio or libiso9660, see the BSD section. You might also try the option --without-versioned-libs. However this option does help with the situtation described below so it is preferred all other things being equal. VCD dependency: --------------- One thing that confuses people is the "dependency" on libvcdinfo from vcdimager, while vcdimager has a dependency on libcdio. This libcdio dependency on vcdimager is optional (i.e. not mandatory) dependency, while the vcdimager dependency right now is mandatory. libvcdinfo is used only by the utility program cd-info. If you want cd-info to use the VCD reporting portion and you don't already have vcdimager installed, build and install libcdio, then vcdimager, then configure libcdio again and it should find libvcdinfo. People who make packages might consider making two packages, a libcdio package with just the libraries (and no dependency on libvcdinfo) and a libcdio-utils which contains cd-info and iso-info, cd-read, iso-read. Should you want cd-info with VCD support then you'd add a dependency in that package to libvcdinfo. Another thing one can do is "make install" inside the library, or run "configure --without-vcd-info --without-cddb" (since libcddb also has an optional dependency on libcdio). BSD --- Unless you use --without-versioned-libs (not recommended), you need to use GNU make which usually can be found under the name "gmake". If you use another make you are likely to get problems linking libcdio and libiso9660. Solaris ------- You may need to use --without-versioned-libs if you get a problem building libcdio or libiso9660. OS Support --------------- Support for Operating Systems's other than GNU/Linux is really based on the desire, ability and willingness of others to help out. To date it's been almost zip. I use GNU/Linux so that probably works best. Occasionally, I'll test on an old Solaris box I have. Steve Shultz has done a great job making BSDI CD support look like GNU/Linux and usually let's me know where I've blown things on BSDI. Derk-Jan Hartman started Mac OSX, but that's not complete yet. Calls for help in FreeBSD (NetBSD whatever) and Solaris have gone out but no one yet seems all that interested. Maybe it's just as well. Microsoft support is also meager. It works on my Windows 98 laptop sort of. Personally I find it a drag to develop on Microsoft Operating Systems and have spent far more time on this platform than I care for. If someone is interested in fixing the Microsoft OS support great. $Id: joliet.iso,v 1.1 2004/10/28 11:13:40 rocky Exp $ FILE "ISOFS-M1.BIN" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 libcdio-2.2.0/test/data/malformed.iso000066400000000000000000001341751474051130400175040ustar00rootroot0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CD00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000libcdio-2.2.0/test/data/malformed2.iso000066400000000000000000001440001474051130400175520ustar00rootroot00000000000000CD001LINUX CDROM "s% 2015030420413962201503042041396200000000000000002015030420413962 CD001MKI Wed Mar 4 20:41:39 2015 3.01a27 -appid -no-pad -o .../test1.iso -l .AAs%"s%"s%A(s%B.TXT;1"s%"s%(s%C.TXT;1libcdio-2.2.0/test/data/multi_extent_8k.iso000066400000000000000000003600001474051130400206450ustar00rootroot00000000000000CD001 ISOIMAGE << "{  XORRISO-1.5.5 2023.03.19.153432, LIBISOBURN-1.5.5, LIBISOFS-1.5.5, LIBBURN-1.5.5 2023032714090800202303271409080000000000000000000000000000000000 CD001{ SPPX$AATF{ { { CE`{ PX$AATF{ { { !! x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_file%% x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_file)) x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_file-- x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_file11 x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_file55 x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_file99!!x4MULTI_EXTENT_FILE.;1PX$TFx4x4x4NMmulti_extent_fileER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION. /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2015 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of options as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Option -iso_rr_pattern "on"|"ls"|"off" */ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,int flag) { if(strcmp(mode, "off")==0) xorriso->do_iso_rr_pattern= 0; else if(strcmp(mode, "on")==0) xorriso->do_iso_rr_pattern= 1; else if(strcmp(mode, "ls")==0) xorriso->do_iso_rr_pattern= 2; else { sprintf(xorriso->info_text, "-iso_rr_pattern: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -jigdo aspect argument */ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag) { int ret; ret= Xorriso_jigdo_interpreter(xorriso, aspect, arg, 0); return(ret); } /* Option -joliet "on"|"off" */ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_joliet= 0; else if(strcmp(mode, "on")==0) xorriso->do_joliet= 1; else { sprintf(xorriso->info_text, "-joliet: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Command -launch_frontend */ int Xorriso_option_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->launch_frontend_banned) { sprintf(xorriso->info_text, "-launch_frontend was already executed in this xorriso run"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } xorriso->launch_frontend_banned= 1; if(end_idx <= *idx) {ret= 1; goto ex;} if(argv[*idx][0] == 0) {ret= 1; goto ex;} xorriso->dialog= 2; ret= Xorriso_launch_frontend(xorriso, end_idx - *idx, argv + *idx, "", "", 0); ex:; (*idx)= end_idx; return(ret); } /* Option -list_arg_sorting */ int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_cmd_sorting_rank(xorriso, 0, NULL, 0, 1); return(ret); } /* Option -list_delimiter */ int Xorriso_option_list_delimiter(struct XorrisO *xorriso, char *text, int flag) { int ret, argc; char **argv= NULL; if(text[0] == 0) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is empty"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(strlen(text) > 80) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is too long"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Sfile_make_argv(xorriso->progname, text, &argc, &argv, 4); if(ret > 0) { if(argc > 2) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains more than one word"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Sfile_make_argv(xorriso->progname, text, &argc, &argv, 2); if(argc > 2) return(0); } if(strchr(text, '"') != NULL || strchr(text, '\'') != NULL) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains quotation marks"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->list_delimiter, text); return(1); } /* Option -list_extras */ int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag) { int ret; ret= Xorriso_list_extras(xorriso, mode, 0); return(ret); } /* Option -list_formats */ int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_formats(xorriso, 0); return(ret); } /* Option -list_speeds */ int Xorriso_option_list_speeds(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_speeds(xorriso, 0); return(ret); } /* Option -list_profiles */ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which, int flag) { int ret; int mode= 0; if(strncmp(which,"in",2)==0) mode|= 1; else if(strncmp(which,"out",3)==0) mode|= 2; else mode|= 3; if(mode & 1) { ret= Xorriso_toc(xorriso, 1 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 0); } if((mode & 2) && xorriso->in_drive_handle != xorriso->out_drive_handle) { ret= Xorriso_toc(xorriso, 1 | 2 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 2); } return(1); } /* Command -lns alias -lnsi */ int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path, int flag) { int ret; char *eff_path= NULL, *buffer= NULL, *namept; Xorriso_alloc_meM(eff_path, char, SfileadrL); Xorriso_alloc_meM(buffer, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) { sprintf(xorriso->info_text, "-lns: Address already existing: "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_truncate_path_comps(xorriso, target, buffer, &namept, 0); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_graft_in(xorriso, NULL, namept, eff_path, (off_t) 0, (off_t) 0, 1024); if(ret <= 0) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(buffer); Xorriso_free_meM(eff_path); return(ret); } /* Option -load session|track|sbsector value */ /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag) { int ret; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-load: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-load", "loads an alternative image", 0); if(ret<=0) return(2); ret= Xorriso_decode_load_adr(xorriso, "-load", adr_mode, adr_value, &(xorriso->image_start_mode), xorriso->image_start_value, flag & 1); if(ret <= 0) return(ret); xorriso->image_start_mode|= (1<<30); /* enable non-default msc1 processing */ if(strlen(xorriso->indev)>0) { ret= Xorriso_option_rollback(xorriso, 1); /* Load image, no -reassure */ if(ret<=0) return(ret); } return(1); } /* Option -logfile */ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, char *fileadr, int flag) { int hflag,channel_no= 0, ret; if(channel[0]==0) { logfile_wrong_form:; sprintf(xorriso->info_text,"Wrong form. Correct would be: -logfile \".\"|\"R\"|\"I\"|\"M\" file_address"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } hflag= 2; if(channel[0]=='R') channel_no= 1; else if(channel[0]=='I') channel_no= 2; else if(channel[0]=='M') channel_no= 3; else if(channel[0]=='.') hflag= 4; else goto logfile_wrong_form; if(strcmp(fileadr,"-")==0 || fileadr[0]==0) hflag|= (1<<15); xorriso->logfile[channel_no][0]= 0; ret= Xorriso_write_to_channel(xorriso, fileadr, channel_no, hflag); if(ret<=0) { sprintf(xorriso->info_text, "Cannot open logfile: %s", fileadr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else if(!(hflag&(1<<15))) if(Sfile_str(xorriso->logfile[channel_no], fileadr, 0)<=0) return(-1); return(ret>0); } /* Options -ls alias -lsi and -lsl alias -lsli and -lsd alias -lsdi and -lsdl alias -lsdli and -du alias -dui and -dus alias -dusi @param flag bit0= long format (-lsl , -du, not -dus, not -ls) bit1= do not expand patterns but use literally bit2= -du rather than -ls bit3= list directories as themselves (-lsd) */ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i, star= 1; char **filev= NULL, **patterns= NULL; off_t mem= 0; struct stat stbuf; if(flag & 4) { if(!(flag & 1)) star= 0; } else { if(flag & 8) star= 0; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->do_iso_rr_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0 ) { ; } else if(nump <= 0) { if(Xorriso_iso_lstat(xorriso, xorriso->wdi, &stbuf, 0)<0) { sprintf(xorriso->info_text, "Current -cd path does not yet exist in the ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } if(!S_ISDIR(stbuf.st_mode)) { sprintf(xorriso->info_text, "Current -cd meanwhile points to a non-directory in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(star) patterns[0]= "*"; else patterns[0]= "."; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iino_behavior & 32)) { ret= Xorriso_make_hln_array(xorriso, 0); /* for stbuf.st_nlink */ if(ret < 0) goto ex; } if(flag&2) { ret= Xorriso_ls_filev(xorriso, xorriso->wdi, nump, argv + (*idx), mem, flag&(1|4|8)); } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); } else { ret= Xorriso_expand_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_ls_filev(xorriso, xorriso->wdi, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Options -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx @param flag bit0= long format (-lslx , -dux) bit1= do not expand patterns but use literally bit2= du rather than ls bit3= list directories as themselves (ls -d) */ int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i; char **filev= NULL, **patterns= NULL; off_t mem= 0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(xorriso->do_disk_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0) { ; } else if(nump <= 0) { patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(flag&8) patterns[0]= "."; else patterns[0]= "*"; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iwdx, nump, argv + (*idx), mem, flag&(1|4|8)); #ifdef Not_yeT } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); #endif } else { ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_lsx_filev(xorriso, xorriso->wdx, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Option -map , -map_single */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit5= -map_single: do not insert directory tree */ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL, *ipth; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-map: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2); if(ret<=0) goto ex; ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 2|(flag&32)); if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(ret<=0) goto ex; if(!(flag&1)) { sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"), eff_origin); Xorriso_info(xorriso,0); } ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -map_l , -compare_l , -update_l , -extract_l , -update_lxi , -update_li */ /* @param flag bit4= do not establish and dispose xorriso->di_array for update_l bit8-11= mode 0= -map_l 1= -compare_l 2= -update_l 3= -extract_l 4= -update_lxi 5= -update_li */ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, optc= 0, was_failure= 1, i, j, fret, mode, problem_count; int ns_flag= 2|4, nt_flag= 2, opt_args_flag= 2, arg2c= 0, opt2c= 0; int new_opt2c; char *source_prefix= NULL, *target_prefix= NULL, *cmd, **optv= NULL; char *eff_source= NULL, *eff_target= NULL, *s_wd, *t_wd; char **eff_src_array= NULL, **eff_tgt_array= NULL, **opt2v= NULL; char **arg2v= NULL; cmd= "-map_l"; s_wd= xorriso->wdx; t_wd= xorriso->wdi; Xorriso_pacifier_reset(xorriso, 0); mode= (flag>>8) & 15; if(mode==1) cmd= "-compare_l"; else if(mode==2) cmd= "-update_l"; else if(mode == 3 || mode == 5) { if(mode == 5) cmd= "-update_li"; else cmd= "-extract_l"; ns_flag= 2; s_wd= xorriso->wdi; nt_flag= 2|4; t_wd= xorriso->wdx; opt_args_flag= 0; } else if(mode == 4) { cmd= "-update_lxi"; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(end_idx - (*idx) < 3) { sprintf(xorriso->info_text, "%s: Not enough arguments given (%d < 3)", cmd, end_idx - (*idx)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); ret= 0; goto ex; } Xorriso_alloc_meM(source_prefix, char, SfileadrL); Xorriso_alloc_meM(target_prefix, char, SfileadrL); Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_target, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[*idx], source_prefix, ns_flag | 64); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, t_wd, argv[(*idx)+1], target_prefix, nt_flag); if(ret<=0) goto ex; ret= Xorriso_opt_args(xorriso, cmd, argc, argv, (*idx)+2, &end_idx, &optc, &optv, opt_args_flag); if(ret<=0) goto ex; if(mode == 4) { /* Convert pattern from disk to iso_rr */ arg2c= end_idx - *idx - 2; Xorriso_alloc_meM(arg2v, char *, arg2c); for(i = 0; i < arg2c; i++) arg2v[i]= NULL; arg2c= 0; for(i = (*idx) + 2; i < end_idx; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[i], eff_source, ns_flag); if(ret<=0) goto ex; ret= Xorriso__exchange_prefix(source_prefix, target_prefix, eff_source, eff_target, 0); if(ret <= 0) continue; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_target) + 1); strcpy(arg2v[arg2c], eff_target); arg2c++; } /* Expand wildcards in iso_rr, do not include unmatched patterns */ ret= Xorriso_opt_args(xorriso, cmd, arg2c, arg2v, 0, &i, &opt2c, &opt2v, (1 << 10) | (1 << 7)); if(ret<=0) goto ex; /* Convert from iso_rr path to disk path */ new_opt2c= 0; for(i = 0; i < opt2c; i++) { ret= Xorriso__exchange_prefix(target_prefix, source_prefix, opt2v[i], eff_source, 0); free(opt2v[i]); opt2v[i]= NULL; if(ret <= 0) continue; Xorriso_alloc_meM(opt2v[new_opt2c], char, strlen(eff_source) + 1); strcpy(opt2v[new_opt2c], eff_source); new_opt2c++; } opt2c= new_opt2c; /* Merge both results */ if(opt2c > 0) { Sfile_destroy_argv(&arg2c, &arg2v, 0); Xorriso_alloc_meM(arg2v, char *, optc + opt2c); for(i = 0; i < optc + opt2c; i++) arg2v[i]= NULL; arg2c= 0; for(i= 0; i < optc; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, optv[i], eff_source, ns_flag); if(ret<=0) goto ex; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_source) + 1); strcpy(arg2v[arg2c], eff_source); arg2c++; } for(i= 0; i < opt2c; i++) { for(j= 0; j < optc; j++) if(strcmp(opt2v[i], arg2v[j]) == 0) break; if(j < optc) continue; arg2v[arg2c++]= opt2v[i]; opt2v[i]= NULL; } Sfile_destroy_argv(&optc, &optv, 0); optv= arg2v; arg2v= NULL; optc= arg2c; arg2c= 0; } } if(mode == 3 && (xorriso->do_restore_sort_lba || !(xorriso->ino_behavior & 4))) { eff_src_array= calloc(optc, sizeof(char *)); eff_tgt_array= calloc(optc, sizeof(char *)); if(eff_src_array == NULL || eff_tgt_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } for(i= 0; i < optc; i++) eff_src_array[i]= eff_tgt_array[i]= NULL; } if((mode == 2 || mode == 4) && !((xorriso->ino_behavior & 2) || (flag & 16) || xorriso->di_array != NULL)) { /* Create all-image node array sorted by isofs.di */ ret= Xorriso_make_di_array(xorriso, 0); if(ret <= 0) goto ex; } for(i= 0; iinfo_text, "%s: disk_path ", cmd); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " does not begin with disk_prefix "); Text_shellsafe(source_prefix, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); } if(ret <= 0) goto ex; if(mode==0) ret= Xorriso_option_map(xorriso, eff_source, eff_target, 2); else if(mode==1) ret= Xorriso_option_compare(xorriso, eff_source, eff_target, 2|8); else if(mode == 2 || mode == 4) ret= Xorriso_option_update(xorriso, eff_source, eff_target, 2 | 8 | 16); else if(mode==3) { if(eff_src_array != NULL) { eff_src_array[i]= strdup(eff_source); eff_tgt_array[i]= strdup(eff_target); if(eff_src_array[i] == NULL || eff_tgt_array[i] == NULL) { Xorriso_no_malloc_memory(xorriso, &(eff_src_array[i]), 0); ret= -1; goto ex; } } else { ret= Xorriso_option_extract(xorriso, eff_source, eff_target, 2 | 4); } } else if(mode == 5) { ret= Xorriso_option_update(xorriso, eff_target, eff_source, 2 | 8 | 16); } if(ret>0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(fret>=0) continue; goto ex; } ret= 1; if(mode == 3 && eff_src_array != NULL) { ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes), target_prefix, strlen(target_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_lst_append_binary(&(xorriso->node_img_prefixes), source_prefix, strlen(source_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, &problem_count, 0); if(ret <= 0 || problem_count > 0) was_failure= 1; } if(mode==0) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); else if(mode==1 || mode==2 || mode == 4 || mode == 5) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); else if(mode==3) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1|4); ex:; Xorriso_destroy_node_array(xorriso, 0); i= optc; Sfile_destroy_argv(&i, &eff_src_array, 0); i= optc; Sfile_destroy_argv(&i, &eff_tgt_array, 0); Xorriso_free_meM(source_prefix); Xorriso_free_meM(target_prefix); Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_target); (*idx)= end_idx; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 256); Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &opt2c, &opt2v, 256); if(arg2c > 0) Sfile_destroy_argv(&arg2c, &arg2v, 0); else if(arg2v != NULL) Xorriso_free_meM(arg2v); if(ret<=0) return(ret); return(!was_failure); } /* Option -mark */ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag) { if(mark[0]==0) xorriso->mark_text[0]= 0; else strncpy(xorriso->mark_text,mark,sizeof(xorriso->mark_text)-1); xorriso->mark_text[sizeof(xorriso->mark_text)-1]= 0; return(1); } /* Option -md5 "on"|"all"|"off" */ int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) xorriso->do_md5&= ~31; else if(l == 2 && strncmp(cpt, "on", l) == 0) xorriso->do_md5= (xorriso->do_md5 & ~31) | 7 | 16; else if(l == 3 && strncmp(cpt, "all", l) == 0) xorriso->do_md5|= 31; else if(l == 18 && strncmp(cpt, "stability_check_on", l) == 0) xorriso->do_md5|= 8; else if(l == 19 && strncmp(cpt, "stability_check_off", l) == 0) xorriso->do_md5&= ~8; else if(l == 13 && strncmp(cpt, "load_check_on", l) == 0) xorriso->do_md5&= ~32; else if(l == 14 && strncmp(cpt, "load_check_off", l) == 0) xorriso->do_md5|= 32; else { sprintf(xorriso->info_text, "-md5: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Option -mkdir alias -mkdiri */ int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx, ret, was_failure= 0, fret; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 0); for(i= *idx; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; if(ret<=0) return(ret); return(!was_failure); } int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt, *ppt; int l, num, set_min; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 1 && strncmp(cpt, "0", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 2 && strncmp(cpt, "on", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 1 && strncmp(cpt, "1", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 2 && strncmp(cpt, "-1", l) == 0) { ; } else if(*cpt >= '1' && *cpt <= '9') { ppt= cpt; set_min= 2; set_size_percent:; sscanf(ppt, "%d", &num); if(num == -1) { ; } else if(num < 25) { bad_percent:; sprintf(xorriso->info_text, "-modesty_on_drive: percentage out of range [25 to 100]"); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(num > 100) { goto bad_percent; } if(set_min == 2) { xorriso->modesty_on_drive= 1; } if(set_min) xorriso->min_buffer_percent= num; else xorriso->max_buffer_percent= num; } else if(l >= 12 && strncmp(cpt, "min_percent=", 12) == 0) { ppt= cpt + 12; set_min= 1; goto set_size_percent; } else if(l >= 12 && strncmp(cpt, "max_percent=", 12) == 0) { ppt= cpt + 12; set_min= 0; goto set_size_percent; } else if(l >= 9 && strncmp(cpt, "min_usec=", 9) == 0) { ppt= cpt + 9; set_min= 1; set_sec:; num= -1; sscanf(ppt, "%d", &num); if(num < 0) num= 0; if(set_min == 2) xorriso->max_buffer_usec= num; else if(set_min == 1) xorriso->min_buffer_usec= num; else if(set_min == 0) xorriso->max_buffer_percent= num; else xorriso->buffer_timeout_sec= num; } else if(l >= 9 && strncmp(cpt, "max_usec=", 9) == 0) { ppt= cpt + 9; set_min= 2; goto set_sec; } else if(l >= 12 && strncmp(cpt, "timeout_sec=", 12) == 0) { ppt= cpt + 12; set_min= -1; goto set_sec; } else { sprintf(xorriso->info_text, "-modesty_on_drive: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Options -mount , -mount_cmd , -session_string */ /* @param bit0= -mount_cmd: print mount command to result channel rather than performing it bit1= perform -session_string rather than -mount_cmd */ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode, char *adr, char *cmd, int flag) { int ret, entity_code= 0, m_flag; char entity_id[81], *mnt; if(flag & 1) mnt= "-mount_cmd"; else if(flag & 2) mnt= "-session_string"; else { mnt= "-mount"; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-mount: image-to-disk features are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first", mnt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } ret= Xorriso_decode_load_adr(xorriso, mnt, adr_mode, adr, &entity_code, entity_id, 0); if(ret <= 0) return(ret); if(flag & 2) m_flag= 1 | 4; else m_flag= (flag & 1) | 2; ret= Xorriso_mount(xorriso, dev, entity_code, entity_id, cmd, m_flag); return(ret); } /* Option -mount_opts option[:...] */ int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag) { int was, l; char *cpt, *npt; was= xorriso->mount_opts_flag; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "shared", l)==0) { xorriso->mount_opts_flag|= 1; } else if(strncmp(cpt, "exclusive", l)==0) { xorriso->mount_opts_flag&= ~1; } else { unknown_mode:; if(linfo_text, "-mount_opts: unknown option '%s'", cpt); else sprintf(xorriso->info_text, "-mount_opts: oversized parameter (%d)",l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->mount_opts_flag= was; return(0); } } return(1); } /* Command -move */ int Xorriso_option_move(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret <= 0) {ret= 0; goto ex;} ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -msg_op */ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg, int flag) { int ret, available, argc, pargc, i, pflag, max_words, input_lines, msd_mem; char **argv= NULL, **pargv= NULL, *msg= ""; char *prefix, *separators; msd_mem= xorriso->msg_sieve_disabled; ret= 1; if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0 || strcmp(what, "parse_bulk") == 0 || strcmp(what, "parse_bulk_silently") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", "", 5, &argc, &argv, 0); prefix= ""; if(argc > 0) prefix= argv[0]; separators= ""; if(argc > 1) separators= argv[1]; max_words= 0; if(argc > 2) sscanf(argv[2], "%d", &max_words); pflag= 0; if(argc > 3) sscanf(argv[3], "%d", &pflag); input_lines= 1; if(argc > 4) sscanf(argv[4], "%d", &input_lines); if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0) { ret= Xorriso_msg_op_parse(xorriso, "", prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_silently") == 0)); } else { ret= Xorriso_msg_op_parse_bulk(xorriso, prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_bulk_silently") == 0)); } if(ret <= 0) goto ex; xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "start_sieve") == 0) { Xorriso_sieve_dispose(xorriso, 0); ret= Xorriso_sieve_big(xorriso, 0); msg= "Message sieve enabled"; /* >>> } else if(strcmp(what, "add_filter_rule") == 0) { */; } else if(strcmp(what, "clear_sieve") == 0) { ret= Xorriso_sieve_clear_results(xorriso, 0); msg= "Recorded message sieve results disposed"; } else if(strcmp(what, "end_sieve") == 0) { ret= Xorriso_sieve_dispose(xorriso, 0); msg= "Message sieve disabled"; } else if(strcmp(what, "read_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, arg, &pargc, &pargv, &available, 0); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { ret= Sfile_count_char(pargv[i], '\n') + 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); Sfile_str(xorriso->result_line, pargv[i], 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 1); } } else { strcpy(xorriso->result_line, "0\n"); Xorriso_result(xorriso, 1); available= 0; } sprintf(xorriso->result_line, "%d\n", available); Xorriso_result(xorriso, 1); xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); ret= 1; } else if(strcmp(what, "show_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, "", &pargc, &pargv, &available, 8); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { sprintf(xorriso->result_line, "%s\n", pargv[i]); Xorriso_result(xorriso, 1); } } xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); } else if(strcmp(what, "compare_sev") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", ",", 2, &argc, &argv, 0); if(argc < 2) { sprintf(xorriso->info_text, "-msg_op cmp_sev: malformed severity pair '%s'", arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else { ret= Xorriso__severity_cmp(argv[0], argv[1]); sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); } Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "list_sev") == 0) { sprintf(xorriso->result_line, "%s\n", Xorriso__severity_list(0)); Xorriso_result(xorriso, 1); } else { sprintf(xorriso->info_text, "-msg_op: unknown operation '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; } if(ret > 0 && msg[0]) Xorriso_msgs_submit(xorriso, 0, msg, 0, "NOTE", 0); ex:; xorriso->msg_sieve_disabled= msd_mem; return(ret); } /* Option -mv alias -mvi */ int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx_dummy, ret, is_dir= 0, was_failure= 0, fret; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL; char *leafname= NULL; int optc= 0; char **optv= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-mvi", argc, argv, idx, &optc, &optv, eff_dest, 0); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } /* Perform movements */ for(i= 0; iwdi,optv[i],eff_origin,0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Renamed in ISO image: "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= !was_failure; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); Xorriso_opt_args(xorriso, "-mvi", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); return(ret); } /* Option -named_pipe_loop */ int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode, char *stdin_pipe, char *stdout_pipe, char *stderr_pipe, int flag) { char *pipe_paths[3], *cpt, *npt; int ret, hflag= 0, l; npt= mode; for(cpt= mode; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, ':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) { ; } else if(strncmp(cpt, "-", l) == 0) { ; } else if(strncmp(cpt, "cleanup", l) == 0) { hflag|= 1; } else if(strncmp(cpt, "keep", l) == 0) { hflag&= ~1; } else if(strncmp(cpt, "buffered", l) == 0) { hflag|= 2; } else if(strncmp(cpt, "direct", l) == 0) { hflag&= ~2; } else { sprintf(xorriso->info_text, "-named_pipe_loop: unknown mode in '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } pipe_paths[0]= stdin_pipe; pipe_paths[1]= stdout_pipe; pipe_paths[2]= stderr_pipe; ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, hflag); return(ret); } /* Option -no_rc */ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag) { xorriso->no_rc= 1; return(1); } /* Option -not_leaf , (-hide_disk_leaf , -as mkisofs -hide) */ /* @param flag bit0-bit5= hide rather than adding to disk_exclusions bit0= add to iso_rr_hidings bit1= add to joliet_hidings bit2= add to hfsplus_hidings */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag) { regex_t re; char *regexpr= NULL; int ret= 0; Xorriso_alloc_meM(regexpr, char, 2 * SfileadrL + 2); if(pattern[0]==0) {ret= 0; goto cannot_add;} Xorriso__bourne_to_reg(pattern, regexpr, 0); if(regcomp(&re, regexpr, 0)!=0) {ret= 0; goto cannot_add;} if(flag & 63) { if(flag & 1) { ret= Exclusions_add_not_leafs(xorriso->iso_rr_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 2) { ret= Exclusions_add_not_leafs(xorriso->joliet_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 4) { ret= Exclusions_add_not_leafs(xorriso->hfsplus_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } } else { ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0); } if(ret<=0) { cannot_add:; sprintf(xorriso->info_text,"Cannot add pattern: %s ", (flag & 3) ? "-hide_disk_leaf" : "-not_leaf"); Text_shellsafe(pattern, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= 1; ex:; Xorriso_free_meM(regexpr); return(ret); } /* Option -not_list , -quoted_not_list */ /* @param flag bit0= -quoted_not_list */ int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag) { int ret, linecount= 0, insertcount= 0, null= 0, argc= 0, i; FILE *fp= NULL; char **argv= NULL; Xorriso_pacifier_reset(xorriso, 0); if(adr[0]==0) { sprintf(xorriso->info_text, "Empty file name given with %s", (flag & 1) ? "-quoted_not_list" : "-not_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; if(strchr(argv[i], '/')!=NULL) { null= 0; ret= Xorriso_option_not_paths(xorriso, 1, argv + i, &null, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); if(ret<=0) goto ex; insertcount++; } } ret= 1; ex:; Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file "); Text_shellsafe(adr, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " in line number %d", linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } sprintf(xorriso->info_text, "Added %d exclusion list items from file ", insertcount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); return(ret); } /* Option -not_mgt */ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag) { int ret; char *what_data= NULL, *what, *what_next; Xorriso_alloc_meM(what_data, char, SfileadrL); if(Sfile_str(what_data, setting, 0)<=0) { sprintf(xorriso->info_text, "-not_mgt: setting string is much too long (%d)", (int) strlen(setting)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } for(what= what_data; what!=NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next!=NULL) { *what_next= 0; what_next++; } if(strcmp(what, "reset")==0 || strcmp(what, "erase")==0) { if(strcmp(what, "reset")==0) xorriso->disk_excl_mode= 1; Exclusions_destroy(&(xorriso->disk_exclusions), 0); ret= Exclusions_new(&(xorriso->disk_exclusions), 0); if(ret<=0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } } else if(strcmp(what, "on")==0) { xorriso->disk_excl_mode|= 1; } else if(strcmp(what, "off")==0) { xorriso->disk_excl_mode&= ~1; } else if(strcmp(what, "param_on")==0) { xorriso->disk_excl_mode|= 2; } else if(strcmp(what, "param_off")==0) { xorriso->disk_excl_mode&= ~2; } else if(strcmp(what, "subtree_on")==0) { xorriso->disk_excl_mode|= 4; } else if(strcmp(what, "subtree_off")==0) { xorriso->disk_excl_mode&= ~4; } else if(strcmp(what, "ignore_on")==0) { xorriso->disk_excl_mode|= 8; } else if(strcmp(what, "ignore_off")==0) { xorriso->disk_excl_mode&= ~8; } else { sprintf(xorriso->info_text, "-not_mgt: unknown setting '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(what_data); return(ret); } /* Option -not_paths , (-hide_disk_paths , -as mkisofs -hide) */ /* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions bit1= add to joliet_hidings rather than disk_exclusions bit2= enable disk pattern expansion regardless of -disk_pattern bit8-13= consolidated hide state bits, duplicating bit0-1 bit8= add to iso_rr_hidings bit9= add to joliet_hidings bit10= add to hfsplus_hidings */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, num_descr= 0, dummy, optc= 0, i; char **descr= NULL, **optv= NULL, *eff_path= NULL, *hpt= NULL; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, (xorriso->do_disk_pattern == 1 || (flag & 4)) | 2); if(end_idx<=0) {ret= end_idx; goto ex;} num_descr= end_idx - *idx; if(num_descr<=0) {ret= 1; goto ex;} /* produce absolute patterns */ Xorriso_alloc_meM(eff_path, char, SfileadrL); descr= TSOB_FELD(char *, num_descr); if(descr==NULL) { no_memory:; Xorriso_no_pattern_memory(xorriso, sizeof(char *) * (off_t) num_descr, 0); ret= -1; goto ex; } for(i= 0; iwdx, argv[i+*idx], eff_path, 2|4); if(ret<=0) goto ex; descr[i]= strdup(eff_path); if(descr[i]==NULL) goto no_memory; } ret= Xorriso_opt_args(xorriso, (flag & 0x3f03) ? "-hide_disk_paths" : "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 2 | ((flag & 4) << 7)); if(ret<=0) goto ex; if(flag & 0x3f03) { if(flag & 0x0101) { ret= Exclusions_add_not_paths(xorriso->iso_rr_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) { no_hide:; sprintf(xorriso->info_text, "Cannot add path list: -hide_disk_paths "); hpt= Xorriso__hide_mode_text(flag & 0x3f03, 0); if(hpt != NULL) sprintf(xorriso->info_text + strlen(xorriso->info_text), "%s ", hpt); Xorriso_free_meM(hpt); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } } if(flag & 0x0202) { ret= Exclusions_add_not_paths(xorriso->joliet_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } if(flag & 0x0400) { ret= Exclusions_add_not_paths(xorriso->hfsplus_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } } else { ret= Exclusions_add_not_paths(xorriso->disk_exclusions, num_descr, descr, optc, optv, 0); if(ret<=0) { sprintf(xorriso->info_text,"Cannot add path list: -not_paths "); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } } ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 256); if(descr!=NULL) { for(i= 0; iinfo_text,"Empty file name given with -options_from_file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ performing command lines from file "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " :\n"); Xorriso_info(xorriso,1); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); sprintf(xorriso->info_text, "Command file: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 1 | 8); if(ret <= 0) goto ex; /* no problem_handler because there is no sense in going on */ if(ret == 2) break; line= linev[0]; if(line[0]==0 || line[0]=='#') continue; if(flag&1) { ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4 | 8 | ((xorriso->bsl_interpretation & 3) << 5)); if(ret<=0) goto problem_handler; ret= Xorriso_prescan_args(xorriso,argc,argv,1); if(ret==0) {ret= 3; goto ex;} if(ret<0) goto problem_handler; } else { if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ %d: %s\n",linecount,line); Xorriso_info(xorriso,1); } ret= Xorriso_execute_option(xorriso,line,1|(1<<16)); if(ret==3) goto ex; if(ret<=0) goto problem_handler; } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1); if(fret>=0) continue; goto ex; } ret= 1; ex:; Sfile_make_argv("", "", &argc, &argv, 2); /* release memory */ Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 2); Xorriso_reset_counters(xorriso,0); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "error triggered by line %d of file:\n ", linecount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1); } sprintf(xorriso->info_text, "Command file end: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(ret!=1) return(ret); return(!was_failure); } /* Option -osirrox "on"|"off" */ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag) { int l, allow_restore; char *npt, *cpt; allow_restore= xorriso->allow_restore; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0 && mode[0]!=0) goto unknown_mode; if(strncmp(cpt, "off", l)==0 && l >= 3) allow_restore= 0; else if(strncmp(cpt, "banned", l)==0 && l >= 5) allow_restore= -1; else if(strncmp(cpt, "blocked", l)==0 && l >= 7) allow_restore= -2; else if(strncmp(cpt, "unblock", l)==0 && l >= 7) { if(xorriso->allow_restore == -2) xorriso->allow_restore= 0; allow_restore= 1; } else if(strncmp(cpt, "device_files", l)==0 && l >= 12) allow_restore= 2; else if((strncmp(cpt, "on", l)==0 && l >= 2) || mode[0]==0) allow_restore= 1; else if(strncmp(cpt, "concat_split_on", l)==0 && l >= 15) xorriso->do_concat_split= 1; else if(strncmp(cpt, "concat_split_off", l)==0 && l >= 16) xorriso->do_concat_split= 0; else if(strncmp(cpt, "auto_chmod_on", l)==0 && l >= 13) xorriso->do_auto_chmod= 1; else if(strncmp(cpt, "auto_chmod_off", l)==0 && l >= 14) xorriso->do_auto_chmod= 0; else if(strncmp(cpt, "sort_lba_on", l)==0 && l >= 11) xorriso->do_restore_sort_lba= 1; else if(strncmp(cpt, "sort_lba_off", l)==0 && l >= 12) xorriso->do_restore_sort_lba= 0; else if(strncmp(cpt, "o_excl_on", l)==0 && l >= 9) xorriso->drives_exclusive= 1; else if(strncmp(cpt, "o_excl_off", l)==0 && l >= 10) xorriso->drives_exclusive= 0; else if(strncmp(cpt, "strict_acl_on", l)==0 && l >= 13) xorriso->do_strict_acl|= 1; else if(strncmp(cpt, "strict_acl_off", l)==0 && l >= 14) xorriso->do_strict_acl&= ~1; else { unknown_mode:; sprintf(xorriso->info_text, "-osirrox: unknown mode '%s'", cpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(allow_restore > 0 && xorriso->allow_restore == -1) { sprintf(xorriso->info_text, "-osirrox: was already permanently disabled by setting 'banned'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(allow_restore > 0 && xorriso->allow_restore == -2) { sprintf(xorriso->info_text, "-osirrox: is currently disabled by setting 'blocked'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(xorriso->allow_restore != -1) xorriso->allow_restore= allow_restore; sprintf(xorriso->info_text, "Copying of file objects from ISO image to disk filesystem is: %s\n", xorriso->allow_restore > 0 ? "Enabled" : "Disabled"); Xorriso_info(xorriso, 0); return(1); } /* Option -overwrite "on"|"nondir"|"off" */ int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_overwrite= 0; else if(strcmp(mode, "on")==0) xorriso->do_overwrite= 1; else if(strcmp(mode, "nondir")==0) xorriso->do_overwrite= 2; else { sprintf(xorriso->info_text, "-overwrite: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } libcdio-2.2.0/test/data/multi_extent_8k_emul_toc_padded.iso000066400000000000000000020000001474051130400240260ustar00rootroot00000000000000CD001 ISOIMAGE RR 45"22v8 XORRISO-1.4.9 2018.05.18.152119, LIBISOBURN-1.4.9, LIBISOFS-1.4.9, LIBBURN-1.4.9 2018062708215600201806270821560000000000000000000000000000000000 CD001CD001 ISOIMAGE 22 45"22v8 XORRISO-1.4.9 2018.05.18.152119, LIBISOBURN-1.4.9, LIBISOFS-1.4.9, LIBBURN-1.4.9 2018062708215600201806270821560000000000000000000000000000000000 CD00122v8SPPX$AATFv8v8v8CE33`22v8PX$AATFv8v8v877 v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_file;; v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_file?? v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_fileCC v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_fileGG v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_fileKK v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_fileOO!!v 4:MULTI_EXTENT_FILE.;1PX$TFv 4:v 4:v 4:NMmulti_extent_fileER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.22 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2015 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of options as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Option -iso_rr_pattern "on"|"ls"|"off" */ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,int flag) { if(strcmp(mode, "off")==0) xorriso->do_iso_rr_pattern= 0; else if(strcmp(mode, "on")==0) xorriso->do_iso_rr_pattern= 1; else if(strcmp(mode, "ls")==0) xorriso->do_iso_rr_pattern= 2; else { sprintf(xorriso->info_text, "-iso_rr_pattern: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -jigdo aspect argument */ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag) { int ret; ret= Xorriso_jigdo_interpreter(xorriso, aspect, arg, 0); return(ret); } /* Option -joliet "on"|"off" */ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_joliet= 0; else if(strcmp(mode, "on")==0) xorriso->do_joliet= 1; else { sprintf(xorriso->info_text, "-joliet: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Command -launch_frontend */ int Xorriso_option_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->launch_frontend_banned) { sprintf(xorriso->info_text, "-launch_frontend was already executed in this xorriso run"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } xorriso->launch_frontend_banned= 1; if(end_idx <= *idx) {ret= 1; goto ex;} if(argv[*idx][0] == 0) {ret= 1; goto ex;} xorriso->dialog= 2; ret= Xorriso_launch_frontend(xorriso, end_idx - *idx, argv + *idx, "", "", 0); ex:; (*idx)= end_idx; return(ret); } /* Option -list_arg_sorting */ int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_cmd_sorting_rank(xorriso, 0, NULL, 0, 1); return(ret); } /* Option -list_delimiter */ int Xorriso_option_list_delimiter(struct XorrisO *xorriso, char *text, int flag) { int ret, argc; char **argv= NULL; if(text[0] == 0) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is empty"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(strlen(text) > 80) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is too long"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Sfile_make_argv(xorriso->progname, text, &argc, &argv, 4); if(ret > 0) { if(argc > 2) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains more than one word"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Sfile_make_argv(xorriso->progname, text, &argc, &argv, 2); if(argc > 2) return(0); } if(strchr(text, '"') != NULL || strchr(text, '\'') != NULL) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains quotation marks"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->list_delimiter, text); return(1); } /* Option -list_extras */ int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag) { int ret; ret= Xorriso_list_extras(xorriso, mode, 0); return(ret); } /* Option -list_formats */ int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_formats(xorriso, 0); return(ret); } /* Option -list_speeds */ int Xorriso_option_list_speeds(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_speeds(xorriso, 0); return(ret); } /* Option -list_profiles */ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which, int flag) { int ret; int mode= 0; if(strncmp(which,"in",2)==0) mode|= 1; else if(strncmp(which,"out",3)==0) mode|= 2; else mode|= 3; if(mode & 1) { ret= Xorriso_toc(xorriso, 1 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 0); } if((mode & 2) && xorriso->in_drive_handle != xorriso->out_drive_handle) { ret= Xorriso_toc(xorriso, 1 | 2 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 2); } return(1); } /* Command -lns alias -lnsi */ int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path, int flag) { int ret; char *eff_path= NULL, *buffer= NULL, *namept; Xorriso_alloc_meM(eff_path, char, SfileadrL); Xorriso_alloc_meM(buffer, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) { sprintf(xorriso->info_text, "-lns: Address already existing: "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_truncate_path_comps(xorriso, target, buffer, &namept, 0); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_graft_in(xorriso, NULL, namept, eff_path, (off_t) 0, (off_t) 0, 1024); if(ret <= 0) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(buffer); Xorriso_free_meM(eff_path); return(ret); } /* Option -load session|track|sbsector value */ /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag) { int ret; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-load: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-load", "loads an alternative image", 0); if(ret<=0) return(2); ret= Xorriso_decode_load_adr(xorriso, "-load", adr_mode, adr_value, &(xorriso->image_start_mode), xorriso->image_start_value, flag & 1); if(ret <= 0) return(ret); xorriso->image_start_mode|= (1<<30); /* enable non-default msc1 processing */ if(strlen(xorriso->indev)>0) { ret= Xorriso_option_rollback(xorriso, 1); /* Load image, no -reassure */ if(ret<=0) return(ret); } return(1); } /* Option -logfile */ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, char *fileadr, int flag) { int hflag,channel_no= 0, ret; if(channel[0]==0) { logfile_wrong_form:; sprintf(xorriso->info_text,"Wrong form. Correct would be: -logfile \".\"|\"R\"|\"I\"|\"M\" file_address"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } hflag= 2; if(channel[0]=='R') channel_no= 1; else if(channel[0]=='I') channel_no= 2; else if(channel[0]=='M') channel_no= 3; else if(channel[0]=='.') hflag= 4; else goto logfile_wrong_form; if(strcmp(fileadr,"-")==0 || fileadr[0]==0) hflag|= (1<<15); xorriso->logfile[channel_no][0]= 0; ret= Xorriso_write_to_channel(xorriso, fileadr, channel_no, hflag); if(ret<=0) { sprintf(xorriso->info_text, "Cannot open logfile: %s", fileadr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else if(!(hflag&(1<<15))) if(Sfile_str(xorriso->logfile[channel_no], fileadr, 0)<=0) return(-1); return(ret>0); } /* Options -ls alias -lsi and -lsl alias -lsli and -lsd alias -lsdi and -lsdl alias -lsdli and -du alias -dui and -dus alias -dusi @param flag bit0= long format (-lsl , -du, not -dus, not -ls) bit1= do not expand patterns but use literally bit2= -du rather than -ls bit3= list directories as themselves (-lsd) */ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i, star= 1; char **filev= NULL, **patterns= NULL; off_t mem= 0; struct stat stbuf; if(flag & 4) { if(!(flag & 1)) star= 0; } else { if(flag & 8) star= 0; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->do_iso_rr_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0 ) { ; } else if(nump <= 0) { if(Xorriso_iso_lstat(xorriso, xorriso->wdi, &stbuf, 0)<0) { sprintf(xorriso->info_text, "Current -cd path does not yet exist in the ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } if(!S_ISDIR(stbuf.st_mode)) { sprintf(xorriso->info_text, "Current -cd meanwhile points to a non-directory in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(star) patterns[0]= "*"; else patterns[0]= "."; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iino_behavior & 32)) { ret= Xorriso_make_hln_array(xorriso, 0); /* for stbuf.st_nlink */ if(ret < 0) goto ex; } if(flag&2) { ret= Xorriso_ls_filev(xorriso, xorriso->wdi, nump, argv + (*idx), mem, flag&(1|4|8)); } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); } else { ret= Xorriso_expand_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_ls_filev(xorriso, xorriso->wdi, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Options -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx @param flag bit0= long format (-lslx , -dux) bit1= do not expand patterns but use literally bit2= du rather than ls bit3= list directories as themselves (ls -d) */ int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i; char **filev= NULL, **patterns= NULL; off_t mem= 0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(xorriso->do_disk_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0) { ; } else if(nump <= 0) { patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(flag&8) patterns[0]= "."; else patterns[0]= "*"; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iwdx, nump, argv + (*idx), mem, flag&(1|4|8)); #ifdef Not_yeT } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); #endif } else { ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_lsx_filev(xorriso, xorriso->wdx, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Option -map , -map_single */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit5= -map_single: do not insert directory tree */ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL, *ipth; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-map: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2); if(ret<=0) goto ex; ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 2|(flag&32)); if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(ret<=0) goto ex; if(!(flag&1)) { sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"), eff_origin); Xorriso_info(xorriso,0); } ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -map_l , -compare_l , -update_l , -extract_l , -update_lxi , -update_li */ /* @param flag bit4= do not establish and dispose xorriso->di_array for update_l bit8-11= mode 0= -map_l 1= -compare_l 2= -update_l 3= -extract_l 4= -update_lxi 5= -update_li */ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, optc= 0, was_failure= 1, i, j, fret, mode, problem_count; int ns_flag= 2|4, nt_flag= 2, opt_args_flag= 2, arg2c= 0, opt2c= 0; int new_opt2c; char *source_prefix= NULL, *target_prefix= NULL, *cmd, **optv= NULL; char *eff_source= NULL, *eff_target= NULL, *s_wd, *t_wd; char **eff_src_array= NULL, **eff_tgt_array= NULL, **opt2v= NULL; char **arg2v= NULL; cmd= "-map_l"; s_wd= xorriso->wdx; t_wd= xorriso->wdi; Xorriso_pacifier_reset(xorriso, 0); mode= (flag>>8) & 15; if(mode==1) cmd= "-compare_l"; else if(mode==2) cmd= "-update_l"; else if(mode == 3 || mode == 5) { if(mode == 5) cmd= "-update_li"; else cmd= "-extract_l"; ns_flag= 2; s_wd= xorriso->wdi; nt_flag= 2|4; t_wd= xorriso->wdx; opt_args_flag= 0; } else if(mode == 4) { cmd= "-update_lxi"; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(end_idx - (*idx) < 3) { sprintf(xorriso->info_text, "%s: Not enough arguments given (%d < 3)", cmd, end_idx - (*idx)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); ret= 0; goto ex; } Xorriso_alloc_meM(source_prefix, char, SfileadrL); Xorriso_alloc_meM(target_prefix, char, SfileadrL); Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_target, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[*idx], source_prefix, ns_flag | 64); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, t_wd, argv[(*idx)+1], target_prefix, nt_flag); if(ret<=0) goto ex; ret= Xorriso_opt_args(xorriso, cmd, argc, argv, (*idx)+2, &end_idx, &optc, &optv, opt_args_flag); if(ret<=0) goto ex; if(mode == 4) { /* Convert pattern from disk to iso_rr */ arg2c= end_idx - *idx - 2; Xorriso_alloc_meM(arg2v, char *, arg2c); for(i = 0; i < arg2c; i++) arg2v[i]= NULL; arg2c= 0; for(i = (*idx) + 2; i < end_idx; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[i], eff_source, ns_flag); if(ret<=0) goto ex; ret= Xorriso__exchange_prefix(source_prefix, target_prefix, eff_source, eff_target, 0); if(ret <= 0) continue; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_target) + 1); strcpy(arg2v[arg2c], eff_target); arg2c++; } /* Expand wildcards in iso_rr, do not include unmatched patterns */ ret= Xorriso_opt_args(xorriso, cmd, arg2c, arg2v, 0, &i, &opt2c, &opt2v, (1 << 10) | (1 << 7)); if(ret<=0) goto ex; /* Convert from iso_rr path to disk path */ new_opt2c= 0; for(i = 0; i < opt2c; i++) { ret= Xorriso__exchange_prefix(target_prefix, source_prefix, opt2v[i], eff_source, 0); free(opt2v[i]); opt2v[i]= NULL; if(ret <= 0) continue; Xorriso_alloc_meM(opt2v[new_opt2c], char, strlen(eff_source) + 1); strcpy(opt2v[new_opt2c], eff_source); new_opt2c++; } opt2c= new_opt2c; /* Merge both results */ if(opt2c > 0) { Sfile_destroy_argv(&arg2c, &arg2v, 0); Xorriso_alloc_meM(arg2v, char *, optc + opt2c); for(i = 0; i < optc + opt2c; i++) arg2v[i]= NULL; arg2c= 0; for(i= 0; i < optc; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, optv[i], eff_source, ns_flag); if(ret<=0) goto ex; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_source) + 1); strcpy(arg2v[arg2c], eff_source); arg2c++; } for(i= 0; i < opt2c; i++) { for(j= 0; j < optc; j++) if(strcmp(opt2v[i], arg2v[j]) == 0) break; if(j < optc) continue; arg2v[arg2c++]= opt2v[i]; opt2v[i]= NULL; } Sfile_destroy_argv(&optc, &optv, 0); optv= arg2v; arg2v= NULL; optc= arg2c; arg2c= 0; } } if(mode == 3 && (xorriso->do_restore_sort_lba || !(xorriso->ino_behavior & 4))) { eff_src_array= calloc(optc, sizeof(char *)); eff_tgt_array= calloc(optc, sizeof(char *)); if(eff_src_array == NULL || eff_tgt_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } for(i= 0; i < optc; i++) eff_src_array[i]= eff_tgt_array[i]= NULL; } if((mode == 2 || mode == 4) && !((xorriso->ino_behavior & 2) || (flag & 16) || xorriso->di_array != NULL)) { /* Create all-image node array sorted by isofs.di */ ret= Xorriso_make_di_array(xorriso, 0); if(ret <= 0) goto ex; } for(i= 0; iinfo_text, "%s: disk_path ", cmd); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " does not begin with disk_prefix "); Text_shellsafe(source_prefix, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); } if(ret <= 0) goto ex; if(mode==0) ret= Xorriso_option_map(xorriso, eff_source, eff_target, 2); else if(mode==1) ret= Xorriso_option_compare(xorriso, eff_source, eff_target, 2|8); else if(mode == 2 || mode == 4) ret= Xorriso_option_update(xorriso, eff_source, eff_target, 2 | 8 | 16); else if(mode==3) { if(eff_src_array != NULL) { eff_src_array[i]= strdup(eff_source); eff_tgt_array[i]= strdup(eff_target); if(eff_src_array[i] == NULL || eff_tgt_array[i] == NULL) { Xorriso_no_malloc_memory(xorriso, &(eff_src_array[i]), 0); ret= -1; goto ex; } } else { ret= Xorriso_option_extract(xorriso, eff_source, eff_target, 2 | 4); } } else if(mode == 5) { ret= Xorriso_option_update(xorriso, eff_target, eff_source, 2 | 8 | 16); } if(ret>0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(fret>=0) continue; goto ex; } ret= 1; if(mode == 3 && eff_src_array != NULL) { ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes), target_prefix, strlen(target_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_lst_append_binary(&(xorriso->node_img_prefixes), source_prefix, strlen(source_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, &problem_count, 0); if(ret <= 0 || problem_count > 0) was_failure= 1; } if(mode==0) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); else if(mode==1 || mode==2 || mode == 4 || mode == 5) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); else if(mode==3) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1|4); ex:; Xorriso_destroy_node_array(xorriso, 0); i= optc; Sfile_destroy_argv(&i, &eff_src_array, 0); i= optc; Sfile_destroy_argv(&i, &eff_tgt_array, 0); Xorriso_free_meM(source_prefix); Xorriso_free_meM(target_prefix); Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_target); (*idx)= end_idx; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 256); Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &opt2c, &opt2v, 256); if(arg2c > 0) Sfile_destroy_argv(&arg2c, &arg2v, 0); else if(arg2v != NULL) Xorriso_free_meM(arg2v); if(ret<=0) return(ret); return(!was_failure); } /* Option -mark */ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag) { if(mark[0]==0) xorriso->mark_text[0]= 0; else strncpy(xorriso->mark_text,mark,sizeof(xorriso->mark_text)-1); xorriso->mark_text[sizeof(xorriso->mark_text)-1]= 0; return(1); } /* Option -md5 "on"|"all"|"off" */ int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) xorriso->do_md5&= ~31; else if(l == 2 && strncmp(cpt, "on", l) == 0) xorriso->do_md5= (xorriso->do_md5 & ~31) | 7 | 16; else if(l == 3 && strncmp(cpt, "all", l) == 0) xorriso->do_md5|= 31; else if(l == 18 && strncmp(cpt, "stability_check_on", l) == 0) xorriso->do_md5|= 8; else if(l == 19 && strncmp(cpt, "stability_check_off", l) == 0) xorriso->do_md5&= ~8; else if(l == 13 && strncmp(cpt, "load_check_on", l) == 0) xorriso->do_md5&= ~32; else if(l == 14 && strncmp(cpt, "load_check_off", l) == 0) xorriso->do_md5|= 32; else { sprintf(xorriso->info_text, "-md5: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Option -mkdir alias -mkdiri */ int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx, ret, was_failure= 0, fret; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 0); for(i= *idx; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; if(ret<=0) return(ret); return(!was_failure); } int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt, *ppt; int l, num, set_min; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 1 && strncmp(cpt, "0", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 2 && strncmp(cpt, "on", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 1 && strncmp(cpt, "1", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 2 && strncmp(cpt, "-1", l) == 0) { ; } else if(*cpt >= '1' && *cpt <= '9') { ppt= cpt; set_min= 2; set_size_percent:; sscanf(ppt, "%d", &num); if(num == -1) { ; } else if(num < 25) { bad_percent:; sprintf(xorriso->info_text, "-modesty_on_drive: percentage out of range [25 to 100]"); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(num > 100) { goto bad_percent; } if(set_min == 2) { xorriso->modesty_on_drive= 1; } if(set_min) xorriso->min_buffer_percent= num; else xorriso->max_buffer_percent= num; } else if(l >= 12 && strncmp(cpt, "min_percent=", 12) == 0) { ppt= cpt + 12; set_min= 1; goto set_size_percent; } else if(l >= 12 && strncmp(cpt, "max_percent=", 12) == 0) { ppt= cpt + 12; set_min= 0; goto set_size_percent; } else if(l >= 9 && strncmp(cpt, "min_usec=", 9) == 0) { ppt= cpt + 9; set_min= 1; set_sec:; num= -1; sscanf(ppt, "%d", &num); if(num < 0) num= 0; if(set_min == 2) xorriso->max_buffer_usec= num; else if(set_min == 1) xorriso->min_buffer_usec= num; else if(set_min == 0) xorriso->max_buffer_percent= num; else xorriso->buffer_timeout_sec= num; } else if(l >= 9 && strncmp(cpt, "max_usec=", 9) == 0) { ppt= cpt + 9; set_min= 2; goto set_sec; } else if(l >= 12 && strncmp(cpt, "timeout_sec=", 12) == 0) { ppt= cpt + 12; set_min= -1; goto set_sec; } else { sprintf(xorriso->info_text, "-modesty_on_drive: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Options -mount , -mount_cmd , -session_string */ /* @param bit0= -mount_cmd: print mount command to result channel rather than performing it bit1= perform -session_string rather than -mount_cmd */ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode, char *adr, char *cmd, int flag) { int ret, entity_code= 0, m_flag; char entity_id[81], *mnt; if(flag & 1) mnt= "-mount_cmd"; else if(flag & 2) mnt= "-session_string"; else { mnt= "-mount"; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-mount: image-to-disk features are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first", mnt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } ret= Xorriso_decode_load_adr(xorriso, mnt, adr_mode, adr, &entity_code, entity_id, 0); if(ret <= 0) return(ret); if(flag & 2) m_flag= 1 | 4; else m_flag= (flag & 1) | 2; ret= Xorriso_mount(xorriso, dev, entity_code, entity_id, cmd, m_flag); return(ret); } /* Option -mount_opts option[:...] */ int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag) { int was, l; char *cpt, *npt; was= xorriso->mount_opts_flag; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "shared", l)==0) { xorriso->mount_opts_flag|= 1; } else if(strncmp(cpt, "exclusive", l)==0) { xorriso->mount_opts_flag&= ~1; } else { unknown_mode:; if(linfo_text, "-mount_opts: unknown option '%s'", cpt); else sprintf(xorriso->info_text, "-mount_opts: oversized parameter (%d)",l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->mount_opts_flag= was; return(0); } } return(1); } /* Command -move */ int Xorriso_option_move(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret <= 0) {ret= 0; goto ex;} ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -msg_op */ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg, int flag) { int ret, available, argc, pargc, i, pflag, max_words, input_lines, msd_mem; char **argv= NULL, **pargv= NULL, *msg= ""; char *prefix, *separators; msd_mem= xorriso->msg_sieve_disabled; ret= 1; if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0 || strcmp(what, "parse_bulk") == 0 || strcmp(what, "parse_bulk_silently") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", "", 5, &argc, &argv, 0); prefix= ""; if(argc > 0) prefix= argv[0]; separators= ""; if(argc > 1) separators= argv[1]; max_words= 0; if(argc > 2) sscanf(argv[2], "%d", &max_words); pflag= 0; if(argc > 3) sscanf(argv[3], "%d", &pflag); input_lines= 1; if(argc > 4) sscanf(argv[4], "%d", &input_lines); if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0) { ret= Xorriso_msg_op_parse(xorriso, "", prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_silently") == 0)); } else { ret= Xorriso_msg_op_parse_bulk(xorriso, prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_bulk_silently") == 0)); } if(ret <= 0) goto ex; xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "start_sieve") == 0) { Xorriso_sieve_dispose(xorriso, 0); ret= Xorriso_sieve_big(xorriso, 0); msg= "Message sieve enabled"; /* >>> } else if(strcmp(what, "add_filter_rule") == 0) { */; } else if(strcmp(what, "clear_sieve") == 0) { ret= Xorriso_sieve_clear_results(xorriso, 0); msg= "Recorded message sieve results disposed"; } else if(strcmp(what, "end_sieve") == 0) { ret= Xorriso_sieve_dispose(xorriso, 0); msg= "Message sieve disabled"; } else if(strcmp(what, "read_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, arg, &pargc, &pargv, &available, 0); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { ret= Sfile_count_char(pargv[i], '\n') + 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); Sfile_str(xorriso->result_line, pargv[i], 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 1); } } else { strcpy(xorriso->result_line, "0\n"); Xorriso_result(xorriso, 1); available= 0; } sprintf(xorriso->result_line, "%d\n", available); Xorriso_result(xorriso, 1); xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); ret= 1; } else if(strcmp(what, "show_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, "", &pargc, &pargv, &available, 8); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { sprintf(xorriso->result_line, "%s\n", pargv[i]); Xorriso_result(xorriso, 1); } } xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); } else if(strcmp(what, "compare_sev") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", ",", 2, &argc, &argv, 0); if(argc < 2) { sprintf(xorriso->info_text, "-msg_op cmp_sev: malformed severity pair '%s'", arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else { ret= Xorriso__severity_cmp(argv[0], argv[1]); sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); } Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "list_sev") == 0) { sprintf(xorriso->result_line, "%s\n", Xorriso__severity_list(0)); Xorriso_result(xorriso, 1); } else { sprintf(xorriso->info_text, "-msg_op: unknown operation '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; } if(ret > 0 && msg[0]) Xorriso_msgs_submit(xorriso, 0, msg, 0, "NOTE", 0); ex:; xorriso->msg_sieve_disabled= msd_mem; return(ret); } /* Option -mv alias -mvi */ int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx_dummy, ret, is_dir= 0, was_failure= 0, fret; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL; char *leafname= NULL; int optc= 0; char **optv= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-mvi", argc, argv, idx, &optc, &optv, eff_dest, 0); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } /* Perform movements */ for(i= 0; iwdi,optv[i],eff_origin,0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Renamed in ISO image: "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= !was_failure; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); Xorriso_opt_args(xorriso, "-mvi", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); return(ret); } /* Option -named_pipe_loop */ int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode, char *stdin_pipe, char *stdout_pipe, char *stderr_pipe, int flag) { char *pipe_paths[3], *cpt, *npt; int ret, hflag= 0, l; npt= mode; for(cpt= mode; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, ':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) { ; } else if(strncmp(cpt, "-", l) == 0) { ; } else if(strncmp(cpt, "cleanup", l) == 0) { hflag|= 1; } else if(strncmp(cpt, "keep", l) == 0) { hflag&= ~1; } else if(strncmp(cpt, "buffered", l) == 0) { hflag|= 2; } else if(strncmp(cpt, "direct", l) == 0) { hflag&= ~2; } else { sprintf(xorriso->info_text, "-named_pipe_loop: unknown mode in '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } pipe_paths[0]= stdin_pipe; pipe_paths[1]= stdout_pipe; pipe_paths[2]= stderr_pipe; ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, hflag); return(ret); } /* Option -no_rc */ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag) { xorriso->no_rc= 1; return(1); } /* Option -not_leaf , (-hide_disk_leaf , -as mkisofs -hide) */ /* @param flag bit0-bit5= hide rather than adding to disk_exclusions bit0= add to iso_rr_hidings bit1= add to joliet_hidings bit2= add to hfsplus_hidings */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag) { regex_t re; char *regexpr= NULL; int ret= 0; Xorriso_alloc_meM(regexpr, char, 2 * SfileadrL + 2); if(pattern[0]==0) {ret= 0; goto cannot_add;} Xorriso__bourne_to_reg(pattern, regexpr, 0); if(regcomp(&re, regexpr, 0)!=0) {ret= 0; goto cannot_add;} if(flag & 63) { if(flag & 1) { ret= Exclusions_add_not_leafs(xorriso->iso_rr_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 2) { ret= Exclusions_add_not_leafs(xorriso->joliet_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 4) { ret= Exclusions_add_not_leafs(xorriso->hfsplus_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } } else { ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0); } if(ret<=0) { cannot_add:; sprintf(xorriso->info_text,"Cannot add pattern: %s ", (flag & 3) ? "-hide_disk_leaf" : "-not_leaf"); Text_shellsafe(pattern, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= 1; ex:; Xorriso_free_meM(regexpr); return(ret); } /* Option -not_list , -quoted_not_list */ /* @param flag bit0= -quoted_not_list */ int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag) { int ret, linecount= 0, insertcount= 0, null= 0, argc= 0, i; FILE *fp= NULL; char **argv= NULL; Xorriso_pacifier_reset(xorriso, 0); if(adr[0]==0) { sprintf(xorriso->info_text, "Empty file name given with %s", (flag & 1) ? "-quoted_not_list" : "-not_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; if(strchr(argv[i], '/')!=NULL) { null= 0; ret= Xorriso_option_not_paths(xorriso, 1, argv + i, &null, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); if(ret<=0) goto ex; insertcount++; } } ret= 1; ex:; Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file "); Text_shellsafe(adr, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " in line number %d", linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } sprintf(xorriso->info_text, "Added %d exclusion list items from file ", insertcount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); return(ret); } /* Option -not_mgt */ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag) { int ret; char *what_data= NULL, *what, *what_next; Xorriso_alloc_meM(what_data, char, SfileadrL); if(Sfile_str(what_data, setting, 0)<=0) { sprintf(xorriso->info_text, "-not_mgt: setting string is much too long (%d)", (int) strlen(setting)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } for(what= what_data; what!=NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next!=NULL) { *what_next= 0; what_next++; } if(strcmp(what, "reset")==0 || strcmp(what, "erase")==0) { if(strcmp(what, "reset")==0) xorriso->disk_excl_mode= 1; Exclusions_destroy(&(xorriso->disk_exclusions), 0); ret= Exclusions_new(&(xorriso->disk_exclusions), 0); if(ret<=0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } } else if(strcmp(what, "on")==0) { xorriso->disk_excl_mode|= 1; } else if(strcmp(what, "off")==0) { xorriso->disk_excl_mode&= ~1; } else if(strcmp(what, "param_on")==0) { xorriso->disk_excl_mode|= 2; } else if(strcmp(what, "param_off")==0) { xorriso->disk_excl_mode&= ~2; } else if(strcmp(what, "subtree_on")==0) { xorriso->disk_excl_mode|= 4; } else if(strcmp(what, "subtree_off")==0) { xorriso->disk_excl_mode&= ~4; } else if(strcmp(what, "ignore_on")==0) { xorriso->disk_excl_mode|= 8; } else if(strcmp(what, "ignore_off")==0) { xorriso->disk_excl_mode&= ~8; } else { sprintf(xorriso->info_text, "-not_mgt: unknown setting '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(what_data); return(ret); } /* Option -not_paths , (-hide_disk_paths , -as mkisofs -hide) */ /* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions bit1= add to joliet_hidings rather than disk_exclusions bit2= enable disk pattern expansion regardless of -disk_pattern bit8-13= consolidated hide state bits, duplicating bit0-1 bit8= add to iso_rr_hidings bit9= add to joliet_hidings bit10= add to hfsplus_hidings */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, num_descr= 0, dummy, optc= 0, i; char **descr= NULL, **optv= NULL, *eff_path= NULL, *hpt= NULL; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, (xorriso->do_disk_pattern == 1 || (flag & 4)) | 2); if(end_idx<=0) {ret= end_idx; goto ex;} num_descr= end_idx - *idx; if(num_descr<=0) {ret= 1; goto ex;} /* produce absolute patterns */ Xorriso_alloc_meM(eff_path, char, SfileadrL); descr= TSOB_FELD(char *, num_descr); if(descr==NULL) { no_memory:; Xorriso_no_pattern_memory(xorriso, sizeof(char *) * (off_t) num_descr, 0); ret= -1; goto ex; } for(i= 0; iwdx, argv[i+*idx], eff_path, 2|4); if(ret<=0) goto ex; descr[i]= strdup(eff_path); if(descr[i]==NULL) goto no_memory; } ret= Xorriso_opt_args(xorriso, (flag & 0x3f03) ? "-hide_disk_paths" : "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 2 | ((flag & 4) << 7)); if(ret<=0) goto ex; if(flag & 0x3f03) { if(flag & 0x0101) { ret= Exclusions_add_not_paths(xorriso->iso_rr_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) { no_hide:; sprintf(xorriso->info_text, "Cannot add path list: -hide_disk_paths "); hpt= Xorriso__hide_mode_text(flag & 0x3f03, 0); if(hpt != NULL) sprintf(xorriso->info_text + strlen(xorriso->info_text), "%s ", hpt); Xorriso_free_meM(hpt); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } } if(flag & 0x0202) { ret= Exclusions_add_not_paths(xorriso->joliet_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } if(flag & 0x0400) { ret= Exclusions_add_not_paths(xorriso->hfsplus_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } } else { ret= Exclusions_add_not_paths(xorriso->disk_exclusions, num_descr, descr, optc, optv, 0); if(ret<=0) { sprintf(xorriso->info_text,"Cannot add path list: -not_paths "); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } } ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 256); if(descr!=NULL) { for(i= 0; iinfo_text,"Empty file name given with -options_from_file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ performing command lines from file "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " :\n"); Xorriso_info(xorriso,1); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); sprintf(xorriso->info_text, "Command file: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 1 | 8); if(ret <= 0) goto ex; /* no problem_handler because there is no sense in going on */ if(ret == 2) break; line= linev[0]; if(line[0]==0 || line[0]=='#') continue; if(flag&1) { ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4 | 8 | ((xorriso->bsl_interpretation & 3) << 5)); if(ret<=0) goto problem_handler; ret= Xorriso_prescan_args(xorriso,argc,argv,1); if(ret==0) {ret= 3; goto ex;} if(ret<0) goto problem_handler; } else { if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ %d: %s\n",linecount,line); Xorriso_info(xorriso,1); } ret= Xorriso_execute_option(xorriso,line,1|(1<<16)); if(ret==3) goto ex; if(ret<=0) goto problem_handler; } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1); if(fret>=0) continue; goto ex; } ret= 1; ex:; Sfile_make_argv("", "", &argc, &argv, 2); /* release memory */ Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 2); Xorriso_reset_counters(xorriso,0); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "error triggered by line %d of file:\n ", linecount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1); } sprintf(xorriso->info_text, "Command file end: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(ret!=1) return(ret); return(!was_failure); } /* Option -osirrox "on"|"off" */ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag) { int l, allow_restore; char *npt, *cpt; allow_restore= xorriso->allow_restore; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0 && mode[0]!=0) goto unknown_mode; if(strncmp(cpt, "off", l)==0 && l >= 3) allow_restore= 0; else if(strncmp(cpt, "banned", l)==0 && l >= 5) allow_restore= -1; else if(strncmp(cpt, "blocked", l)==0 && l >= 7) allow_restore= -2; else if(strncmp(cpt, "unblock", l)==0 && l >= 7) { if(xorriso->allow_restore == -2) xorriso->allow_restore= 0; allow_restore= 1; } else if(strncmp(cpt, "device_files", l)==0 && l >= 12) allow_restore= 2; else if((strncmp(cpt, "on", l)==0 && l >= 2) || mode[0]==0) allow_restore= 1; else if(strncmp(cpt, "concat_split_on", l)==0 && l >= 15) xorriso->do_concat_split= 1; else if(strncmp(cpt, "concat_split_off", l)==0 && l >= 16) xorriso->do_concat_split= 0; else if(strncmp(cpt, "auto_chmod_on", l)==0 && l >= 13) xorriso->do_auto_chmod= 1; else if(strncmp(cpt, "auto_chmod_off", l)==0 && l >= 14) xorriso->do_auto_chmod= 0; else if(strncmp(cpt, "sort_lba_on", l)==0 && l >= 11) xorriso->do_restore_sort_lba= 1; else if(strncmp(cpt, "sort_lba_off", l)==0 && l >= 12) xorriso->do_restore_sort_lba= 0; else if(strncmp(cpt, "o_excl_on", l)==0 && l >= 9) xorriso->drives_exclusive= 1; else if(strncmp(cpt, "o_excl_off", l)==0 && l >= 10) xorriso->drives_exclusive= 0; else if(strncmp(cpt, "strict_acl_on", l)==0 && l >= 13) xorriso->do_strict_acl|= 1; else if(strncmp(cpt, "strict_acl_off", l)==0 && l >= 14) xorriso->do_strict_acl&= ~1; else { unknown_mode:; sprintf(xorriso->info_text, "-osirrox: unknown mode '%s'", cpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(allow_restore > 0 && xorriso->allow_restore == -1) { sprintf(xorriso->info_text, "-osirrox: was already permanently disabled by setting 'banned'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(allow_restore > 0 && xorriso->allow_restore == -2) { sprintf(xorriso->info_text, "-osirrox: is currently disabled by setting 'blocked'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(xorriso->allow_restore != -1) xorriso->allow_restore= allow_restore; sprintf(xorriso->info_text, "Copying of file objects from ISO image to disk filesystem is: %s\n", xorriso->allow_restore > 0 ? "Enabled" : "Disabled"); Xorriso_info(xorriso, 0); return(1); } /* Option -overwrite "on"|"nondir"|"off" */ int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_overwrite= 0; else if(strcmp(mode, "on")==0) xorriso->do_overwrite= 1; else if(strcmp(mode, "nondir")==0) xorriso->do_overwrite= 2; else { sprintf(xorriso->info_text, "-overwrite: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } libcdio-2.2.0/test/data/multi_extent_8k_joliet.iso000066400000000000000000003600001474051130400222130ustar00rootroot00000000000000CD001 ISOIMAGE << "{ XORRISO-1.5.5 2023.03.19.153432, LIBISOBURN-1.5.5, LIBISOFS-1.5.5, LIBBURN-1.5.5 2023032714080500202303271408050000000000000000000000000000000000 CD001 ISOIMAGE <<%/E "{ XORRISO-1.5.5 2023.03.19.153432, LIBISOBURN-1.5.5, LIBISOFS-1.5. 2023032714080500202303271408050000000000000000000000000000000000CD001"{"{6!! x4MULTI_EXTENT_FILE.;16%% x4MULTI_EXTENT_FILE.;16)) x4MULTI_EXTENT_FILE.;16-- x4MULTI_EXTENT_FILE.;1611 x4MULTI_EXTENT_FILE.;1655 x4MULTI_EXTENT_FILE.;1699!!x4MULTI_EXTENT_FILE.;1"{"{D!! x4"multi_extent_fileD%% x4"multi_extent_fileD)) x4"multi_extent_fileD-- x4"multi_extent_fileD11 x4"multi_extent_fileD55 x4"multi_extent_fileD99!!x4"multi_extent_file /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2015 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of options as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Option -iso_rr_pattern "on"|"ls"|"off" */ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,int flag) { if(strcmp(mode, "off")==0) xorriso->do_iso_rr_pattern= 0; else if(strcmp(mode, "on")==0) xorriso->do_iso_rr_pattern= 1; else if(strcmp(mode, "ls")==0) xorriso->do_iso_rr_pattern= 2; else { sprintf(xorriso->info_text, "-iso_rr_pattern: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -jigdo aspect argument */ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag) { int ret; ret= Xorriso_jigdo_interpreter(xorriso, aspect, arg, 0); return(ret); } /* Option -joliet "on"|"off" */ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_joliet= 0; else if(strcmp(mode, "on")==0) xorriso->do_joliet= 1; else { sprintf(xorriso->info_text, "-joliet: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Command -launch_frontend */ int Xorriso_option_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->launch_frontend_banned) { sprintf(xorriso->info_text, "-launch_frontend was already executed in this xorriso run"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } xorriso->launch_frontend_banned= 1; if(end_idx <= *idx) {ret= 1; goto ex;} if(argv[*idx][0] == 0) {ret= 1; goto ex;} xorriso->dialog= 2; ret= Xorriso_launch_frontend(xorriso, end_idx - *idx, argv + *idx, "", "", 0); ex:; (*idx)= end_idx; return(ret); } /* Option -list_arg_sorting */ int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_cmd_sorting_rank(xorriso, 0, NULL, 0, 1); return(ret); } /* Option -list_delimiter */ int Xorriso_option_list_delimiter(struct XorrisO *xorriso, char *text, int flag) { int ret, argc; char **argv= NULL; if(text[0] == 0) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is empty"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(strlen(text) > 80) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is too long"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Sfile_make_argv(xorriso->progname, text, &argc, &argv, 4); if(ret > 0) { if(argc > 2) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains more than one word"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Sfile_make_argv(xorriso->progname, text, &argc, &argv, 2); if(argc > 2) return(0); } if(strchr(text, '"') != NULL || strchr(text, '\'') != NULL) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains quotation marks"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->list_delimiter, text); return(1); } /* Option -list_extras */ int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag) { int ret; ret= Xorriso_list_extras(xorriso, mode, 0); return(ret); } /* Option -list_formats */ int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_formats(xorriso, 0); return(ret); } /* Option -list_speeds */ int Xorriso_option_list_speeds(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_speeds(xorriso, 0); return(ret); } /* Option -list_profiles */ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which, int flag) { int ret; int mode= 0; if(strncmp(which,"in",2)==0) mode|= 1; else if(strncmp(which,"out",3)==0) mode|= 2; else mode|= 3; if(mode & 1) { ret= Xorriso_toc(xorriso, 1 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 0); } if((mode & 2) && xorriso->in_drive_handle != xorriso->out_drive_handle) { ret= Xorriso_toc(xorriso, 1 | 2 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 2); } return(1); } /* Command -lns alias -lnsi */ int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path, int flag) { int ret; char *eff_path= NULL, *buffer= NULL, *namept; Xorriso_alloc_meM(eff_path, char, SfileadrL); Xorriso_alloc_meM(buffer, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) { sprintf(xorriso->info_text, "-lns: Address already existing: "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_truncate_path_comps(xorriso, target, buffer, &namept, 0); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_graft_in(xorriso, NULL, namept, eff_path, (off_t) 0, (off_t) 0, 1024); if(ret <= 0) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(buffer); Xorriso_free_meM(eff_path); return(ret); } /* Option -load session|track|sbsector value */ /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag) { int ret; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-load: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-load", "loads an alternative image", 0); if(ret<=0) return(2); ret= Xorriso_decode_load_adr(xorriso, "-load", adr_mode, adr_value, &(xorriso->image_start_mode), xorriso->image_start_value, flag & 1); if(ret <= 0) return(ret); xorriso->image_start_mode|= (1<<30); /* enable non-default msc1 processing */ if(strlen(xorriso->indev)>0) { ret= Xorriso_option_rollback(xorriso, 1); /* Load image, no -reassure */ if(ret<=0) return(ret); } return(1); } /* Option -logfile */ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, char *fileadr, int flag) { int hflag,channel_no= 0, ret; if(channel[0]==0) { logfile_wrong_form:; sprintf(xorriso->info_text,"Wrong form. Correct would be: -logfile \".\"|\"R\"|\"I\"|\"M\" file_address"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } hflag= 2; if(channel[0]=='R') channel_no= 1; else if(channel[0]=='I') channel_no= 2; else if(channel[0]=='M') channel_no= 3; else if(channel[0]=='.') hflag= 4; else goto logfile_wrong_form; if(strcmp(fileadr,"-")==0 || fileadr[0]==0) hflag|= (1<<15); xorriso->logfile[channel_no][0]= 0; ret= Xorriso_write_to_channel(xorriso, fileadr, channel_no, hflag); if(ret<=0) { sprintf(xorriso->info_text, "Cannot open logfile: %s", fileadr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else if(!(hflag&(1<<15))) if(Sfile_str(xorriso->logfile[channel_no], fileadr, 0)<=0) return(-1); return(ret>0); } /* Options -ls alias -lsi and -lsl alias -lsli and -lsd alias -lsdi and -lsdl alias -lsdli and -du alias -dui and -dus alias -dusi @param flag bit0= long format (-lsl , -du, not -dus, not -ls) bit1= do not expand patterns but use literally bit2= -du rather than -ls bit3= list directories as themselves (-lsd) */ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i, star= 1; char **filev= NULL, **patterns= NULL; off_t mem= 0; struct stat stbuf; if(flag & 4) { if(!(flag & 1)) star= 0; } else { if(flag & 8) star= 0; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->do_iso_rr_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0 ) { ; } else if(nump <= 0) { if(Xorriso_iso_lstat(xorriso, xorriso->wdi, &stbuf, 0)<0) { sprintf(xorriso->info_text, "Current -cd path does not yet exist in the ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } if(!S_ISDIR(stbuf.st_mode)) { sprintf(xorriso->info_text, "Current -cd meanwhile points to a non-directory in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(star) patterns[0]= "*"; else patterns[0]= "."; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iino_behavior & 32)) { ret= Xorriso_make_hln_array(xorriso, 0); /* for stbuf.st_nlink */ if(ret < 0) goto ex; } if(flag&2) { ret= Xorriso_ls_filev(xorriso, xorriso->wdi, nump, argv + (*idx), mem, flag&(1|4|8)); } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); } else { ret= Xorriso_expand_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_ls_filev(xorriso, xorriso->wdi, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Options -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx @param flag bit0= long format (-lslx , -dux) bit1= do not expand patterns but use literally bit2= du rather than ls bit3= list directories as themselves (ls -d) */ int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i; char **filev= NULL, **patterns= NULL; off_t mem= 0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(xorriso->do_disk_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0) { ; } else if(nump <= 0) { patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(flag&8) patterns[0]= "."; else patterns[0]= "*"; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iwdx, nump, argv + (*idx), mem, flag&(1|4|8)); #ifdef Not_yeT } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); #endif } else { ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_lsx_filev(xorriso, xorriso->wdx, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Option -map , -map_single */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit5= -map_single: do not insert directory tree */ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL, *ipth; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-map: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2); if(ret<=0) goto ex; ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 2|(flag&32)); if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(ret<=0) goto ex; if(!(flag&1)) { sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"), eff_origin); Xorriso_info(xorriso,0); } ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -map_l , -compare_l , -update_l , -extract_l , -update_lxi , -update_li */ /* @param flag bit4= do not establish and dispose xorriso->di_array for update_l bit8-11= mode 0= -map_l 1= -compare_l 2= -update_l 3= -extract_l 4= -update_lxi 5= -update_li */ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, optc= 0, was_failure= 1, i, j, fret, mode, problem_count; int ns_flag= 2|4, nt_flag= 2, opt_args_flag= 2, arg2c= 0, opt2c= 0; int new_opt2c; char *source_prefix= NULL, *target_prefix= NULL, *cmd, **optv= NULL; char *eff_source= NULL, *eff_target= NULL, *s_wd, *t_wd; char **eff_src_array= NULL, **eff_tgt_array= NULL, **opt2v= NULL; char **arg2v= NULL; cmd= "-map_l"; s_wd= xorriso->wdx; t_wd= xorriso->wdi; Xorriso_pacifier_reset(xorriso, 0); mode= (flag>>8) & 15; if(mode==1) cmd= "-compare_l"; else if(mode==2) cmd= "-update_l"; else if(mode == 3 || mode == 5) { if(mode == 5) cmd= "-update_li"; else cmd= "-extract_l"; ns_flag= 2; s_wd= xorriso->wdi; nt_flag= 2|4; t_wd= xorriso->wdx; opt_args_flag= 0; } else if(mode == 4) { cmd= "-update_lxi"; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(end_idx - (*idx) < 3) { sprintf(xorriso->info_text, "%s: Not enough arguments given (%d < 3)", cmd, end_idx - (*idx)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); ret= 0; goto ex; } Xorriso_alloc_meM(source_prefix, char, SfileadrL); Xorriso_alloc_meM(target_prefix, char, SfileadrL); Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_target, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[*idx], source_prefix, ns_flag | 64); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, t_wd, argv[(*idx)+1], target_prefix, nt_flag); if(ret<=0) goto ex; ret= Xorriso_opt_args(xorriso, cmd, argc, argv, (*idx)+2, &end_idx, &optc, &optv, opt_args_flag); if(ret<=0) goto ex; if(mode == 4) { /* Convert pattern from disk to iso_rr */ arg2c= end_idx - *idx - 2; Xorriso_alloc_meM(arg2v, char *, arg2c); for(i = 0; i < arg2c; i++) arg2v[i]= NULL; arg2c= 0; for(i = (*idx) + 2; i < end_idx; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[i], eff_source, ns_flag); if(ret<=0) goto ex; ret= Xorriso__exchange_prefix(source_prefix, target_prefix, eff_source, eff_target, 0); if(ret <= 0) continue; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_target) + 1); strcpy(arg2v[arg2c], eff_target); arg2c++; } /* Expand wildcards in iso_rr, do not include unmatched patterns */ ret= Xorriso_opt_args(xorriso, cmd, arg2c, arg2v, 0, &i, &opt2c, &opt2v, (1 << 10) | (1 << 7)); if(ret<=0) goto ex; /* Convert from iso_rr path to disk path */ new_opt2c= 0; for(i = 0; i < opt2c; i++) { ret= Xorriso__exchange_prefix(target_prefix, source_prefix, opt2v[i], eff_source, 0); free(opt2v[i]); opt2v[i]= NULL; if(ret <= 0) continue; Xorriso_alloc_meM(opt2v[new_opt2c], char, strlen(eff_source) + 1); strcpy(opt2v[new_opt2c], eff_source); new_opt2c++; } opt2c= new_opt2c; /* Merge both results */ if(opt2c > 0) { Sfile_destroy_argv(&arg2c, &arg2v, 0); Xorriso_alloc_meM(arg2v, char *, optc + opt2c); for(i = 0; i < optc + opt2c; i++) arg2v[i]= NULL; arg2c= 0; for(i= 0; i < optc; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, optv[i], eff_source, ns_flag); if(ret<=0) goto ex; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_source) + 1); strcpy(arg2v[arg2c], eff_source); arg2c++; } for(i= 0; i < opt2c; i++) { for(j= 0; j < optc; j++) if(strcmp(opt2v[i], arg2v[j]) == 0) break; if(j < optc) continue; arg2v[arg2c++]= opt2v[i]; opt2v[i]= NULL; } Sfile_destroy_argv(&optc, &optv, 0); optv= arg2v; arg2v= NULL; optc= arg2c; arg2c= 0; } } if(mode == 3 && (xorriso->do_restore_sort_lba || !(xorriso->ino_behavior & 4))) { eff_src_array= calloc(optc, sizeof(char *)); eff_tgt_array= calloc(optc, sizeof(char *)); if(eff_src_array == NULL || eff_tgt_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } for(i= 0; i < optc; i++) eff_src_array[i]= eff_tgt_array[i]= NULL; } if((mode == 2 || mode == 4) && !((xorriso->ino_behavior & 2) || (flag & 16) || xorriso->di_array != NULL)) { /* Create all-image node array sorted by isofs.di */ ret= Xorriso_make_di_array(xorriso, 0); if(ret <= 0) goto ex; } for(i= 0; iinfo_text, "%s: disk_path ", cmd); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " does not begin with disk_prefix "); Text_shellsafe(source_prefix, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); } if(ret <= 0) goto ex; if(mode==0) ret= Xorriso_option_map(xorriso, eff_source, eff_target, 2); else if(mode==1) ret= Xorriso_option_compare(xorriso, eff_source, eff_target, 2|8); else if(mode == 2 || mode == 4) ret= Xorriso_option_update(xorriso, eff_source, eff_target, 2 | 8 | 16); else if(mode==3) { if(eff_src_array != NULL) { eff_src_array[i]= strdup(eff_source); eff_tgt_array[i]= strdup(eff_target); if(eff_src_array[i] == NULL || eff_tgt_array[i] == NULL) { Xorriso_no_malloc_memory(xorriso, &(eff_src_array[i]), 0); ret= -1; goto ex; } } else { ret= Xorriso_option_extract(xorriso, eff_source, eff_target, 2 | 4); } } else if(mode == 5) { ret= Xorriso_option_update(xorriso, eff_target, eff_source, 2 | 8 | 16); } if(ret>0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(fret>=0) continue; goto ex; } ret= 1; if(mode == 3 && eff_src_array != NULL) { ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes), target_prefix, strlen(target_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_lst_append_binary(&(xorriso->node_img_prefixes), source_prefix, strlen(source_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, &problem_count, 0); if(ret <= 0 || problem_count > 0) was_failure= 1; } if(mode==0) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); else if(mode==1 || mode==2 || mode == 4 || mode == 5) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); else if(mode==3) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1|4); ex:; Xorriso_destroy_node_array(xorriso, 0); i= optc; Sfile_destroy_argv(&i, &eff_src_array, 0); i= optc; Sfile_destroy_argv(&i, &eff_tgt_array, 0); Xorriso_free_meM(source_prefix); Xorriso_free_meM(target_prefix); Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_target); (*idx)= end_idx; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 256); Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &opt2c, &opt2v, 256); if(arg2c > 0) Sfile_destroy_argv(&arg2c, &arg2v, 0); else if(arg2v != NULL) Xorriso_free_meM(arg2v); if(ret<=0) return(ret); return(!was_failure); } /* Option -mark */ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag) { if(mark[0]==0) xorriso->mark_text[0]= 0; else strncpy(xorriso->mark_text,mark,sizeof(xorriso->mark_text)-1); xorriso->mark_text[sizeof(xorriso->mark_text)-1]= 0; return(1); } /* Option -md5 "on"|"all"|"off" */ int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) xorriso->do_md5&= ~31; else if(l == 2 && strncmp(cpt, "on", l) == 0) xorriso->do_md5= (xorriso->do_md5 & ~31) | 7 | 16; else if(l == 3 && strncmp(cpt, "all", l) == 0) xorriso->do_md5|= 31; else if(l == 18 && strncmp(cpt, "stability_check_on", l) == 0) xorriso->do_md5|= 8; else if(l == 19 && strncmp(cpt, "stability_check_off", l) == 0) xorriso->do_md5&= ~8; else if(l == 13 && strncmp(cpt, "load_check_on", l) == 0) xorriso->do_md5&= ~32; else if(l == 14 && strncmp(cpt, "load_check_off", l) == 0) xorriso->do_md5|= 32; else { sprintf(xorriso->info_text, "-md5: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Option -mkdir alias -mkdiri */ int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx, ret, was_failure= 0, fret; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 0); for(i= *idx; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; if(ret<=0) return(ret); return(!was_failure); } int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt, *ppt; int l, num, set_min; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 1 && strncmp(cpt, "0", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 2 && strncmp(cpt, "on", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 1 && strncmp(cpt, "1", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 2 && strncmp(cpt, "-1", l) == 0) { ; } else if(*cpt >= '1' && *cpt <= '9') { ppt= cpt; set_min= 2; set_size_percent:; sscanf(ppt, "%d", &num); if(num == -1) { ; } else if(num < 25) { bad_percent:; sprintf(xorriso->info_text, "-modesty_on_drive: percentage out of range [25 to 100]"); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(num > 100) { goto bad_percent; } if(set_min == 2) { xorriso->modesty_on_drive= 1; } if(set_min) xorriso->min_buffer_percent= num; else xorriso->max_buffer_percent= num; } else if(l >= 12 && strncmp(cpt, "min_percent=", 12) == 0) { ppt= cpt + 12; set_min= 1; goto set_size_percent; } else if(l >= 12 && strncmp(cpt, "max_percent=", 12) == 0) { ppt= cpt + 12; set_min= 0; goto set_size_percent; } else if(l >= 9 && strncmp(cpt, "min_usec=", 9) == 0) { ppt= cpt + 9; set_min= 1; set_sec:; num= -1; sscanf(ppt, "%d", &num); if(num < 0) num= 0; if(set_min == 2) xorriso->max_buffer_usec= num; else if(set_min == 1) xorriso->min_buffer_usec= num; else if(set_min == 0) xorriso->max_buffer_percent= num; else xorriso->buffer_timeout_sec= num; } else if(l >= 9 && strncmp(cpt, "max_usec=", 9) == 0) { ppt= cpt + 9; set_min= 2; goto set_sec; } else if(l >= 12 && strncmp(cpt, "timeout_sec=", 12) == 0) { ppt= cpt + 12; set_min= -1; goto set_sec; } else { sprintf(xorriso->info_text, "-modesty_on_drive: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Options -mount , -mount_cmd , -session_string */ /* @param bit0= -mount_cmd: print mount command to result channel rather than performing it bit1= perform -session_string rather than -mount_cmd */ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode, char *adr, char *cmd, int flag) { int ret, entity_code= 0, m_flag; char entity_id[81], *mnt; if(flag & 1) mnt= "-mount_cmd"; else if(flag & 2) mnt= "-session_string"; else { mnt= "-mount"; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-mount: image-to-disk features are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first", mnt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } ret= Xorriso_decode_load_adr(xorriso, mnt, adr_mode, adr, &entity_code, entity_id, 0); if(ret <= 0) return(ret); if(flag & 2) m_flag= 1 | 4; else m_flag= (flag & 1) | 2; ret= Xorriso_mount(xorriso, dev, entity_code, entity_id, cmd, m_flag); return(ret); } /* Option -mount_opts option[:...] */ int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag) { int was, l; char *cpt, *npt; was= xorriso->mount_opts_flag; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "shared", l)==0) { xorriso->mount_opts_flag|= 1; } else if(strncmp(cpt, "exclusive", l)==0) { xorriso->mount_opts_flag&= ~1; } else { unknown_mode:; if(linfo_text, "-mount_opts: unknown option '%s'", cpt); else sprintf(xorriso->info_text, "-mount_opts: oversized parameter (%d)",l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->mount_opts_flag= was; return(0); } } return(1); } /* Command -move */ int Xorriso_option_move(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret <= 0) {ret= 0; goto ex;} ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -msg_op */ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg, int flag) { int ret, available, argc, pargc, i, pflag, max_words, input_lines, msd_mem; char **argv= NULL, **pargv= NULL, *msg= ""; char *prefix, *separators; msd_mem= xorriso->msg_sieve_disabled; ret= 1; if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0 || strcmp(what, "parse_bulk") == 0 || strcmp(what, "parse_bulk_silently") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", "", 5, &argc, &argv, 0); prefix= ""; if(argc > 0) prefix= argv[0]; separators= ""; if(argc > 1) separators= argv[1]; max_words= 0; if(argc > 2) sscanf(argv[2], "%d", &max_words); pflag= 0; if(argc > 3) sscanf(argv[3], "%d", &pflag); input_lines= 1; if(argc > 4) sscanf(argv[4], "%d", &input_lines); if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0) { ret= Xorriso_msg_op_parse(xorriso, "", prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_silently") == 0)); } else { ret= Xorriso_msg_op_parse_bulk(xorriso, prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_bulk_silently") == 0)); } if(ret <= 0) goto ex; xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "start_sieve") == 0) { Xorriso_sieve_dispose(xorriso, 0); ret= Xorriso_sieve_big(xorriso, 0); msg= "Message sieve enabled"; /* >>> } else if(strcmp(what, "add_filter_rule") == 0) { */; } else if(strcmp(what, "clear_sieve") == 0) { ret= Xorriso_sieve_clear_results(xorriso, 0); msg= "Recorded message sieve results disposed"; } else if(strcmp(what, "end_sieve") == 0) { ret= Xorriso_sieve_dispose(xorriso, 0); msg= "Message sieve disabled"; } else if(strcmp(what, "read_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, arg, &pargc, &pargv, &available, 0); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { ret= Sfile_count_char(pargv[i], '\n') + 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); Sfile_str(xorriso->result_line, pargv[i], 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 1); } } else { strcpy(xorriso->result_line, "0\n"); Xorriso_result(xorriso, 1); available= 0; } sprintf(xorriso->result_line, "%d\n", available); Xorriso_result(xorriso, 1); xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); ret= 1; } else if(strcmp(what, "show_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, "", &pargc, &pargv, &available, 8); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { sprintf(xorriso->result_line, "%s\n", pargv[i]); Xorriso_result(xorriso, 1); } } xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); } else if(strcmp(what, "compare_sev") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", ",", 2, &argc, &argv, 0); if(argc < 2) { sprintf(xorriso->info_text, "-msg_op cmp_sev: malformed severity pair '%s'", arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else { ret= Xorriso__severity_cmp(argv[0], argv[1]); sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); } Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "list_sev") == 0) { sprintf(xorriso->result_line, "%s\n", Xorriso__severity_list(0)); Xorriso_result(xorriso, 1); } else { sprintf(xorriso->info_text, "-msg_op: unknown operation '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; } if(ret > 0 && msg[0]) Xorriso_msgs_submit(xorriso, 0, msg, 0, "NOTE", 0); ex:; xorriso->msg_sieve_disabled= msd_mem; return(ret); } /* Option -mv alias -mvi */ int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx_dummy, ret, is_dir= 0, was_failure= 0, fret; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL; char *leafname= NULL; int optc= 0; char **optv= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-mvi", argc, argv, idx, &optc, &optv, eff_dest, 0); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } /* Perform movements */ for(i= 0; iwdi,optv[i],eff_origin,0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Renamed in ISO image: "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= !was_failure; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); Xorriso_opt_args(xorriso, "-mvi", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); return(ret); } /* Option -named_pipe_loop */ int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode, char *stdin_pipe, char *stdout_pipe, char *stderr_pipe, int flag) { char *pipe_paths[3], *cpt, *npt; int ret, hflag= 0, l; npt= mode; for(cpt= mode; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, ':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) { ; } else if(strncmp(cpt, "-", l) == 0) { ; } else if(strncmp(cpt, "cleanup", l) == 0) { hflag|= 1; } else if(strncmp(cpt, "keep", l) == 0) { hflag&= ~1; } else if(strncmp(cpt, "buffered", l) == 0) { hflag|= 2; } else if(strncmp(cpt, "direct", l) == 0) { hflag&= ~2; } else { sprintf(xorriso->info_text, "-named_pipe_loop: unknown mode in '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } pipe_paths[0]= stdin_pipe; pipe_paths[1]= stdout_pipe; pipe_paths[2]= stderr_pipe; ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, hflag); return(ret); } /* Option -no_rc */ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag) { xorriso->no_rc= 1; return(1); } /* Option -not_leaf , (-hide_disk_leaf , -as mkisofs -hide) */ /* @param flag bit0-bit5= hide rather than adding to disk_exclusions bit0= add to iso_rr_hidings bit1= add to joliet_hidings bit2= add to hfsplus_hidings */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag) { regex_t re; char *regexpr= NULL; int ret= 0; Xorriso_alloc_meM(regexpr, char, 2 * SfileadrL + 2); if(pattern[0]==0) {ret= 0; goto cannot_add;} Xorriso__bourne_to_reg(pattern, regexpr, 0); if(regcomp(&re, regexpr, 0)!=0) {ret= 0; goto cannot_add;} if(flag & 63) { if(flag & 1) { ret= Exclusions_add_not_leafs(xorriso->iso_rr_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 2) { ret= Exclusions_add_not_leafs(xorriso->joliet_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 4) { ret= Exclusions_add_not_leafs(xorriso->hfsplus_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } } else { ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0); } if(ret<=0) { cannot_add:; sprintf(xorriso->info_text,"Cannot add pattern: %s ", (flag & 3) ? "-hide_disk_leaf" : "-not_leaf"); Text_shellsafe(pattern, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= 1; ex:; Xorriso_free_meM(regexpr); return(ret); } /* Option -not_list , -quoted_not_list */ /* @param flag bit0= -quoted_not_list */ int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag) { int ret, linecount= 0, insertcount= 0, null= 0, argc= 0, i; FILE *fp= NULL; char **argv= NULL; Xorriso_pacifier_reset(xorriso, 0); if(adr[0]==0) { sprintf(xorriso->info_text, "Empty file name given with %s", (flag & 1) ? "-quoted_not_list" : "-not_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; if(strchr(argv[i], '/')!=NULL) { null= 0; ret= Xorriso_option_not_paths(xorriso, 1, argv + i, &null, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); if(ret<=0) goto ex; insertcount++; } } ret= 1; ex:; Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file "); Text_shellsafe(adr, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " in line number %d", linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } sprintf(xorriso->info_text, "Added %d exclusion list items from file ", insertcount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); return(ret); } /* Option -not_mgt */ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag) { int ret; char *what_data= NULL, *what, *what_next; Xorriso_alloc_meM(what_data, char, SfileadrL); if(Sfile_str(what_data, setting, 0)<=0) { sprintf(xorriso->info_text, "-not_mgt: setting string is much too long (%d)", (int) strlen(setting)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } for(what= what_data; what!=NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next!=NULL) { *what_next= 0; what_next++; } if(strcmp(what, "reset")==0 || strcmp(what, "erase")==0) { if(strcmp(what, "reset")==0) xorriso->disk_excl_mode= 1; Exclusions_destroy(&(xorriso->disk_exclusions), 0); ret= Exclusions_new(&(xorriso->disk_exclusions), 0); if(ret<=0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } } else if(strcmp(what, "on")==0) { xorriso->disk_excl_mode|= 1; } else if(strcmp(what, "off")==0) { xorriso->disk_excl_mode&= ~1; } else if(strcmp(what, "param_on")==0) { xorriso->disk_excl_mode|= 2; } else if(strcmp(what, "param_off")==0) { xorriso->disk_excl_mode&= ~2; } else if(strcmp(what, "subtree_on")==0) { xorriso->disk_excl_mode|= 4; } else if(strcmp(what, "subtree_off")==0) { xorriso->disk_excl_mode&= ~4; } else if(strcmp(what, "ignore_on")==0) { xorriso->disk_excl_mode|= 8; } else if(strcmp(what, "ignore_off")==0) { xorriso->disk_excl_mode&= ~8; } else { sprintf(xorriso->info_text, "-not_mgt: unknown setting '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(what_data); return(ret); } /* Option -not_paths , (-hide_disk_paths , -as mkisofs -hide) */ /* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions bit1= add to joliet_hidings rather than disk_exclusions bit2= enable disk pattern expansion regardless of -disk_pattern bit8-13= consolidated hide state bits, duplicating bit0-1 bit8= add to iso_rr_hidings bit9= add to joliet_hidings bit10= add to hfsplus_hidings */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, num_descr= 0, dummy, optc= 0, i; char **descr= NULL, **optv= NULL, *eff_path= NULL, *hpt= NULL; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, (xorriso->do_disk_pattern == 1 || (flag & 4)) | 2); if(end_idx<=0) {ret= end_idx; goto ex;} num_descr= end_idx - *idx; if(num_descr<=0) {ret= 1; goto ex;} /* produce absolute patterns */ Xorriso_alloc_meM(eff_path, char, SfileadrL); descr= TSOB_FELD(char *, num_descr); if(descr==NULL) { no_memory:; Xorriso_no_pattern_memory(xorriso, sizeof(char *) * (off_t) num_descr, 0); ret= -1; goto ex; } for(i= 0; iwdx, argv[i+*idx], eff_path, 2|4); if(ret<=0) goto ex; descr[i]= strdup(eff_path); if(descr[i]==NULL) goto no_memory; } ret= Xorriso_opt_args(xorriso, (flag & 0x3f03) ? "-hide_disk_paths" : "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 2 | ((flag & 4) << 7)); if(ret<=0) goto ex; if(flag & 0x3f03) { if(flag & 0x0101) { ret= Exclusions_add_not_paths(xorriso->iso_rr_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) { no_hide:; sprintf(xorriso->info_text, "Cannot add path list: -hide_disk_paths "); hpt= Xorriso__hide_mode_text(flag & 0x3f03, 0); if(hpt != NULL) sprintf(xorriso->info_text + strlen(xorriso->info_text), "%s ", hpt); Xorriso_free_meM(hpt); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } } if(flag & 0x0202) { ret= Exclusions_add_not_paths(xorriso->joliet_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } if(flag & 0x0400) { ret= Exclusions_add_not_paths(xorriso->hfsplus_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } } else { ret= Exclusions_add_not_paths(xorriso->disk_exclusions, num_descr, descr, optc, optv, 0); if(ret<=0) { sprintf(xorriso->info_text,"Cannot add path list: -not_paths "); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } } ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 256); if(descr!=NULL) { for(i= 0; iinfo_text,"Empty file name given with -options_from_file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ performing command lines from file "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " :\n"); Xorriso_info(xorriso,1); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); sprintf(xorriso->info_text, "Command file: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 1 | 8); if(ret <= 0) goto ex; /* no problem_handler because there is no sense in going on */ if(ret == 2) break; line= linev[0]; if(line[0]==0 || line[0]=='#') continue; if(flag&1) { ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4 | 8 | ((xorriso->bsl_interpretation & 3) << 5)); if(ret<=0) goto problem_handler; ret= Xorriso_prescan_args(xorriso,argc,argv,1); if(ret==0) {ret= 3; goto ex;} if(ret<0) goto problem_handler; } else { if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ %d: %s\n",linecount,line); Xorriso_info(xorriso,1); } ret= Xorriso_execute_option(xorriso,line,1|(1<<16)); if(ret==3) goto ex; if(ret<=0) goto problem_handler; } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1); if(fret>=0) continue; goto ex; } ret= 1; ex:; Sfile_make_argv("", "", &argc, &argv, 2); /* release memory */ Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 2); Xorriso_reset_counters(xorriso,0); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "error triggered by line %d of file:\n ", linecount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1); } sprintf(xorriso->info_text, "Command file end: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(ret!=1) return(ret); return(!was_failure); } /* Option -osirrox "on"|"off" */ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag) { int l, allow_restore; char *npt, *cpt; allow_restore= xorriso->allow_restore; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0 && mode[0]!=0) goto unknown_mode; if(strncmp(cpt, "off", l)==0 && l >= 3) allow_restore= 0; else if(strncmp(cpt, "banned", l)==0 && l >= 5) allow_restore= -1; else if(strncmp(cpt, "blocked", l)==0 && l >= 7) allow_restore= -2; else if(strncmp(cpt, "unblock", l)==0 && l >= 7) { if(xorriso->allow_restore == -2) xorriso->allow_restore= 0; allow_restore= 1; } else if(strncmp(cpt, "device_files", l)==0 && l >= 12) allow_restore= 2; else if((strncmp(cpt, "on", l)==0 && l >= 2) || mode[0]==0) allow_restore= 1; else if(strncmp(cpt, "concat_split_on", l)==0 && l >= 15) xorriso->do_concat_split= 1; else if(strncmp(cpt, "concat_split_off", l)==0 && l >= 16) xorriso->do_concat_split= 0; else if(strncmp(cpt, "auto_chmod_on", l)==0 && l >= 13) xorriso->do_auto_chmod= 1; else if(strncmp(cpt, "auto_chmod_off", l)==0 && l >= 14) xorriso->do_auto_chmod= 0; else if(strncmp(cpt, "sort_lba_on", l)==0 && l >= 11) xorriso->do_restore_sort_lba= 1; else if(strncmp(cpt, "sort_lba_off", l)==0 && l >= 12) xorriso->do_restore_sort_lba= 0; else if(strncmp(cpt, "o_excl_on", l)==0 && l >= 9) xorriso->drives_exclusive= 1; else if(strncmp(cpt, "o_excl_off", l)==0 && l >= 10) xorriso->drives_exclusive= 0; else if(strncmp(cpt, "strict_acl_on", l)==0 && l >= 13) xorriso->do_strict_acl|= 1; else if(strncmp(cpt, "strict_acl_off", l)==0 && l >= 14) xorriso->do_strict_acl&= ~1; else { unknown_mode:; sprintf(xorriso->info_text, "-osirrox: unknown mode '%s'", cpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(allow_restore > 0 && xorriso->allow_restore == -1) { sprintf(xorriso->info_text, "-osirrox: was already permanently disabled by setting 'banned'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(allow_restore > 0 && xorriso->allow_restore == -2) { sprintf(xorriso->info_text, "-osirrox: is currently disabled by setting 'blocked'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(xorriso->allow_restore != -1) xorriso->allow_restore= allow_restore; sprintf(xorriso->info_text, "Copying of file objects from ISO image to disk filesystem is: %s\n", xorriso->allow_restore > 0 ? "Enabled" : "Disabled"); Xorriso_info(xorriso, 0); return(1); } /* Option -overwrite "on"|"nondir"|"off" */ int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_overwrite= 0; else if(strcmp(mode, "on")==0) xorriso->do_overwrite= 1; else if(strcmp(mode, "nondir")==0) xorriso->do_overwrite= 2; else { sprintf(xorriso->info_text, "-overwrite: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } libcdio-2.2.0/test/data/multi_extent_file000066400000000000000000001520411474051130400204550ustar00rootroot00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2015 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of options as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Option -iso_rr_pattern "on"|"ls"|"off" */ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,int flag) { if(strcmp(mode, "off")==0) xorriso->do_iso_rr_pattern= 0; else if(strcmp(mode, "on")==0) xorriso->do_iso_rr_pattern= 1; else if(strcmp(mode, "ls")==0) xorriso->do_iso_rr_pattern= 2; else { sprintf(xorriso->info_text, "-iso_rr_pattern: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -jigdo aspect argument */ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag) { int ret; ret= Xorriso_jigdo_interpreter(xorriso, aspect, arg, 0); return(ret); } /* Option -joliet "on"|"off" */ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_joliet= 0; else if(strcmp(mode, "on")==0) xorriso->do_joliet= 1; else { sprintf(xorriso->info_text, "-joliet: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Command -launch_frontend */ int Xorriso_option_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->launch_frontend_banned) { sprintf(xorriso->info_text, "-launch_frontend was already executed in this xorriso run"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } xorriso->launch_frontend_banned= 1; if(end_idx <= *idx) {ret= 1; goto ex;} if(argv[*idx][0] == 0) {ret= 1; goto ex;} xorriso->dialog= 2; ret= Xorriso_launch_frontend(xorriso, end_idx - *idx, argv + *idx, "", "", 0); ex:; (*idx)= end_idx; return(ret); } /* Option -list_arg_sorting */ int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_cmd_sorting_rank(xorriso, 0, NULL, 0, 1); return(ret); } /* Option -list_delimiter */ int Xorriso_option_list_delimiter(struct XorrisO *xorriso, char *text, int flag) { int ret, argc; char **argv= NULL; if(text[0] == 0) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is empty"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(strlen(text) > 80) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is too long"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Sfile_make_argv(xorriso->progname, text, &argc, &argv, 4); if(ret > 0) { if(argc > 2) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains more than one word"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Sfile_make_argv(xorriso->progname, text, &argc, &argv, 2); if(argc > 2) return(0); } if(strchr(text, '"') != NULL || strchr(text, '\'') != NULL) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains quotation marks"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->list_delimiter, text); return(1); } /* Option -list_extras */ int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag) { int ret; ret= Xorriso_list_extras(xorriso, mode, 0); return(ret); } /* Option -list_formats */ int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_formats(xorriso, 0); return(ret); } /* Option -list_speeds */ int Xorriso_option_list_speeds(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_speeds(xorriso, 0); return(ret); } /* Option -list_profiles */ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which, int flag) { int ret; int mode= 0; if(strncmp(which,"in",2)==0) mode|= 1; else if(strncmp(which,"out",3)==0) mode|= 2; else mode|= 3; if(mode & 1) { ret= Xorriso_toc(xorriso, 1 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 0); } if((mode & 2) && xorriso->in_drive_handle != xorriso->out_drive_handle) { ret= Xorriso_toc(xorriso, 1 | 2 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 2); } return(1); } /* Command -lns alias -lnsi */ int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path, int flag) { int ret; char *eff_path= NULL, *buffer= NULL, *namept; Xorriso_alloc_meM(eff_path, char, SfileadrL); Xorriso_alloc_meM(buffer, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) { sprintf(xorriso->info_text, "-lns: Address already existing: "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_truncate_path_comps(xorriso, target, buffer, &namept, 0); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_graft_in(xorriso, NULL, namept, eff_path, (off_t) 0, (off_t) 0, 1024); if(ret <= 0) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(buffer); Xorriso_free_meM(eff_path); return(ret); } /* Option -load session|track|sbsector value */ /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag) { int ret; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-load: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-load", "loads an alternative image", 0); if(ret<=0) return(2); ret= Xorriso_decode_load_adr(xorriso, "-load", adr_mode, adr_value, &(xorriso->image_start_mode), xorriso->image_start_value, flag & 1); if(ret <= 0) return(ret); xorriso->image_start_mode|= (1<<30); /* enable non-default msc1 processing */ if(strlen(xorriso->indev)>0) { ret= Xorriso_option_rollback(xorriso, 1); /* Load image, no -reassure */ if(ret<=0) return(ret); } return(1); } /* Option -logfile */ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, char *fileadr, int flag) { int hflag,channel_no= 0, ret; if(channel[0]==0) { logfile_wrong_form:; sprintf(xorriso->info_text,"Wrong form. Correct would be: -logfile \".\"|\"R\"|\"I\"|\"M\" file_address"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } hflag= 2; if(channel[0]=='R') channel_no= 1; else if(channel[0]=='I') channel_no= 2; else if(channel[0]=='M') channel_no= 3; else if(channel[0]=='.') hflag= 4; else goto logfile_wrong_form; if(strcmp(fileadr,"-")==0 || fileadr[0]==0) hflag|= (1<<15); xorriso->logfile[channel_no][0]= 0; ret= Xorriso_write_to_channel(xorriso, fileadr, channel_no, hflag); if(ret<=0) { sprintf(xorriso->info_text, "Cannot open logfile: %s", fileadr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else if(!(hflag&(1<<15))) if(Sfile_str(xorriso->logfile[channel_no], fileadr, 0)<=0) return(-1); return(ret>0); } /* Options -ls alias -lsi and -lsl alias -lsli and -lsd alias -lsdi and -lsdl alias -lsdli and -du alias -dui and -dus alias -dusi @param flag bit0= long format (-lsl , -du, not -dus, not -ls) bit1= do not expand patterns but use literally bit2= -du rather than -ls bit3= list directories as themselves (-lsd) */ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i, star= 1; char **filev= NULL, **patterns= NULL; off_t mem= 0; struct stat stbuf; if(flag & 4) { if(!(flag & 1)) star= 0; } else { if(flag & 8) star= 0; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->do_iso_rr_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0 ) { ; } else if(nump <= 0) { if(Xorriso_iso_lstat(xorriso, xorriso->wdi, &stbuf, 0)<0) { sprintf(xorriso->info_text, "Current -cd path does not yet exist in the ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } if(!S_ISDIR(stbuf.st_mode)) { sprintf(xorriso->info_text, "Current -cd meanwhile points to a non-directory in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(star) patterns[0]= "*"; else patterns[0]= "."; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iino_behavior & 32)) { ret= Xorriso_make_hln_array(xorriso, 0); /* for stbuf.st_nlink */ if(ret < 0) goto ex; } if(flag&2) { ret= Xorriso_ls_filev(xorriso, xorriso->wdi, nump, argv + (*idx), mem, flag&(1|4|8)); } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); } else { ret= Xorriso_expand_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_ls_filev(xorriso, xorriso->wdi, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Options -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx @param flag bit0= long format (-lslx , -dux) bit1= do not expand patterns but use literally bit2= du rather than ls bit3= list directories as themselves (ls -d) */ int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i; char **filev= NULL, **patterns= NULL; off_t mem= 0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(xorriso->do_disk_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0) { ; } else if(nump <= 0) { patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(flag&8) patterns[0]= "."; else patterns[0]= "*"; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iwdx, nump, argv + (*idx), mem, flag&(1|4|8)); #ifdef Not_yeT } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); #endif } else { ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_lsx_filev(xorriso, xorriso->wdx, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Option -map , -map_single */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit5= -map_single: do not insert directory tree */ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL, *ipth; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-map: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2); if(ret<=0) goto ex; ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 2|(flag&32)); if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(ret<=0) goto ex; if(!(flag&1)) { sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"), eff_origin); Xorriso_info(xorriso,0); } ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -map_l , -compare_l , -update_l , -extract_l , -update_lxi , -update_li */ /* @param flag bit4= do not establish and dispose xorriso->di_array for update_l bit8-11= mode 0= -map_l 1= -compare_l 2= -update_l 3= -extract_l 4= -update_lxi 5= -update_li */ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, optc= 0, was_failure= 1, i, j, fret, mode, problem_count; int ns_flag= 2|4, nt_flag= 2, opt_args_flag= 2, arg2c= 0, opt2c= 0; int new_opt2c; char *source_prefix= NULL, *target_prefix= NULL, *cmd, **optv= NULL; char *eff_source= NULL, *eff_target= NULL, *s_wd, *t_wd; char **eff_src_array= NULL, **eff_tgt_array= NULL, **opt2v= NULL; char **arg2v= NULL; cmd= "-map_l"; s_wd= xorriso->wdx; t_wd= xorriso->wdi; Xorriso_pacifier_reset(xorriso, 0); mode= (flag>>8) & 15; if(mode==1) cmd= "-compare_l"; else if(mode==2) cmd= "-update_l"; else if(mode == 3 || mode == 5) { if(mode == 5) cmd= "-update_li"; else cmd= "-extract_l"; ns_flag= 2; s_wd= xorriso->wdi; nt_flag= 2|4; t_wd= xorriso->wdx; opt_args_flag= 0; } else if(mode == 4) { cmd= "-update_lxi"; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(end_idx - (*idx) < 3) { sprintf(xorriso->info_text, "%s: Not enough arguments given (%d < 3)", cmd, end_idx - (*idx)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); ret= 0; goto ex; } Xorriso_alloc_meM(source_prefix, char, SfileadrL); Xorriso_alloc_meM(target_prefix, char, SfileadrL); Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_target, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[*idx], source_prefix, ns_flag | 64); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, t_wd, argv[(*idx)+1], target_prefix, nt_flag); if(ret<=0) goto ex; ret= Xorriso_opt_args(xorriso, cmd, argc, argv, (*idx)+2, &end_idx, &optc, &optv, opt_args_flag); if(ret<=0) goto ex; if(mode == 4) { /* Convert pattern from disk to iso_rr */ arg2c= end_idx - *idx - 2; Xorriso_alloc_meM(arg2v, char *, arg2c); for(i = 0; i < arg2c; i++) arg2v[i]= NULL; arg2c= 0; for(i = (*idx) + 2; i < end_idx; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[i], eff_source, ns_flag); if(ret<=0) goto ex; ret= Xorriso__exchange_prefix(source_prefix, target_prefix, eff_source, eff_target, 0); if(ret <= 0) continue; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_target) + 1); strcpy(arg2v[arg2c], eff_target); arg2c++; } /* Expand wildcards in iso_rr, do not include unmatched patterns */ ret= Xorriso_opt_args(xorriso, cmd, arg2c, arg2v, 0, &i, &opt2c, &opt2v, (1 << 10) | (1 << 7)); if(ret<=0) goto ex; /* Convert from iso_rr path to disk path */ new_opt2c= 0; for(i = 0; i < opt2c; i++) { ret= Xorriso__exchange_prefix(target_prefix, source_prefix, opt2v[i], eff_source, 0); free(opt2v[i]); opt2v[i]= NULL; if(ret <= 0) continue; Xorriso_alloc_meM(opt2v[new_opt2c], char, strlen(eff_source) + 1); strcpy(opt2v[new_opt2c], eff_source); new_opt2c++; } opt2c= new_opt2c; /* Merge both results */ if(opt2c > 0) { Sfile_destroy_argv(&arg2c, &arg2v, 0); Xorriso_alloc_meM(arg2v, char *, optc + opt2c); for(i = 0; i < optc + opt2c; i++) arg2v[i]= NULL; arg2c= 0; for(i= 0; i < optc; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, optv[i], eff_source, ns_flag); if(ret<=0) goto ex; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_source) + 1); strcpy(arg2v[arg2c], eff_source); arg2c++; } for(i= 0; i < opt2c; i++) { for(j= 0; j < optc; j++) if(strcmp(opt2v[i], arg2v[j]) == 0) break; if(j < optc) continue; arg2v[arg2c++]= opt2v[i]; opt2v[i]= NULL; } Sfile_destroy_argv(&optc, &optv, 0); optv= arg2v; arg2v= NULL; optc= arg2c; arg2c= 0; } } if(mode == 3 && (xorriso->do_restore_sort_lba || !(xorriso->ino_behavior & 4))) { eff_src_array= calloc(optc, sizeof(char *)); eff_tgt_array= calloc(optc, sizeof(char *)); if(eff_src_array == NULL || eff_tgt_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } for(i= 0; i < optc; i++) eff_src_array[i]= eff_tgt_array[i]= NULL; } if((mode == 2 || mode == 4) && !((xorriso->ino_behavior & 2) || (flag & 16) || xorriso->di_array != NULL)) { /* Create all-image node array sorted by isofs.di */ ret= Xorriso_make_di_array(xorriso, 0); if(ret <= 0) goto ex; } for(i= 0; iinfo_text, "%s: disk_path ", cmd); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " does not begin with disk_prefix "); Text_shellsafe(source_prefix, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); } if(ret <= 0) goto ex; if(mode==0) ret= Xorriso_option_map(xorriso, eff_source, eff_target, 2); else if(mode==1) ret= Xorriso_option_compare(xorriso, eff_source, eff_target, 2|8); else if(mode == 2 || mode == 4) ret= Xorriso_option_update(xorriso, eff_source, eff_target, 2 | 8 | 16); else if(mode==3) { if(eff_src_array != NULL) { eff_src_array[i]= strdup(eff_source); eff_tgt_array[i]= strdup(eff_target); if(eff_src_array[i] == NULL || eff_tgt_array[i] == NULL) { Xorriso_no_malloc_memory(xorriso, &(eff_src_array[i]), 0); ret= -1; goto ex; } } else { ret= Xorriso_option_extract(xorriso, eff_source, eff_target, 2 | 4); } } else if(mode == 5) { ret= Xorriso_option_update(xorriso, eff_target, eff_source, 2 | 8 | 16); } if(ret>0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(fret>=0) continue; goto ex; } ret= 1; if(mode == 3 && eff_src_array != NULL) { ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes), target_prefix, strlen(target_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_lst_append_binary(&(xorriso->node_img_prefixes), source_prefix, strlen(source_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, &problem_count, 0); if(ret <= 0 || problem_count > 0) was_failure= 1; } if(mode==0) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); else if(mode==1 || mode==2 || mode == 4 || mode == 5) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); else if(mode==3) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1|4); ex:; Xorriso_destroy_node_array(xorriso, 0); i= optc; Sfile_destroy_argv(&i, &eff_src_array, 0); i= optc; Sfile_destroy_argv(&i, &eff_tgt_array, 0); Xorriso_free_meM(source_prefix); Xorriso_free_meM(target_prefix); Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_target); (*idx)= end_idx; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 256); Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &opt2c, &opt2v, 256); if(arg2c > 0) Sfile_destroy_argv(&arg2c, &arg2v, 0); else if(arg2v != NULL) Xorriso_free_meM(arg2v); if(ret<=0) return(ret); return(!was_failure); } /* Option -mark */ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag) { if(mark[0]==0) xorriso->mark_text[0]= 0; else strncpy(xorriso->mark_text,mark,sizeof(xorriso->mark_text)-1); xorriso->mark_text[sizeof(xorriso->mark_text)-1]= 0; return(1); } /* Option -md5 "on"|"all"|"off" */ int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) xorriso->do_md5&= ~31; else if(l == 2 && strncmp(cpt, "on", l) == 0) xorriso->do_md5= (xorriso->do_md5 & ~31) | 7 | 16; else if(l == 3 && strncmp(cpt, "all", l) == 0) xorriso->do_md5|= 31; else if(l == 18 && strncmp(cpt, "stability_check_on", l) == 0) xorriso->do_md5|= 8; else if(l == 19 && strncmp(cpt, "stability_check_off", l) == 0) xorriso->do_md5&= ~8; else if(l == 13 && strncmp(cpt, "load_check_on", l) == 0) xorriso->do_md5&= ~32; else if(l == 14 && strncmp(cpt, "load_check_off", l) == 0) xorriso->do_md5|= 32; else { sprintf(xorriso->info_text, "-md5: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Option -mkdir alias -mkdiri */ int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx, ret, was_failure= 0, fret; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 0); for(i= *idx; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; if(ret<=0) return(ret); return(!was_failure); } int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt, *ppt; int l, num, set_min; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 1 && strncmp(cpt, "0", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 2 && strncmp(cpt, "on", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 1 && strncmp(cpt, "1", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 2 && strncmp(cpt, "-1", l) == 0) { ; } else if(*cpt >= '1' && *cpt <= '9') { ppt= cpt; set_min= 2; set_size_percent:; sscanf(ppt, "%d", &num); if(num == -1) { ; } else if(num < 25) { bad_percent:; sprintf(xorriso->info_text, "-modesty_on_drive: percentage out of range [25 to 100]"); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(num > 100) { goto bad_percent; } if(set_min == 2) { xorriso->modesty_on_drive= 1; } if(set_min) xorriso->min_buffer_percent= num; else xorriso->max_buffer_percent= num; } else if(l >= 12 && strncmp(cpt, "min_percent=", 12) == 0) { ppt= cpt + 12; set_min= 1; goto set_size_percent; } else if(l >= 12 && strncmp(cpt, "max_percent=", 12) == 0) { ppt= cpt + 12; set_min= 0; goto set_size_percent; } else if(l >= 9 && strncmp(cpt, "min_usec=", 9) == 0) { ppt= cpt + 9; set_min= 1; set_sec:; num= -1; sscanf(ppt, "%d", &num); if(num < 0) num= 0; if(set_min == 2) xorriso->max_buffer_usec= num; else if(set_min == 1) xorriso->min_buffer_usec= num; else if(set_min == 0) xorriso->max_buffer_percent= num; else xorriso->buffer_timeout_sec= num; } else if(l >= 9 && strncmp(cpt, "max_usec=", 9) == 0) { ppt= cpt + 9; set_min= 2; goto set_sec; } else if(l >= 12 && strncmp(cpt, "timeout_sec=", 12) == 0) { ppt= cpt + 12; set_min= -1; goto set_sec; } else { sprintf(xorriso->info_text, "-modesty_on_drive: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Options -mount , -mount_cmd , -session_string */ /* @param bit0= -mount_cmd: print mount command to result channel rather than performing it bit1= perform -session_string rather than -mount_cmd */ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode, char *adr, char *cmd, int flag) { int ret, entity_code= 0, m_flag; char entity_id[81], *mnt; if(flag & 1) mnt= "-mount_cmd"; else if(flag & 2) mnt= "-session_string"; else { mnt= "-mount"; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-mount: image-to-disk features are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first", mnt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } ret= Xorriso_decode_load_adr(xorriso, mnt, adr_mode, adr, &entity_code, entity_id, 0); if(ret <= 0) return(ret); if(flag & 2) m_flag= 1 | 4; else m_flag= (flag & 1) | 2; ret= Xorriso_mount(xorriso, dev, entity_code, entity_id, cmd, m_flag); return(ret); } /* Option -mount_opts option[:...] */ int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag) { int was, l; char *cpt, *npt; was= xorriso->mount_opts_flag; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "shared", l)==0) { xorriso->mount_opts_flag|= 1; } else if(strncmp(cpt, "exclusive", l)==0) { xorriso->mount_opts_flag&= ~1; } else { unknown_mode:; if(linfo_text, "-mount_opts: unknown option '%s'", cpt); else sprintf(xorriso->info_text, "-mount_opts: oversized parameter (%d)",l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->mount_opts_flag= was; return(0); } } return(1); } /* Command -move */ int Xorriso_option_move(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret <= 0) {ret= 0; goto ex;} ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -msg_op */ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg, int flag) { int ret, available, argc, pargc, i, pflag, max_words, input_lines, msd_mem; char **argv= NULL, **pargv= NULL, *msg= ""; char *prefix, *separators; msd_mem= xorriso->msg_sieve_disabled; ret= 1; if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0 || strcmp(what, "parse_bulk") == 0 || strcmp(what, "parse_bulk_silently") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", "", 5, &argc, &argv, 0); prefix= ""; if(argc > 0) prefix= argv[0]; separators= ""; if(argc > 1) separators= argv[1]; max_words= 0; if(argc > 2) sscanf(argv[2], "%d", &max_words); pflag= 0; if(argc > 3) sscanf(argv[3], "%d", &pflag); input_lines= 1; if(argc > 4) sscanf(argv[4], "%d", &input_lines); if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0) { ret= Xorriso_msg_op_parse(xorriso, "", prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_silently") == 0)); } else { ret= Xorriso_msg_op_parse_bulk(xorriso, prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_bulk_silently") == 0)); } if(ret <= 0) goto ex; xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "start_sieve") == 0) { Xorriso_sieve_dispose(xorriso, 0); ret= Xorriso_sieve_big(xorriso, 0); msg= "Message sieve enabled"; /* >>> } else if(strcmp(what, "add_filter_rule") == 0) { */; } else if(strcmp(what, "clear_sieve") == 0) { ret= Xorriso_sieve_clear_results(xorriso, 0); msg= "Recorded message sieve results disposed"; } else if(strcmp(what, "end_sieve") == 0) { ret= Xorriso_sieve_dispose(xorriso, 0); msg= "Message sieve disabled"; } else if(strcmp(what, "read_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, arg, &pargc, &pargv, &available, 0); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { ret= Sfile_count_char(pargv[i], '\n') + 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); Sfile_str(xorriso->result_line, pargv[i], 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 1); } } else { strcpy(xorriso->result_line, "0\n"); Xorriso_result(xorriso, 1); available= 0; } sprintf(xorriso->result_line, "%d\n", available); Xorriso_result(xorriso, 1); xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); ret= 1; } else if(strcmp(what, "show_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, "", &pargc, &pargv, &available, 8); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { sprintf(xorriso->result_line, "%s\n", pargv[i]); Xorriso_result(xorriso, 1); } } xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); } else if(strcmp(what, "compare_sev") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", ",", 2, &argc, &argv, 0); if(argc < 2) { sprintf(xorriso->info_text, "-msg_op cmp_sev: malformed severity pair '%s'", arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else { ret= Xorriso__severity_cmp(argv[0], argv[1]); sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); } Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "list_sev") == 0) { sprintf(xorriso->result_line, "%s\n", Xorriso__severity_list(0)); Xorriso_result(xorriso, 1); } else { sprintf(xorriso->info_text, "-msg_op: unknown operation '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; } if(ret > 0 && msg[0]) Xorriso_msgs_submit(xorriso, 0, msg, 0, "NOTE", 0); ex:; xorriso->msg_sieve_disabled= msd_mem; return(ret); } /* Option -mv alias -mvi */ int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx_dummy, ret, is_dir= 0, was_failure= 0, fret; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL; char *leafname= NULL; int optc= 0; char **optv= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-mvi", argc, argv, idx, &optc, &optv, eff_dest, 0); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } /* Perform movements */ for(i= 0; iwdi,optv[i],eff_origin,0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Renamed in ISO image: "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= !was_failure; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); Xorriso_opt_args(xorriso, "-mvi", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); return(ret); } /* Option -named_pipe_loop */ int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode, char *stdin_pipe, char *stdout_pipe, char *stderr_pipe, int flag) { char *pipe_paths[3], *cpt, *npt; int ret, hflag= 0, l; npt= mode; for(cpt= mode; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, ':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) { ; } else if(strncmp(cpt, "-", l) == 0) { ; } else if(strncmp(cpt, "cleanup", l) == 0) { hflag|= 1; } else if(strncmp(cpt, "keep", l) == 0) { hflag&= ~1; } else if(strncmp(cpt, "buffered", l) == 0) { hflag|= 2; } else if(strncmp(cpt, "direct", l) == 0) { hflag&= ~2; } else { sprintf(xorriso->info_text, "-named_pipe_loop: unknown mode in '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } pipe_paths[0]= stdin_pipe; pipe_paths[1]= stdout_pipe; pipe_paths[2]= stderr_pipe; ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, hflag); return(ret); } /* Option -no_rc */ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag) { xorriso->no_rc= 1; return(1); } /* Option -not_leaf , (-hide_disk_leaf , -as mkisofs -hide) */ /* @param flag bit0-bit5= hide rather than adding to disk_exclusions bit0= add to iso_rr_hidings bit1= add to joliet_hidings bit2= add to hfsplus_hidings */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag) { regex_t re; char *regexpr= NULL; int ret= 0; Xorriso_alloc_meM(regexpr, char, 2 * SfileadrL + 2); if(pattern[0]==0) {ret= 0; goto cannot_add;} Xorriso__bourne_to_reg(pattern, regexpr, 0); if(regcomp(&re, regexpr, 0)!=0) {ret= 0; goto cannot_add;} if(flag & 63) { if(flag & 1) { ret= Exclusions_add_not_leafs(xorriso->iso_rr_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 2) { ret= Exclusions_add_not_leafs(xorriso->joliet_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 4) { ret= Exclusions_add_not_leafs(xorriso->hfsplus_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } } else { ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0); } if(ret<=0) { cannot_add:; sprintf(xorriso->info_text,"Cannot add pattern: %s ", (flag & 3) ? "-hide_disk_leaf" : "-not_leaf"); Text_shellsafe(pattern, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= 1; ex:; Xorriso_free_meM(regexpr); return(ret); } /* Option -not_list , -quoted_not_list */ /* @param flag bit0= -quoted_not_list */ int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag) { int ret, linecount= 0, insertcount= 0, null= 0, argc= 0, i; FILE *fp= NULL; char **argv= NULL; Xorriso_pacifier_reset(xorriso, 0); if(adr[0]==0) { sprintf(xorriso->info_text, "Empty file name given with %s", (flag & 1) ? "-quoted_not_list" : "-not_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; if(strchr(argv[i], '/')!=NULL) { null= 0; ret= Xorriso_option_not_paths(xorriso, 1, argv + i, &null, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); if(ret<=0) goto ex; insertcount++; } } ret= 1; ex:; Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file "); Text_shellsafe(adr, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " in line number %d", linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } sprintf(xorriso->info_text, "Added %d exclusion list items from file ", insertcount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); return(ret); } /* Option -not_mgt */ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag) { int ret; char *what_data= NULL, *what, *what_next; Xorriso_alloc_meM(what_data, char, SfileadrL); if(Sfile_str(what_data, setting, 0)<=0) { sprintf(xorriso->info_text, "-not_mgt: setting string is much too long (%d)", (int) strlen(setting)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } for(what= what_data; what!=NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next!=NULL) { *what_next= 0; what_next++; } if(strcmp(what, "reset")==0 || strcmp(what, "erase")==0) { if(strcmp(what, "reset")==0) xorriso->disk_excl_mode= 1; Exclusions_destroy(&(xorriso->disk_exclusions), 0); ret= Exclusions_new(&(xorriso->disk_exclusions), 0); if(ret<=0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } } else if(strcmp(what, "on")==0) { xorriso->disk_excl_mode|= 1; } else if(strcmp(what, "off")==0) { xorriso->disk_excl_mode&= ~1; } else if(strcmp(what, "param_on")==0) { xorriso->disk_excl_mode|= 2; } else if(strcmp(what, "param_off")==0) { xorriso->disk_excl_mode&= ~2; } else if(strcmp(what, "subtree_on")==0) { xorriso->disk_excl_mode|= 4; } else if(strcmp(what, "subtree_off")==0) { xorriso->disk_excl_mode&= ~4; } else if(strcmp(what, "ignore_on")==0) { xorriso->disk_excl_mode|= 8; } else if(strcmp(what, "ignore_off")==0) { xorriso->disk_excl_mode&= ~8; } else { sprintf(xorriso->info_text, "-not_mgt: unknown setting '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(what_data); return(ret); } /* Option -not_paths , (-hide_disk_paths , -as mkisofs -hide) */ /* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions bit1= add to joliet_hidings rather than disk_exclusions bit2= enable disk pattern expansion regardless of -disk_pattern bit8-13= consolidated hide state bits, duplicating bit0-1 bit8= add to iso_rr_hidings bit9= add to joliet_hidings bit10= add to hfsplus_hidings */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, num_descr= 0, dummy, optc= 0, i; char **descr= NULL, **optv= NULL, *eff_path= NULL, *hpt= NULL; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, (xorriso->do_disk_pattern == 1 || (flag & 4)) | 2); if(end_idx<=0) {ret= end_idx; goto ex;} num_descr= end_idx - *idx; if(num_descr<=0) {ret= 1; goto ex;} /* produce absolute patterns */ Xorriso_alloc_meM(eff_path, char, SfileadrL); descr= TSOB_FELD(char *, num_descr); if(descr==NULL) { no_memory:; Xorriso_no_pattern_memory(xorriso, sizeof(char *) * (off_t) num_descr, 0); ret= -1; goto ex; } for(i= 0; iwdx, argv[i+*idx], eff_path, 2|4); if(ret<=0) goto ex; descr[i]= strdup(eff_path); if(descr[i]==NULL) goto no_memory; } ret= Xorriso_opt_args(xorriso, (flag & 0x3f03) ? "-hide_disk_paths" : "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 2 | ((flag & 4) << 7)); if(ret<=0) goto ex; if(flag & 0x3f03) { if(flag & 0x0101) { ret= Exclusions_add_not_paths(xorriso->iso_rr_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) { no_hide:; sprintf(xorriso->info_text, "Cannot add path list: -hide_disk_paths "); hpt= Xorriso__hide_mode_text(flag & 0x3f03, 0); if(hpt != NULL) sprintf(xorriso->info_text + strlen(xorriso->info_text), "%s ", hpt); Xorriso_free_meM(hpt); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } } if(flag & 0x0202) { ret= Exclusions_add_not_paths(xorriso->joliet_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } if(flag & 0x0400) { ret= Exclusions_add_not_paths(xorriso->hfsplus_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } } else { ret= Exclusions_add_not_paths(xorriso->disk_exclusions, num_descr, descr, optc, optv, 0); if(ret<=0) { sprintf(xorriso->info_text,"Cannot add path list: -not_paths "); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } } ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 256); if(descr!=NULL) { for(i= 0; iinfo_text,"Empty file name given with -options_from_file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ performing command lines from file "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " :\n"); Xorriso_info(xorriso,1); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); sprintf(xorriso->info_text, "Command file: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 1 | 8); if(ret <= 0) goto ex; /* no problem_handler because there is no sense in going on */ if(ret == 2) break; line= linev[0]; if(line[0]==0 || line[0]=='#') continue; if(flag&1) { ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4 | 8 | ((xorriso->bsl_interpretation & 3) << 5)); if(ret<=0) goto problem_handler; ret= Xorriso_prescan_args(xorriso,argc,argv,1); if(ret==0) {ret= 3; goto ex;} if(ret<0) goto problem_handler; } else { if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ %d: %s\n",linecount,line); Xorriso_info(xorriso,1); } ret= Xorriso_execute_option(xorriso,line,1|(1<<16)); if(ret==3) goto ex; if(ret<=0) goto problem_handler; } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1); if(fret>=0) continue; goto ex; } ret= 1; ex:; Sfile_make_argv("", "", &argc, &argv, 2); /* release memory */ Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 2); Xorriso_reset_counters(xorriso,0); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "error triggered by line %d of file:\n ", linecount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1); } sprintf(xorriso->info_text, "Command file end: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(ret!=1) return(ret); return(!was_failure); } /* Option -osirrox "on"|"off" */ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag) { int l, allow_restore; char *npt, *cpt; allow_restore= xorriso->allow_restore; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0 && mode[0]!=0) goto unknown_mode; if(strncmp(cpt, "off", l)==0 && l >= 3) allow_restore= 0; else if(strncmp(cpt, "banned", l)==0 && l >= 5) allow_restore= -1; else if(strncmp(cpt, "blocked", l)==0 && l >= 7) allow_restore= -2; else if(strncmp(cpt, "unblock", l)==0 && l >= 7) { if(xorriso->allow_restore == -2) xorriso->allow_restore= 0; allow_restore= 1; } else if(strncmp(cpt, "device_files", l)==0 && l >= 12) allow_restore= 2; else if((strncmp(cpt, "on", l)==0 && l >= 2) || mode[0]==0) allow_restore= 1; else if(strncmp(cpt, "concat_split_on", l)==0 && l >= 15) xorriso->do_concat_split= 1; else if(strncmp(cpt, "concat_split_off", l)==0 && l >= 16) xorriso->do_concat_split= 0; else if(strncmp(cpt, "auto_chmod_on", l)==0 && l >= 13) xorriso->do_auto_chmod= 1; else if(strncmp(cpt, "auto_chmod_off", l)==0 && l >= 14) xorriso->do_auto_chmod= 0; else if(strncmp(cpt, "sort_lba_on", l)==0 && l >= 11) xorriso->do_restore_sort_lba= 1; else if(strncmp(cpt, "sort_lba_off", l)==0 && l >= 12) xorriso->do_restore_sort_lba= 0; else if(strncmp(cpt, "o_excl_on", l)==0 && l >= 9) xorriso->drives_exclusive= 1; else if(strncmp(cpt, "o_excl_off", l)==0 && l >= 10) xorriso->drives_exclusive= 0; else if(strncmp(cpt, "strict_acl_on", l)==0 && l >= 13) xorriso->do_strict_acl|= 1; else if(strncmp(cpt, "strict_acl_off", l)==0 && l >= 14) xorriso->do_strict_acl&= ~1; else { unknown_mode:; sprintf(xorriso->info_text, "-osirrox: unknown mode '%s'", cpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(allow_restore > 0 && xorriso->allow_restore == -1) { sprintf(xorriso->info_text, "-osirrox: was already permanently disabled by setting 'banned'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(allow_restore > 0 && xorriso->allow_restore == -2) { sprintf(xorriso->info_text, "-osirrox: is currently disabled by setting 'blocked'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(xorriso->allow_restore != -1) xorriso->allow_restore= allow_restore; sprintf(xorriso->info_text, "Copying of file objects from ISO image to disk filesystem is: %s\n", xorriso->allow_restore > 0 ? "Enabled" : "Disabled"); Xorriso_info(xorriso, 0); return(1); } /* Option -overwrite "on"|"nondir"|"off" */ int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_overwrite= 0; else if(strcmp(mode, "on")==0) xorriso->do_overwrite= 1; else if(strcmp(mode, "nondir")==0) xorriso->do_overwrite= 2; else { sprintf(xorriso->info_text, "-overwrite: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } libcdio-2.2.0/test/data/p1.bin000066400000000000000000025532401474051130400160340ustar00rootroot00000000000000    ( (   >#>#k1k1;;vBvBa6a6>+>+   nn>>llBB))mmq5q5ddYYGGKKqq\\<&<&UUyyddQQ_0_0 CCj0j0>>HH`/`/;;rrccyy++^2^2bbkkVVjCjC>">"ww99""\\u<u<ddEELL z z!!gg00EE0!0!$$OO``^^22H*H*!!  55@@F2F288\\ZZvJvJ`3`3NNPP@ @ **ff((ll&&MM**XXGG VV66QQQQ  __^^TTffQQqqEECC""44UUdWdW===%=%QQ ::H\H\xxv^v^||[[__ppV4V4I}I}!!aarrbb[,[,MMnnWWBBe/e/WW??vv44EE;;MMl7l7]]ee.1.1SQSQUUnnbbDDccU2U2lIlI55/!/!55NNzzaa9w9wnene++oJoJ    = X= Xd *d *ThThQQ}v}vqqxxq q 44CC`K`KHH@@ddgg[[**iitt@@b b TTeeCCVVYBYBnn""\E\E[[9*9* ``@@3%3%KhKhvv#Tk |    O <O <}+plkkkEEmm__HH??||XX>>cc11'Q'Q%%   + + B BgvgvnnUUHH}}33 W WZ Z  : : v v' ' NNii==JJ$F$FI)I) _ _**; ; $$EEJJkkK?K?j,j,MMXXii rr8+8+8877g2g2LL__$$WWllHH;;eeee''IIff ccCC  22%0%0''ssdd((nCnCllUUT1T1}I}IDD11CCXXooiiDDmmqqggBB88~~^^\:\:  !!vv44EE||;;,,eeee^^ss@@zz^^ s sFFkk{{   " "gpgpuuBB77ccrJrJL L c Zc Zl= l= P P   v v,|,|"",,88((bb      e+e+OO  33AAAuAuUUOOn4n4M-M-77__ 66  cScSbb%A%AKSKSoo%}%}  II| |   II33HHll#k#k[[ADAD55))""  !p !p m=m= A A - -{{$P$P>>bLbLNN__jjII*> *>   L L     {{LL   A A??rr+F+FyyJvJvTPTPWW  hh22**||VuVunnYY4X4X  dd  s\s\rr>>MMTT|(|(l$l$//  ((^[ ^[ g g w )w )uueeqqmm,,ZZxfxf  c|c|M M ? d? dnn4:4:x#x#pp??@@KK00 % %GG  11 y y33llVVFFhhOvOv99BBJJ\\PcPcff@@dd%%   @ @UUBB8 8   qq((,y,y "("(B B   Z0Z0LL     11[[GG@>@>~e~e*8*8  n n   kkPP**LLe e   p p } } M M r r [J[J$$ ^ ^[[MMJJ##y>y>}}tt&&VV>>--  #j#jXXBB= = wwx<x<\2\2C)C){{aa??BBPP88jju =u = ) ) X XaaGGiWiWFFqqJJ~~ ss * *C'C'ww  tjtjcc4T4TyfyfggGG88TT::==UU66ll##EEwwvv b bR -R -##@ @ qq77""99..;;9944""  ==  77 X X ffuu7 7 P P FF   @@2n2nII+=+=DDooZZy y p p ((  ]]IIRR""h`h`ccuuN$N$uuII~~>p>p%M%Mss0 0 MMiyiy..ii>55x jx jnn9911}}[3[3tt))::OO;;y y DwDwY Y   ~ ~ jjnnII!B!BLL M MMM<< 7 7 ) ) FFMDMD< < W W 7 7 nnhhKK))MMT T P P7*7***"Q"QNN  77 ((((111ۜ1ۜwQwQkk W W  hh. . e e   ::~4~4**ccZZBB? ?   ; ; t t uH uH + + v v F F   Y8Y8>>ߵߵ_D_DVqVqR R "W"W))<(<(ff  ''h&h&xx;;hQhQhh.. X XkkFUFU&&      Gq Gq F F qqppMMUU@ @   AnAnvv  z3z3FFooOO^^l\l\++E E     zzLLdd55uuvv44/"/"sDsDEyEyz z \\ wwQQBBssyy  KE KE        ##mm""LLY(Y(((s 3s 3    zzkkgSgSxxr Tr TB;B;||YYHHvv<>qqss&&KKpmpm  ' ' ll????11@M@Moo  xxook k hh;;: C: C  //  e.e.nnzzv(v(??ttKKqq    R!R!p p ttll..qWqWdddd//__p p #V#V..(.(.&_&_7f7frrgg 8181""+I+I88qqH H # #     ZZ2255NN//II22II<<    f f   ) )    xx]B]BUrUr|؅|؅6611YY7 7 ;;((..5+5+1#'1#'. . susuqqD)D)--] ]   | | MM;;==$$EEjpjpd d U U c c ?Z ?Z ''ffSS*~*~_C_C55886 6 dd. . > e> e{{UUxx55S S hhii X X   m mD@D@z^z^--H)H)l)l)P,P,XX1919YYjjKKmmF/F/ 11{{''    [[a-a-,^ ,^ y2y2UU?b?bNN77"""" MM T T  $ $  #T#TWWdd--vjvjVkVk::VVHHJJrrggGGPP88JJ==YY]]))==TT]]X cX cx Yx Y@ @ N N x x MM88;;ZZ11%%QQ   { {nTnTPPLLEEuuii ` `    tt i i5544zz  ODODaaOO' ' ""ffggmsms$I$IRV RV K K %9%9% % aa @@};};>>&&||CpCpjjccG[G[ ccwwoOoOvv    1n1nd ;d ;JJll55..hhTO TO BB~~y y F F vv(A(A( ( aaVRVR tt"@"@ZZiiC C &&""  $$/ z/ zRRccӊӊHyHyZZqqWWC C ;!;!$$!!V gV g44KK((xx**UU  qqJJ==::}}TT\\||FFCC!!A JA J  f f p p qwqw&&,V,V//u u 99!A!A""N N d d ''D^D^J۫J۫ l lJJ * *D2D2g-g-$$4 4 VV"Ԑ"ԐRyRyݡݡ88{{EE  {{((    ) )9966c~c~**DD||004141qq{{Q Q = =         wi wi E ERR]]ߔߔwDwDffLL  D2D2&&(( # #II" " f f f#f#7s7s    @ @ D6D6nOnO S S88YY  G G V V 6: 6:  qqffUU0F0FOOqq}}  > > HH--  E E gg]]ppp}p}??xxvvy (y (  DDkk,^,^**K)K)tstsyyllYYbbAAAABB+ |+ |3 3 **rrKK55//]] a ai6i6zzqq  R R    - -GAGAHH//# !# !( ( AAHwHwEXEXFF))((rJrJ,,UfUfvv : :  ` ` 9 9 P P ( (;;DD))DDQQ ++]]  i Yi Y: : ::AZAZqqqqeep=p=JJ  wx wx   r r p-p-llt{t{ q qPP..pp  uu--  nnSS[[<<445]5]@@  , , //g g ~ ~ ! ! *i*ibbnn ii``xxnnxx((&&$ $ MM  ''JJG`G`}}MMwcwcB B 8b8b}}    IIvv --++||@@WW[[d d ""J J   mKmKKKAA||bbn n EE##~b~b  $ /$ /**DDhhyyNNCC((??h Sh S--6)6) E Eff7w7wGGrrIILLvv  %%tQ tQ 00&&mmjj-F-FVl V uh h uu  " q8K oH  ))5050 Ѵ ѴDәDәa.a.]]  H H..o1o1#+#+ww] ] ""p@p@BB    88  9 9 ~ L~ L   ee33??CCbbwawa66yy99t t E E   q q ~Z ~Z Y Y q5 q5  f fjj((ffyy&&  **%%%%$$   %b%bYY / / * * 9 9%q%qTT[[V#V#hEhEm m   ; ; j j D D   PnPn))7W7Woo | | e e ll     //**kkJfJfJJ EzEz<<jj__YY;k;k{{xxWWcOcOSSGGuu ww''[[MM~~44w w I;I;r%r%  q q Y Y iihh,,kk//CCY1Y1 \ \  a a   --"{"{xxPPjNjNxxPP!!o`o`uuiieeeeMMMMww|X|X66UUd d ?dEobbXX D  u*  (   {n{nDDcULLGvGvA{ p{ < m< mY Y PPAA m mAkAk--( @( @ v v 8 8  QQVVAAN N SSWW$ $ iiXX55V V 3 3 [h[h>J >J   ~~IIttU}U}{{DDjj > >SbSbvv.q.qynyn m mz z t t    4V4V4J4J`%`%JJnnPPvvN(N(jj \ \&&4 4  h h..NNggddk k % % CCv jv j33''׋׋;;SSUU??  $$!!CC ^^++iiJJ{{   e eee>>FFuGuGx.x.AxAx 00rrLL ' '  **Cj Cj  ,6,6hhMMPPeeOO  eeR R t#pt#pK! K!   * * aa77885$5$MM 7 7  hh(&(&2< 2< /N/N%%  }}vvBBԩԩGGww--""  h3h3a~t j 8 |8 |ww'@o=ppxxRRWWW5W5^^//66;;^ @^ @  i v qL    ' ' J J H ARl\ 11nn6f6f  : : pp""!!774 4 LL 2y2yLLQQaa99SS    ppZZ|y|y@@``.. o o  ; ; y y..MpMpbb@@&&55BBGG  + + ((V V  p/p/6*tz5XX55qa8[7GG ~ ~W PW PGG  ##__ 99ZUZU  ||3J_w 66>>*Z-gGt66HH__22PP : :  ??aa66) ) dd~<~<[[WW77vvbbtt        ))??ACAC99mmzz3F3FKKddQQmm &&ffKKMMaa_}_}ddjj  b? b?   b b  @@ww''--BB3O3O        xxOhOhppLLkk  Au Au     00))CC``ssk k   RRp p jjL}L}DGDG..5 5 DPDPpp( ( ShShKK##22**ff2Y2Y<<*<*G>G__**bb''""  VV/ / * *  X X >; >; h h xt xt 33VzVzZZQ Q --JJ5ت5تڣڣ99: : Z)Z)G.G.,,$$kk++UUvvPPTTGdGd)) z z6 6 T {T {'k'kii C C  O O _ _   [[KKUU55؎؎C"C"jBjBll  LL  9% 9%  %%DSDSUUjj;;w w   e e     G G?-?-m]m]   { {, ,   -2 -2 | |      # D# D      ? U? Uee::ff""FF      f f d  d  GG00gg<<ee''5T5Tzzhh^^66,,;;qq''....``rrWW--xx<<VKVK;;DD" " hh  ?6?6iiݦʽۦʽ""00TT : :wW wW WW))y y ??~~ + +""ppZ Z   ++\~\~ssvbvb''WW         D D4 4 __KK!!!!$h$hxx b b TeTeI&I&F F 66?? KK}F}FEiEinn33{{jAjA[[~~tt܄܄RR : :?? II_2_2U8U8rr~~**CKCK   C C   M< M< r r r6 r6     p p   $ $     [ [  k kFFc c [[vvPP991v1vqqGGhh??2h2hgg  zGzG ||rr-4-4ppqq>>TT^^pp*-*-wwmm    T T   mm  ! ! ::'m'm}}{{U"U"ttss*I*IPPMMSS & &3%3%^^QQEE````$$NNtt/"/"eeNN88rraa// \\;;KK   3 3\? \? d'd' a a    ` ` ddjhjhTT>q>q t t> > ! !  ' "' "--NNCCjjRRr r  Y Y / /  tt$$ee!Z!Z~~FFgFgFII Q Q@ @ fD fD Pz Pz  ++OO^^??LLWWVLVL 22f0f0UUQQ33HHii33>=>=PP[[[[PP2W2W,,N N < <   99  55  3# 3# B FB F\\  L L   WW    7*7*/ / v v ~~<<II<><>KK6!6!'<'<""rrBB33VV11޶޶OoOo]q]q44߳'' ݿ ݿ``PP55aa^^00^^ ppaxax v v   ""%%~'~'*|*|++. . Y1"Y1"3c$3c$;6"&;6"&h7&h7&6&6&3$3$|/!|/!))m#m#BlBlZZ]]3"3"MMOZOZ}}   JJA(A(bbEE##ո]׸] ̪ ̪ҹҹ߫//>>FF{ߠ{ߠ}}~"~"[ѳ[ѳiɰiɰYY0B0B{¥{¥LLؿΪݿΪ > >II  ``]],,RRQ Q |Y |Y rr!!m&dm&d**<-<-. . |. |. m/h!m/h!0["0["1=#1=#F2#F2#%3$%3$ 3# 3#M0"M0"O-O-`'`' ! !cc  ~ ~   6 6 ' ' 88dd00HH$$22ooTT<Ϡ<ϠƩƩqq--Վڎr0r0ooIDIDX[X[{={=ZZ?l?lTT;;>>55( (   ffB\B\00  S S   K K C k C k     y Xy Xg~g~22BByy{/{/66CC99oommR3R3ooFFsjsjyyDD NNss44UUI I aaH"H"j j   XlXl##7a7ao / o / zh zh   3 3 t  t        DDffoo663d3d::hhffv)v)BBzz--izizyyVOVO]]ppB3B3==FF.:.:rrii44h h     %b%b]V]V  6 6 ]]33@2@2++ff F FN N aQ aQ n n  , , ZZDD2g2gcc66TT;;``44L L nn&&>ZZnn.b.bppbb~ ~ IISSll{s{s99YY;B;B YYZZ ""]&]&{{yy``h h       %7%7@'@'mmFF5!5!VV A A   ItItx1x1PQPQg g   l l 99aa==  bGbGjjtt{{ffGGDDq0q0s[s[& & zzPPܟܟssZ؎Z؎((ݎݎ__Q Q ,,QQxxNNuuX-X-  UU#5#5)U)U- !- !a1#a1#3%3%4&4&/6+'/6+'P7?(P7?(9@)9@) ;* ;*c=,c=,s@.s@.A/A/B/B/@.@.;+;+4&4&-C!-C!%%NNkmkm    *f *f     L L vv;Z;Z!!nnQ}Q}ҞHΞH'l'l*M*M7Ɔ7Ɔ8˞8˞ЋЋ;;ݧܧ2ͤ2ͤgɪgɪf>QAQA& &   $7 $7 +O+Oss  **3'3'>4.>4.*EJ3*EJ3E3E3Ci2Ci2=u-=u-4&4&*?*?jj    4 4 O O   K. K.  $$UU//wwhwhw}'}'IIٹٹKӛKӛXX_ɘ_ɘ/{/{mmggggnnғғagag}}hh'['[--cco o ==bb55vv  C C B}B}GG!!||iiFFaamm==FFDeDe-j-jkrkrO>O>G G      hJhJ   7 7 w1w1   <J<Jii66##==dd @@88 @~@~>>AA,ߑ,ߑާާb b <<001f1f!!jjhh~~oo8"8"88ll]] : :<<##      pX pX !!%%(=(=_)+_)+w(Ow(O(&(&##!!  l!gl!g>">"#|#|1$"1$"l$<l$<p#p#!!mm} } s s / / WW%%=M=Mg>g> eeAA B B==fڝfڝ--&&55}}(X(X@@_ފ_ ۱u^u^GG__rvrvRDRD8 8 ::``ddT T   y y   m- m-   8X 8X g g   Gk Gk ))ZZ66MMpp   EEF 5F 5_ _ aa+ + 22  ;;TTMM55@ @ dSdSOO W W  knkn  eeN N Zr>r - -## ## &&E)E) ," ,"@.#@.#R/B$R/B$s/$s/$.#.#-"-"+!+!); ); I(I(&&%%o#[o#[    @ @h6h6UzUz99))ff!!##((DDO԰O԰&&hYhYc8c8xxXX\\EE''LL%%kkAA  GG[[%%L pL p   G G } } [ [ < < 8 8   . . !5!5e e f f   >b>bfefeCC^^;;xxXX::;;GG::XXzFzFllaa%w%w. . ||cLcL tt  r!r!ss l l HH||>>,,rrq q 0u 0u   H2 H2 00]]PPWW==}}ll uu=A=AYYggzz2K2KCC>>]]qTqT$|$|__mm00I I }}WcWc   a a  MBMB?? t tv v w w kkraraMM     99S S **99aa~~!(!(s$s$77> > &&c"c"J J BBQQ??oo]K]KJJuJuJAaAarrAAUAUAWWff ffMM@@zz ..jj22,,`<`<KcKc**uAuA.. KK  /2/2GG \ \ 44II "t"tEESSnn$$+"+",S#,S#''''xxO4O444&C&CKKIIJBJBgg4 4 gg  i7i7hh SSmmXX::++00++33kk\\ ..ccvv>  >    . . N N ~E ~E   kk mmnn] Y] YCCa)a)/!/! ! !00 ||99}}))ZZhhPP55YXYXii55??@@ososooBBbb K K QzQz&&A dA d" q " q     +s +s  FF  QQ    ""n n yoyoMM@ @ T_ T_ 8 8   D D 3 3 v v h h __7-7-Y Y HH]]F\F\GG66#T#T..==??)q)q>>yy'a'aaa{{&&yyttMMff[[``KKOIOI::5p5pFgFg00DD O O % % # # z z g gpp^^))FFDDTSTS*T*TvvGGll       p p776F6Fpp/x/x\\<<==|y|y||MMxx22HAHA  O O > > g g 4  4  IIjTjT00\\C 7C 7   x x 88~-~-' I' I^^TPTP UU:5:5{{7L7LnnttWWV\V\'m'm&F&FSS((ee::$$:[:[66gg++aa m m    OO11##%%""{{  OO  ( (   ()()II::O O = =   nt nt GG9 ^9 ^5L5LSSvv\\nnXX``QQDD@@YY ] ]i+i+@E@E((bbjj2*2*AA]+]+gg;;}}00 bUbUGGoPoP[ [ ''gg0x0x``& & uu66--@@[[hh_q_qAAi i c c XX22:: a a  wwaaxx{{\\   KK}y}yX X //EE-4-4~~EE W W Y Y     a a tt$$9-9-uu_]_]__ AA--R9R9KKuupqpq##HHt!t!ff  <<--NN__P?P?++ppSSCC   y y B B NNuuVV%%|:|:55""  , , ]  ]  [ [ l  l   zSzS_1_1  \ \   --p p 4 4 nngg\Z\ZYY33bb,,nn W WNN E E=d=dUUzz++XXr}r}SSII))KaKa]]33pp3p3p{^{^@@SS0055r{r{YOYO  y~y~> >  "v  wPP  @ 2@ 2Jj#uI~\\..YY,""  K  K  Ij&EE;;XiXi00JJ[L[Lkk4s4s&&iiaaZZ22rree/R>11\\66~[ce+UURR7vI]$]jj?\?\**BBXnXn77TTL%L%,,i i    Z Z xxJnJnoo0077ccSSWWiYiY^^ JJ##ffAA  // F F H H _ _ > ?>0"c9c9y;Z9Fp2p2t t SSII;; >> jj~~tt,, ( (" j " j         & &I[I[++[[22))|3|3BB%%  %F%Fyy>>||KKssXX''33 @ @88`` ` K ` K m m WW11``DD  nnYY$$  uDuD$$:<:<~~ccnn||k k w # w #    _  _ : :  ]]  FFll22bbP|P|TT-n-n} } } i} iBB6600 ..++wwNN PP**  UU((nhnhOO] ]   a A a A G X G X  nn4.4.R&R&k k t t //NN    SS / /ee55  uuAhAhAAVV&&B:B:GG~]~]DD]]..{*{*gg44//cc}}  ::   d d H H mm\\      b b 4 4 "h"hKK  + l + l {  {    n n O O ` ` / /  cca a IIdd||vv!!vvKK0s0s  77[[8q8q[[00AARRddVVII..{{uuNNiiYY66--22popo GG!!11>S >S nnT@T@33,,HHGG++XX;; ~ ~r r dndnZj Zj  SSoaoaKKYY0 0  i i   H H     *8 *8  l  l h h k k H H ^r^rQMQM| 4 | 4   SSUU=}=}jj] ] ^  ^  (( ll}}ii XXGGp6p6 qMqMFF\\9]9]eeddQfQf@@==11;;r r \\<<``eePPQQ     3 3 Q Q P P - -     OOmm--llVV  dd!h!hVV88O{O{JJ||f$f$!!mm:: ododttQQ00 >>__YHYH6 '6 's y s y O O     |&|&##SdSd!!__rrllhhEE9a9aii2Y2Ymm Y YppVV\\&&00vv??[[dd]]FFEEz#z#cYcYLLEEE E   @ @ R R  [ [aa"'"'88II++jj1o1ojj>>/3/3}}MM||55pjpjPP   ) ) ( ( ((mm[[ddHH  g g V V l 0 l 0 qqzzQNQNRR=X=Xvv**ffIxIxb b ^ ^ ~Q~QcUcU11mm||o&o&PPAAdd--aa, ", "L  L  W W O j O j  PPkkWW##DXDX Q Q $$  i i g g %%rrj2j2  7X7X d d;;((``55qqAAvvEE222;2;RReeNNd4d4bb22qq!!SSC C xxhh&&==%%\ \  A A . .%%w%w%]$]${{  = =    k k   h h   x x *C*CF.F...PP''UqUq?y?yLޕLޕ}7}7xx"I"I{Y{YfBfB==26261717ޖ__ߞߞl\l\?[?[ii88vlvlhhEENxNx   9 9 ~N~N%%WWqq{|{|V1V1JHJH;-;-77]+]+   yyvv##~~DDuu kk==qq  xXxX--iidܯdܯtt޸KK""))ff  SSRR00 A A   7 7  o o     y y  tYtY^^DDIISS]]_F_F8i8iuXuXvvll!!UU- - 44DDRnRnJJggRRSS!!KKZZ!!; ; XXBB+C+Cx ` x ` ""ff__uu ` `   r r       ppPPOO``""KKkk%%lZlZPPZZ  3E3EOOppHzHzUU"  "  p p ! ! XXzz^^ ZZ{~{~ffJ)J)yyNNLL##II66**jdjd''jjjjvvUUGG=E=E{{v(v(;;AAUU"Q"QA$A$##[[GGwwLLRRoo    &&8811  QQ>>p[p[ewew;; ``RR((7u7u99qsqsVV;;UUeevvHH \\DDllEE++e e l c l c *  *  TOTO<<,,4%4%k[k[&_&_C`C`Y_Y_ImIm00""}} +"+" O OHHBB**;;EEkk##^5^5 77bbOOLMLMMM@@66EEhh??WWtKtKooe ~e ~3 3 eiei))$$jjYY""S#S##T #T # # _ _ uu[C[C R R nnh h   gygyK6rY5ލ5ލٸ܈ٸܕt٭m)߿l/I/I''zz?c?cHHGfGf664400>->-??   HHjjii,3,3uSuSyy0202,,0!0!))[ti@nFF   n0$7==+V+V66x#x# nnddVV\\88e3e3hhtt''HH{{""YYTT??)u)uYY bb''0 0 LL H P H P S S J T J T i i ""  ==DDPPaaj~j~ttuuD D GG.. 0404MMo;>;bb``scscrrc c 77LL$$oo ))QQ``/./.00 GG 5 5 V VVVIIUUPP44GGFF""55HH\\ D>D>  t B t B " "  PPUU;;u?u?NN L L ??SS$$&K&KXX] W ] W RR{ { ##hhz3z3NN m  m VV00ss4Q4Qw w /g/gLvLvHH((  vvss^b^b3~3~__f f @@XX}}ccSSFMFMttiwiwllm9m9??yy33008!8!77jqjq? ?  ss$#$#*)*)/I-/I-10100I/0I/,T+,T+'&'&2" 2" yyKK|}|}1414#)#)vv ,f,f^>^66 dddd  i - i - 88$$HeHe  4+4+ l l a a  7  7 ccDDQQffeoeo /N/N H H   X X W % W % <<ggp7p7++,,^^1B1BBJBJz6z6GtGt88MbMb~~/7/76Q6QaLaLQQ77gsgs22jMjM##TTss2 2  00pp<<:: mmSSpNpN:: z  z @@ll{{FF UU@@%%AA77??$$I;I;SSwwEnEn&9&9||mzmzaQaQ..7/7/EGEG` } ` }   \\(>  hhtt&&PaPa%%OO}}h.h. % %XkXk?N?NlqlqRRmm. .   ccnnuu??&&yy\\GGN9N9RTRTRR!!NNNN3333}c}cLLYY A%A%&&',',55EoEo:: & &,, 66CCDDeeEE!!L L n e n e ++ # # p  p  9 9 &l&l R9R9O O 22RRRBRB22ss%%ee11\\66HUHU~~ssj j ZZss vZvZfIfI?"?"wTwT{c{cXIXI  C5C5A+A+KKo o F F _v_vll  & = & = #R#RQQ//DKDK55IIcc S S Q 3 Q 3 <<d d  " "{{jjhh   [[   a a ;;rr;;UUkkJ%J% t t * * <<8r8ruNuNopop\\OO----yZyZqkqkkiki&@&@EGEGaaGGYY##55 * * X X 88MSMS00__TOTOnn}}/p/pkwkwSS""?I?I i  i l l Q Q ee\\ ??,,jjii 66SSss{t{t))116K6K_k_kuuAA||#2#2  rre0e0d)d)JJVV    d d 33  CCO O --00ll66\\RtRt1[1[uEuEvXvX<.<.CCttttGG<<vvJ4J4vv))KK88^^++/B/BDKDK|T|Trr""JJ%^%^))PrPr$x$x55cUcUyynOnOXXMMBB B B g g ''rrNENEX+X+ ]  ] rrbWbW $ $ ddxqxqeCeCKKsTsT''8 * 8 * i i ..--}[}[YYNN22{{<><>C C o@o@iiz z 88xmxmfUfUCC)){{/j/jejej~~oo==8 ~ 8 ~ i  i  C}C}RRBNBN DD^^$($(QQ\\ddOeOe@@2a2a{{zz ' ' vv__,1,15 5 U!U!;;11 [ [ //\\ s sz z JJvvKKZZJgJgAAyyg g 3 3   $$;o;olqlqvPvP}}//Y^Y^JJ~~wwAA  O)O)oowwoo[[~~::]g]g[[0 0 <<kk00,,N7N7igig__ oo 2  2 ))ZKZKK K WW@z@znn__z3z3'' m`m`EE^^&V&Vff<<}}H/H/wwv8v8f f HH``NN<<MM$I$IPPRR]]~~"";;brbrtt$`$`@@uuxxzz9 G9 GuuR0R0oo  MMUeUenn!!44hh,,..\\AAzzeehh77Z5Z5>>eeggPmPmDD++vvAA.F.F==mmlleqeq__..!!AAhhbbLlLl  eeQcQccc'J'JnnHHzzg g U U % % y y   22F F a a x x **{{tt44##E E J J   rrIMIM++jjllaa } }JJ]qUs:-XX;Rkg((33{FS j2SS||e'e')e,ll n<)){{ `pN^88+F+Fii   w'w'&&II\\}}m&m&dd??VV55  ,  ,    CC&&}}||CCggaa^^% % g g L L   ''\\ffttwwTT==@@3 3 ! ! ( y ( y u o u o %  %    LLGNGNDD??rr[[++[[t't'CC&&PP[[6633rrTfx1eeQw[t 5522aaTDTD]]::CC PP<< Y Y==rrkk==ff,,VVZZ??ddeeW!6=wcIIRR >>ii]"]" 7 7ffg.g.kklls s <<^L^L,?,?wwJ J H H ==FF1%1%J>|M|MXXss>>^^u]u]$$    66hhc' c' Q Q ] { ] { 6 6 IIww44wOwOII ||pp__;";"+2+2,z,zbbRR ! !qqgg::**4{4{##}}cAcA33JJ||66H&H&887!7! g g @ @  IIbb<<KKHH(e(e  __.. _ _ ,,bbC@C@w w q M q M 4 E 4 E 99JJ##&&==$$/M/M++JJe2e277TXTX<<,,$$<v>99LL$$""  hhQQ..Y.Y.ANANh3h3@9@9R-R-;A;A++]H]H6C6C>m>mi%i%ee77 ,^,^"~"~    p p = = aa``yyHHA/A/}}22  x x 5 5 UU..ZZ==1h1h((D+D+88hhggWW//@E@E - -7W7W33:.:.TT=:=: hh''XCXC    <> jj'r'r@f@fyy..wwnnRR!!KK:q:qWWss%%ww -f-fYYRRff``II::tTtT}E}Eoo ) ) M 7 M 7  # #XvXv"G"G77 j jKKgg++AA;;==YY!!  X X   LL^6^6zz66eemm))99//tt88UU^^ggm\m\LNLNnknk008&8&66<>^^99((\ \ A A K 6K 6  ||AA : :   Q Q   t t y y    %%!!##    , , A Ah:h:;;ee4242XXZZ||AAIIttOO22^^jj<0<0^^11>>ccWWSSKKEE&&33jjECECcscsvv9v: Zu;E;E::NNS n*J2B2B^[L_ cchhd'd'tK^#l/ZNNVVR R iiqqn n u u @ @ **IIJJ++I1I1==WWNN  R TR T.}.}E E L S L S 1^1^[{[{ees]s]zz33P0P0BBRRMYMYssxx]]CCQfQf_J_J**bby.y.44(( F F  >%>%.S.S++%P%P##""".". V V     +_+_@0@0/5/5 S S# # ;;99__{${$ Y Y&^&^TTrr<<ww4444RRp6p6nMnMZZ>> !!SSMM{{**22  //' ' J J r r p p ] ] l l | | g g t t \ \ ' ' A A mm99ww!!OSOSrr]]GG,,77(({{::YjYjn2n2wowovv--5N5N88!M!M[[ddWrWr2277GGFMFM,,]]]']'DDJJee  ssPP44|w|w,F,F. . R  R  p p V Y V Y " 2 " 2 ` ` q, q, b b ::BB          F F hhHHxfxf""hh(h(hLL7755ppE~E~$J$JRRRfRfgg::>W>Waavcvc::gg))ooyy__tt%%}s}s--]]JJyy//    e=e=~Z~ZDUDU%% k k)o)o,z,zXKXKUUrr55nnS.S.uuXXww~~ffmLmLe/e/i'i'\\;;ll8l8l#"#"  CCrr__bb PP#?#?XXSSOOX}X}55nn\Z\Zt t XX'&'& L L2q2q * *__UsUs__g@g@77W W JJrr88RXRXZZ;*;*  ``  ? ?    ww d dI I J  J  --rr99""     =m=m~ S~ S WW5r5reeXX,,/33JMcuu^^@@Ed7&`6uuZZ{R{R  __ZZ77zaza//##BB&O&Onnoo{{ZZNN""r'r'\\o o  p  p 11>">"    O O   7  7   q qq qQ wQ w  O [O [    @ @ 's'shhbbhh))OO^^vvRRuu``gg ,,dcdclldd66>>ddDHDH1:1:%%;;..cc33xxpSpSU U l l   v v s s F F ( (  h 6h 6     { {O   \p    ]  ] K p K p  ja  9 D4040GGDDNNmmH|H|CC;;ffNNG!G!II0044  66dd66BB66  77"{"{vvcc44##((  HuHuMMV/V/((,!,! E Ez6z6DD|W|WPPAA||wwqqffpp--""(2(2^^oo22RR t tQ{Q{FF    6 6 SScciGiG''lluuAAu>u>X'X'ccr>r>ddPPDDllkSkShUhU//ee-/-/JJ>>00ww,?,?..ieie]q]q66j j 2 2 ,9 ,9   ''^"^"))LL|q|q  YSYSooZZkkdd''ccFF(([[&&s7s7##ee''MMRR99BB  ee` ` ss[[ppJJ-]-]LeLe44""gg88))8<8<]:]:xxccUUQQRwRw{{vv\\YYYYzzYYeeii#k#k~~**77gngnWW    M M ] ] :g:gDDvvnn""kk*b*bII  u R u R   Z Z_ _ 7 7 ##&&ff__}}FFvv//EE--TTOO " "]]y"y"iinnt_t_mm tt!!99U&U&xx,?,?--&&N:N:YYGG]J]J))hhVV[y [y ; ;     ppBB7$7$ooO O \;\;EEy$y$y@y@ II33!!M7M7//vvnn]]mGmG>>JJee@@ wwzzggAAvv>> d d,},}LL  **  LLNN66SSRRGgGgppUU11  xxHH55GG``EERRhhmmH&H&B5B5,,..zyzyVV1k1kEE,,RR#z#z009&9&==bb**ooEE@@qAqA %%ppss:7:7z_z_%%aaoobpbp!!??ffooPP!!jjZZ$$qqyiyi``11\B\B$$-v-v 1 1 mm  nnYYsszzjj]]Y.Y.[[*b*bff  **iiNN77~~22cucuQYQY ..&&D1D188uu$9$9$r$r??</>AbAbp}p}zz~o~o$$!!qqGGddvveeQQ;;$$IZIZS!S![[ SS2233rrhh8R8R  XXQ*Q*zqzq##f}f}==ipipxxwwXXQQdd,,ppRR##<<{x{xmm77  qq  L_L_))ppUUttllKK>>]]}Y}Y !!11kk55<<_A_A&&GG..uu::SS,,uu66&&{{  ~~}}RR22$$~~OOMlMljMjM  dKdKqEqE ee444"4"[[KK33}}ghghXX;;NfNfPTPT r rwwRROOf(f(^^qqV V jujuFFIIVEVE!!99ee%%"Z"ZNN%%pp::;n;njXjX""""55mmuuuuVV&&e=e=LLbMbM%%))v(v(\J\Ju u //iiYJYJ##ccXX@@ggJ?J?  "T"TUUhhOOo_o_#>#>NN,x,x  !!eeLL77HHckckw?w?gg<4<4ZZ]]++~E~EnhnhtRtRffddg6g6  iiPP``44ll;;\\<>II((wLwL&&eeddii1d1dkknn!!DZDZ}}OOAAJJPPNNLL;1;133%%(l(lOOmmII{{  LpLp**m^m^88NdNd^^DD00     T TCC[[OOPqPqmmd>d>::,M,M''  dd  ::9977]a]a1166ZZddww Y Y{{XXSSEE```2`2rr ? ?ss[[ppAAttFFddB1B1. . ] ] bIbI5599<<% % ??  aa"h"hy`y`||PP))11*}*}  ''88  pp]]""UU--iikk((nlnlccxx++JJee&&zMzM>J>J88))dd+J+JiiYoYo44  ^^bb\\s s ))""&&ddBBzzQQuu!H!Hmmbbxxtt--FF"7"7yyvv..3;3;cc(( ~~**FFrr--__AAddBB-w-w#n#nRRuu%~%~`v`v;o;ott11[[==.#.#<^<^88//ii  ll\\DDaa``ssL8L8wwAAWW0"0"44((  bb77''  E E ##pp..K;K;&&66//ppcc\\>>CC::ZZ gg,,ggUU]]xx JJVVPPjjkk~~SSuu--%-%-ll}} qq]`]`// < <%%%%__44%%HH__ l lggX X tt^^l:l:';';wwAGAG-f-f::((00xx66//..SSNN]]//77  MoMog*g*ff:g:g}}]]GG^Y^Y**<> Y:--44 ll66]#]#bbqqQQ WWTT))QQGG##4499DDSS{L{L44llm_m_**^+^+RRjjdd``!g!gmmcc4499aa==22..(^(^yzyz``UUyyO1O1;;]]GGMMuur>r>hh9911ll1@1@SS22++ ""ffNNIIJJL L   RF RF       ;- ;- Z Z eeOO~~77||rr99QQJJ"Z"Z..ssgg##KK,,aallzqzqGGUU>>ZZ)) O OCC++66SS$6$6M}M}DDuu))?=?=]]))0 0 s s     3 3 ii  88>>nnEEPP44VV<>jojo22II  5544bb((    E E %r %r W W     [[JDJDccc c ||22MMAAQQ;;F*F*6622NNY:Y:K,K, iiHHbYbYiWiWttf=f==q=q**4b4bLLLLrr]]DD++))--CCdvdvaaww) ) ]];;XXUU++((T}T}..@@""hh==gg[[uu44#^#^::NNUUmm@2@2zKzK{{I$I$bbu(u(@@2J2JWW))r=r=SvSv""QQddgg0808|(|(  //yOyOa'a'II)=)=  00CCt_t_aa99<>ffGGww,X,X - -zzUU%*%*55}}hh__GG'3'3""nnrrj j bbIIGG GGOO+E+EggLL##ZZGGmm$O$O--LLkk77OOoo||44}}00mmz=z=  HnHn##**!/!/%2%2f f UUrrC_C_kk33e e gg  v!v!CC``(J(JGGnnccTTgg[[MMeeDSDS,A,A9O9Orr00@@x@x@gghhHHccLL ? ?ll8W8W\\JJ]]||\\:b:bDD__((w=w=  //ZZ//.N.N//eejjUUz>z>||** &&%%(K(K<<^^EE&&@@HH`` ::!!33}}^^ggEE?v?vOO77vv  r"r"RR!!  ::!!  "<"<++]]#P#P((3g3gooY Y hh 88``}B}BHHRR~~??!!66VV77<<vvRMRMK?K?\V\VggNNMZMZ%%II>e>ehhnnQQV V FF[[OTOT    / /   ^ ^ \ \   N N DDVV H H++,Z,Zuu==KK+{+{))||+C+CCC>>ffjj v v((ZZ >>%%&&ff__,,,,b_b_**??||tt--NNMMHH1~1~xx  jj<<..pfpfRR,,;;QQZZeeC\C\66+F+FFqFqzzcc##]|]|eeoo{{VV!!bbj~j~ffBLBL+(+(OdOdgg^ ^ \\}}__::PPyy((AAPPV$V$U%U%NNSSa)a)vv  h/h/ccJ_J_y>J,["'Y\\\\ ~o00XXXXWHWH_4_4sSsS"|"|55IIww**CC66kk00 @@nnYY#{#{kk @ @ZZ99`J`J1Oo)PP66.Q.Quull< < vvQQ<<NN2R2Raacc&=&=d8d833 E EhThTnn,G,G``oocc66 a akk||44rrKK66e3e3zzuutNtNxwxwb6b6TTmN<g*A,@,@,P,P;[;[Fb9T-F!2++3Y3YIIYVTQNyBj7\7\#C#C"-"- * *|"|"ueueAA=(=(;;zz  ##TT]]v#v#hh((gg>n>nooggppddxxyyN1N1CC  7Y7Ycctt55XX22}9}9 . .>f>fFaFa++CCEE++wawateteOOHH00]]~(~(``ZZww``(?(?``TTppaa//uuffxxMM==  ||ElEl''!>!>HHyyP1P16644!C!Cbb<<55&&yydd*F*FMMVV>>qq*S*S115Y5Y6X6X%%>>TThh}}77TTnn88JJ;;__>>nn''44 k k;;::&/&/XX))Y:Y:\P\Pff|1|1gg))vv:b:b;m;m$$N9N9J$J$SSbb7N7N3[3[nnJJ66SS^B^Bzz``aaJJbb=_=_tt]]??__ h huu((>>RRddeehhllqqw-w-ll@@CCaaWW|/|/ppll6 6 88  MMXX99 l lyyRR44}}hhIIrr$L$LuuYYzz""&&\\vv??||pppypy  ]]ll{"{"NN,?,?}}EE,,>>''qq,,PP F F>o>opp  EE??^^LL3300KKDD\\  RRyy66GG++X0X0oo 33LL4 4 KKt\t\ugug\\~~EE00AAwwccAiAi$K$K11wwVV]]  3T3TXXtt||uu..MMPP5X5XCCrr-z-z~~ccZZD%D%66:R:RqqJJOO  {{a;JmJm 59`Ndt^^>>jjHH 5Y-~tRRttw2__hh\%\%F F AAZZgg119[9[=[=[/9/9  5c5cttCC66e_e_uulplp_Y_Y>,>,//8)8)JEJESRSRUSUSQ:Q:((,,>1>1GLGLYXYX22'.'.KK \ \!t!tEEuunn99HH Z Z%%[[CCddqqmmllmmpp''UU}}rrII**iiXX<<88GG**0R0RWKWKvvvvYCYCXX^^gGgGyyhhTTC!5 (/`<TT==ccSS[[ii77  oo::  zztlemw  gg'78 :&  T1J }TT44==WWnn~~ffTTHHttFFdd|N|N``_4_4JJLL**#>#>  66VV//22WW44?k?kss22@OMLJI66##00=CJPWMDD!!uaNx=^-E!2!2<< Y!W"V"L#C"9#0#0  ttaaNN;;HHee# ! 44f[PPPar r nn26tY} Zjjjjjjjd,MMccss^TKBp:`2O+?+?,,;;JJ))ffccJJHHYYyy__,,0K0K9Z9Z?Y?Y2X2X&W&WVV55``??..]]PPVVgg5i5i  CC!!|%|%KK33'9'9aa{'{'zz33yy!K!KCaCa=g=g'='=ooUUKKqq  9c9cdd55++uuEmEm##  ,a,aUUttPP1A1A  !!    uuKKAAGGmm99DDff^^@m@m&0&0*R*RQQ;;NNAAzzNzNzee((ssYYVVffuu**==@@33wwLL+l+l//NNJJ|$|$%%&@&@++HHOO}}IItt  ))/'/'/2/2*-*-!!YYttffiiyy!!NN{{eeGG e eJJnn}}{{kk@@YYtt]]ffRREE&&  ::;t;tcc""LLffppzzzz44ccEE;l;l1f1f(`(` J J44  FF``ZZccQQ]]"?"?NNPPPP.M.M  11>}>}[[!!||kk[[LL>q>qAmAmByByAA?q?q<]<](9(9mmII55!!t t jjddaaqq55aaaaMM99EEqq 5u5ugg9955SS-5-5     EE>q>qWWyyyyeeSSSSQQ^^WWOyOy7U7U!! mmII55!!MMyy==*i*i<u<u9a9a%M%M  ]]IIee55+a+a:}:}EyEy<u<u#A#A    !!   !!==IIEEAA==II(U(U2Q2Q9M9M=I=I?U?U?a?a>}>}<<9u9u5a5a0M0M+I+I&E&E!1!1 )) 5 5$A$A--   - -!I!I2U2U/a/a+M+M'9'9}}yyeeaammyyAA&]&]?y?yRR``iinnppoollggqqwwzzzzxxttnngg__WWOmOm7Y7Y"E"E Q Q-]-]6Y6Y<U<U/Q/Q#M#M}}IIyyppz z %%AA]]yymmYYEE11zz  !!MMyy % %AA%]%].i.i4u4uHHWWaaggZZNNCC9u9u/a/a&M&M.I.I3U3U6a6a7}7}VVmmmmkkWWEE5a5a--uuaa]]yy  %%AA"-"-    % %AA(M(M1Y1Y7e7e;q;q=m=m=i=i,U,UAA--))%%      ! !==99%% ! !== Y Y'e'e<q<q<m<m;Y;Y)E)E!! 11=]=]VVXXXXFF6i6i(E(E  }}iieeaa]]YYee        %%11==IIEEAA==99&U&U/q/qEEUU``ggkkllkkXXGG8i8i*E*EAA==995511==IIUUAA--  qqmmiieeaammyy   - -99*E*E#A#A==99EE$Q$Q(M(M*I*I*E*E)Q)Q'M'M$I$I!E!EAA==))%%!!-- 9 9 5 5!!    ))%%!!  ))55   libcdio-2.2.0/test/data/p1.cue000066400000000000000000000004261474051130400160270ustar00rootroot00000000000000TITLE "Join us now we have the software" CATALOG 0000010271955 PERFORMER "Richard Stallman" FILE "BOING.BIN" BINARY TRACK 01 AUDIO FLAGS DCP INDEX 00 00:00:00 INDEX 01 00:01:00 TRACK 02 AUDIO FLAGS DCP INDEX 00 00:02:00 INDEX 01 00:03:00 libcdio-2.2.0/test/data/p1.nrg000066400000000000000000040350561474051130400160540ustar00rootroot00000000000000    ( (   >#>#k1k1;;vBvBa6a6>+>+   nn>>llBB))mmq5q5ddYYGGKKqq\\<&<&UUyyddQQ_0_0 CCj0j0>>HH`/`/;;rrccyy++^2^2bbkkVVjCjC>">"ww99""\\u<u<ddEELL z z!!gg00EE0!0!$$OO``^^22H*H*!!  55@@F2F288\\ZZvJvJ`3`3NNPP@ @ **ff((ll&&MM**XXGG VV66QQQQ  __^^TTffQQqqEECC""44UUdWdW===%=%QQ ::H\H\xxv^v^||[[__ppV4V4I}I}!!aarrbb[,[,MMnnWWBBe/e/WW??vv44EE;;MMl7l7]]ee.1.1SQSQUUnnbbDDccU2U2lIlI55/!/!55NNzzaa9w9wnene++oJoJ    = X= Xd *d *ThThQQ}v}vqqxxq q 44CC`K`KHH@@ddgg[[**iitt@@b b TTeeCCVVYBYBnn""\E\E[[9*9* ``@@3%3%KhKhvv#Tk |    O <O <}+plkkkEEmm__HH??||XX>>cc11'Q'Q%%   + + B BgvgvnnUUHH}}33 W WZ Z  : : v v' ' NNii==JJ$F$FI)I) _ _**; ; $$EEJJkkK?K?j,j,MMXXii rr8+8+8877g2g2LL__$$WWllHH;;eeee''IIff ccCC  22%0%0''ssdd((nCnCllUUT1T1}I}IDD11CCXXooiiDDmmqqggBB88~~^^\:\:  !!vv44EE||;;,,eeee^^ss@@zz^^ s sFFkk{{   " "gpgpuuBB77ccrJrJL L c Zc Zl= l= P P   v v,|,|"",,88((bb      e+e+OO  33AAAuAuUUOOn4n4M-M-77__ 66  cScSbb%A%AKSKSoo%}%}  II| |   II33HHll#k#k[[ADAD55))""  !p !p m=m= A A - -{{$P$P>>bLbLNN__jjII*> *>   L L     {{LL   A A??rr+F+FyyJvJvTPTPWW  hh22**||VuVunnYY4X4X  dd  s\s\rr>>MMTT|(|(l$l$//  ((^[ ^[ g g w )w )uueeqqmm,,ZZxfxf  c|c|M M ? d? dnn4:4:x#x#pp??@@KK00 % %GG  11 y y33llVVFFhhOvOv99BBJJ\\PcPcff@@dd%%   @ @UUBB8 8   qq((,y,y "("(B B   Z0Z0LL     11[[GG@>@>~e~e*8*8  n n   kkPP**LLe e   p p } } M M r r [J[J$$ ^ ^[[MMJJ##y>y>}}tt&&VV>>--  #j#jXXBB= = wwx<x<\2\2C)C){{aa??BBPP88jju =u = ) ) X XaaGGiWiWFFqqJJ~~ ss * *C'C'ww  tjtjcc4T4TyfyfggGG88TT::==UU66ll##EEwwvv b bR -R -##@ @ qq77""99..;;9944""  ==  77 X X ffuu7 7 P P FF   @@2n2nII+=+=DDooZZy y p p ((  ]]IIRR""h`h`ccuuN$N$uuII~~>p>p%M%Mss0 0 MMiyiy..ii>55x jx jnn9911}}[3[3tt))::OO;;y y DwDwY Y   ~ ~ jjnnII!B!BLL M MMM<< 7 7 ) ) FFMDMD< < W W 7 7 nnhhKK))MMT T P P7*7***"Q"QNN  77 ((((111ۜ1ۜwQwQkk W W  hh. . e e   ::~4~4**ccZZBB? ?   ; ; t t uH uH + + v v F F   Y8Y8>>ߵߵ_D_DVqVqR R "W"W))<(<(ff  ''h&h&xx;;hQhQhh.. X XkkFUFU&&      Gq Gq F F qqppMMUU@ @   AnAnvv  z3z3FFooOO^^l\l\++E E     zzLLdd55uuvv44/"/"sDsDEyEyz z \\ wwQQBBssyy  KE KE        ##mm""LLY(Y(((s 3s 3    zzkkgSgSxxr Tr TB;B;||YYHHvv<>qqss&&KKpmpm  ' ' ll????11@M@Moo  xxook k hh;;: C: C  //  e.e.nnzzv(v(??ttKKqq    R!R!p p ttll..qWqWdddd//__p p #V#V..(.(.&_&_7f7frrgg 8181""+I+I88qqH H # #     ZZ2255NN//II22II<<    f f   ) )    xx]B]BUrUr|؅|؅6611YY7 7 ;;((..5+5+1#'1#'. . susuqqD)D)--] ]   | | MM;;==$$EEjpjpd d U U c c ?Z ?Z ''ffSS*~*~_C_C55886 6 dd. . > e> e{{UUxx55S S hhii X X   m mD@D@z^z^--H)H)l)l)P,P,XX1919YYjjKKmmF/F/ 11{{''    [[a-a-,^ ,^ y2y2UU?b?bNN77"""" MM T T  $ $  #T#TWWdd--vjvjVkVk::VVHHJJrrggGGPP88JJ==YY]]))==TT]]X cX cx Yx Y@ @ N N x x MM88;;ZZ11%%QQ   { {nTnTPPLLEEuuii ` `    tt i i5544zz  ODODaaOO' ' ""ffggmsms$I$IRV RV K K %9%9% % aa @@};};>>&&||CpCpjjccG[G[ ccwwoOoOvv    1n1nd ;d ;JJll55..hhTO TO BB~~y y F F vv(A(A( ( aaVRVR tt"@"@ZZiiC C &&""  $$/ z/ zRRccӊӊHyHyZZqqWWC C ;!;!$$!!V gV g44KK((xx**UU  qqJJ==::}}TT\\||FFCC!!A JA J  f f p p qwqw&&,V,V//u u 99!A!A""N N d d ''D^D^J۫J۫ l lJJ * *D2D2g-g-$$4 4 VV"Ԑ"ԐRyRyݡݡ88{{EE  {{((    ) )9966c~c~**DD||004141qq{{Q Q = =         wi wi E ERR]]ߔߔwDwDffLL  D2D2&&(( # #II" " f f f#f#7s7s    @ @ D6D6nOnO S S88YY  G G V V 6: 6:  qqffUU0F0FOOqq}}  > > HH--  E E gg]]ppp}p}??xxvvy (y (  DDkk,^,^**K)K)tstsyyllYYbbAAAABB+ |+ |3 3 **rrKK55//]] a ai6i6zzqq  R R    - -GAGAHH//# !# !( ( AAHwHwEXEXFF))((rJrJ,,UfUfvv : :  ` ` 9 9 P P ( (;;DD))DDQQ ++]]  i Yi Y: : ::AZAZqqqqeep=p=JJ  wx wx   r r p-p-llt{t{ q qPP..pp  uu--  nnSS[[<<445]5]@@  , , //g g ~ ~ ! ! *i*ibbnn ii``xxnnxx((&&$ $ MM  ''JJG`G`}}MMwcwcB B 8b8b}}    IIvv --++||@@WW[[d d ""J J   mKmKKKAA||bbn n EE##~b~b  $ /$ /**DDhhyyNNCC((??h Sh S--6)6) E Eff7w7wGGrrIILLvv  %%tQ tQ 00&&mmjj-F-FVl V uh h uu  " q8K oH  ))5050 Ѵ ѴDәDәa.a.]]  H H..o1o1#+#+ww] ] ""p@p@BB    88  9 9 ~ L~ L   ee33??CCbbwawa66yy99t t E E   q q ~Z ~Z Y Y q5 q5  f fjj((ffyy&&  **%%%%$$   %b%bYY / / * * 9 9%q%qTT[[V#V#hEhEm m   ; ; j j D D   PnPn))7W7Woo | | e e ll     //**kkJfJfJJ EzEz<<jj__YY;k;k{{xxWWcOcOSSGGuu ww''[[MM~~44w w I;I;r%r%  q q Y Y iihh,,kk//CCY1Y1 \ \  a a   --"{"{xxPPjNjNxxPP!!o`o`uuiieeeeMMMMww|X|X66UUd d ?dEobbXX D  u*  (   {n{nDDcULLGvGvA{ p{ < m< mY Y PPAA m mAkAk--( @( @ v v 8 8  QQVVAAN N SSWW$ $ iiXX55V V 3 3 [h[h>J >J   ~~IIttU}U}{{DDjj > >SbSbvv.q.qynyn m mz z t t    4V4V4J4J`%`%JJnnPPvvN(N(jj \ \&&4 4  h h..NNggddk k % % CCv jv j33''׋׋;;SSUU??  $$!!CC ^^++iiJJ{{   e eee>>FFuGuGx.x.AxAx 00rrLL ' '  **Cj Cj  ,6,6hhMMPPeeOO  eeR R t#pt#pK! K!   * * aa77885$5$MM 7 7  hh(&(&2< 2< /N/N%%  }}vvBBԩԩGGww--""  h3h3a~t j 8 |8 |ww'@o=ppxxRRWWW5W5^^//66;;^ @^ @  i v qL    ' ' J J H ARl\ 11nn6f6f  : : pp""!!774 4 LL 2y2yLLQQaa99SS    ppZZ|y|y@@``.. o o  ; ; y y..MpMpbb@@&&55BBGG  + + ((V V  p/p/6*tz5XX55qa8[7GG ~ ~W PW PGG  ##__ 99ZUZU  ||3J_w 66>>*Z-gGt66HH__22PP : :  ??aa66) ) dd~<~<[[WW77vvbbtt        ))??ACAC99mmzz3F3FKKddQQmm &&ffKKMMaa_}_}ddjj  b? b?   b b  @@ww''--BB3O3O        xxOhOhppLLkk  Au Au     00))CC``ssk k   RRp p jjL}L}DGDG..5 5 DPDPpp( ( ShShKK##22**ff2Y2Y<<*<*G>G__**bb''""  VV/ / * *  X X >; >; h h xt xt 33VzVzZZQ Q --JJ5ت5تڣڣ99: : Z)Z)G.G.,,$$kk++UUvvPPTTGdGd)) z z6 6 T {T {'k'kii C C  O O _ _   [[KKUU55؎؎C"C"jBjBll  LL  9% 9%  %%DSDSUUjj;;w w   e e     G G?-?-m]m]   { {, ,   -2 -2 | |      # D# D      ? U? Uee::ff""FF      f f d  d  GG00gg<<ee''5T5Tzzhh^^66,,;;qq''....``rrWW--xx<<VKVK;;DD" " hh  ?6?6iiݦʽۦʽ""00TT : :wW wW WW))y y ??~~ + +""ppZ Z   ++\~\~ssvbvb''WW         D D4 4 __KK!!!!$h$hxx b b TeTeI&I&F F 66?? KK}F}FEiEinn33{{jAjA[[~~tt܄܄RR : :?? II_2_2U8U8rr~~**CKCK   C C   M< M< r r r6 r6     p p   $ $     [ [  k kFFc c [[vvPP991v1vqqGGhh??2h2hgg  zGzG ||rr-4-4ppqq>>TT^^pp*-*-wwmm    T T   mm  ! ! ::'m'm}}{{U"U"ttss*I*IPPMMSS & &3%3%^^QQEE````$$NNtt/"/"eeNN88rraa// \\;;KK   3 3\? \? d'd' a a    ` ` ddjhjhTT>q>q t t> > ! !  ' "' "--NNCCjjRRr r  Y Y / /  tt$$ee!Z!Z~~FFgFgFII Q Q@ @ fD fD Pz Pz  ++OO^^??LLWWVLVL 22f0f0UUQQ33HHii33>=>=PP[[[[PP2W2W,,N N < <   99  55  3# 3# B FB F\\  L L   WW    7*7*/ / v v ~~<<II<><>KK6!6!'<'<""rrBB33VV11޶޶OoOo]q]q44߳'' ݿ ݿ``PP55aa^^00^^ ppaxax v v   ""%%~'~'*|*|++. . Y1"Y1"3c$3c$;6"&;6"&h7&h7&6&6&3$3$|/!|/!))m#m#BlBlZZ]]3"3"MMOZOZ}}   JJA(A(bbEE##ո]׸] ̪ ̪ҹҹ߫//>>FF{ߠ{ߠ}}~"~"[ѳ[ѳiɰiɰYY0B0B{¥{¥LLؿΪݿΪ > >II  ``]],,RRQ Q |Y |Y rr!!m&dm&d**<-<-. . |. |. m/h!m/h!0["0["1=#1=#F2#F2#%3$%3$ 3# 3#M0"M0"O-O-`'`' ! !cc  ~ ~   6 6 ' ' 88dd00HH$$22ooTT<Ϡ<ϠƩƩqq--Վڎr0r0ooIDIDX[X[{={=ZZ?l?lTT;;>>55( (   ffB\B\00  S S   K K C k C k     y Xy Xg~g~22BByy{/{/66CC99oommR3R3ooFFsjsjyyDD NNss44UUI I aaH"H"j j   XlXl##7a7ao / o / zh zh   3 3 t  t        DDffoo663d3d::hhffv)v)BBzz--izizyyVOVO]]ppB3B3==FF.:.:rrii44h h     %b%b]V]V  6 6 ]]33@2@2++ff F FN N aQ aQ n n  , , ZZDD2g2gcc66TT;;``44L L nn&&>ZZnn.b.bppbb~ ~ IISSll{s{s99YY;B;B YYZZ ""]&]&{{yy``h h       %7%7@'@'mmFF5!5!VV A A   ItItx1x1PQPQg g   l l 99aa==  bGbGjjtt{{ffGGDDq0q0s[s[& & zzPPܟܟssZ؎Z؎((ݎݎ__Q Q ,,QQxxNNuuX-X-  UU#5#5)U)U- !- !a1#a1#3%3%4&4&/6+'/6+'P7?(P7?(9@)9@) ;* ;*c=,c=,s@.s@.A/A/B/B/@.@.;+;+4&4&-C!-C!%%NNkmkm    *f *f     L L vv;Z;Z!!nnQ}Q}ҞHΞH'l'l*M*M7Ɔ7Ɔ8˞8˞ЋЋ;;ݧܧ2ͤ2ͤgɪgɪf>QAQA& &   $7 $7 +O+Oss  **3'3'>4.>4.*EJ3*EJ3E3E3Ci2Ci2=u-=u-4&4&*?*?jj    4 4 O O   K. K.  $$UU//wwhwhw}'}'IIٹٹKӛKӛXX_ɘ_ɘ/{/{mmggggnnғғagag}}hh'['[--cco o ==bb55vv  C C B}B}GG!!||iiFFaamm==FFDeDe-j-jkrkrO>O>G G      hJhJ   7 7 w1w1   <J<Jii66##==dd @@88 @~@~>>AA,ߑ,ߑާާb b <<001f1f!!jjhh~~oo8"8"88ll]] : :<<##      pX pX !!%%(=(=_)+_)+w(Ow(O(&(&##!!  l!gl!g>">"#|#|1$"1$"l$<l$<p#p#!!mm} } s s / / WW%%=M=Mg>g> eeAA B B==fڝfڝ--&&55}}(X(X@@_ފ_ ۱u^u^GG__rvrvRDRD8 8 ::``ddT T   y y   m- m-   8X 8X g g   Gk Gk ))ZZ66MMpp   EEF 5F 5_ _ aa+ + 22  ;;TTMM55@ @ dSdSOO W W  knkn  eeN N Zr>r - -## ## &&E)E) ," ,"@.#@.#R/B$R/B$s/$s/$.#.#-"-"+!+!); ); I(I(&&%%o#[o#[    @ @h6h6UzUz99))ff!!##((DDO԰O԰&&hYhYc8c8xxXX\\EE''LL%%kkAA  GG[[%%L pL p   G G } } [ [ < < 8 8   . . !5!5e e f f   >b>bfefeCC^^;;xxXX::;;GG::XXzFzFllaa%w%w. . ||cLcL tt  r!r!ss l l HH||>>,,rrq q 0u 0u   H2 H2 00]]PPWW==}}ll uu=A=AYYggzz2K2KCC>>]]qTqT$|$|__mm00I I }}WcWc   a a  MBMB?? t tv v w w kkraraMM     99S S **99aa~~!(!(s$s$77> > &&c"c"J J BBQQ??oo]K]KJJuJuJAaAarrAAUAUAWWff ffMM@@zz ..jj22,,`<`<KcKc**uAuA.. KK  /2/2GG \ \ 44II "t"tEESSnn$$+"+",S#,S#''''xxO4O444&C&CKKIIJBJBgg4 4 gg  i7i7hh SSmmXX::++00++33kk\\ ..ccvv>  >    . . N N ~E ~E   kk mmnn] Y] YCCa)a)/!/! ! !00 ||99}}))ZZhhPP55YXYXii55??@@ososooBBbb K K QzQz&&A dA d" q " q     +s +s  FF  QQ    ""n n yoyoMM@ @ T_ T_ 8 8   D D 3 3 v v h h __7-7-Y Y HH]]F\F\GG66#T#T..==??)q)q>>yy'a'aaa{{&&yyttMMff[[``KKOIOI::5p5pFgFg00DD O O % % # # z z g gpp^^))FFDDTSTS*T*TvvGGll       p p776F6Fpp/x/x\\<<==|y|y||MMxx22HAHA  O O > > g g 4  4  IIjTjT00\\C 7C 7   x x 88~-~-' I' I^^TPTP UU:5:5{{7L7LnnttWWV\V\'m'm&F&FSS((ee::$$:[:[66gg++aa m m    OO11##%%""{{  OO  ( (   ()()II::O O = =   nt nt GG9 ^9 ^5L5LSSvv\\nnXX``QQDD@@YY ] ]i+i+@E@E((bbjj2*2*AA]+]+gg;;}}00 bUbUGGoPoP[ [ ''gg0x0x``& & uu66--@@[[hh_q_qAAi i c c XX22:: a a  wwaaxx{{\\   KK}y}yX X //EE-4-4~~EE W W Y Y     a a tt$$9-9-uu_]_]__ AA--R9R9KKuupqpq##HHt!t!ff  <<--NN__P?P?++ppSSCC   y y B B NNuuVV%%|:|:55""  , , ]  ]  [ [ l  l   zSzS_1_1  \ \   --p p 4 4 nngg\Z\ZYY33bb,,nn W WNN E E=d=dUUzz++XXr}r}SSII))KaKa]]33pp3p3p{^{^@@SS0055r{r{YOYO  y~y~> >  "v  wPP  @ 2@ 2Jj#uI~\\..YY,""  K  K  Ij&EE;;XiXi00JJ[L[Lkk4s4s&&iiaaZZ22rree/R>11\\66~[ce+UURR7vI]$]jj?\?\**BBXnXn77TTL%L%,,i i    Z Z xxJnJnoo0077ccSSWWiYiY^^ JJ##ffAA  // F F H H _ _ > ?>0"c9c9y;Z9Fp2p2t t SSII;; >> jj~~tt,, ( (" j " j         & &I[I[++[[22))|3|3BB%%  %F%Fyy>>||KKssXX''33 @ @88`` ` K ` K m m WW11``DD  nnYY$$  uDuD$$:<:<~~ccnn||k k w # w #    _  _ : :  ]]  FFll22bbP|P|TT-n-n} } } i} iBB6600 ..++wwNN PP**  UU((nhnhOO] ]   a A a A G X G X  nn4.4.R&R&k k t t //NN    SS / /ee55  uuAhAhAAVV&&B:B:GG~]~]DD]]..{*{*gg44//cc}}  ::   d d H H mm\\      b b 4 4 "h"hKK  + l + l {  {    n n O O ` ` / /  cca a IIdd||vv!!vvKK0s0s  77[[8q8q[[00AARRddVVII..{{uuNNiiYY66--22popo GG!!11>S >S nnT@T@33,,HHGG++XX;; ~ ~r r dndnZj Zj  SSoaoaKKYY0 0  i i   H H     *8 *8  l  l h h k k H H ^r^rQMQM| 4 | 4   SSUU=}=}jj] ] ^  ^  (( ll}}ii XXGGp6p6 qMqMFF\\9]9]eeddQfQf@@==11;;r r \\<<``eePPQQ     3 3 Q Q P P - -     OOmm--llVV  dd!h!hVV88O{O{JJ||f$f$!!mm:: ododttQQ00 >>__YHYH6 '6 's y s y O O     |&|&##SdSd!!__rrllhhEE9a9aii2Y2Ymm Y YppVV\\&&00vv??[[dd]]FFEEz#z#cYcYLLEEE E   @ @ R R  [ [aa"'"'88II++jj1o1ojj>>/3/3}}MM||55pjpjPP   ) ) ( ( ((mm[[ddHH  g g V V l 0 l 0 qqzzQNQNRR=X=Xvv**ffIxIxb b ^ ^ ~Q~QcUcU11mm||o&o&PPAAdd--aa, ", "L  L  W W O j O j  PPkkWW##DXDX Q Q $$  i i g g %%rrj2j2  7X7X d d;;((``55qqAAvvEE222;2;RReeNNd4d4bb22qq!!SSC C xxhh&&==%%\ \  A A . .%%w%w%]$]${{  = =    k k   h h   x x *C*CF.F...PP''UqUq?y?yLޕLޕ}7}7xx"I"I{Y{YfBfB==26261717ޖ__ߞߞl\l\?[?[ii88vlvlhhEENxNx   9 9 ~N~N%%WWqq{|{|V1V1JHJH;-;-77]+]+   yyvv##~~DDuu kk==qq  xXxX--iidܯdܯtt޸KK""))ff  SSRR00 A A   7 7  o o     y y  tYtY^^DDIISS]]_F_F8i8iuXuXvvll!!UU- - 44DDRnRnJJggRRSS!!KKZZ!!; ; XXBB+C+Cx ` x ` ""ff__uu ` `   r r       ppPPOO``""KKkk%%lZlZPPZZ  3E3EOOppHzHzUU"  "  p p ! ! XXzz^^ ZZ{~{~ffJ)J)yyNNLL##II66**jdjd''jjjjvvUUGG=E=E{{v(v(;;AAUU"Q"QA$A$##[[GGwwLLRRoo    &&8811  QQ>>p[p[ewew;; ``RR((7u7u99qsqsVV;;UUeevvHH \\DDllEE++e e l c l c *  *  TOTO<<,,4%4%k[k[&_&_C`C`Y_Y_ImIm00""}} +"+" O OHHBB**;;EEkk##^5^5 77bbOOLMLMMM@@66EEhh??WWtKtKooe ~e ~3 3 eiei))$$jjYY""S#S##T #T # # _ _ uu[C[C R R nnh h   gygyK6rY5ލ5ލٸ܈ٸܕt٭m)߿l/I/I''zz?c?cHHGfGf664400>->-??   HHjjii,3,3uSuSyy0202,,0!0!))[ti@nFF   n0$7==+V+V66x#x# nnddVV\\88e3e3hhtt''HH{{""YYTT??)u)uYY bb''0 0 LL H P H P S S J T J T i i ""  ==DDPPaaj~j~ttuuD D GG.. 0404MMo;>;bb``scscrrc c 77LL$$oo ))QQ``/./.00 GG 5 5 V VVVIIUUPP44GGFF""55HH\\ D>D>  t B t B " "  PPUU;;u?u?NN L L ??SS$$&K&KXX] W ] W RR{ { ##hhz3z3NN m  m VV00ss4Q4Qw w /g/gLvLvHH((  vvss^b^b3~3~__f f @@XX}}ccSSFMFMttiwiwllm9m9??yy33008!8!77jqjq? ?  ss$#$#*)*)/I-/I-10100I/0I/,T+,T+'&'&2" 2" yyKK|}|}1414#)#)vv ,f,f^>^66 dddd  i - i - 88$$HeHe  4+4+ l l a a  7  7 ccDDQQffeoeo /N/N H H   X X W % W % <<ggp7p7++,,^^1B1BBJBJz6z6GtGt88MbMb~~/7/76Q6QaLaLQQ77gsgs22jMjM##TTss2 2  00pp<<:: mmSSpNpN:: z  z @@ll{{FF UU@@%%AA77??$$I;I;SSwwEnEn&9&9||mzmzaQaQ..7/7/EGEG` } ` }   \\(>  hhtt&&PaPa%%OO}}h.h. % %XkXk?N?NlqlqRRmm. .   ccnnuu??&&yy\\GGN9N9RTRTRR!!NNNN3333}c}cLLYY A%A%&&',',55EoEo:: & &,, 66CCDDeeEE!!L L n e n e ++ # # p  p  9 9 &l&l R9R9O O 22RRRBRB22ss%%ee11\\66HUHU~~ssj j ZZss vZvZfIfI?"?"wTwT{c{cXIXI  C5C5A+A+KKo o F F _v_vll  & = & = #R#RQQ//DKDK55IIcc S S Q 3 Q 3 <<d d  " "{{jjhh   [[   a a ;;rr;;UUkkJ%J% t t * * <<8r8ruNuNopop\\OO----yZyZqkqkkiki&@&@EGEGaaGGYY##55 * * X X 88MSMS00__TOTOnn}}/p/pkwkwSS""?I?I i  i l l Q Q ee\\ ??,,jjii 66SSss{t{t))116K6K_k_kuuAA||#2#2  rre0e0d)d)JJVV    d d 33  CCO O --00ll66\\RtRt1[1[uEuEvXvX<.<.CCttttGG<<vvJ4J4vv))KK88^^++/B/BDKDK|T|Trr""JJ%^%^))PrPr$x$x55cUcUyynOnOXXMMBB B B g g ''rrNENEX+X+ ]  ] rrbWbW $ $ ddxqxqeCeCKKsTsT''8 * 8 * i i ..--}[}[YYNN22{{<><>C C o@o@iiz z 88xmxmfUfUCC)){{/j/jejej~~oo==8 ~ 8 ~ i  i  C}C}RRBNBN DD^^$($(QQ\\ddOeOe@@2a2a{{zz ' ' vv__,1,15 5 U!U!;;11 [ [ //\\ s sz z JJvvKKZZJgJgAAyyg g 3 3   $$;o;olqlqvPvP}}//Y^Y^JJ~~wwAA  O)O)oowwoo[[~~::]g]g[[0 0 <<kk00,,N7N7igig__ oo 2  2 ))ZKZKK K WW@z@znn__z3z3'' m`m`EE^^&V&Vff<<}}H/H/wwv8v8f f HH``NN<<MM$I$IPPRR]]~~"";;brbrtt$`$`@@uuxxzz9 G9 GuuR0R0oo  MMUeUenn!!44hh,,..\\AAzzeehh77Z5Z5>>eeggPmPmDD++vvAA.F.F==mmlleqeq__..!!AAhhbbLlLl  eeQcQccc'J'JnnHHzzg g U U % % y y   22F F a a x x **{{tt44##E E J J   rrIMIM++jjllaa } }JJ]qUs:-XX;Rkg((33{FS j2SS||e'e')e,ll n<)){{ `pN^88+F+Fii   w'w'&&II\\}}m&m&dd??VV55  ,  ,    CC&&}}||CCggaa^^% % g g L L   ''\\ffttwwTT==@@3 3 ! ! ( y ( y u o u o %  %    LLGNGNDD??rr[[++[[t't'CC&&PP[[6633rrTfx1eeQw[t 5522aaTDTD]]::CC PP<< Y Y==rrkk==ff,,VVZZ??ddeeW!6=wcIIRR >>ii]"]" 7 7ffg.g.kklls s <<^L^L,?,?wwJ J H H ==FF1%1%J>|M|MXXss>>^^u]u]$$    66hhc' c' Q Q ] { ] { 6 6 IIww44wOwOII ||pp__;";"+2+2,z,zbbRR ! !qqgg::**4{4{##}}cAcA33JJ||66H&H&887!7! g g @ @  IIbb<<KKHH(e(e  __.. _ _ ,,bbC@C@w w q M q M 4 E 4 E 99JJ##&&==$$/M/M++JJe2e277TXTX<<,,$$<v>99LL$$""  hhQQ..Y.Y.ANANh3h3@9@9R-R-;A;A++]H]H6C6C>m>mi%i%ee77 ,^,^"~"~    p p = = aa``yyHHA/A/}}22  x x 5 5 UU..ZZ==1h1h((D+D+88hhggWW//@E@E - -7W7W33:.:.TT=:=: hh''XCXC    <> jj'r'r@f@fyy..wwnnRR!!KK:q:qWWss%%ww -f-fYYRRff``II::tTtT}E}Eoo ) ) M 7 M 7  # #XvXv"G"G77 j jKKgg++AA;;==YY!!  X X   LL^6^6zz66eemm))99//tt88UU^^ggm\m\LNLNnknk008&8&66<>^^99((\ \ A A K 6K 6  ||AA : :   Q Q   t t y y    %%!!##    , , A Ah:h:;;ee4242XXZZ||AAIIttOO22^^jj<0<0^^11>>ccWWSSKKEE&&33jjECECcscsvv9v: Zu;E;E::NNS n*J2B2B^[L_ cchhd'd'tK^#l/ZNNVVR R iiqqn n u u @ @ **IIJJ++I1I1==WWNN  R TR T.}.}E E L S L S 1^1^[{[{ees]s]zz33P0P0BBRRMYMYssxx]]CCQfQf_J_J**bby.y.44(( F F  >%>%.S.S++%P%P##""".". V V     +_+_@0@0/5/5 S S# # ;;99__{${$ Y Y&^&^TTrr<<ww4444RRp6p6nMnMZZ>> !!SSMM{{**22  //' ' J J r r p p ] ] l l | | g g t t \ \ ' ' A A mm99ww!!OSOSrr]]GG,,77(({{::YjYjn2n2wowovv--5N5N88!M!M[[ddWrWr2277GGFMFM,,]]]']'DDJJee  ssPP44|w|w,F,F. . R  R  p p V Y V Y " 2 " 2 ` ` q, q, b b ::BB          F F hhHHxfxf""hh(h(hLL7755ppE~E~$J$JRRRfRfgg::>W>Waavcvc::gg))ooyy__tt%%}s}s--]]JJyy//    e=e=~Z~ZDUDU%% k k)o)o,z,zXKXKUUrr55nnS.S.uuXXww~~ffmLmLe/e/i'i'\\;;ll8l8l#"#"  CCrr__bb PP#?#?XXSSOOX}X}55nn\Z\Zt t XX'&'& L L2q2q * *__UsUs__g@g@77W W JJrr88RXRXZZ;*;*  ``  ? ?    ww d dI I J  J  --rr99""     =m=m~ S~ S WW5r5reeXX,,/33JMcuu^^@@Ed7&`6uuZZ{R{R  __ZZ77zaza//##BB&O&Onnoo{{ZZNN""r'r'\\o o  p  p 11>">"    O O   7  7   q qq qQ wQ w  O [O [    @ @ 's'shhbbhh))OO^^vvRRuu``gg ,,dcdclldd66>>ddDHDH1:1:%%;;..cc33xxpSpSU U l l   v v s s F F ( (  h 6h 6     { {O   \p    ]  ] K p K p  ja  9 D4040GGDDNNmmH|H|CC;;ffNNG!G!II0044  66dd66BB66  77"{"{vvcc44##((  HuHuMMV/V/((,!,! E Ez6z6DD|W|WPPAA||wwqqffpp--""(2(2^^oo22RR t tQ{Q{FF    6 6 SScciGiG''lluuAAu>u>X'X'ccr>r>ddPPDDllkSkShUhU//ee-/-/JJ>>00ww,?,?..ieie]q]q66j j 2 2 ,9 ,9   ''^"^"))LL|q|q  YSYSooZZkkdd''ccFF(([[&&s7s7##ee''MMRR99BB  ee` ` ss[[ppJJ-]-]LeLe44""gg88))8<8<]:]:xxccUUQQRwRw{{vv\\YYYYzzYYeeii#k#k~~**77gngnWW    M M ] ] :g:gDDvvnn""kk*b*bII  u R u R   Z Z_ _ 7 7 ##&&ff__}}FFvv//EE--TTOO " "]]y"y"iinnt_t_mm tt!!99U&U&xx,?,?--&&N:N:YYGG]J]J))hhVV[y [y ; ;     ppBB7$7$ooO O \;\;EEy$y$y@y@ II33!!M7M7//vvnn]]mGmG>>JJee@@ wwzzggAAvv>> d d,},}LL  **  LLNN66SSRRGgGgppUU11  xxHH55GG``EERRhhmmH&H&B5B5,,..zyzyVV1k1kEE,,RR#z#z009&9&==bb**ooEE@@qAqA %%ppss:7:7z_z_%%aaoobpbp!!??ffooPP!!jjZZ$$qqyiyi``11\B\B$$-v-v 1 1 mm  nnYYsszzjj]]Y.Y.[[*b*bff  **iiNN77~~22cucuQYQY ..&&D1D188uu$9$9$r$r??</>AbAbp}p}zz~o~o$$!!qqGGddvveeQQ;;$$IZIZS!S![[ SS2233rrhh8R8R  XXQ*Q*zqzq##f}f}==ipipxxwwXXQQdd,,ppRR##<<{x{xmm77  qq  L_L_))ppUUttllKK>>]]}Y}Y !!11kk55<<_A_A&&GG..uu::SS,,uu66&&{{  ~~}}RR22$$~~OOMlMljMjM  dKdKqEqE ee444"4"[[KK33}}ghghXX;;NfNfPTPT r rwwRROOf(f(^^qqV V jujuFFIIVEVE!!99ee%%"Z"ZNN%%pp::;n;njXjX""""55mmuuuuVV&&e=e=LLbMbM%%))v(v(\J\Ju u //iiYJYJ##ccXX@@ggJ?J?  "T"TUUhhOOo_o_#>#>NN,x,x  !!eeLL77HHckckw?w?gg<4<4ZZ]]++~E~EnhnhtRtRffddg6g6  iiPP``44ll;;\\<>II((wLwL&&eeddii1d1dkknn!!DZDZ}}OOAAJJPPNNLL;1;133%%(l(lOOmmII{{  LpLp**m^m^88NdNd^^DD00     T TCC[[OOPqPqmmd>d>::,M,M''  dd  ::9977]a]a1166ZZddww Y Y{{XXSSEE```2`2rr ? ?ss[[ppAAttFFddB1B1. . ] ] bIbI5599<<% % ??  aa"h"hy`y`||PP))11*}*}  ''88  pp]]""UU--iikk((nlnlccxx++JJee&&zMzM>J>J88))dd+J+JiiYoYo44  ^^bb\\s s ))""&&ddBBzzQQuu!H!Hmmbbxxtt--FF"7"7yyvv..3;3;cc(( ~~**FFrr--__AAddBB-w-w#n#nRRuu%~%~`v`v;o;ott11[[==.#.#<^<^88//ii  ll\\DDaa``ssL8L8wwAAWW0"0"44((  bb77''  E E ##pp..K;K;&&66//ppcc\\>>CC::ZZ gg,,ggUU]]xx JJVVPPjjkk~~SSuu--%-%-ll}} qq]`]`// < <%%%%__44%%HH__ l lggX X tt^^l:l:';';wwAGAG-f-f::((00xx66//..SSNN]]//77  MoMog*g*ff:g:g}}]]GG^Y^Y**<> Y:--44 ll66]#]#bbqqQQ WWTT))QQGG##4499DDSS{L{L44llm_m_**^+^+RRjjdd``!g!gmmcc4499aa==22..(^(^yzyz``UUyyO1O1;;]]GGMMuur>r>hh9911ll1@1@SS22++ ""ffNNIIJJL L   RF RF       ;- ;- Z Z eeOO~~77||rr99QQJJ"Z"Z..ssgg##KK,,aallzqzqGGUU>>ZZ)) O OCC++66SS$6$6M}M}DDuu))?=?=]]))0 0 s s     3 3 ii  88>>nnEEPP44VV<>jojo22II  5544bb((    E E %r %r W W     [[JDJDccc c ||22MMAAQQ;;F*F*6622NNY:Y:K,K, iiHHbYbYiWiWttf=f==q=q**4b4bLLLLrr]]DD++))--CCdvdvaaww) ) ]];;XXUU++((T}T}..@@""hh==gg[[uu44#^#^::NNUUmm@2@2zKzK{{I$I$bbu(u(@@2J2JWW))r=r=SvSv""QQddgg0808|(|(  //yOyOa'a'II)=)=  00CCt_t_aa99<>ffGGww,X,X - -zzUU%*%*55}}hh__GG'3'3""nnrrj j bbIIGG GGOO+E+EggLL##ZZGGmm$O$O--LLkk77OOoo||44}}00mmz=z=  HnHn##**!/!/%2%2f f UUrrC_C_kk33e e gg  v!v!CC``(J(JGGnnccTTgg[[MMeeDSDS,A,A9O9Orr00@@x@x@gghhHHccLL ? ?ll8W8W\\JJ]]||\\:b:bDD__((w=w=  //ZZ//.N.N//eejjUUz>z>||** &&%%(K(K<<^^EE&&@@HH`` ::!!33}}^^ggEE?v?vOO77vv  r"r"RR!!  ::!!  "<"<++]]#P#P((3g3gooY Y hh 88``}B}BHHRR~~??!!66VV77<<vvRMRMK?K?\V\VggNNMZMZ%%II>e>ehhnnQQV V FF[[OTOT    / /   ^ ^ \ \   N N DDVV H H++,Z,Zuu==KK+{+{))||+C+CCC>>ffjj v v((ZZ >>%%&&ff__,,,,b_b_**??||tt--NNMMHH1~1~xx  jj<<..pfpfRR,,;;QQZZeeC\C\66+F+FFqFqzzcc##]|]|eeoo{{VV!!bbj~j~ffBLBL+(+(OdOdgg^ ^ \\}}__::PPyy((AAPPV$V$U%U%NNSSa)a)vv  h/h/ccJ_J_y>J,["'Y\\\\ ~o00XXXXWHWH_4_4sSsS"|"|55IIww**CC66kk00 @@nnYY#{#{kk @ @ZZ99`J`J1Oo)PP66.Q.Quull< < vvQQ<<NN2R2Raacc&=&=d8d833 E EhThTnn,G,G``oocc66 a akk||44rrKK66e3e3zzuutNtNxwxwb6b6TTmN<g*A,@,@,P,P;[;[Fb9T-F!2++3Y3YIIYVTQNyBj7\7\#C#C"-"- * *|"|"ueueAA=(=(;;zz  ##TT]]v#v#hh((gg>n>nooggppddxxyyN1N1CC  7Y7Ycctt55XX22}9}9 . .>f>fFaFa++CCEE++wawateteOOHH00]]~(~(``ZZww``(?(?``TTppaa//uuffxxMM==  ||ElEl''!>!>HHyyP1P16644!C!Cbb<<55&&yydd*F*FMMVV>>qq*S*S115Y5Y6X6X%%>>TThh}}77TTnn88JJ;;__>>nn''44 k k;;::&/&/XX))Y:Y:\P\Pff|1|1gg))vv:b:b;m;m$$N9N9J$J$SSbb7N7N3[3[nnJJ66SS^B^Bzz``aaJJbb=_=_tt]]??__ h huu((>>RRddeehhllqqw-w-ll@@CCaaWW|/|/ppll6 6 88  MMXX99 l lyyRR44}}hhIIrr$L$LuuYYzz""&&\\vv??||pppypy  ]]ll{"{"NN,?,?}}EE,,>>''qq,,PP F F>o>opp  EE??^^LL3300KKDD\\  RRyy66GG++X0X0oo 33LL4 4 KKt\t\ugug\\~~EE00AAwwccAiAi$K$K11wwVV]]  3T3TXXtt||uu..MMPP5X5XCCrr-z-z~~ccZZD%D%66:R:RqqJJOO  {{a;JmJm 59`Ndt^^>>jjHH 5Y-~tRRttw2__hh\%\%F F AAZZgg119[9[=[=[/9/9  5c5cttCC66e_e_uulplp_Y_Y>,>,//8)8)JEJESRSRUSUSQ:Q:((,,>1>1GLGLYXYX22'.'.KK \ \!t!tEEuunn99HH Z Z%%[[CCddqqmmllmmpp''UU}}rrII**iiXX<<88GG**0R0RWKWKvvvvYCYCXX^^gGgGyyhhTTC!5 (/`<TT==ccSS[[ii77  oo::  zztlemw  gg'78 :&  T1J }TT44==WWnn~~ffTTHHttFFdd|N|N``_4_4JJLL**#>#>  66VV//22WW44?k?kss22@OMLJI66##00=CJPWMDD!!uaNx=^-E!2!2<< Y!W"V"L#C"9#0#0  ttaaNN;;HHee# ! 44f[PPPar r nn26tY} Zjjjjjjjd,MMccss^TKBp:`2O+?+?,,;;JJ))ffccJJHHYYyy__,,0K0K9Z9Z?Y?Y2X2X&W&WVV55``??..]]PPVVgg5i5i  CC!!|%|%KK33'9'9aa{'{'zz33yy!K!KCaCa=g=g'='=ooUUKKqq  9c9cdd55++uuEmEm##  ,a,aUUttPP1A1A  !!    uuKKAAGGmm99DDff^^@m@m&0&0*R*RQQ;;NNAAzzNzNzee((ssYYVVffuu**==@@33wwLL+l+l//NNJJ|$|$%%&@&@++HHOO}}IItt  ))/'/'/2/2*-*-!!YYttffiiyy!!NN{{eeGG e eJJnn}}{{kk@@YYtt]]ffRREE&&  ::;t;tcc""LLffppzzzz44ccEE;l;l1f1f(`(` J J44  FF``ZZccQQ]]"?"?NNPPPP.M.M  11>}>}[[!!||kk[[LL>q>qAmAmByByAA?q?q<]<](9(9mmII55!!t t jjddaaqq55aaaaMM99EEqq 5u5ugg9955SS-5-5     EE>q>qWWyyyyeeSSSSQQ^^WWOyOy7U7U!! mmII55!!MMyy==*i*i<u<u9a9a%M%M  ]]IIee55+a+a:}:}EyEy<u<u#A#A    !!   !!==IIEEAA==II(U(U2Q2Q9M9M=I=I?U?U?a?a>}>}<<9u9u5a5a0M0M+I+I&E&E!1!1 )) 5 5$A$A--   - -!I!I2U2U/a/a+M+M'9'9}}yyeeaammyyAA&]&]?y?yRR``iinnppoollggqqwwzzzzxxttnngg__WWOmOm7Y7Y"E"E Q Q-]-]6Y6Y<U<U/Q/Q#M#M}}IIyyppz z %%AA]]yymmYYEE11zz  !!MMyy % %AA%]%].i.i4u4uHHWWaaggZZNNCC9u9u/a/a&M&M.I.I3U3U6a6a7}7}VVmmmmkkWWEE5a5a--uuaa]]yy  %%AA"-"-    % %AA(M(M1Y1Y7e7e;q;q=m=m=i=i,U,UAA--))%%      ! !==99%% ! !== Y Y'e'e<q<q<m<m;Y;Y)E)E!! 11=]=]VVXXXXFF6i6i(E(E  }}iieeaa]]YYee        %%11==IIEEAA==99&U&U/q/qEEUU``ggkkllkkXXGG8i8i*E*EAA==995511==IIUUAA--  qqmmiieeaammyy   - -99*E*E#A#A==99EE$Q$Q(M(M*I*I*E*E)Q)Q'M'M$I$I!E!EAA==))%%!!-- 9 9 5 5!!    ))%%!!  ))55   CUEX0j!j!!!,.DAOXjj 0 @ uP 0 uP&`8CDTXJoin us now KC we have the software Richard Stalc lmancK BSINFMTYPEND!NER58libcdio-2.2.0/test/data/t1.toc000066400000000000000000000001661474051130400160450ustar00rootroot00000000000000// simplest cue sheet TRACK AUDIO NO COPY // so that all CTL flags are 0 SILENCE 0:0:74 // frames are just under 75 libcdio-2.2.0/test/data/t10.toc000066400000000000000000000001601474051130400161170ustar00rootroot00000000000000// non default CTL flag of track 1 TRACK AUDIO COPY NO PRE_EMPHASIS FOUR_CHANNEL_AUDIO FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/t2.toc000066400000000000000000000002641474051130400160450ustar00rootroot00000000000000// additional pre-gap for track 1 TRACK AUDIO NO COPY // so that all CTL flags are 0 FILE "cdda.bin" 0:59:0 // Seconds are just under 60 START 0:10:0 // 10 second pre-gap libcdio-2.2.0/test/data/t3.toc000066400000000000000000000004751474051130400160520ustar00rootroot00000000000000// simplest cue sheet for two tracks TRACK AUDIO NO COPY // so that all CTL flags are 0 FILE "cdda.bin" 180:0:0 // 180 for number of minutes is okay, although // it is not for a second or a frame value. TRACK AUDIO NO COPY // so that all CTL flags are 0 FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/t4.toc000066400000000000000000000001551474051130400160460ustar00rootroot00000000000000// non default CTL flag of track 1 TRACK AUDIO COPY PRE_EMPHASIS FOUR_CHANNEL_AUDIO FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/t5.toc000066400000000000000000000001341474051130400160440ustar00rootroot00000000000000// test catalog number CATALOG "1234567890123" TRACK AUDIO NO COPY FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/t6.toc000066400000000000000000000001221474051130400160420ustar00rootroot00000000000000// test ISRC code TRACK AUDIO NO COPY ISRC "DEMUA9800001" FILE "cdda.bin" 1:0:0 libcdio-2.2.0/test/data/t7.toc000066400000000000000000000002561474051130400160530ustar00rootroot00000000000000// check two tracks with pre-gap and ISRC TRACK AUDIO NO COPY FILE "cdda.bin" 1:0:0 TRACK AUDIO NO COPY ISRC "DEMUA9800001" FILE "cdda.bin" 1:0:0 START 0:5:0 // pre-gap libcdio-2.2.0/test/data/t8.toc000066400000000000000000000002451474051130400160520ustar00rootroot00000000000000// check index increments TRACK AUDIO NO COPY FILE "cdda.bin" 0:10:0 INDEX 1:0:0 INDEX 2:0:0 TRACK AUDIO NO COPY FILE "cdda.bin" 0:10:0 START 0:5:0 // pre-gap libcdio-2.2.0/test/data/t9.toc000066400000000000000000000006061474051130400160540ustar00rootroot00000000000000CD_DA // check mulitple tracks CATALOG "0724385356926" TRACK AUDIO ISRC "USEM39600078" COPY FILE "cdda.bin" 0:10:0 START 0:5:0 TRACK AUDIO NO COPY ISRC "USEM39600079" FILE "cdda.bin" 0:10:0 START 0:2:0 TRACK AUDIO COPY FILE "cdda.bin" 0:10:0 START 0:1:30 TRACK AUDIO NO COPY START 0:0:0 FILE "cdda.bin" 0:10:0 TRACK AUDIO ISRC "EDUMA9892346" NO COPY FILE "cdda.bin" 0:10:0 START 0:2:1 libcdio-2.2.0/test/data/test-udf1.iso000066400000000000000000033640001474051130400173450ustar00rootroot00000000000000CD001LINUX CDROM   "p$ GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM 2012012321161100201201232116110000000000000000002012012321161100 CD001LINUX CDROM %/E  "p$ GENISOIMAGE ISO 9660_HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE 2012012321161100201201232116110000000000000000002012012321161100 CD001BEA01NSR02TEA01mP CDROM4F1E146B00002710OSTA Compressed UnicodeOSTA Compressed Unicode *genisoimage!*UDF LV InfoOSTA Compressed UnicodeCDROM*genisoimage[@"+NSR02&*genisoimageOd#OSTA Compressed UnicodeCDROM*OSTA UDF Compliant*genisoimage@m$ %mP0CDROM4F1E146B00002710OSTA Compressed UnicodeOSTA Compressed Unicode *genisoimage1*UDF LV InfoOSTA Compressed UnicodeCDROM*genisoimage[@2+NSR02&*genisoimage_d3OSTA Compressed UnicodeCDROM*OSTA UDF Compliant*genisoimage@m405 v@ .&*genisoimage<A 0F OSTA Compressed UnicodeCDROMOSTA Compressed UnicodeCDROM*OSTA UDF Compliant+20$$$*genisoimageGb  mw COPYING\P README50K$$$*genisoimageKh0$$$*genisoimage#p$SPRRPX$AATFp$p p$CEfp RRPX$mAAmTFp p p |KKp$ COPYING.;1RRNM COPYINGPX$TFp$p$p$x$$p$ README.;1RRNM READMEPX$TFp$p$p$"p$"p 0KKp$COPYING.$$p$ READMEER TRRIP_1991ATHE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICSPLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . This directory contains some simple examples of the use of the libcdio library. One might also possibly find useful C code among the regression tests (directory test), e.g. testbincue.c, testdefault.c, testiso9660.c, testparanoia.c, or testtoc.c Larger more-complicated examples are the cd-drive, cd-info, cd-read, cdda-player, iso-info and iso-read programs in the src directory. And going further there's the cd-paranoia program (in src/cd-paranoia), and "real-world' code in the xine VCD plugin, or the vlc CD-DA plugin which are part of those distributions. In some cases you may have to make small changes to compile these programs. For example, compiling using Solaris's C compiler with largefile support on a 64-bit system, may require changing C headers. Descriptions of the programs in this example directory are as follows... audio.c: Sample program to show audio controls. cdchange.c: A program to test if a CD has been changed since the last change test. cdio-eject.c: a stripped-down "eject" command to open or close a CDROM tray cdtext.c: A program to show CD-Text and CD disc mode info. discid.c: http://sourceforge.net/projects/discid/ using libcdio: a small program to calculate the disc-ID for audio compact discs. The disc-ID can be used to query info (tracks, title, interpret) about compact audio discs from a CDDB-Server. drives.c: A program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. eject.c: A program eject a CD from a CD-ROM drive and then close the door again. extract.c: Extract the full contents of either an UDF or ISO9660 image file. isofile.c: A program to show using libiso9660 to extract a file from an ISO-9660 image. isofile2.c: A program to show using libiso9660 to extract a file from a CDRWIN cue/bin CD image. isofuzzy.c : A program showing fuzzy ISO-9660 detection/reading. isolist.c: A program to show using libiso9660 to list files in a directory of an ISO-9660 image and give basic iso9660 information. isolsn.c: A program to show using libiso9660 to get the file path for a given LSN. mmc1.c: A program to show issuing a simple MMC command (INQUIRY). mmc2.c: A more involved MMC command to list features from a MMC GET_CONFIGURATION command. mmc2a.c: Show MODE_SENSE page 2A paramaters: CD/DVD Capabilities and Mechanical Status Page paranoia: A program to show using CD-DA paranoia (a library for jitter detection and audio-read error correction). This program uses an interface compatible (mostly) with cdparanoia. It looks for a CD-ROM with an audio CD in it and rips up to the first 300 sectors of track 1 to file track01s.wav. paranoia2: Another program to show using CD-DA paranoia using a more libcdio-oriented initialization. Probably more suited to things that otherwise use libcdio such as media players (e.g. for getting CDDB or CD-Text info) sample2.c: A simple program to show drivers installed and what the default CD-ROM drive is. sample3.c: A simple program to show the use of cdio_guess_cd_type(). Figure out the kind of CD image we've got. sample4.c: A slightly improved sample3 program: we handle cdio logging and take an optional CD-location. tracks.c: A program to list track numbers and logical sector numbers of a Compact Disc using libcdio. udf1.c: A program to show using libudf to list files in a directory of an UDF image. udf2.c: A program to show using libudf to extract a file from an UDF image. Many of the above programs can be compiled in C++. See that directory for C++ examples which include some of the above. & 0' 0( 0) 0* 0+ 0, 0- 0. 0/ 00 01 02 03 04 05 06 07 08 09 0: 0 ; 0 < 0 = 0 > 0 ? 0@ 0A 0B 0C 0D 0E 0F 0G 0H 0I 0J 0K 0L 0M 0N 0O 0P 0Q 0 R 0!S 0"T 0#U 0$V 0%W 0&X 0'Y 0(Z 0)[ 0*\ 0+] 0,^ 0-_ 0.` 0/a 00b 01c 02d 03e 04f 05g 06h 07i 08j 09k 0:l 0;m 0<n 0=o 0>p 0?q 0@r 0As 0Bt 0Cu 0Dv 0Ew 0Fx 0Gy 0Hz 0I{ 0J| 0K} 0L~ 0M 0N 0O 0P 0Q 0R 0S 0T 0U 0V 0W 0X 0Y 0Z 0[ 0\ 0] 0^ 0_ 0` 0a 0b 0c 0d 0e 0f 0g 0h 0i 0j 0k 0l 0m 0n 0o 0p 0q 0r 0s 0t 0u 0v 0w 0x 0y 0z 0{ 0| 0} 0~ 0 0 0 0 0 0 0 0 0 0 0 0 0libcdio-2.2.0/test/data/udf102.iso000066400000000000000000046000001474051130400165240ustar00rootroot00000000000000BEA01NSR02TEA01_R F6vrier44540B4A00000257!OSTA Compressed UnicodeOSTA Compressed Unicode*ImgBurn v2.5.8.0V *ImgBurn:!*UDF LV InfoOSTA Compressed UnicodeF6vrier*ImgBurn#W"+NSR02Q*ImgBurnl#OSTA Compressed UnicodeF6vrier*OSTA UDF Compliant*ImgBurn@m$!%_R0F6vrier44540B4A00000257!OSTA Compressed UnicodeOSTA Compressed Unicode*ImgBurn v2.5.8.0V *ImgBurn:1*UDF LV InfoOSTA Compressed UnicodeF6vrier*ImgBurn3W2+NSR02Q*ImgBurnl3OSTA Compressed UnicodeF6vrier*OSTA UDF Compliant*ImgBurn@m415 wv@V .*ImgBurn=A 0B3V OSTA Compressed UnicodeF6vrierOSTA Compressed UnicodeF?Tvrier*OSTA UDF Compliant" dV V V *ImgBurn dGb ,F6vrierX   !A  P!. P!.*ImgBurn  0123456789/_ 0libcdio-2.2.0/test/data/vcd2.toc000066400000000000000000000005461474051130400163610ustar00rootroot00000000000000// Taken from one of Steve Schultz's VCD collection. // The .bin and offsets have been changed and are wrong. CD_ROM_XA // Track 1 TRACK MODE2_FORM_MIX COPY DATAFILE "../data/cdda.bin" 00:00:00 // comment // Track 2 TRACK MODE2_FORM_MIX COPY DATAFILE "cdda.bin" #100 00:00:03 // Track 3 TRACK MODE2_FORM_MIX COPY DATAFILE "cdda.bin" #200 00:00:25 libcdio-2.2.0/test/data/vcd_demo.toc000066400000000000000000000003341474051130400172760ustar00rootroot00000000000000CD_ROM_XA TRACK MODE2_RAW COPY FILE "vcd_demo.bin" 00:00:00 00:13:57 TRACK MODE2_RAW COPY FILE "vcd_demo.bin" 00:13:57 00:07:14 START 00:02:00 TRACK MODE2_RAW COPY FILE "vcd_demo.bin" 00:20:71 00:05:14 START 00:02:00 libcdio-2.2.0/test/data/videocd.nrg000066400000000000000000120215101474051130400171360ustar00rootroot00000000000000  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V  5arb#g5HpSt.B!V CD001CD-RTOS CD-BRIDGE SVIDEOCD @@"N PUBL_ID GNU VCDIMAGER CHECK MODE SVIDEOCD.APP;1 1978071400000000197807140000000000000000000000000000000000000000CD-XA001dTa}nVNF,:xb[kôx x-z{5d\gK ;!RE= 2;?:Yh O;Sٸ3!CQXܭjX`4>a5t@K(B >ӼxmnSS0=\0elg?oEBR_C'B#Dqj*W AcDxlG3|9z"!EVwАD`CD001%0x oPTU<Ji`PT  ,DQ/"31S`~kÕɭG0NUXA0NUXA2NEXT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Fn[@MOJ,0ԧt'l|UP x6m  3z4x04 _&|VHކf{\ ((_ AaeH!5:F|mca QHi Z:d'2D% M!rҍSawT!0rw.cE $t/?p5}bV)CӾ`k'(iJ93kb:d`!bUv$72uG_%$Y|~G+_^zBFG43S uX&(喜MNoFXdZnQm@LCbra@Pg Ih~r+^XN8` I/XkZ$ Q[>l `@ @1,B Lp*QH,4AHGQ웂X4 @0(^Hhjid|u5=@I dwuedy57xMݣ]hseN}y\u0n+(tD]T( _zM".W".VIxTEJMt@-DED]48UΈ WrUPtv͢/H}\"0x14EH".RJR")H+})H".RJR"#tn2PΒOK /\PMuEqeK@"DK"/.0E4E@t`@%˸PD_h @2]:E}'0%D H֓"#Kiw#<.%܌ }YpŗP OL&'qC~{؀8N^MH`rF#d១ JٝPB,x^P3lLFPomٶt|짼!h0(L,BI'êHbJ-%|:bˈ B` evW%Yc; !dLHj@v I1$R8b9/ts?m3e-^Y~vRIRVNJ%*i4@aI-"Swh,X@ @t#d11(OVXW_[|@@0vMR*ri0nws[ :7Sd4 :0b)Hh`g i j@LL A4 HiH)='d'v:rS{F=%b4``!0ҒYF~걀P@a)Y-3+]sw .K&C 'dZv?o8!DK."rpԨ1QI-9kK,\0izZ =`'7}xi~%덀`"_k-@%>DEp%r@"$K,]'GH Io J䌍m@0R^+$SLucm@*&|,"P %n` vJR7 zj^e)KТ)HfKH".RJR"!+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR""+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"#+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"$+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"B!!4xPPˀh@"7$M1`PaEԍ[<pE~v Td.H 8ad(Q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ZC8N0A߀v %%n3߿ôʩPL!P䆧5L ΫY! WFb߲NKBנ`P+L!cIIx0 6- %Q%ll@ zJ)ebhd%h 7%=0a}F=u BPN+(p@0pB?(d/C8: @`)JIXԗz2Ys)wLDX@'7bD0OBC`ݪB ]; Q.W3$Xj8j0qt!-JKt{J$mɀ@') WK,bKN-< 7!)A@PO倥%V+k(@ VpQHG0`)O@a|+n;c -_Ajz0j:rw qa۝"dXpa1@)$,XԁiBF!;d71$MH%`{lҮub<*@ 8 ` p @`aZ>tWt%{  0 0 & b ۀdž ,5K>КJ5#:u,H7!p _ \jU?( $ zIEtdwct|L,ܢQ\3~5;λ@b0(f&Ryۭ]@5PC&(&'|Y !8ݳ fF+Z:#߫-V€v+tP C &|+equp dǁ^MBK #!BoN`d PR K `N`X啺G(3dw= 0 @0SPh9pSj!b(Q05 U` 5iN`zؚ (i/~Y+#l%1GޜXL! 8i,Zm%O4JA Qbb!] `&1_,@# @dR".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"+})H".RJR")H".RJR")HSDXޚ"֑EGB"#DXER)ZGGZ;B""ЈH".R:)HX^ER)4 00/sw5 ' &kts+ӓ|K` ou|_XpF&_LM!a`1%wg;vy$ 7&ɣa֜>,psbp"  J, bb!g! @ KJ!4axOG|d^C4Q#уp1r[=004sw5 ǡ(ىG]LirCv$|RWI.]^YT-.<}Y0>1([3!P`8GNAk퓺?uI! Ɗ(1( x <{^0nˆp0ҀMHTy|7c @N N@pӂT|G^L =n3v*!0`;O4AQ|fYY)K}*!)O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OK /\PMuEqeK@"DK"/.0E4E@t`@%˸PD_h @2]:E}'0%D H֓"#Kiw#<.%܌ }YpŗP OL&'qC~{؀8N^MH`rF#d១ JٝPB,x^P3lLFPomٶt|짼!h0(L,BI'êHbJ-%|:bˈ B` evW%Yc; !dLHj@v I1$R8b9/ts?m3e-^Y~vRIRVNJ%*i4@aI-"Swh,X@ @t#d11(OVXW_[|@@0vMR*ri0nws[ :7Sd4 :0b)Hh`g i j@LL A4 HiH)='d'v:rS{F=%b4``!0ҒYF~걀P@a)Y-3+]sw .K&C 'dZv?o8!DK."rpԨ1QI-9kK,\0izZ =`'7}xi~%덀`"_k-@%>DEp%r@"$K,]'GH Io J䌍m@0R^+$SLucm@*&|,"P %n` vJR7 zj^e)KТ)HfKH".RJR"!+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR""+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"#+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"$+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"B!!4xPPˀh@"7$M1`PaEԍ[<pE~v Td.H 8ad(QY; V04era_==g9?g@oa?.p L0[J.lH" })H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H" })H".RJR")H".RJR")H".RJR")HR)Hm R)Hm R)Hm R)Hm R`|<; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 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tdwct|L,ܢQ\3~5;λ@b0(f&Ryۭ]@5PC&(&'|Y !8ݳ fF+Z:#߫-V€v+tP C &|+equp dǁ^MBK #!BoN`d PR K `N`X啺G(3dw= 0 @0SPh9pSj!b(Q05 U` 5iN`zؚ (i/~Y+#l%1GޜXL! 8i,Zm%O4JA Qbb!] `&1_,@# @dR".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"+})H".RJR")H".RJR")HSDXޚ"֑EGB"#DXER)ZGGZ;B""ЈH".R:)HX^ER)4 00/sw5 ' &kts+ӓ|K` ou|_XpF&_LM!a`1%wg;vy$ 7&ɣa֜>,psbp"  J, bb!g! @ KJ!4axOG|d^C4Q#уp1r[=004sw5 ǡ(ىG]LirCv$|RWI.]^YT-.<}Y0>1([3!P`8GNAk퓺?uI! Ɗ(1( x <{^0nˆp0ҀMHTy|7c @N N@pӂT|G^L =n3v*!0`;O4AQ|fYY)K}*!)OsCuA JŠBq7&R6S| :)% +Zs71M쒜R1N}3F#\mm} @@tB D_:  @H Ġ2VAvazhOA3;2!$?8Wty0^<%T_I{OKa9w Tw;BBX_HO&m1%|/M&dW^M!~QFl%>$g GyaHen=³> ܚMa_̥i~ȄI8$_ A5w@@PY+s7_r@0 $y-(ԿŶ蚔R$|g!OD@ ( 0 ~P2%?71!@w鲑JO`;&6 %pߜ#3?/潸N(r G{EjqWR|FLp*OR9y@90X"d4R ӂX̰>X?!IA_~^p7Rz2])!Հf,bCx2H`:&@;-x_}(Ok@hJ&`L C,P~z17 s `K @_ؾ^_lM  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izZ =`'7}xi~%덀`"_k-@%>DEp%r@"$K,]'GH Io J䌍m@0R^+$SLucm@*&|,"P %n` vJR7 zj^e)KТ)HfKH".RJR"!+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR""+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"#+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"$+})H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR"B!!4xPPˀh@"7$M1`PaEԍ[<pE~v Td.H 8ad(QY; V04era_==g9?g@oa?.p L0[J.lH" })H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H" })H".RJR")H".RJR")H".RJR")HR)Hm R)Hm R)Hm R)Hm R`|<; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SCAN_VCD $  '"""\~Îb~tjdx8:d-xx1?:52< v&6+?.ᒝgo4d{?I wE,柂$+gAj+[(mxV,ߌ[ 3-挸RZzpX6tgV bb!A .`edd!"  +'%bb!, `.1  !! !##$##!%&''&%)***)----010448@  })H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RJR")H".RzB8 I7A=yl<Ҕ/)H".RJ~!$`.ZYh8d`= 5Z@1\ 5#ru X8yK@0 @*1,k|0)^T 1\ U&ąKĮ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@j @10 HH%3 C@07nP@Wp  !CC C咐+W<_@@(4pXNLC0 d *QDD-eϻ&5!ҋ -r)H".RJR")Hvu蓼p@@j @ M p@E@4*30&P 4 ` @vMrhh ,0dD  @P(XbO€hbPKeo@~'$ @ @t`VrL1J! ʸa4& :9xx> bP 7,0wɡh A.(0 Ed ^5v@@aC Ԅɣ0!}g @ `h @'`np! Bp@< I@d’w`M,$%7%0 A0p j _@00@9@9 ! H`T3L +w8@ @=  * `@@L( L &H@LI\(l$ P*LIx)ЎX 7TJ @F$@ @p @ p]N`J Z(I A @`@, @V @@@LP @g b(DA@:@O3\@ @4 bh , `@Gb(d@ @4  $Ƿh @ "f@+A< h @1 !Q `;&,@g#@x4ɩزX()(?OBOP@- @ #pp@3!$ H@1tH@0H@NXok1 N P@*8@`@1DXA Z bRX`0(Xw&!Y(A_0d  a/LEL=  `D,f& $=y p 7  M/r@ m`L ɠ DX%6 OY`7bjRR[l\`» @L<!X& b @X: CId@4A@:L&f) P 2P 2 00@F  ` W;xA :vBAa?`D]` `?H `j d0x m 76 > \ Q '5Qdw@ځ@b AXo3,b@nH Sj@  @ Q Y 0 9!jLtlfh,    C`MC$4( 3i9Wz   C!%_$02<0 AINl,@  R @  Wldd!9@ !hűl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZ 33DfffffUUU$mI wwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZ 33DfffffUUU$mI wwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{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h @ "f@+A< h @1 !Q `;&,@g#@x4ɩزX()(?OBOP@- @ #pp@3!$ H@1tH@0H@NXok1 N P@*8@`@1DXA Z bRX`0(Xw&!Y(A_0d  a/LEL=  `D,f& $=y p 7  M/r@ m`L ɠ DX%6 OY`7bjRR[l\`» @L<!X& b @X: CId@4A@:L&f) P 2P 2 00@F  ` W;xA :vBAa?`D]` `?H `j d0x m 76 > \ Q '5Qdw@ځ@b AXo3,b@nH Sj@  @ Q Y 0 9!jLtlfh,    C`MC$4( 3i9Wz   C!%_$02<0 AINl,@  R @  Wldd!9@ !hűl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZ 33DfffffUUU$mI wwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZ 33DfffffUUU$mI wwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZ 33DfffffUUU$mI wwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{{{l[űmkZwwwwww{{{{wwwwwwwwwwwwwww[űlmoֵ{{{{{űl[m浭wwwwww{{{{{wwwwwwwwwwwwwwul[mk]{{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?ETNFd``q@`:  SINFEND!NERO("libcdio-2.2.0/test/deep_directory.right000066400000000000000000000070731474051130400201450ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: dr-xr-xr-x 3 0 0 [LSN 23] 2048 May 29 2020 15:32:43 . dr-xr-xr-x 3 0 0 [LSN 23] 2048 May 29 2020 15:32:43 .. dr-xr-xr-x 3 0 0 [LSN 32] 2048 May 28 2020 16:14:19 1 /1/: dr-xr-xr-x 3 0 0 [LSN 32] 2048 May 28 2020 16:14:19 . dr-xr-xr-x 4 0 0 [LSN 23] 2048 May 29 2020 15:32:43 .. dr-xr-xr-x 3 0 0 [LSN 33] 2048 May 28 2020 16:14:21 2 /1/2/: dr-xr-xr-x 3 0 0 [LSN 33] 2048 May 28 2020 16:14:21 . dr-xr-xr-x 3 0 0 [LSN 32] 2048 May 28 2020 16:14:19 .. dr-xr-xr-x 3 0 0 [LSN 34] 2048 Apr 29 2020 22:35:20 3 /1/2/3/: dr-xr-xr-x 3 0 0 [LSN 34] 2048 Apr 29 2020 22:35:20 . dr-xr-xr-x 3 0 0 [LSN 33] 2048 May 28 2020 16:14:21 .. dr-xr-xr-x 3 0 0 [LSN 35] 2048 Apr 29 2020 22:35:24 4 /1/2/3/4/: dr-xr-xr-x 3 0 0 [LSN 35] 2048 Apr 29 2020 22:35:24 . dr-xr-xr-x 3 0 0 [LSN 34] 2048 Apr 29 2020 22:35:20 .. dr-xr-xr-x 3 0 0 [LSN 36] 2048 Apr 29 2020 22:35:27 5 /1/2/3/4/5/: dr-xr-xr-x 3 0 0 [LSN 36] 2048 Apr 29 2020 22:35:27 . dr-xr-xr-x 3 0 0 [LSN 35] 2048 Apr 29 2020 22:35:24 .. dr-xr-xr-x 3 0 0 [LSN 37] 2048 May 28 2020 16:16:34 6 /1/2/3/4/5/6/: dr-xr-xr-x 3 0 0 [LSN 37] 2048 May 28 2020 16:16:34 . dr-xr-xr-x 3 0 0 [LSN 36] 2048 Apr 29 2020 22:35:27 .. dr-xr-xr-x 3 0 0 [LSN 38] 2048 May 28 2020 17:16:58 7 /1/2/3/4/5/6/7/: dr-xr-xr-x 3 0 0 [LSN 38] 2048 May 28 2020 17:16:58 . dr-xr-xr-x 3 0 0 [LSN 37] 2048 May 28 2020 16:16:34 .. -r-xr-xr-x 1 0 0 [LSN 43] 7 May 28 2020 16:15:56 7.txt dr-xr-xr-x 3 0 0 [LSN 25] 2048 May 28 2020 16:16:05 8 /1/2/3/4/5/6/7/8/: dr-xr-xr-x 3 0 0 [LSN 25] 2048 May 28 2020 16:16:05 . dr-xr-xr-x 4 0 0 [LSN 24] 2048 May 28 2020 17:16:58 .. -r-xr-xr-x 1 0 0 [LSN 40] 7 May 28 2020 16:16:15 8.txt dr-xr-xr-x 3 0 0 [LSN 26] 2048 May 28 2020 16:13:50 9 /1/2/3/4/5/6/7/8/9/: dr-xr-xr-x 3 0 0 [LSN 26] 2048 May 28 2020 16:13:50 . dr-xr-xr-x 3 0 0 [LSN 25] 2048 May 28 2020 16:16:05 .. dr-xr-xr-x 3 0 0 [LSN 27] 2048 May 28 2020 16:14:27 10 /1/2/3/4/5/6/7/8/9/10/: dr-xr-xr-x 3 0 0 [LSN 27] 2048 May 28 2020 16:14:27 . dr-xr-xr-x 3 0 0 [LSN 26] 2048 May 28 2020 16:13:50 .. dr-xr-xr-x 3 0 0 [LSN 28] 2048 May 28 2020 16:14:32 11 /1/2/3/4/5/6/7/8/9/10/11/: dr-xr-xr-x 3 0 0 [LSN 28] 2048 May 28 2020 16:14:32 . dr-xr-xr-x 3 0 0 [LSN 27] 2048 May 28 2020 16:14:27 .. dr-xr-xr-x 3 0 0 [LSN 29] 2048 May 28 2020 16:14:37 12 /1/2/3/4/5/6/7/8/9/10/11/12/: dr-xr-xr-x 3 0 0 [LSN 29] 2048 May 28 2020 16:14:37 . dr-xr-xr-x 3 0 0 [LSN 28] 2048 May 28 2020 16:14:32 .. dr-xr-xr-x 3 0 0 [LSN 30] 2048 May 28 2020 17:17:00 13 /1/2/3/4/5/6/7/8/9/10/11/12/13/: dr-xr-xr-x 3 0 0 [LSN 30] 2048 May 28 2020 17:17:00 . dr-xr-xr-x 3 0 0 [LSN 29] 2048 May 28 2020 16:14:37 .. -r-xr-xr-x 1 0 0 [LSN 41] 8 May 28 2020 16:45:15 13.txt dr-xr-xr-x 2 0 0 [LSN 31] 2048 May 28 2020 16:46:40 14 /1/2/3/4/5/6/7/8/9/10/11/12/13/14/: dr-xr-xr-x 2 0 0 [LSN 31] 2048 May 28 2020 16:46:40 . dr-xr-xr-x 4 0 0 [LSN 24] 2048 May 28 2020 17:17:00 .. -r-xr-xr-x 1 0 0 [LSN 42] 8 May 28 2020 16:17:21 14.txt libcdio-2.2.0/test/driver/000077500000000000000000000000001474051130400153715ustar00rootroot00000000000000libcdio-2.2.0/test/driver/.gitignore000066400000000000000000000003211474051130400173550ustar00rootroot00000000000000/*.exe /*.o /*~ /.deps /.libs /Makefile /Makefile.in /abs_path /bincue /bincue /cdda /cdrdao /cdtext /follow_symlink /freebsd /gnu_linux /logger /mmc_read /mmc_write /nrg /osx /realpath /solaris /track /win32 libcdio-2.2.0/test/driver/Makefile.am000066400000000000000000000051271474051130400174320ustar00rootroot00000000000000# Copyright (C) 2009, 2010, 2012, 2017 Rocky Bernstein # # 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 # the Free Software Foundation, either version 3 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 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . .PHONY: check-leaks test check-short DATA_DIR = $(abs_top_srcdir)/test/data AM_CPPFLAGS = $(LIBCDIO_CFLAGS) $(LIBISO9660_CFLAGS) -DDATA_DIR=\"$(DATA_DIR)\" abs_path_SOURCES = abs_path.c abs_path_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) bincue_SOURCES = helper.c bincue.c bincue_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdda_SOURCES = helper.c cdda.c cdda_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdrdao_SOURCES = helper.c cdrdao.c cdrdao_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) cdtext_SOURCES = cdtext.c cdtext_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) freebsd_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) realpath_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) gnu_linux_SOURCES= helper.c gnu_linux.c gnu_linux_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) logger_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) mmc_read_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) mmc_write_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) nrg_SOURCES = helper.c nrg.c nrg_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) osx_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) track_SOURCES = track.c track_LDADD = $(LIBCDIO_LIBS) solaris_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) win32_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) check_PROGRAMS = \ abs_path bincue cdda cdrdao cdtext freebsd gnu_linux \ logger mmc_read mmc_write nrg \ osx realpath solaris track win32 TESTS = $(check_PROGRAMS) EXTRA_DIST = \ bincue.c \ helper.c \ helper.h \ cdrdao.c \ cdtext.c \ nrg.c \ track.c MOSTLYCLEANFILES = \ $(check_PROGRAMS) \ core core.* *.dump cdda-orig.wav cdda-try.wav *.raw #: run regression tests. "test" is the same thing as "check" test: check-am #: run valgrind on C progrma check-leaks: $(check_PROGRAMS) for p in $(check_PROGRAMS); do \ valgrind ./$$p; \ done #: Run all tests without bloated output check-short: $(MAKE) check 2>&1 | ruby @abs_top_srcdir@/make-check-filter.rb libcdio-2.2.0/test/driver/abs_path.c000066400000000000000000000015041474051130400173160ustar00rootroot00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif char *cdio_abspath(const char *cwd, const char *fname); char *cdio_dirname(const char *fname); int main(int argc, const char *argv[]) { const char *cue_filename[] = { "/tmp/foo.bar", "foo.bar" }; const char *expect[] = { "/tmp/baz", "./baz" }; int rc=0; int i; for (i=0; i<2; i++) { char *dirname = cdio_dirname(cue_filename[i]); char *dest = cdio_abspath(dirname, "baz"); if (0 != strcmp(expect[i], dest)) { fprintf(stderr, "Incorrect: expecting %s, got %s.\n", expect[i], dest); rc=i+1; } free(dirname); free(dest); } exit(rc); } libcdio-2.2.0/test/driver/bincue.c000066400000000000000000000074721474051130400170140ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2004, 2006, 2008, 2010, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for BIN/CUE device driver: lib/driver/image/bincue.c. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include /* chdir */ #endif #include #include #include "helper.h" #ifndef DATA_DIR #define DATA_DIR "../data" #endif #define NUM_GOOD_CUES 2 #define NUM_BAD_CUES 7 int main(int argc, const char *argv[]) { const char *cue_file[NUM_GOOD_CUES] = { "cdda.cue", "isofs-m1.cue", }; const char *badcue_file[NUM_BAD_CUES] = { "bad-cat1.cue", "bad-cat2.cue", "bad-cat3.cue", "bad-mode1.cue", "bad-msf-1.cue", "bad-msf-2.cue", "bad-msf-3.cue", }; int ret=0; unsigned int i; char psz_cuefile[500]; unsigned int verbose = (argc > 1); psz_cuefile[sizeof(psz_cuefile)-1] = '\0'; cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; for (i=0; i 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for cdda-like things lib/driver/disc.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include "helper.h" int main(int argc, const char *argv[]) { char *mcn; cdio_get_mcn(NULL); cdio_log_set_handler(log_handler); cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* Had a bug in not testing for null p_cdio with cdio_get_mcn. */ mcn = cdio_get_mcn(NULL); if (mcn != NULL) { printf("Should have gotten NULL for MCN for cdio object\n"); return 1; } return 0; } libcdio-2.2.0/test/driver/cdrdao.c000066400000000000000000000101361474051130400167720ustar00rootroot00000000000000/* Copyright (C) 2004, 2008, 2010, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for cdio_tocfile. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include /* chdir */ #endif #include #include #include "helper.h" #ifndef DATA_DIR #define DATA_DIR "../data" #endif #define NUM_GOOD_TOCS 17 #define NUM_BAD_TOCS 8 int main(int argc, const char *argv[]) { const char *toc_file[NUM_GOOD_TOCS] = { "cdtext.toc", "t1.toc", "t2.toc", "t3.toc", "t4.toc", "t5.toc", "t6.toc", "t7.toc", "t8.toc", "t9.toc", "t10.toc", "data1.toc", "data2.toc", "data5.toc", "data6.toc", "data7.toc", "vcd2.toc", }; const char *badtoc_file[NUM_BAD_TOCS] = { "bad-msf-1.toc", "bad-msf-2.toc", "bad-msf-3.toc", "bad-cat1.toc", "bad-cat2.toc", "bad-cat3.toc", "bad-file.toc", "bad-mode1.toc" }; int ret=0; unsigned int i; char psz_tocfile[500]; unsigned int verbose = (argc > 1); #ifdef HAVE_CHDIR if (0 == chdir(DATA_DIR)) #endif { psz_tocfile[sizeof(psz_tocfile)-1] = '\0'; cdio_loglevel_default = verbose ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; for (i=0; i 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Performs some regression tests concerning: * the association of numerical language codes and language names, and * the handling of all language codes, valid and invalid. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include static int language_code_tests(void) { cdtext_lang_t num, re_num; char *text; int i; int rc=0; static cdtext_lang_t spot_codes[] = { CDTEXT_LANGUAGE_ENGLISH, CDTEXT_LANGUAGE_WALLON , CDTEXT_LANGUAGE_ZULU, CDTEXT_LANGUAGE_MALAGASAY, CDTEXT_LANGUAGE_AMHARIC }; static const char *spot_names[] = { "English", "Wallon", "Zulu", "Malagasay", "Amharic" }; static int spots = 5; for (i = 0; i < spots; i++) { if (0 != strcmp(cdtext_lang2str(spot_codes[i]), spot_names[i])) { fprintf(stderr, "cdtext_lang2str() test: idx %d , code 0x%2.2X : expected '%s' , got '%s'\n", i, (unsigned int) spot_codes[i], spot_names[i], cdtext_lang2str(spot_codes[i])); rc++; } } for (i = 0; i <= 0xFF; i++) { num = i; text = (char *) cdtext_lang2str(num); re_num = cdtext_str2lang(text); if ((i > CDTEXT_LANGUAGE_WALLON && i < CDTEXT_LANGUAGE_ZULU) || i > CDTEXT_LANGUAGE_AMHARIC) { if (0 != strcmp(text, "INVALID")) { fprintf(stderr, "cdtext_lang2str() test: invalid code 0x%2.2X yields '%s'\n", (unsigned int) i, text); rc++; } if (CDTEXT_LANGUAGE_INVALID != re_num) { fprintf(stderr, "cdtext_str2lang(cdtext_lang2str()) test: invalid code 0x%2.2X yields 0x%2.2X, expected 0x%2.2X\n", (unsigned int) i, (unsigned int) re_num, (unsigned int) CDTEXT_LANGUAGE_INVALID); rc++; } } else { if (re_num != num) { fprintf(stderr, "cdtext_str2lang(cdtext_lang2str()) test: code 0x%2.2X yields '%s' yields 0x%2.2X\n", (unsigned int) i, text, (unsigned int) re_num); rc++; } } } return rc; } int main(int argc, const char *argv[]) { int rc = language_code_tests(); return rc; } libcdio-2.2.0/test/driver/freebsd.c000066400000000000000000000045421474051130400171540ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/freebsd.c */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives=NULL; cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", TEST_DIR, cue_file[i]); */ if (!cdio_have_driver(DRIVER_FREEBSD)) return(77); p_cdio = cdio_open_am (NULL, DRIVER_UNKNOWN, NULL); if (p_cdio) { const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); if (0 != strncmp(psz_access_mode, "ioctl", strlen("ioctl")) && 0 != strncmp(psz_access_mode, "CAM", strlen("CAM"))) { fprintf(stderr, "Got %s; Should get back ioctl or CAM.\n", psz_access_mode); exit(2); } } cdio_destroy(p_cdio); ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(77); } p_cdio = cdio_open_freebsd(ppsz_drives[0]); if (p_cdio) { const char *psz_source = cdio_get_arg(p_cdio, "source"); if (0 != strncmp(psz_source, ppsz_drives[0], strlen(ppsz_drives[0]))) { fprintf(stderr, "Got %s; should get back %s, the name we opened.\n", psz_source, ppsz_drives[0]); exit(1); } } cdio_free_device_list(ppsz_drives); return 0; } libcdio-2.2.0/test/driver/gnu_linux.c000066400000000000000000000050111474051130400175420ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2009, 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/gnu_linux.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include "helper.h" int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives=NULL; cdio_log_set_handler(log_handler); cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", TEST_DIR, cue_file[i]); */ if (!cdio_have_driver(DRIVER_LINUX)) return(77); ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(77); } p_cdio = cdio_open_linux(ppsz_drives[0]); if (p_cdio) { const char *psz_scsi_tuple; lsn_t lsn; reset_counts(); lsn = cdio_get_track_lsn(p_cdio, CDIO_CD_MAX_TRACKS+1); assert_equal_int(CDIO_INVALID_LSN, lsn, "cdio_get_track_lsn with too large of a track number"); reset_counts(); check_get_arg_source(p_cdio, ppsz_drives[0]); check_mmc_supported(p_cdio, 3); psz_scsi_tuple = cdio_get_arg(p_cdio, "scsi-tuple"); if (psz_scsi_tuple == NULL) { fprintf(stderr, "cdio_get_arg(\"scsi-tuple\") returns NULL.\n"); cdio_destroy(p_cdio); exit(3); } if (cdio_loglevel_default == CDIO_LOG_DEBUG) printf("Drive '%s' has cdio_get_arg(\"scsi-tuple\") = '%s'\n", ppsz_drives[0], psz_scsi_tuple); cdio_destroy(p_cdio); } p_cdio = cdio_open_am_linux(ppsz_drives[0], "MMC_RDWR"); if (p_cdio) { check_access_mode(p_cdio, "MMC_RDWR"); } cdio_destroy(p_cdio); cdio_free_device_list(ppsz_drives); return 0; } libcdio-2.2.0/test/driver/helper.c000066400000000000000000000100621474051130400170130ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2010, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include "helper.h" unsigned int info_msg_count=0; unsigned int debug_msg_count=0; unsigned int warn_msg_count=0; unsigned int error_msg_count=0; const char *info_messages[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; const char *debug_messages[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; const char *warn_messages[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; const char *error_messages[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; void assert_equal_int(int expect, int got, const char *msg) { if (expect != got) { fprintf(stderr, "ERROR: Expected %d, got %d\n", expect, got); if (NULL != msg) fprintf(stderr, "%s\n", msg); exit(1); } } void assert_no_warn(const char *msg) { if (warn_msg_count != 0) { unsigned int i; fprintf(stderr, "ERROR: got unexpected warnings:\n"); for (i=0; i expect false 2 => expect true 3 => expect true or false */ void check_mmc_supported(CdIo_t *p_cdio, int i_expected) { const char *psz_response = cdio_get_arg(p_cdio, "mmc-supported?"); if ( psz_response == NULL ) { fprintf(stderr, "cdio_get_arg(\"mmc-supported?\") returned NULL\n"); exit(30); } else if ( (0 == (i_expected & 1)) && (0 == strncmp("false", psz_response, sizeof("false"))) ) { fprintf(stderr, "cdio_get_arg(\"mmc-supported?\") should not return \"false\""); exit(31); } else if ( (0 == (i_expected & 2)) && (0 == strncmp("true", psz_response, sizeof("true"))) ) { fprintf(stderr, "cdio_get_arg(\"mmc-supported?\") should not return \"true\""); exit(32); } } void log_handler(cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: debug_messages[debug_msg_count] = message; debug_msg_count++; return; case CDIO_LOG_INFO: info_messages[info_msg_count] = message; info_msg_count++; return; case CDIO_LOG_ERROR: error_messages[info_msg_count] = message; error_msg_count++; return; default: warn_messages[warn_msg_count] = message; warn_msg_count++; return; } } void reset_counts(void) { info_msg_count = debug_msg_count = warn_msg_count = 0; } libcdio-2.2.0/test/driver/helper.h000066400000000000000000000026471474051130400170320ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2010, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include void check_access_mode(CdIo_t *p_cdio, const char *psz_expected_access_mode); void check_get_arg_source(CdIo_t *p_cdio, const char *psz_expected_source); void check_mmc_supported(CdIo_t *p_cdio, int i_expected); #include void log_handler(cdio_log_level_t level, const char message[]); extern unsigned int info_msg_count; extern unsigned int debug_msg_count; extern unsigned int warn_msg_count; extern const char *info_messages[6]; extern const char *debug_messages[6]; extern const char *warn_messages[6]; extern void assert_equal_int(int expect, int got, const char *msg); extern void reset_counts(void); extern void assert_warn(const char *msg); extern void assert_no_warn(const char *msg); libcdio-2.2.0/test/driver/logger.c000066400000000000000000000101441474051130400170140ustar00rootroot00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include char *last_debugmsg = NULL; char *last_infomsg = NULL; char *last_warnmsg = NULL; char *last_errmsg = NULL; char *last_assertmsg = NULL; char *last_othermsg = NULL; /* Here is an example of a custom log handler. */ static void test_log_handler (cdio_log_level_t level, const char *message) { switch(level) { case CDIO_LOG_DEBUG: last_debugmsg = strdup(message); return; case CDIO_LOG_INFO: last_infomsg = strdup(message); return; case CDIO_LOG_WARN: last_warnmsg = strdup(message); return; case CDIO_LOG_ERROR: last_errmsg = strdup(message); return; case CDIO_LOG_ASSERT: last_assertmsg = strdup(message); return; default: fprintf(stderr, "level %d message: %s should not happen\n", level, message); exit(20); } } int main(int argc, const char *argv[]) { const char *test_msg = "test message"; #ifndef HAVE_WIN32_CDROM cdio_log_handler_t old_log_handler = (cdio_log_handler_t) NULL; old_log_handler = cdio_log_set_handler(test_log_handler); if (old_log_handler != cdio_default_log_handler) { fprintf(stderr, "Should have gotten old log handler back %p vs %p\n", (void *) old_log_handler, (void *) cdio_default_log_handler); exit(1); } #else cdio_log_set_handler(test_log_handler); #endif /* Check that calling each of the logger routine appears in the right variable, based on the log level */ test_msg = "debug"; cdio_debug("%s", test_msg); if (last_debugmsg != NULL) { fprintf(stderr, "debug message should have been ignored due to default log level\n"); exit(2); } cdio_loglevel_default = CDIO_LOG_DEBUG; cdio_debug("%s", test_msg); if (last_debugmsg == NULL || strncmp(test_msg, last_debugmsg, strlen(test_msg)) != 0) { fprintf(stderr, "debug message %s did not get handled\n", last_debugmsg); free(last_debugmsg); exit(2); } free(last_debugmsg); test_msg = "info"; cdio_info("%s", test_msg); if (strncmp(test_msg, last_infomsg, strlen(test_msg)) != 0) { fprintf(stderr, "info message %s did not get handled\n", last_infomsg); free(last_infomsg); exit(3); } free(last_infomsg); test_msg = "warn"; cdio_warn("%s", test_msg); if (strncmp(test_msg, last_warnmsg, strlen(test_msg)) != 0) { fprintf(stderr, "warn message %s did not get handled\n", last_warnmsg); free(last_warnmsg); exit(4); } free(last_warnmsg); test_msg = "error"; cdio_error("%s", test_msg); if (strncmp(test_msg, last_errmsg, strlen(test_msg)) != 0) { fprintf(stderr, "error message %s did not get handled\n", last_errmsg); free(last_errmsg); exit(5); } free(last_errmsg); /* Try using generic cdio_log routine */ test_msg = "debug via cdio_log"; cdio_log(CDIO_LOG_DEBUG, "%s", test_msg); if (strncmp(test_msg, last_debugmsg, strlen(test_msg)) != 0) { fprintf(stderr, "debug message %s did not get handled, phase 2\n", last_debugmsg); free(last_debugmsg); exit(6); } free(last_debugmsg); test_msg = "info via cdio_log"; cdio_log(CDIO_LOG_INFO, "%s", test_msg); if (strncmp(test_msg, last_infomsg, strlen(test_msg)) != 0) { fprintf(stderr, "info message %s did not get handled\n", last_infomsg); free(last_infomsg); exit(7); } free(last_infomsg); test_msg = "warn via cdio_log"; cdio_log(CDIO_LOG_WARN, "%s", test_msg); if (strncmp(test_msg, last_warnmsg, strlen(test_msg)) != 0) { fprintf(stderr, "warn message %s did not get handled\n", last_warnmsg); free(last_warnmsg); exit(8); } free(last_warnmsg); test_msg = "error via cdio_log"; cdio_log(CDIO_LOG_ERROR, "%s", test_msg); if (strncmp(test_msg, last_errmsg, strlen(test_msg)) != 0) { fprintf(stderr, "error message %s did not get handled\n", last_errmsg); free(last_errmsg); exit(9); } free(last_errmsg); exit(0); } libcdio-2.2.0/test/driver/mmc_read.c000066400000000000000000000346111474051130400173110ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2009 Thomas Schmitt Copyright (C) 2010-2013, 2017, 2019 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** Regression test for MMC commands which don't involve write access. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef _WIN32 # undef HAVE_SLEEP #endif #if !defined(HAVE_SLEEP) # if defined(_WIN32) # include # define sleep(s) Sleep(1000*s) # elif defined(HAVE_USLEEP) # define sleep(s) usleep(1000000*s) # else # define sleep(s) { int i; for(i=0; i<=1000*s; i++); } # endif #endif #include #include #include #define SKIP_TEST 77 /* gcc may warn if no prototypes are given before function definition */ static int handle_outcome(CdIo_t *p_cdio, driver_return_code_t i_status, int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_flag); static int get_disctype(CdIo_t *p_cdio, bool b_verbose); static driver_return_code_t get_disc_erasable(const CdIo_t *p_cdio, const char *psz_source, bool verbose); static driver_return_code_t mode_sense(CdIo_t *p_cdio, int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int page_code, unsigned int subpage_code, int i_alloc_len, unsigned char *p_buf, int *pi_size, unsigned int i_flag); static void print_status_sense(int i_status, int i_sense_valid, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_flag); static int test_read(char *psz_drive_path, unsigned int i_flag); static int test_unit_ready(CdIo_t *p_cdio, int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_flag); static int wait_for_drive(CdIo_t *p_cdio, unsigned int max_tries, bool b_verbose); /* ------------------------- Helper functions ---------------------------- */ static driver_return_code_t get_disc_erasable(const CdIo_t *p_cdio, const char *psz_source, bool b_verbose) { driver_return_code_t i_status; bool b_erasable; i_status = mmc_get_disc_erasable(p_cdio, &b_erasable); if (b_verbose && DRIVER_OP_SUCCESS == i_status) printf("Disc is %serasable.\n", b_erasable ? "" : "not "); return i_status; } static int get_disctype(CdIo_t *p_cdio, bool b_verbose) { cdio_mmc_feature_profile_t disctype; driver_return_code_t i_status = mmc_get_disctype(p_cdio, 0, &disctype); if (DRIVER_OP_SUCCESS == i_status) { if (b_verbose) fprintf(stderr, "test_disctype: profile is %s (0x%X)\n", mmc_feature_profile2str(disctype), disctype); } return DRIVER_OP_SUCCESS; } /** @param flag bit0= verbose */ static int handle_outcome(CdIo_t *p_cdio, driver_return_code_t i_status, int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_flag) { cdio_mmc_request_sense_t *p_temp_sense_reply = NULL; *pi_sense_avail = mmc_last_cmd_sense(p_cdio, &p_temp_sense_reply); print_status_sense(i_status, *pi_sense_avail, p_temp_sense_reply, i_flag & 1); if (18 <= *pi_sense_avail) { memset(p_sense_reply, 0, sizeof(cdio_mmc_request_sense_t)); memcpy(p_sense_reply, p_temp_sense_reply, *pi_sense_avail); } else memset(p_sense_reply, 0, sizeof(cdio_mmc_request_sense_t)); cdio_free(p_temp_sense_reply); return i_status; } /** @param i_flag bit0= verbose */ static void print_status_sense(int i_status, int i_sense_valid, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_flag) { if (!(i_flag & 1)) return; printf("return= %d , sense(%d)", i_status, i_sense_valid); if (i_sense_valid >= 14) printf(": KEY=%s (%1.1X), ASC= %2.2X , ASCQ= %2.2X", mmc_sense_key2str[p_sense_reply->sense_key], p_sense_reply->sense_key, p_sense_reply->asc, p_sense_reply->ascq); printf("\n"); } /* --------------------------- MMC commands ------------------------------ */ /** @param flag bit0= verbose @param sense_avail Number of available sense bytes (18 get copied if all 18 exist) @param sense_reply eventual sense bytes @return return value of mmc_run_cmd() */ static int test_unit_ready(CdIo_t *p_cdio, int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_flag) { int i_status; int old_log_level = cdio_loglevel_default; cdio_loglevel_default = CDIO_LOG_WARN; if (i_flag & 1) printf("test_unit_ready ... "); i_status = mmc_test_unit_ready(p_cdio, 0); cdio_loglevel_default = old_log_level; return handle_outcome(p_cdio, i_status, pi_sense_avail, p_sense_reply, i_flag & 1); } /* BARELY OBTRUSIVE: MIGHT RUIN A SIMULTANEOUS BURNING OPERATION ON THE DRIVE */ /** Fetch a mode page or a part of it from the drive. @param i_alloc_len The number of bytes to be requested from the drive and to be copied into parameter buf. This has to include the 8 bytes of header and may not be less than 10. @param p_buf Will contain at most alloc_len many bytes. The first 8 are a Mode Parameter Header as of SPC-3 7.4.3, table 240. The further bytes are the mode page, typically as of MMC-5 7.2. There are meanwhile deprecated mode pages which appear only in older versions of MMC. @param i_size Will return the number of actually read bytes resp. the number of available bytes. See flag bit1. @param i_flag bit0= verbose bit1= Peek mode: Reply number of available bytes in *i_size and not the number of actually read bytes. @return return value of mmc_run_cmd(), or other driver_return_code_t */ static driver_return_code_t mode_sense(CdIo_t *p_cdio, int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_page_code, unsigned int subpage_code, int i_alloc_len, unsigned char *p_buf, int *pi_size, unsigned int i_flag) { driver_return_code_t i_status; if (i_alloc_len < 10) return DRIVER_OP_BAD_PARAMETER; if (i_flag & 1) printf("mode_sense(0x%X, %X, %d) ... ", i_page_code, subpage_code, i_alloc_len); i_status = mmc_mode_sense_10(p_cdio, p_buf, i_alloc_len, i_page_code); handle_outcome(p_cdio, i_status, pi_sense_avail, p_sense_reply, i_flag & 1); if (DRIVER_OP_SUCCESS != i_status) return i_status; if (i_flag & 2) *pi_size = p_buf[9] + 10; /* MMC-5 7.2.3 */ else *pi_size = p_buf[0] * 256 + p_buf[1] + 2; /* SPC-3 7.4.3, table 240 */ return i_status; } /** Watch drive by test unit ready loop until ready, no media or timeout. @param b_verbose verbose @return 1= unit ready , 0= error , -1= severe failure, 2 = no media */ static int wait_for_drive(CdIo_t *p_cdio, unsigned int i_max_tries, bool b_verbose) { int i_ret, i, i_sense_avail; cdio_mmc_request_sense_t sense_reply; memset(&sense_reply, 0, sizeof(sense_reply)); for (i = 0; i < i_max_tries; i++) { i_ret = test_unit_ready(p_cdio, &i_sense_avail, &sense_reply, b_verbose); if (i_ret == 0) /* Unit is ready */ return 1; if (i_sense_avail < 18) return -1; if (2 == sense_reply.sense_key && 0x04 == sense_reply.asc) { /* Not ready */; } else if (6 == sense_reply.sense_key && 0x28 == sense_reply.asc && 0 == sense_reply.ascq) { /* Media change notice = try again */; } else if (2 == sense_reply.sense_key && 0x3a == sense_reply.asc) { /* Medium not present */; return 2; } else if (0 == sense_reply.sense_key && 0 == sense_reply.asc) { /* Error with no sense */; return -1; break; } else { /* Other error */; return 0; } sleep(1); } fprintf(stderr, "wait_for_drive: Drive not ready after %d retries\n", i_max_tries); return -1; } /** This function bundles tests for the read capability to perform MMC commands and detecting the sense reply of MMC commands, which indicates error causes or important drive events. @param drive_path a drive address suitable for cdio_open_am() @param flag bit0= verbose @return 0= no severe failure else an proposal for an exit() value is returned */ static int test_read(char *psz_drive_path, unsigned int i_flag) { int sense_avail = 0, i_ret = 0, i_sense_valid, i_size, alloc_len = 10; bool b_verbose = !!(i_flag & 1); int old_log_level = cdio_loglevel_default; cdio_mmc_request_sense_t sense_reply; unsigned char buf[10]; CdIo_t *p_cdio; const char *scsi_tuple; p_cdio = cdio_open(psz_drive_path, DRIVER_DEVICE); if (!p_cdio) i_ret = SKIP_TEST - 16; /* The further code produces some intentional failures which should not be reported by mmc_run_cmd() as INFO messages. */ cdio_loglevel_default = CDIO_LOG_WARN; /* Test availability of info for cdrecord style adresses . */ scsi_tuple = cdio_get_arg(p_cdio, "scsi-tuple"); if (scsi_tuple == NULL) { fprintf(stderr, "Error: cdio_get_arg(\"scsi-tuple\") returns NULL.\n"); i_ret += 6; goto ex; } else if (i_flag & 1) printf("Drive '%s' has cdio_get_arg(\"scsi-tuple\") = '%s'\n", psz_drive_path, scsi_tuple); /* Test availability of sense reply in case of unready drive. E.g. if the tray is already ejected. */ i_ret = test_unit_ready(p_cdio, &sense_avail, &sense_reply, b_verbose); if (i_ret != 0 && sense_avail < 18) { fprintf(stderr, "Error: Drive not ready. Only %d sense bytes. Expected >= 18.\n", sense_avail); i_ret += 2; goto ex; } /* Cause sense reply failure by requesting inappropriate mode page 3Eh */ i_ret += mode_sense(p_cdio, &sense_avail, &sense_reply, 0x3e, 0, alloc_len, buf, &i_size, b_verbose); if (i_ret != 0 && sense_avail < 18) { fprintf(stderr, "Error: Deliberately illegal command yields only %d sense bytes. Expected >= 18.\n", sense_avail); i_ret = 3; goto ex; } else { if (sense_reply.sense_key != 5) { fprintf(stderr, "Error: Sense key should be 5, got %d\n", sense_reply.sense_key); i_ret = 3; goto ex; } else if (sense_reply.asc != 0x24) { fprintf(stderr, "Error: Sense code should be 24, got %d\n", sense_reply.asc); i_ret = 4; goto ex; } else if (sense_reply.ascq != 0) { fprintf(stderr, "Error: Sense code should be 24, got %d\n", sense_reply.ascq); i_ret = 4; goto ex; } } /* How are we, finally ? */ i_ret = test_unit_ready(p_cdio, &i_sense_valid, &sense_reply, b_verbose); if ((i_flag & 1) && 0 != i_ret && 2 == sense_reply.sense_key && 0x3a == sense_reply.asc) fprintf(stderr, "test_unit_ready: Note: No loaded media detected.\n"); /* Call mmc_read with a null pointer and check that we get the right return code. */ if (DRIVER_OP_BAD_POINTER != (i_ret = mmc_read_cd(p_cdio, NULL, /* wrong! should be a buffer. */ 200, CDIO_MMC_READ_TYPE_ANY, false, false, 0, true, false, false, 1, 2448, 1))) { fprintf(stderr, "mmc_read_cd: expecting bad pointer return, got %d\n", i_ret); } else { i_ret = 0; } ex:; cdio_loglevel_default = old_log_level; cdio_destroy(p_cdio); return i_ret; } /* --------------------------- main ----------------------------- */ int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives = NULL; const char *psz_source = NULL; int i_ret; int exitrc = 0; bool b_verbose = (argc > 1); driver_return_code_t i_status; cdio_loglevel_default = b_verbose ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; if (0 != strncmp("TEST UNIT READY", mmc_cmd2str(CDIO_MMC_GPCMD_TEST_UNIT_READY), sizeof("TEST UNIT READY"))) { printf("Expecting mmc_cmd2str to give 'TEST UNIT READY' for code 0x%x\n", CDIO_MMC_GPCMD_TEST_UNIT_READY); exit(1); } ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(SKIP_TEST); } p_cdio = cdio_open(ppsz_drives[0], DRIVER_DEVICE); if (p_cdio) { const char *psz_have_mmc = cdio_get_arg(p_cdio, "mmc-supported?"); psz_source = cdio_get_arg(p_cdio, "source"); if (0 != strncmp(psz_source, ppsz_drives[0], strlen(ppsz_drives[0]))) { fprintf(stderr, "Got %s; should get back %s, the name we opened.\n", psz_source, ppsz_drives[0]); exit(1); } i_ret = wait_for_drive(p_cdio, 30, b_verbose); if (0 >= i_ret) { fprintf(stderr, "Wait for drive error\n"); exit(SKIP_TEST); } else { if (1 == i_ret) { i_status = get_disc_erasable(p_cdio, psz_source, b_verbose); if (DRIVER_OP_SUCCESS != i_status) { printf("Got status %d back from get_disc_erasable(%s)\n", i_status, psz_source); } get_disctype(p_cdio, b_verbose); if ( psz_have_mmc && 0 == strncmp("true", psz_have_mmc, sizeof("true")) ) { /* Test the MMC enhancements of version 0.83 in december 2009 */ i_ret = test_read(ppsz_drives[0], cdio_loglevel_default == CDIO_LOG_DEBUG); if (0 != i_ret) exit(i_ret + 16); } } else if (2 == i_ret && b_verbose) printf("Drive is empty... skipping remaining tests.\n"); } cdio_destroy(p_cdio); } else { fprintf(stderr, "cdio_open('%s') failed\n", ppsz_drives[0]); exit(2); } cdio_free_device_list(ppsz_drives); return exitrc; } libcdio-2.2.0/test/driver/mmc_write.c000066400000000000000000000555211474051130400175330ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2009 Thomas Schmitt Copyright (C) 2010, 2012-2013, 2017, 2024 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for MMC commands involving read/write access. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef _WIN32 # undef HAVE_SLEEP #endif #if !defined(HAVE_SLEEP) # if defined(_WIN32) # include # define sleep(s) Sleep(1000*s) # elif defined(HAVE_USLEEP) # define sleep(s) usleep(1000000*s) # else # define sleep(s) { int i; for(i=0; i<=1000*s; i++); } # endif #endif #include #include #include #define SKIP_TEST 77 /* gcc may warn if no prototypes are given before function definition */ static int handle_outcome(CdIo_t *p_cdio, driver_return_code_t i_status, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_flag); static int load_eject(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_flag); static void print_status_sense(int i_status, int sense_valid, cdio_mmc_request_sense_t *, unsigned int i_flag); static int test_eject_load_cycle(CdIo_t *p_cdio, unsigned int i_flag); static int test_eject_test_load(CdIo_t *p_cdio, unsigned int i_flag); static int test_mode_select(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned char *p_buf, unsigned int i_size, unsigned int i_flag); static driver_return_code_t mode_sense(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_page_code, unsigned int subpage_code, int i_alloc_len, unsigned char *buf, int *i_size, unsigned int u_flag); static int test_unit_ready(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_flag); static int test_rwr_mode_page(CdIo_t *p_cdio, unsigned int i_flag); static int test_write(char *psz_drive_path, unsigned int i_flag); static int wait_for_drive(CdIo_t *p_cdio, unsigned int max_tries, unsigned int i_flag); /* ------------------------- Helper functions ---------------------------- */ /* @param i_flag bit0= verbose */ static int handle_outcome(CdIo_t *p_cdio, driver_return_code_t i_status, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t * p_sense_reply, unsigned int i_flag) { cdio_mmc_request_sense_t *p_temp_sense_reply = NULL; *pi_sense_avail = mmc_last_cmd_sense(p_cdio, &p_temp_sense_reply); print_status_sense(i_status, *pi_sense_avail, p_temp_sense_reply, i_flag & 1); if (18 <= *pi_sense_avail) { memset(p_sense_reply, 0, sizeof(cdio_mmc_request_sense_t)); memcpy(p_sense_reply, p_temp_sense_reply, *pi_sense_avail); } else memset(p_sense_reply, 0, sizeof(cdio_mmc_request_sense_t)); cdio_free(p_temp_sense_reply); return i_status; } /** @param flag bit0= verbose */ static void print_status_sense(int i_status, int sense_valid, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_flag) { if (!(i_flag & 1)) return; printf("return= %d , sense(%d)", i_status, sense_valid); if (sense_valid >= 14) printf(": KEY=%s (%1.1X), ASC= %2.2X , ASCQ= %2.2X", mmc_sense_key2str[p_sense_reply->sense_key], p_sense_reply->sense_key, p_sense_reply->asc, p_sense_reply->ascq); printf("\n"); } /* --------------------------- MMC commands ------------------------------ */ /* OBTRUSIVE. PHYSICAL EFFECT: DANGER OF HUMAN INJURY */ /** @param i_flag bit0= verbose bit1= Asynchronous operation bit2= Load (else Eject) @return return value of mmc_run_cmd() */ static int load_eject(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_flag) { int i_status; bool b_eject = !!(i_flag & 4); bool b_immediate = !!(i_flag & 2); i_status = mmc_start_stop_unit(p_cdio, b_eject, b_immediate, 0, 0); if (i_flag & 1) printf("load_eject(0x%X) ... ", i_flag); return handle_outcome(p_cdio, i_status, pi_sense_avail, p_sense_reply, i_flag & 1); } /* BARELY OBTRUSIVE: MIGHT RUIN A SIMULTANEOUS BURNING OPERATION ON THE DRIVE */ /** Fetch a mode page or a part of it from the drive. @param i_alloc_len The number of bytes to be requested from the drive and to be copied into parameter buf. This has to include the 8 bytes of header and may not be less than 10. @param p_buf Will contain at most alloc_len many bytes. The first 8 are a Mode Parameter Header as of SPC-3 7.4.3, table 240. The further bytes are the mode page, typically as of MMC-5 7.2. There are meanwhile deprecated mode pages which appear only in older versions of MMC. @param i_size Will return the number of actually read bytes resp. the number of available bytes. See flag bit1. @param i_flag bit0= verbose bit1= Peek mode: Reply number of available bytes in *i_size and not the number of actually read bytes. @return return value of mmc_run_cmd(), or other driver_return_code_t */ static driver_return_code_t mode_sense(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int i_page_code, unsigned int subpage_code, int i_alloc_len, unsigned char *p_buf, int *pi_size, unsigned int u_flag) { driver_return_code_t i_status; if (i_alloc_len < 10) return DRIVER_OP_BAD_PARAMETER; if (u_flag & 1) printf("mode_sense(0x%X, %X, %d) ... ", i_page_code, subpage_code, i_alloc_len); i_status = mmc_mode_sense_10(p_cdio, p_buf, i_alloc_len, i_page_code); handle_outcome(p_cdio, i_status, pi_sense_avail, p_sense_reply, u_flag & 1); if (DRIVER_OP_SUCCESS != i_status) return i_status; if (u_flag & 2) *pi_size = p_buf[9] + 10; /* MMC-5 7.2.3 */ else *pi_size = p_buf[0] * 256 + p_buf[1] + 2; /* SPC-3 7.4.3, table 240 */ return i_status; } /* OBTRUSIVE. RUINS A SIMULTANEOUS BURNING OPERATION ON THE DRIVE and might return minor failure with -ROM drives */ /** Send a mode page to the drive. @param buf Contains the payload bytes. The first 8 shall be a Mode Parameter Header as of SPC-3 7.4.3, table 240. The further bytes are the mode page, typically as of MMC-5 7.2. There are meanwhile deprecated mode pages which appear only in older versions of MMC. @param i_size The number of bytes in buf. @param flag bit0= verbose @return return value of mmc_run_cmd(), or other driver_return_code_t */ static int test_mode_select(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned char *p_buf, unsigned int i_size, unsigned int u_flag) { int i_status, i; if (i_size < 10) return DRIVER_OP_BAD_PARAMETER; if (u_flag & 1) { printf("-- test_mode_select to drive: %d bytes\n", i_size); for (i = 0; i < i_size; i++) { printf("%2.2X ", (unsigned int) p_buf[i]); if ((i % 20) == 19) printf("\n"); } if ((i % 20)) printf("\n"); } if (u_flag & 1) printf("-- test_mode_select(0x%X, %d, %d) ... ", (unsigned int) p_buf[8], (unsigned int) p_buf[9], i_size); i_status = mmc_mode_select_10(p_cdio, p_buf, i_size, 0x10, 10000); return handle_outcome(p_cdio, i_status, pi_sense_avail, p_sense_reply, u_flag & 1); } /* UNOBTRUSIVE */ /** @param pi_sense_avail Number of available sense bytes (18 get copied if all 18 exist) @param p_sense_reply eventual sense bytes @param u_flag bit0= verbose @return return value of mmc_run_cmd() */ static int test_unit_ready(CdIo_t *p_cdio, unsigned int *pi_sense_avail, cdio_mmc_request_sense_t *p_sense_reply, unsigned int u_flag) { int i_status; if (u_flag & 1) printf("-- test_unit_ready ... "); i_status = mmc_test_unit_ready(p_cdio, 0); return handle_outcome(p_cdio, i_status, pi_sense_avail, p_sense_reply, u_flag & 1); } /* --------------------------- Larger gestures ----------------------------- */ /* UNOBTRUSIVE */ /** Watch drive by test unit ready loop until ready, no media or timeout. @param flag bit0= verbose bit1= expect media (do not end on no-media sense) @return 1= all seems well , 0= minor failure , -1= severe failure */ static int wait_for_drive(CdIo_t *p_cdio, unsigned int i_max_tries, unsigned int u_flag) { int i_ret, i; unsigned int i_sense_avail; cdio_mmc_request_sense_t sense_reply; for (i = 0; i < i_max_tries; i++) { i_ret = test_unit_ready(p_cdio, &i_sense_avail, &sense_reply, !!(u_flag & 1)); if (i_ret == 0) /* Unit is ready */ return 1; if (i_sense_avail < 18) return -1; if (2 == sense_reply.sense_key && 0x04 == sense_reply.asc) { /* Not ready */; } else if (6 == sense_reply.sense_key && 0x28 == sense_reply.asc && 0 == sense_reply.ascq) { /* Media change notice = try again */; } else if (2 == sense_reply.sense_key && 0x3a == sense_reply.asc) { /* Medium not present */; if (!(u_flag & 2)) return 1; } else if (0 == sense_reply.sense_key && 0 == sense_reply.asc) { /* Error with no sense */; return -1; break; } else { /* Other error */; return 0; } sleep(1); } fprintf(stderr, "wait_for_drive: Drive not ready after %d retries\n", i_max_tries); return -1; } /* OBTRUSIVE. Opens and closes drive door - watch your fingers! */ /** Eject, wait, load asynchronously, and watch by test unit ready loop. @param u_flag bit0= verbose bit1= expect media (do not end on no-media sense) @return 1= all seems well , 0= minor failure , -1= severe failure */ static int test_eject_load_cycle(CdIo_t *p_cdio, unsigned int u_flag) { int i_ret; unsigned int i_sense_avail; cdio_mmc_request_sense_t sense_reply; /* Eject synchronously */ printf("test_eject_load_cycle: WARNING: EJECTING THE TRAY !\n"); sleep(2); load_eject(p_cdio, &i_sense_avail, &sense_reply, 0 | (u_flag & 1)); printf("test_eject_load_cycle: waiting for 5 seconds. DO NOT TOUCH THE TRAY !\n"); sleep(3); /* Load asynchronously */ printf("test_eject_load_cycle: WARNING: LOADING THE TRAY !\n"); sleep(2); load_eject(p_cdio, &i_sense_avail, &sense_reply, 4 | 2 | (u_flag & 1)); /* Wait for drive attention */ i_ret = wait_for_drive(p_cdio, 30, u_flag & 3); return i_ret; } /* OBTRUSIVE , PHYSICAL EFFECT , DANGER OF HUMAN INJURY */ /** Eject, wait, test, load. All synchronously. @param flag bit0= verbose @return 1= all seems well , 0= minor failure , -1= severe failure */ static int test_eject_test_load(CdIo_t *p_cdio, unsigned int u_flag) { int i_ret; unsigned int i_sense_avail; cdio_mmc_request_sense_t sense_reply; /* Eject synchronously */ printf("test_eject_test_load: WARNING: EJECTING THE TRAY !\n"); sleep(2); load_eject(p_cdio, &i_sense_avail, &sense_reply, 0 | (u_flag & 1)); printf("test_eject_test_load: waiting for 5 seconds. DO NOT TOUCH THE TRAY !\n"); sleep(3); i_ret = test_unit_ready(p_cdio, &i_sense_avail, &sense_reply, u_flag & 1); if (i_ret == 0) { fprintf(stderr, "test_eject_test_load: Drive ready although tray ejected.\n"); fprintf(stderr, "test_eject_test_load: Test aborted. Tray will stay ejected.\n"); return -1; } if (i_ret == 0 || i_sense_avail < 18) { fprintf(stderr, "test_eject_test_load: Only %d sense reply bytes returned. Expected >= 18.\n", i_sense_avail); fprintf(stderr, "test_eject_test_load: Test aborted. Tray will stay ejected.\n"); return -1; } /* Load synchronously */ fprintf(stderr, "test_eject_test_load: WARNING: LOADING THE TRAY !\n"); sleep(2); load_eject(p_cdio, &i_sense_avail, &sense_reply, 4 | (u_flag & 1)); return 1; } /* OBTRUSIVE */ /** Read Mode Page 05h "Write Parameters", change a value, write the page, check effect, restore old value, check again. @param flag bit0= verbose @return 1= all seems well , 0= minor failure , -1= severe failure */ static int test_rwr_mode_page(CdIo_t *p_cdio, unsigned int u_flag) { int i_ret; unsigned int i_sense_avail = 0; int page_code = 5, subpage_code = 0, i_alloc_len, i_size = 0; int write_type, final_return = 1, new_write_type, old_i_size; cdio_mmc_request_sense_t sense_reply; unsigned char buf[265], old_buf[265]; /* page size is max. 255 + 10 */ static char w_types[4][8] = {"Packet", "TAO", "SAO", "Raw"}; memset(buf, 0, sizeof(buf)); i_alloc_len = 10; i_ret = mode_sense(p_cdio, &i_sense_avail, &sense_reply, page_code, subpage_code, i_alloc_len, buf, &i_size, 2 | (u_flag & 1)); if (i_ret != 0) { fprintf(stderr, "-- test_rwr_mode_page: Cannot obtain mode page 05h.\n"); return 0; } i_alloc_len = (i_size <= sizeof(buf)) ? i_size : sizeof(buf); i_ret = mode_sense(p_cdio, &i_sense_avail, &sense_reply, page_code, subpage_code, i_alloc_len, buf, &i_size, (u_flag & 1)); if (i_ret != 0) { fprintf(stderr, "-- test_rwr_mode_page: Cannot obtain mode page 05h.\n"); return 0; } memcpy(old_buf, buf, sizeof(buf)); old_i_size = i_size; write_type = buf[10] & 0x0f; if (u_flag & 1) printf("test_rwr_mode_page: Write type = %d (%s)\n", write_type, write_type < 4 ? w_types[write_type] : "Reserved"); /* Choose a conservative CD writer setting. */ memset(buf, 0, 8); if (write_type == 1) { /* is TAO -> make SAO */ buf[10] = (buf[10] & 0xf0) | 2; /* SAO */ new_write_type = 2; } else { buf[10] = (buf[10] & 0xf0) | 1; /* TAO */ new_write_type = 1; } buf[11] = 4; /* Track Mode 4, no multi-session, variable Packet size */ buf[12] = 8; /* Data Block Type : CD-ROM Mode 1 */ buf[16] = 0; /* Session Format : "CD-DA or CD-ROM" */ i_ret = test_mode_select(p_cdio, &i_sense_avail, &sense_reply, buf, i_size, u_flag & 1); if (i_ret != 0) { fprintf(stderr, "-- test_rwr_mode_page: Cannot set mode page 05h.\n"); if (DRIVER_OP_NOT_PERMITTED == i_ret) { fprintf(stderr, "test_rwr_mode_page: DRIVER_OP_NOT_PERMITTED with MODE SELECT.\n"); return -1; } return 0; } /* Read mode page and check whether effect visible in buf[10] */ i_ret = mode_sense(p_cdio, &i_sense_avail, &sense_reply, page_code, subpage_code, i_alloc_len, buf, &i_size, (u_flag & 1)); if (0 != i_ret) { fprintf(stderr, "test_rwr_mode_page: Cannot obtain mode page 05h.\n"); final_return = final_return > 0 ? 0 : final_return; } else if ((buf[10] & 0xf) != new_write_type) { fprintf(stderr, "test_rwr_mode_page: Mode page did not get into effect. (expected %d, got %d)\n", new_write_type, buf[10] & 0xf); /* One of my DVD burners does this if no media is loaded */ final_return = final_return > 0 ? 0 : final_return; } /* Restore old mode page */ i_ret = test_mode_select(p_cdio, &i_sense_avail, &sense_reply, old_buf, old_i_size, u_flag & 1); if (0 != i_ret) { fprintf(stderr, "test_rwr_mode_page: Cannot set mode page 05h.\n"); if (i_ret == DRIVER_OP_NOT_PERMITTED) { fprintf(stderr, "test_rwr_mode_page: DRIVER_OP_NOT_PERMITTED with MODE SELECT.\n"); return -1; } final_return = final_return > 0 ? 0 : final_return; } /* Read mode page and check whether old_buf is in effect again */ i_ret = mode_sense(p_cdio, &i_sense_avail, &sense_reply, page_code, subpage_code, i_alloc_len, buf, &i_size, (u_flag & 1)); if (0 != i_ret) { fprintf(stderr, "test_rwr_mode_page: Cannot obtain mode page 05h.\n"); return final_return > 0 ? 0 : final_return; } else if (memcmp(buf, old_buf, i_size) != 0) { fprintf(stderr, "test_rwr_mode_page: Mode page was not restored to old state.\n"); final_return = final_return > 0 ? -1 : final_return; } if (u_flag & 1) printf("test_rwr_mode_page: Mode page 2Ah restored to previous state\n"); return final_return; } /* ----------- Test of MMC driver enhancements , december 2009 ------------- */ /* OBTRUSIVE */ /** This function bundles tests for the capability to perform MMC commands of payload direction SCSI_MMC_DATA_WRITE and to detect the sense reply of MMC commands, which indicates error causes or important drive events. The default configuration is not very obtrusive to the drive, although the drive should not be used for other operations at the same time. There are static variables in this function which enable additional more obtrusive tests or simulate the lack of write capabilities. See the statements about obtrusiveness and undesired side effects above the descriptions of the single functions. @param psz_drive_path a drive address suitable for cdio_open_am() @param flag bit0= verbose @return 0= no severe failure else an proposal for an exit() value is returned */ static int test_write(char *psz_drive_path, unsigned int u_flag) { unsigned int i_sense_avail = 0; unsigned int i_sense_valid; int i_ret; bool b_verbose = !!(u_flag & 1); int old_log_level = cdio_loglevel_default; cdio_mmc_request_sense_t sense_reply; CdIo_t *p_cdio; /* If true, then the tray will get ejected and loaded again */ static bool with_tray_dance = false; /* If true, then an asynchronous test loop will wait 30 s for loaded media */ static bool test_cycle_with_media = false; /* If true, then a lack of w-permission will be emulated by using the insufficient access mode "IOCTL" */ static bool emul_lack_of_wperm = false; p_cdio = cdio_open_am(psz_drive_path, DRIVER_DEVICE, "MMC_RDWR_EXCL"); if (!p_cdio) i_ret = SKIP_TEST - 16; else { const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); if (0 != strncmp(psz_access_mode, "MMC_RDWR_EXCL", strlen("MMC_RDWR_EXCL"))) { fprintf(stderr, "Got %s; Should get back %s, the access mode requested.\n", psz_access_mode, "MMC_RDWR_EXCL"); i_ret = 1; goto ex; } /* The further code produces some intentional failures which should not be reported by mmc_run_cmd() as INFO messages. */ cdio_loglevel_default = CDIO_LOG_WARN; /* Test availability of sense reply in case of unready drive. E.g. if the tray is already ejected. */ i_ret = test_unit_ready(p_cdio, &i_sense_avail, &sense_reply, b_verbose); if (0 != i_ret && i_sense_avail < 18) { fprintf(stderr, "Error: Drive not ready. Only %u sense bytes. Expected >= 18.\n", i_sense_avail); i_ret = 2; goto ex; } if (emul_lack_of_wperm) { /* To check behavior with lack of w-permission */ printf("-- test_write: SIMULATING LACK OF WRITE CAPABILITIES by access mode IOCTL\n"); cdio_destroy(p_cdio); p_cdio = cdio_open_am(psz_drive_path, DRIVER_DEVICE, "IOCTL"); } /* Test write permission */ /* Try whether a mode page 2Ah can be set */ i_ret = test_rwr_mode_page(p_cdio, b_verbose); if (i_ret <= 0) { if (i_ret < 0) { fprintf(stderr, "Error: test_rwr_mode_page() had severe failure.\n"); i_ret = 3; goto ex; } printf("-- Warning: test_rwr_mode_page() had minor failure.\n"); } if (with_tray_dance) { /* More surely provoke a non-trivial sense reply */ if (test_cycle_with_media) { /* Eject, wait, load, watch by test unit ready loop */ i_ret = test_eject_load_cycle(p_cdio, 2 | b_verbose); if (i_ret <= 0) { if (i_ret < 0) { fprintf(stderr, "Error: test_eject_load_cycle() had severe failure.\n"); i_ret = 4; goto ex; } printf("Warning: test_eject_load_cycle() had minor failure.\n"); } } else { /* Eject, test for proper unreadiness, load */ i_ret = test_eject_test_load(p_cdio, b_verbose); if (i_ret <= 0) { if (i_ret < 0) { fprintf(stderr, "Error: test_eject_test_load() had severe failure.\n"); i_ret = 5; goto ex; } printf("Warning: test_eject_test_load() had minor failure.\n"); } /* Wait for drive attention */ wait_for_drive(p_cdio, 15, 2 | b_verbose); } } /* How are we, finally ? */ i_ret = test_unit_ready(p_cdio, &i_sense_valid, &sense_reply, b_verbose); if ((u_flag & 1) && 0 != i_ret && 2 == sense_reply.sense_key && 0x3a == sense_reply.asc) fprintf(stderr, "test_unit_ready: Note: No loaded media detected.\n"); i_ret = 0; } ex:; cdio_loglevel_default = old_log_level; cdio_destroy(p_cdio); return i_ret; } /* --------------------------- main ----------------------------- */ int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives=NULL; int ret; int exitrc = 0; bool b_verbose = (argc > 1); cdio_loglevel_default = b_verbose ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(SKIP_TEST); } p_cdio = cdio_open(ppsz_drives[0], DRIVER_DEVICE); if (p_cdio) { const char *psz_have_mmc = cdio_get_arg(p_cdio, "mmc-supported?"); if ( psz_have_mmc && 0 == strncmp("true", psz_have_mmc, sizeof("true")) ) { /* Test the MMC enhancements of version 0.83 in december 2009 */ ret = test_write(ppsz_drives[0], cdio_loglevel_default == CDIO_LOG_DEBUG); if (ret != 0) exit(ret + 16); } cdio_destroy(p_cdio); } else { fprintf(stderr, "cdio_open('%s') failed\n", ppsz_drives[0]); exit(2); } cdio_free_device_list(ppsz_drives); return exitrc; } libcdio-2.2.0/test/driver/nrg.c000066400000000000000000000050601474051130400163240ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2008, 2010, 2011, 2012 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for Nero image driver: lib/driver/image/nrg.c. */ #if defined(HAVE_CONFIG_H) #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include "helper.h" #ifndef DATA_DIR #define DATA_DIR "../data" #endif #define NUM_FIELDS 2 int main(int argc, const char *argv[]) { char psz_nrgfile[500]; CdIo_t *p_cdio; const char *cdtext_check[NUM_FIELDS] = { "Richard Stallman", "Join us now we have the software" }; const int cdtext_fields[NUM_FIELDS] = {CDTEXT_FIELD_PERFORMER, CDTEXT_FIELD_TITLE}; cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", DATA_DIR, cue_file[i]); */ if (!cdio_have_driver(DRIVER_NRG)) return(77); snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", DATA_DIR, "p1.nrg"); p_cdio = cdio_open_nrg(psz_nrgfile); if (!p_cdio) { printf("Can't open Nero image file: %s.\n", psz_nrgfile); return(1); } { unsigned int i; cdtext_t *p_cdtext = cdio_get_cdtext(p_cdio); if (!p_cdtext) return(1); for (i=0; i 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/osx.c */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives=NULL; int n=0; cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", TEST_DIR, cue_file[i]); */ if (!cdio_have_driver(DRIVER_OSX)) return(77); ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(77); } do { p_cdio = cdio_open_osx(ppsz_drives[n]); if (p_cdio) { const char *psz_source = cdio_get_arg(p_cdio, "source"); const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); discmode_t discmode = cdio_get_discmode(p_cdio); if (0 != strncmp(psz_source, ppsz_drives[0], strlen(ppsz_drives[0]))) { fprintf(stderr, "Got %s; should get back %s, the name we opened.\n", psz_source, ppsz_drives[0]); exit(1); } if (0 != strncmp(psz_access_mode, "OS X", strlen("OS X"))) { fprintf(stderr, "Got %s; Should get back %s, the access mode requested.\n", psz_access_mode, "OS X"); exit(2); } if (CDIO_DISC_MODE_ERROR == discmode) { fprintf(stderr, "Error getting disc mode for device %s.\n", ppsz_drives[n]); exit(3); } } cdio_destroy(p_cdio); } while (ppsz_drives[++n] != NULL); cdio_free_device_list(ppsz_drives); return 0; } libcdio-2.2.0/test/driver/realpath.c000066400000000000000000000130041474051130400173330ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2010-2012, 2015, 2017, 2022 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/realpath.c */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #if defined(_WIN32) && !defined(__CYGWIN__) #include #include /* _mkdir */ /* MinGW, MSVC do not have symlink */ #define symlink(oldpath, newpath) CopyFileA(oldpath, newpath, FALSE) #else #define _mkdir(a) mkdir(a, S_IRWXU) #endif #include #ifdef MINGW32 #define MY_DIR_SEPARATOR '\\' #else #define MY_DIR_SEPARATOR '/' #endif #ifndef PATH_MAX #define PATH_MAX 4096 #endif static char * get_temporary_name(const char *dirname, const char *errmsg) { char *new_filename = tempnam(NULL, "syml"); if (NULL == new_filename) { printf("Could not generate %s name\n", errmsg); } return new_filename; } static int check_rc(int rc, const char *psz_operation, const char *psz_filename) { if (-1 == rc) { printf("%s %s failed with error: %s\n", psz_operation, psz_filename, strerror(errno)); } else if (0 != rc) { printf("%s %s gives weird return %d\n", psz_operation, psz_filename, rc); } return rc; } int main(int argc, const char *argv[]) { char *psz_tmp_subdir; char *psz_orig_file; char tmp_dir[PATH_MAX+1] = {0}; char tmp_subdir[PATH_MAX+1] = {0}; char psz_file_check[PATH_MAX+1]; char *psz_last_slash; int i_last_slash; char *psz_symlink_file = NULL; int rc = 0; psz_tmp_subdir = get_temporary_name(NULL, "temporary directory"); if (NULL == psz_tmp_subdir) { rc = 77; goto err_exit1; } if (-1 == check_rc(_mkdir(psz_tmp_subdir), "mkdir", psz_tmp_subdir)) { rc = 77; goto err_exit1; } cdio_realpath(psz_tmp_subdir, tmp_subdir); if (0 == strlen(tmp_subdir)) { fprintf(stderr, "cdio_realpath on temp directory %s failed\n", psz_tmp_subdir); rc = 1; goto err_exit1; } psz_last_slash = strrchr(tmp_subdir, MY_DIR_SEPARATOR); if (psz_last_slash == NULL) { printf("Can't find %c in %s\n", MY_DIR_SEPARATOR, tmp_subdir); rc = 2; goto err_exit1; } i_last_slash = psz_last_slash - tmp_subdir + 1; memcpy(tmp_dir, tmp_subdir, i_last_slash); tmp_dir[i_last_slash] = '\0'; printf("-- Temp directory is %s\n", tmp_dir); psz_orig_file = get_temporary_name(NULL, "file"); if (NULL != psz_orig_file) { FILE *fp = fopen(psz_orig_file, "w"); char orig_file[PATH_MAX+1] = {0}; char symlink_file[PATH_MAX+1] = {0}; fprintf(fp, "testing\n"); fclose(fp); cdio_realpath(psz_orig_file, orig_file); if (0 == strlen(orig_file)) { fprintf(stderr, "cdio_realpath on temp file %s failed\n", psz_orig_file); rc = 3; goto err_exit; } psz_symlink_file = get_temporary_name(NULL, "symlink file"); rc = check_rc(symlink(psz_orig_file, psz_symlink_file), "symlink", psz_symlink_file); if (0 == rc) { /* Just when you thought we'd forgotten, here is our first test! */ cdio_realpath(psz_symlink_file, psz_file_check); if (0 != strncmp(psz_file_check, orig_file, PATH_MAX)) { fprintf(stderr, "simple cdio_realpath failed: %s vs %s\n", psz_file_check, orig_file); rc = 4; goto err_exit; } check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file); } /* Make sure we handle a cyclic symbolic name, e.g. xx -> xx */ cdio_realpath(psz_symlink_file, symlink_file); rc = check_rc(symlink(psz_symlink_file, psz_symlink_file), "symlink", psz_symlink_file); if (0 == rc) { char *retvalue = cdio_realpath(psz_symlink_file, psz_file_check); if (0 != retvalue) { if (0 != strncmp(psz_file_check, symlink_file, PATH_MAX)) { fprintf(stderr, "direct cdio_realpath cycle test failed. %s vs %s\n", psz_file_check, symlink_file); rc = 5; goto err_exit; } check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file); } } } check_rc(unlink(psz_orig_file), "unlink", psz_orig_file); check_rc(rmdir(psz_tmp_subdir), "rmdir", psz_tmp_subdir); free(psz_symlink_file); err_exit: free(psz_orig_file); err_exit1: free(psz_tmp_subdir); return rc; } libcdio-2.2.0/test/driver/solaris.c000066400000000000000000000044551474051130400172210ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2009, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/solaris.c */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives=NULL; cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", TEST_DIR, cue_file[i]); */ if (!cdio_have_driver(DRIVER_SOLARIS)) return(77); ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(77); } p_cdio = cdio_open_linux(ppsz_drives[0]); if (p_cdio) { const char *psz_source = cdio_get_arg(p_cdio, "source"); if (0 != strncmp(psz_source, ppsz_drives[0], strlen(ppsz_drives[0]))) { fprintf(stderr, "Got %s; should get back %s, the name we opened.\n", psz_source, ppsz_drives[0]); exit(1); } } cdio_destroy(p_cdio); p_cdio = cdio_open_am_linux(ppsz_drives[0], "SCSI"); if (p_cdio) { const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); if (0 != strncmp(psz_access_mode, "SCSI", strlen("SCSI"))) { fprintf(stderr, "Got %s; Should get back %s, the access mode requested.\n", psz_access_mode, "SCSI"); exit(2); } } cdio_destroy(p_cdio); cdio_free_device_list(ppsz_drives); return 0; } libcdio-2.2.0/test/driver/track.c000066400000000000000000000052441474051130400166460ustar00rootroot00000000000000/* Copyright (C) 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for lib/driver/track.c To compile as standalone program: gcc -g3 -Wall -DHAVE_CONFIG_H -I../.. -I../../include track.c ../../lib/driver/.libs/libcdio.a -o track */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #ifndef DATA_DIR #define DATA_DIR "../data" #endif static void log_handler (cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } int main(int argc, const char *argv[]) { CdIo_t *cdObj; track_t i_track; lsn_t lsn; cdio_log_set_handler (log_handler); if (cdio_have_driver(DRIVER_BINCUE)) { cdObj = cdio_open(DATA_DIR "/cdda.cue", DRIVER_UNKNOWN); } else if (cdio_have_driver(DRIVER_CDRDAO)) { cdObj = cdio_open(DATA_DIR "/cdda.toc", DRIVER_UNKNOWN); } else { printf("-- You don't have enough drivers for this test\n"); return 77; } i_track = cdio_get_track(cdObj, 1000); if (i_track != CDIO_INVALID_TRACK) { printf("LSN 1000 is too large should have gotten CDIO_INVALID_TRACK back\n"); return 1; } for(lsn=0; lsn<10; lsn++) { i_track = cdio_get_track(cdObj, lsn); if (i_track != 1) { printf("LSN %d should return 1. Got %d\n", lsn, i_track); return 3; } } i_track = cdio_get_track(cdObj, 302); if (i_track != CDIO_CDROM_LEADOUT_TRACK) { printf("LSN %d should return leadout. Got %d\n", 302, i_track); return 4; } for(lsn=301; lsn > 300; lsn--) { i_track = cdio_get_track(cdObj, lsn); if (i_track != 1) { printf("LSN %d should return 1. Got %d\n", lsn, i_track); return 4; } } cdio_destroy(cdObj); return 0; } libcdio-2.2.0/test/driver/win32.c000066400000000000000000000067541474051130400165130ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2009, 2010, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/MSWindows/win32.c */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include int main(int argc, const char *argv[]) { CdIo_t *p_cdio; char **ppsz_drives=NULL; cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; /* snprintf(psz_nrgfile, sizeof(psz_nrgfile)-1, "%s/%s", TEST_DIR, cue_file[i]); */ if (!cdio_have_driver(DRIVER_WIN32)) return(77); ppsz_drives = cdio_get_devices(DRIVER_DEVICE); if (!ppsz_drives) { printf("Can't find a CD-ROM drive. Skipping test.\n"); exit(77); } p_cdio = cdio_open_win32(ppsz_drives[0]); if (p_cdio) { const char *psz_source = cdio_get_arg(p_cdio, "source"); const char *psz_scsi_tuple; const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); if (0 != strncmp(psz_source, ppsz_drives[0], strlen(ppsz_drives[0]))) { fprintf(stderr, "Got %s; should get back %s, the name we opened.\n", psz_source, ppsz_drives[0]); cdio_destroy(p_cdio); exit(1); } if (0 == strncmp(psz_access_mode, "ioctl", strlen("ioctl"))) { psz_scsi_tuple = cdio_get_arg(p_cdio, "scsi-tuple"); if (psz_scsi_tuple == NULL) { fprintf(stderr, "cdio_get_arg(\"scsi-tuple\") returns NULL.\n"); cdio_destroy(p_cdio); exit(3); } if (cdio_loglevel_default == CDIO_LOG_DEBUG) printf("Drive '%s' has cdio_get_arg(\"scsi-tuple\") = '%s'\n", psz_source, psz_scsi_tuple); } } cdio_destroy(p_cdio); p_cdio = cdio_open_am_win32(ppsz_drives[0], "ASPI"); if (p_cdio) { const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); if (0 != strncmp(psz_access_mode, "ASPI", strlen("ASPI"))) { fprintf(stderr, "Got %s; Should get back %s, the access mode requested.\n", psz_access_mode, "ASPI"); exit(2); } } p_cdio = cdio_open_am_win32(ppsz_drives[0], "ioctl"); if (p_cdio) { const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); const char *psz_response = cdio_get_arg(p_cdio, "mmc-supported?"); if (0 != strncmp(psz_access_mode, "ioctl", strlen("ioctl"))) { fprintf(stderr, "Got %s; Should get back %s, the access mode requested.\n", psz_access_mode, "ioctl"); exit(3); } if ( psz_response == NULL || ((0 != strncmp("true", psz_response, sizeof("true")))) ) { fprintf(stderr, "cdio_get_arg(\"mmc-supported?\") should return \"true\"; got: %s.\n", psz_response); exit(4); } } cdio_destroy(p_cdio); cdio_free_device_list(ppsz_drives); return 0; } libcdio-2.2.0/test/fsf.right000066400000000000000000000005041474051130400157120ustar00rootroot00000000000000CD Info 2.0 | (c) 2003 Gerd Knorr, Heiko Eifeldt & R. Bernstein __________________________________ CD-ROM Track List (1 - 1) #: MSF LSN Type 1: 00:02:00 000000 audio 170: 01:50:20 008120 leadout __________________________________ try to find out what sort of CD this is Audio CD, CDDB disc ID is 02006c01 libcdio-2.2.0/test/isofs-m1-no-rr.right000066400000000000000000000020541474051130400176270ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : ISO9660 filesystem /: d [LSN 23] 2048 Apr 20 2003 11:26:46 . d [LSN 23] 2048 Apr 20 2003 11:26:46 .. - [LSN 26] 17992 Jul 29 2002 12:39:53 copying d [LSN 24] 2048 Apr 20 2003 16:18:53 doc /DOC/: d [LSN 24] 2048 Apr 20 2003 16:18:53 . d [LSN 23] 2048 Apr 20 2003 11:26:46 .. - [LSN 35] 648 Apr 20 2003 16:18:53 readme.txt libcdio-2.2.0/test/isofs-m1-read.right000066400000000000000000000414021474051130400175050ustar00rootroot000000000000000x0000: 0909 2020 2020 474e 5520 4745 4e45 5241 .. GNU GENERA 0x0010: 4c20 5055 424c 4943 204c 4943 454e 5345 L PUBLIC LICENSE 0x0020: 0a09 0920 2020 2020 2020 5665 7273 696f ... Versio 0x0030: 6e20 322c 204a 756e 6520 3139 3931 0a0a n 2, June 1991.. 0x0040: 2043 6f70 7972 6967 6874 2028 4329 2031 Copyright (C) 1 0x0050: 3938 392c 2031 3939 3120 4672 6565 2053 989, 1991 Free S 0x0060: 6f66 7477 6172 6520 466f 756e 6461 7469 oftware Foundati 0x0070: 6f6e 2c20 496e 632e 0a20 2020 2020 3539 on, Inc.. 59 0x0080: 2054 656d 706c 6520 506c 6163 652c 2053 Temple Place, S 0x0090: 7569 7465 2033 3330 2c20 426f 7374 6f6e uite 330, Boston 0x00a0: 2c20 4d41 2020 3032 3131 312d 3133 3037 , MA 02111-1307 0x00b0: 2020 5553 410a 2045 7665 7279 6f6e 6520 USA. Everyone 0x00c0: 6973 2070 6572 6d69 7474 6564 2074 6f20 is permitted to 0x00d0: 636f 7079 2061 6e64 2064 6973 7472 6962 copy and distrib 0x00e0: 7574 6520 7665 7262 6174 696d 2063 6f70 ute verbatim cop 0x00f0: 6965 730a 206f 6620 7468 6973 206c 6963 ies. of this lic 0x0100: 656e 7365 2064 6f63 756d 656e 742c 2062 ense document, b 0x0110: 7574 2063 6861 6e67 696e 6720 6974 2069 ut changing it i 0x0120: 7320 6e6f 7420 616c 6c6f 7765 642e 0a0a s not allowed... 0x0130: 0909 0920 2020 2050 7265 616d 626c 650a ... Preamble. 0x0140: 0a20 2054 6865 206c 6963 656e 7365 7320 . The licenses 0x0150: 666f 7220 6d6f 7374 2073 6f66 7477 6172 for most softwar 0x0160: 6520 6172 6520 6465 7369 676e 6564 2074 e are designed t 0x0170: 6f20 7461 6b65 2061 7761 7920 796f 7572 o take away your 0x0180: 0a66 7265 6564 6f6d 2074 6f20 7368 6172 .freedom to shar 0x0190: 6520 616e 6420 6368 616e 6765 2069 742e e and change it. 0x01a0: 2020 4279 2063 6f6e 7472 6173 742c 2074 By contrast, t 0x01b0: 6865 2047 4e55 2047 656e 6572 616c 2050 he GNU General P 0x01c0: 7562 6c69 630a 4c69 6365 6e73 6520 6973 ublic.License is 0x01d0: 2069 6e74 656e 6465 6420 746f 2067 7561 intended to gua 0x01e0: 7261 6e74 6565 2079 6f75 7220 6672 6565 rantee your free 0x01f0: 646f 6d20 746f 2073 6861 7265 2061 6e64 dom to share and 0x0200: 2063 6861 6e67 6520 6672 6565 0a73 6f66 change free.sof 0x0210: 7477 6172 652d 2d74 6f20 6d61 6b65 2073 tware--to make s 0x0220: 7572 6520 7468 6520 736f 6674 7761 7265 ure the software 0x0230: 2069 7320 6672 6565 2066 6f72 2061 6c6c is free for all 0x0240: 2069 7473 2075 7365 7273 2e20 2054 6869 its users. Thi 0x0250: 730a 4765 6e65 7261 6c20 5075 626c 6963 s.General Public 0x0260: 204c 6963 656e 7365 2061 7070 6c69 6573 License applies 0x0270: 2074 6f20 6d6f 7374 206f 6620 7468 6520 to most of the 0x0280: 4672 6565 2053 6f66 7477 6172 650a 466f Free Software.Fo 0x0290: 756e 6461 7469 6f6e 2773 2073 6f66 7477 undation's softw 0x02a0: 6172 6520 616e 6420 746f 2061 6e79 206f are and to any o 0x02b0: 7468 6572 2070 726f 6772 616d 2077 686f ther program who 0x02c0: 7365 2061 7574 686f 7273 2063 6f6d 6d69 se authors commi 0x02d0: 7420 746f 0a75 7369 6e67 2069 742e 2020 t to.using it. 0x02e0: 2853 6f6d 6520 6f74 6865 7220 4672 6565 (Some other Free 0x02f0: 2053 6f66 7477 6172 6520 466f 756e 6461 Software Founda 0x0300: 7469 6f6e 2073 6f66 7477 6172 6520 6973 tion software is 0x0310: 2063 6f76 6572 6564 2062 790a 7468 6520 covered by.the 0x0320: 474e 5520 4c69 6272 6172 7920 4765 6e65 GNU Library Gene 0x0330: 7261 6c20 5075 626c 6963 204c 6963 656e ral Public Licen 0x0340: 7365 2069 6e73 7465 6164 2e29 2020 596f se instead.) Yo 0x0350: 7520 6361 6e20 6170 706c 7920 6974 2074 u can apply it t 0x0360: 6f0a 796f 7572 2070 726f 6772 616d 732c o.your programs, 0x0370: 2074 6f6f 2e0a 0a20 2057 6865 6e20 7765 too... When we 0x0380: 2073 7065 616b 206f 6620 6672 6565 2073 speak of free s 0x0390: 6f66 7477 6172 652c 2077 6520 6172 6520 oftware, we are 0x03a0: 7265 6665 7272 696e 6720 746f 2066 7265 referring to fre 0x03b0: 6564 6f6d 2c20 6e6f 740a 7072 6963 652e edom, not.price. 0x03c0: 2020 4f75 7220 4765 6e65 7261 6c20 5075 Our General Pu 0x03d0: 626c 6963 204c 6963 656e 7365 7320 6172 blic Licenses ar 0x03e0: 6520 6465 7369 676e 6564 2074 6f20 6d61 e designed to ma 0x03f0: 6b65 2073 7572 6520 7468 6174 2079 6f75 ke sure that you 0x0400: 0a68 6176 6520 7468 6520 6672 6565 646f .have the freedo 0x0410: 6d20 746f 2064 6973 7472 6962 7574 6520 m to distribute 0x0420: 636f 7069 6573 206f 6620 6672 6565 2073 copies of free s 0x0430: 6f66 7477 6172 6520 2861 6e64 2063 6861 oftware (and cha 0x0440: 7267 6520 666f 720a 7468 6973 2073 6572 rge for.this ser 0x0450: 7669 6365 2069 6620 796f 7520 7769 7368 vice if you wish 0x0460: 292c 2074 6861 7420 796f 7520 7265 6365 ), that you rece 0x0470: 6976 6520 736f 7572 6365 2063 6f64 6520 ive source code 0x0480: 6f72 2063 616e 2067 6574 2069 740a 6966 or can get it.if 0x0490: 2079 6f75 2077 616e 7420 6974 2c20 7468 you want it, th 0x04a0: 6174 2079 6f75 2063 616e 2063 6861 6e67 at you can chang 0x04b0: 6520 7468 6520 736f 6674 7761 7265 206f e the software o 0x04c0: 7220 7573 6520 7069 6563 6573 206f 6620 r use pieces of 0x04d0: 6974 0a69 6e20 6e65 7720 6672 6565 2070 it.in new free p 0x04e0: 726f 6772 616d 733b 2061 6e64 2074 6861 rograms; and tha 0x04f0: 7420 796f 7520 6b6e 6f77 2079 6f75 2063 t you know you c 0x0500: 616e 2064 6f20 7468 6573 6520 7468 696e an do these thin 0x0510: 6773 2e0a 0a20 2054 6f20 7072 6f74 6563 gs... To protec 0x0520: 7420 796f 7572 2072 6967 6874 732c 2077 t your rights, w 0x0530: 6520 6e65 6564 2074 6f20 6d61 6b65 2072 e need to make r 0x0540: 6573 7472 6963 7469 6f6e 7320 7468 6174 estrictions that 0x0550: 2066 6f72 6269 640a 616e 796f 6e65 2074 forbid.anyone t 0x0560: 6f20 6465 6e79 2079 6f75 2074 6865 7365 o deny you these 0x0570: 2072 6967 6874 7320 6f72 2074 6f20 6173 rights or to as 0x0580: 6b20 796f 7520 746f 2073 7572 7265 6e64 k you to surrend 0x0590: 6572 2074 6865 2072 6967 6874 732e 0a54 er the rights..T 0x05a0: 6865 7365 2072 6573 7472 6963 7469 6f6e hese restriction 0x05b0: 7320 7472 616e 736c 6174 6520 746f 2063 s translate to c 0x05c0: 6572 7461 696e 2072 6573 706f 6e73 6962 ertain responsib 0x05d0: 696c 6974 6965 7320 666f 7220 796f 7520 ilities for you 0x05e0: 6966 2079 6f75 0a64 6973 7472 6962 7574 if you.distribut 0x05f0: 6520 636f 7069 6573 206f 6620 7468 6520 e copies of the 0x0600: 736f 6674 7761 7265 2c20 6f72 2069 6620 software, or if 0x0610: 796f 7520 6d6f 6469 6679 2069 742e 0a0a you modify it... 0x0620: 2020 466f 7220 6578 616d 706c 652c 2069 For example, i 0x0630: 6620 796f 7520 6469 7374 7269 6275 7465 f you distribute 0x0640: 2063 6f70 6965 7320 6f66 2073 7563 6820 copies of such 0x0650: 6120 7072 6f67 7261 6d2c 2077 6865 7468 a program, wheth 0x0660: 6572 0a67 7261 7469 7320 6f72 2066 6f72 er.gratis or for 0x0670: 2061 2066 6565 2c20 796f 7520 6d75 7374 a fee, you must 0x0680: 2067 6976 6520 7468 6520 7265 6369 7069 give the recipi 0x0690: 656e 7473 2061 6c6c 2074 6865 2072 6967 ents all the rig 0x06a0: 6874 7320 7468 6174 0a79 6f75 2068 6176 hts that.you hav 0x06b0: 652e 2020 596f 7520 6d75 7374 206d 616b e. You must mak 0x06c0: 6520 7375 7265 2074 6861 7420 7468 6579 e sure that they 0x06d0: 2c20 746f 6f2c 2072 6563 6569 7665 206f , too, receive o 0x06e0: 7220 6361 6e20 6765 7420 7468 650a 736f r can get the.so 0x06f0: 7572 6365 2063 6f64 652e 2020 416e 6420 urce code. And 0x0700: 796f 7520 6d75 7374 2073 686f 7720 7468 you must show th 0x0710: 656d 2074 6865 7365 2074 6572 6d73 2073 em these terms s 0x0720: 6f20 7468 6579 206b 6e6f 7720 7468 6569 o they know thei 0x0730: 720a 7269 6768 7473 2e0a 0a20 2057 6520 r.rights... We 0x0740: 7072 6f74 6563 7420 796f 7572 2072 6967 protect your rig 0x0750: 6874 7320 7769 7468 2074 776f 2073 7465 hts with two ste 0x0760: 7073 3a20 2831 2920 636f 7079 7269 6768 ps: (1) copyrigh 0x0770: 7420 7468 6520 736f 6674 7761 7265 2c20 t the software, 0x0780: 616e 640a 2832 2920 6f66 6665 7220 796f and.(2) offer yo 0x0790: 7520 7468 6973 206c 6963 656e 7365 2077 u this license w 0x07a0: 6869 6368 2067 6976 6573 2079 6f75 206c hich gives you l 0x07b0: 6567 616c 2070 6572 6d69 7373 696f 6e20 egal permission 0x07c0: 746f 2063 6f70 792c 0a64 6973 7472 6962 to copy,.distrib 0x07d0: 7574 6520 616e 642f 6f72 206d 6f64 6966 ute and/or modif 0x07e0: 7920 7468 6520 736f 6674 7761 7265 2e0a y the software.. 0x07f0: 0a20 2041 6c73 6f2c 2066 6f72 2065 6163 . Also, for eac 0x0000: 6820 6175 7468 6f72 2773 2070 726f 7465 h author's prote 0x0010: 6374 696f 6e20 616e 6420 6f75 7273 2c20 ction and ours, 0x0020: 7765 2077 616e 7420 746f 206d 616b 6520 we want to make 0x0030: 6365 7274 6169 6e0a 7468 6174 2065 7665 certain.that eve 0x0040: 7279 6f6e 6520 756e 6465 7273 7461 6e64 ryone understand 0x0050: 7320 7468 6174 2074 6865 7265 2069 7320 s that there is 0x0060: 6e6f 2077 6172 7261 6e74 7920 666f 7220 no warranty for 0x0070: 7468 6973 2066 7265 650a 736f 6674 7761 this free.softwa 0x0080: 7265 2e20 2049 6620 7468 6520 736f 6674 re. If the soft 0x0090: 7761 7265 2069 7320 6d6f 6469 6669 6564 ware is modified 0x00a0: 2062 7920 736f 6d65 6f6e 6520 656c 7365 by someone else 0x00b0: 2061 6e64 2070 6173 7365 6420 6f6e 2c20 and passed on, 0x00c0: 7765 0a77 616e 7420 6974 7320 7265 6369 we.want its reci 0x00d0: 7069 656e 7473 2074 6f20 6b6e 6f77 2074 pients to know t 0x00e0: 6861 7420 7768 6174 2074 6865 7920 6861 hat what they ha 0x00f0: 7665 2069 7320 6e6f 7420 7468 6520 6f72 ve is not the or 0x0100: 6967 696e 616c 2c20 736f 0a74 6861 7420 iginal, so.that 0x0110: 616e 7920 7072 6f62 6c65 6d73 2069 6e74 any problems int 0x0120: 726f 6475 6365 6420 6279 206f 7468 6572 roduced by other 0x0130: 7320 7769 6c6c 206e 6f74 2072 6566 6c65 s will not refle 0x0140: 6374 206f 6e20 7468 6520 6f72 6967 696e ct on the origin 0x0150: 616c 0a61 7574 686f 7273 2720 7265 7075 al.authors' repu 0x0160: 7461 7469 6f6e 732e 0a0a 2020 4669 6e61 tations... Fina 0x0170: 6c6c 792c 2061 6e79 2066 7265 6520 7072 lly, any free pr 0x0180: 6f67 7261 6d20 6973 2074 6872 6561 7465 ogram is threate 0x0190: 6e65 6420 636f 6e73 7461 6e74 6c79 2062 ned constantly b 0x01a0: 7920 736f 6674 7761 7265 0a70 6174 656e y software.paten 0x01b0: 7473 2e20 2057 6520 7769 7368 2074 6f20 ts. We wish to 0x01c0: 6176 6f69 6420 7468 6520 6461 6e67 6572 avoid the danger 0x01d0: 2074 6861 7420 7265 6469 7374 7269 6275 that redistribu 0x01e0: 746f 7273 206f 6620 6120 6672 6565 0a70 tors of a free.p 0x01f0: 726f 6772 616d 2077 696c 6c20 696e 6469 rogram will indi 0x0200: 7669 6475 616c 6c79 206f 6274 6169 6e20 vidually obtain 0x0210: 7061 7465 6e74 206c 6963 656e 7365 732c patent licenses, 0x0220: 2069 6e20 6566 6665 6374 206d 616b 696e in effect makin 0x0230: 6720 7468 650a 7072 6f67 7261 6d20 7072 g the.program pr 0x0240: 6f70 7269 6574 6172 792e 2020 546f 2070 oprietary. To p 0x0250: 7265 7665 6e74 2074 6869 732c 2077 6520 revent this, we 0x0260: 6861 7665 206d 6164 6520 6974 2063 6c65 have made it cle 0x0270: 6172 2074 6861 7420 616e 790a 7061 7465 ar that any.pate 0x0280: 6e74 206d 7573 7420 6265 206c 6963 656e nt must be licen 0x0290: 7365 6420 666f 7220 6576 6572 796f 6e65 sed for everyone 0x02a0: 2773 2066 7265 6520 7573 6520 6f72 206e 's free use or n 0x02b0: 6f74 206c 6963 656e 7365 6420 6174 2061 ot licensed at a 0x02c0: 6c6c 2e0a 0a20 2054 6865 2070 7265 6369 ll... The preci 0x02d0: 7365 2074 6572 6d73 2061 6e64 2063 6f6e se terms and con 0x02e0: 6469 7469 6f6e 7320 666f 7220 636f 7079 ditions for copy 0x02f0: 696e 672c 2064 6973 7472 6962 7574 696f ing, distributio 0x0300: 6e20 616e 640a 6d6f 6469 6669 6361 7469 n and.modificati 0x0310: 6f6e 2066 6f6c 6c6f 772e 0a0c 0a09 0920 on follow...... 0x0320: 2020 2047 4e55 2047 454e 4552 414c 2050 GNU GENERAL P 0x0330: 5542 4c49 4320 4c49 4345 4e53 450a 2020 UBLIC LICENSE. 0x0340: 2054 4552 4d53 2041 4e44 2043 4f4e 4449 TERMS AND CONDI 0x0350: 5449 4f4e 5320 464f 5220 434f 5059 494e TIONS FOR COPYIN 0x0360: 472c 2044 4953 5452 4942 5554 494f 4e20 G, DISTRIBUTION 0x0370: 414e 4420 4d4f 4449 4649 4341 5449 4f4e AND MODIFICATION 0x0380: 0a0a 2020 302e 2054 6869 7320 4c69 6365 .. 0. This Lice 0x0390: 6e73 6520 6170 706c 6965 7320 746f 2061 nse applies to a 0x03a0: 6e79 2070 726f 6772 616d 206f 7220 6f74 ny program or ot 0x03b0: 6865 7220 776f 726b 2077 6869 6368 2063 her work which c 0x03c0: 6f6e 7461 696e 730a 6120 6e6f 7469 6365 ontains.a notice 0x03d0: 2070 6c61 6365 6420 6279 2074 6865 2063 placed by the c 0x03e0: 6f70 7972 6967 6874 2068 6f6c 6465 7220 opyright holder 0x03f0: 7361 7969 6e67 2069 7420 6d61 7920 6265 saying it may be 0x0400: 2064 6973 7472 6962 7574 6564 0a75 6e64 distributed.und 0x0410: 6572 2074 6865 2074 6572 6d73 206f 6620 er the terms of 0x0420: 7468 6973 2047 656e 6572 616c 2050 7562 this General Pub 0x0430: 6c69 6320 4c69 6365 6e73 652e 2020 5468 lic License. Th 0x0440: 6520 2250 726f 6772 616d 222c 2062 656c e "Program", bel 0x0450: 6f77 2c0a 7265 6665 7273 2074 6f20 616e ow,.refers to an 0x0460: 7920 7375 6368 2070 726f 6772 616d 206f y such program o 0x0470: 7220 776f 726b 2c20 616e 6420 6120 2277 r work, and a "w 0x0480: 6f72 6b20 6261 7365 6420 6f6e 2074 6865 ork based on the 0x0490: 2050 726f 6772 616d 220a 6d65 616e 7320 Program".means 0x04a0: 6569 7468 6572 2074 6865 2050 726f 6772 either the Progr 0x04b0: 616d 206f 7220 616e 7920 6465 7269 7661 am or any deriva 0x04c0: 7469 7665 2077 6f72 6b20 756e 6465 7220 tive work under 0x04d0: 636f 7079 7269 6768 7420 6c61 773a 0a74 copyright law:.t 0x04e0: 6861 7420 6973 2074 6f20 7361 792c 2061 hat is to say, a 0x04f0: 2077 6f72 6b20 636f 6e74 6169 6e69 6e67 work containing 0x0500: 2074 6865 2050 726f 6772 616d 206f 7220 the Program or 0x0510: 6120 706f 7274 696f 6e20 6f66 2069 742c a portion of it, 0x0520: 0a65 6974 6865 7220 7665 7262 6174 696d .either verbatim 0x0530: 206f 7220 7769 7468 206d 6f64 6966 6963 or with modific 0x0540: 6174 696f 6e73 2061 6e64 2f6f 7220 7472 ations and/or tr 0x0550: 616e 736c 6174 6564 2069 6e74 6f20 616e anslated into an 0x0560: 6f74 6865 720a 6c61 6e67 7561 6765 2e20 other.language. 0x0570: 2028 4865 7265 696e 6166 7465 722c 2074 (Hereinafter, t 0x0580: 7261 6e73 6c61 7469 6f6e 2069 7320 696e ranslation is in 0x0590: 636c 7564 6564 2077 6974 686f 7574 206c cluded without l 0x05a0: 696d 6974 6174 696f 6e20 696e 0a74 6865 imitation in.the 0x05b0: 2074 6572 6d20 226d 6f64 6966 6963 6174 term "modificat 0x05c0: 696f 6e22 2e29 2020 4561 6368 206c 6963 ion".) Each lic 0x05d0: 656e 7365 6520 6973 2061 6464 7265 7373 ensee is address 0x05e0: 6564 2061 7320 2279 6f75 222e 0a0a 4163 ed as "you"...Ac 0x05f0: 7469 7669 7469 6573 206f 7468 6572 2074 tivities other t 0x0600: 6861 6e20 636f 7079 696e 672c 2064 6973 han copying, dis 0x0610: 7472 6962 7574 696f 6e20 616e 6420 6d6f tribution and mo 0x0620: 6469 6669 6361 7469 6f6e 2061 7265 206e dification are n 0x0630: 6f74 0a63 6f76 6572 6564 2062 7920 7468 ot.covered by th 0x0640: 6973 204c 6963 656e 7365 3b20 7468 6579 is License; they 0x0650: 2061 7265 206f 7574 7369 6465 2069 7473 are outside its 0x0660: 2073 636f 7065 2e20 2054 6865 2061 6374 scope. The act 0x0670: 206f 660a 7275 6e6e 696e 6720 7468 6520 of.running the 0x0680: 5072 6f67 7261 6d20 6973 206e 6f74 2072 Program is not r 0x0690: 6573 7472 6963 7465 642c 2061 6e64 2074 estricted, and t 0x06a0: 6865 206f 7574 7075 7420 6672 6f6d 2074 he output from t 0x06b0: 6865 2050 726f 6772 616d 0a69 7320 636f he Program.is co 0x06c0: 7665 7265 6420 6f6e 6c79 2069 6620 6974 vered only if it 0x06d0: 7320 636f 6e74 656e 7473 2063 6f6e 7374 s contents const 0x06e0: 6974 7574 6520 6120 776f 726b 2062 6173 itute a work bas 0x06f0: 6564 206f 6e20 7468 650a 5072 6f67 7261 ed on the.Progra 0x0700: 6d20 2869 6e64 6570 656e 6465 6e74 206f m (independent o 0x0710: 6620 6861 7669 6e67 2062 6565 6e20 6d61 f having been ma 0x0720: 6465 2062 7920 7275 6e6e 696e 6720 7468 de by running th 0x0730: 6520 5072 6f67 7261 6d29 2e0a 5768 6574 e Program)..Whet 0x0740: 6865 7220 7468 6174 2069 7320 7472 7565 her that is true 0x0750: 2064 6570 656e 6473 206f 6e20 7768 6174 depends on what 0x0760: 2074 6865 2050 726f 6772 616d 2064 6f65 the Program doe 0x0770: 732e 0a0a 2020 312e 2059 6f75 206d 6179 s... 1. You may 0x0780: 2063 6f70 7920 616e 6420 6469 7374 7269 copy and distri 0x0790: 6275 7465 2076 6572 6261 7469 6d20 636f bute verbatim co 0x07a0: 7069 6573 206f 6620 7468 6520 5072 6f67 pies of the Prog 0x07b0: 7261 6d27 730a 736f 7572 6365 2063 6f64 ram's.source cod 0x07c0: 6520 6173 2079 6f75 2072 6563 6569 7665 e as you receive 0x07d0: 2069 742c 2069 6e20 616e 7920 6d65 6469 it, in any medi 0x07e0: 756d 2c20 7072 6f76 6964 6564 2074 6861 um, provided tha 0x07f0: 7420 796f 750a 636f 6e73 7069 6375 6f75 t you.conspicuou libcdio-2.2.0/test/isofs-m1-test2.right000066400000000000000000000022771474051130400176420ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : ISO9660 filesystem /: drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 11:26:46 . drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 11:26:46 .. -rw-r--r-- 1 715 715 [LSN 26] 17992 Jul 29 2002 12:39:53 COPYING drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 16:18:53 doc /doc/: drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 16:18:53 . drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 11:26:46 .. -rw-rw-r-- 1 715 715 [LSN 35] 648 Apr 20 2003 16:18:53 readme.txt libcdio-2.2.0/test/isofs-m1.right000066400000000000000000000022771474051130400166030ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 1) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 data false no 170: 00:06:02 000302 leadout (693 KB raw, 604 KB formatted) Media Catalog Number (MCN): 0000012101954 Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 64 blocks, label `CDROM ' Application: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Preparer : Publisher : System : LINUX Volume : CDROM Volume Set : ISO9660 filesystem /: drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 11:26:46 . drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 11:26:46 .. -rw-r--r-- 1 715 715 [LSN 26] 17992 Jul 29 2002 12:39:53 COPYING drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 16:18:53 doc /doc/: drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 16:18:53 . drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 11:26:46 .. -rw-rw-r-- 1 715 715 [LSN 35] 648 Apr 20 2003 16:18:53 readme.txt libcdio-2.2.0/test/joliet-nojoliet.right000066400000000000000000000013541474051130400202470ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: d [LSN 28] 2048 Oct 22 2004 22:44:59 . d [LSN 28] 2048 Oct 22 2004 22:44:59 .. d [LSN 29] 2048 Oct 22 2004 22:44:59 libcdio /libcdio/: d [LSN 29] 2048 Oct 22 2004 22:44:59 . d [LSN 28] 2048 Oct 22 2004 22:44:59 .. - [LSN 34] 17992 Mar 12 2004 07:18:03 copying - [LSN 43] 2156 Jun 26 2004 10:01:09 readme - [LSN 45] 2849 Aug 12 2004 09:22:23 readme.libcdio d [LSN 30] 2048 Oct 22 2004 22:44:59 test /libcdio/test/: d [LSN 30] 2048 Oct 22 2004 22:44:59 . d [LSN 29] 2048 Oct 22 2004 22:44:59 .. - [LSN 47] 74 Jul 25 2004 09:52:32 isofs_m1.cue libcdio-2.2.0/test/joliet.right000066400000000000000000000013541474051130400164260ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: d [LSN 31] 2048 Oct 22 2004 22:44:59 . d [LSN 31] 2048 Oct 22 2004 22:44:59 .. d [LSN 32] 2048 Oct 22 2004 22:44:59 libcdio /libcdio/: d [LSN 32] 2048 Oct 22 2004 22:44:59 . d [LSN 31] 2048 Oct 22 2004 22:44:59 .. - [LSN 34] 17992 Mar 12 2004 07:18:03 COPYING - [LSN 43] 2156 Jun 26 2004 10:01:09 README - [LSN 45] 2849 Aug 12 2004 09:22:23 README.libcdio d [LSN 33] 2048 Oct 22 2004 22:44:59 test /libcdio/test/: d [LSN 33] 2048 Oct 22 2004 22:44:59 . d [LSN 32] 2048 Oct 22 2004 22:44:59 .. - [LSN 47] 74 Jul 25 2004 09:52:32 isofs-m1.cue libcdio-2.2.0/test/malformed.right000066400000000000000000000001421474051130400171000ustar00rootroot00000000000000Error getting above directory information __________________________________ ISO-9660 Information libcdio-2.2.0/test/malformed2.right000066400000000000000000000002001474051130400171550ustar00rootroot00000000000000Error getting above directory information __________________________________ ISO-9660 Information 2048 /a 0 /b.txt libcdio-2.2.0/test/monvoisin.right000066400000000000000000000061351474051130400171630ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD DATA (Mode 2) CD-ROM Track List (1 - 2) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 XA true no 2: 00:18:51 001251 XA true no 170: 00:39:71 002846 leadout (6 MB raw, 6 MB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with CD-RTOS and ISO 9660 filesystem ISO 9660: 1101 blocks, label `MONVOISIN ' Application: CDI/CDI_VCD.APP;1 Preparer : Publisher : System : CD-RTOS CD-BRIDGE Volume : MONVOISIN Volume Set : ISO9660 filesystem /: d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Feb 19 2001 15:37:04 cdi d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Feb 19 2001 15:37:04 ext d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Feb 19 2001 15:37:04 mpegav d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Feb 19 2001 15:37:04 segment d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Feb 19 2001 15:37:04 vcd /CDI/: d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jan 01 1970 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 .. ---2-xrxrxr 0 0 [fn 01] [LSN 211] 1494332 ( 1315168) Feb 19 2001 15:37:04 cdi_imag.rtf ----1xrxrxr 0 0 [fn 01] [LSN 854] 13616 Feb 19 2001 15:37:04 cdi_text.fnt ----1xrxrxr 0 0 [fn 01] [LSN 861] 102400 Feb 19 2001 15:37:04 cdi_vcd.app ----1xrxrxr 0 0 [fn 01] [LSN 911] 279 Feb 19 2001 15:37:04 cdi_vcd.cfg /EXT/: d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 01 1970 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 912] 65536 Feb 19 2001 15:37:04 lot_x.vcd ----1xrxrxr 0 0 [fn 01] [LSN 944] 24 Feb 19 2001 15:37:04 psd_x.vcd ----1xrxrxr 0 0 [fn 01] [LSN 945] 114 Feb 19 2001 15:37:04 scandata.dat /MPEGAV/: d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jan 01 1970 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 .. ---2-xrxrxr 0 0 [fn 01] [LSN 1251] 3655652 ( 3221504) Feb 19 2001 15:37:59 avseq01.dat /SEGMENT/: d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jan 01 1970 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 .. /VCD/: d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jan 01 1970 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Feb 19 2001 15:37:04 entries.vcd ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Feb 19 2001 15:37:04 info.vcd ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Feb 19 2001 15:37:04 lot.vcd ----1xrxrxr 0 0 [fn 00] [LSN 184] 24 Feb 19 2001 15:37:04 psd.vcd XA sectors Video CD session #2 starts at track 2, LSN: 1251, ISO 9660 blocks: 1101 ISO 9660: 1101 blocks, label `MONVOISIN ' libcdio-2.2.0/test/multiextent.right000066400000000000000000000004371474051130400175230ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: drwxr-xr-x 1 0 0 [LSN 18] 2048 Mar 27 2023 14:09:08 . drwxr-xr-x 1 0 0 [LSN 18] 2048 Mar 27 2023 14:09:08 .. -rw-r--r-- 1 1007 1001 [LSN 33] 54305 Jun 17 2020 19:29:52 multi_extent_file libcdio-2.2.0/test/multiextent_emultocpad.right000066400000000000000000000004371474051130400217400ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: drwxr-xr-x 1 0 0 [LSN 50] 2048 Jun 27 2018 08:21:56 . drwxr-xr-x 1 0 0 [LSN 50] 2048 Jun 27 2018 08:21:56 .. -rw-r--r-- 1 1000 1000 [LSN 55] 54305 Jun 10 2018 17:52:58 multi_extent_file libcdio-2.2.0/test/multiextent_joliet.right000066400000000000000000000003461474051130400210700ustar00rootroot00000000000000__________________________________ ISO-9660 Information /: d [LSN 22] 2048 Mar 27 2023 14:08:05 . d [LSN 22] 2048 Mar 27 2023 14:08:05 .. - [LSN 33] 54305 Jun 17 2020 19:29:52 multi_extent_file libcdio-2.2.0/test/svcd_ogt_test_ntsc.right000066400000000000000000000052211474051130400210330ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 2) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 XA true yes 2: 00:09:01 000526 XA true yes 170: 00:56:56 004106 leadout (9 MB raw, 9 MB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with CD-RTOS and ISO 9660 filesystem ISO 9660: 376 blocks, label `SVCD_OGT_TEST_NTSC ' Application: Preparer : GNU VCDIMAGER 0.7.12 LINUX-GNU/I386 Publisher : System : CD-RTOS CD-BRIDGE Volume : SVCD_OGT_TEST_NTSC Volume Set : ISO9660 filesystem /: d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 ext d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 mpeg2 d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 segment d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 svcd /EXT/: d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 375] 201 Jul 14 1978 00:00:00 scandata.dat /MPEG2/: d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 00] [LSN 526] 7971320 ( 7024640) Jul 14 1978 00:00:00 avseq01.mpg /SEGMENT/: d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 00] [LSN 225] 183596 ( 161792) Jul 14 1978 00:00:00 item0001.mpg /SVCD/: d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Jul 14 1978 00:00:00 entries.svd ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Jul 14 1978 00:00:00 info.svd ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Jul 14 1978 00:00:00 lot.svd ----1xrxrxr 0 0 [fn 00] [LSN 184] 40 Jul 14 1978 00:00:00 psd.svd ----1xrxrxr 0 0 [fn 00] [LSN 186] 190 Jul 14 1978 00:00:00 search.dat ----1xrxrxr 0 0 [fn 00] [LSN 185] 2048 Jul 14 1978 00:00:00 tracks.svd XA sectors Super Video CD (SVCD) or Chaoji Video CD (CVD) session #2 starts at track 2, LSN: 526, ISO 9660 blocks: 376 ISO 9660: 376 blocks, label `SVCD_OGT_TEST_NTSC ' libcdio-2.2.0/test/svcdgs.right000066400000000000000000000072001474051130400164250ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD DATA (Mode 2) CD-ROM Track List (1 - 2) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 XA true no 2: 00:22:53 001553 XA true no 170: 01:17:62 005687 leadout (12 MB raw, 12 MB formatted) Media Catalog Number (MCN): Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with ISO 9660 filesystem ISO 9660: 6610 blocks, label `SVCD ' Application: I-author v1.0, EnReach, Inc. (C) Copyright 1998, Kernel writen by Hujianjun Preparer : EnReach Publisher : EnReach System : S_VCD30 DISC of EnReach Volume : SVCD Volume Set : SVCD01 ISO9660 filesystem /: d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jan 06 2001 21:29:31 autorun d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jan 06 2001 21:29:31 data d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jan 06 2001 21:29:31 ext d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jan 06 2001 21:29:31 mpegav d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jan 06 2001 21:29:31 segment d---1xrxrxr 0 0 [fn 00] [LSN 26] 2048 Jan 06 2001 21:29:31 svcd d---1xrxrxr 0 0 [fn 00] [LSN 27] 2048 Jan 06 2001 21:29:31 vmp /AUTORUN/: d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. /DATA/: d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. d---1xrxrxr 0 0 [fn 00] [LSN 300] 2048 Jan 06 2001 21:29:31 svcddata /DATA/SVCDDATA/: d---1xrxrxr 0 0 [fn 00] [LSN 300] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jan 06 2001 21:29:31 .. /EXT/: d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. /MPEGAV/: d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. ---2--r-r-r 0 0 [fn 01] [LSN 463] 13909140 ( 12257280) Jan 06 2001 21:29:31 avseq01.mpg /SEGMENT/: d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. /SVCD/: d---1xrxrxr 0 0 [fn 00] [LSN 26] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. ----1xr-rxr 0 0 [fn 00] [LSN 151] 2048 Jan 06 2001 21:29:31 entries.svd ----1xr-rxr 0 0 [fn 00] [LSN 150] 2048 Jan 06 2001 21:29:31 info.svd ----1xr-rxr 0 0 [fn 00] [LSN 152] 65536 Jan 06 2001 21:29:31 lot.svd ----1xr-rxr 0 0 [fn 00] [LSN 184] 16 Jan 06 2001 21:29:31 psd.svd ----1xr-rxr 0 0 [fn 00] [LSN 188] 427 Jan 06 2001 21:29:31 search.dat ----1xr-rxr 0 0 [fn 00] [LSN 186] 4096 Jan 06 2001 21:29:31 spicontx.svd ----1xr-rxr 0 0 [fn 00] [LSN 185] 2048 Jan 06 2001 21:29:31 tracks.svd /VMP/: d---1xrxrxr 0 0 [fn 00] [LSN 27] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 06 2001 21:29:31 .. d---1xrxrxr 0 0 [fn 00] [LSN 28] 2048 Jan 06 2001 21:29:31 svcdj /VMP/SVCDJ/: d---1xrxrxr 0 0 [fn 00] [LSN 28] 2048 Jan 06 2001 21:29:31 . d---1xrxrxr 0 0 [fn 00] [LSN 27] 2048 Jan 06 2001 21:29:31 .. XA sectors Chaoji Video CD (CVD) libcdio-2.2.0/test/test_lib_driver_util.c000066400000000000000000000026331474051130400204630ustar00rootroot00000000000000/* -*- C -*- Copyright (C) 2009, 2011 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Unit test for lib/driver/util.c */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include int main(int argc, const char *argv[]) { if (0 != strncmp(cdio_version_string, CDIO_VERSION, strlen(CDIO_VERSION))) { fprintf(stderr, "CDIO VERSION string mismatch %s vs %s\n", cdio_version_string, CDIO_VERSION); exit(1); } if (libcdio_version_num != LIBCDIO_VERSION_NUM) { fprintf(stderr, "LIBCDIO_VERSION_NUM value mismatch %d vs %d\n", libcdio_version_num, LIBCDIO_VERSION_NUM); exit(2); } exit(0); } libcdio-2.2.0/test/testassert.c000066400000000000000000000017041474051130400164450ustar00rootroot00000000000000/* Copyright (C) 2001, 2008 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif /* Private headers */ #include "cdio_assert.h" int main (int argc, const char *argv[]) { cdio_assert (argc < 2); cdio_assert_not_reached (); return 0; } libcdio-2.2.0/test/testgetdevices.c000066400000000000000000000114301474051130400172630ustar00rootroot00000000000000/* Copyright (C) 2008-2009, 2011, 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for cdio_get_devices, cdio_get_devices_with_cap(), and cdio_free_device_list() */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_UTSNAME_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #ifndef DATA_DIR #define DATA_DIR "./data" #endif #ifndef __MINGW32__ static void log_handler (cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } static bool is_in(char **file_list, const char *file) { char **p; for (p = file_list; p != NULL && *p != NULL; p++) { if (strcmp(*p, file) == 0) { printf("-- File %s found as expected\n", file); return true; } } printf("-- Can't find file %s in list\n", file); return false; } #endif int main(int argc, const char *argv[]) { #if defined(__MINGW32__) printf("testgetdevices test skipped until drive recording testing issues resolved\n"); return 77; #else char **nrg_images=NULL; char **bincue_images=NULL; char **imgs; unsigned int i; int ret=0; const char *cue_files[2] = {"cdda.cue", "isofs-m1.cue"}; const char *nrg_files[1] = {"videocd.nrg"}; cdio_log_set_handler (log_handler); if (cdio_have_driver(-1) != false) { fprintf(stderr, "Bogus driver number -1 should be rejected\n"); return 5; } #ifdef HAVE_SYS_UTSNAME_H { struct utsname utsname; if (0 == uname(&utsname)) { if (0 == strncmp("Linux", utsname.sysname, sizeof("Linux"))) { if (!cdio_have_driver(DRIVER_LINUX)) { fprintf(stderr, "You should have been able to get GNU/Linux driver\n"); return 6; } else { printf("-- Good! You have the GNU/Linux driver installed.\n"); } } else if (0 == strncmp("CYGWIN", utsname.sysname, sizeof("CYGWIN"))) { if (!cdio_have_driver(DRIVER_WIN32)) { fprintf(stderr, "You should have been able to get Win32 driver\n"); return 6; } else { printf("-- Good! You have the Win32 driver installed.\n"); } } else if (0 == strncmp("Darwin", utsname.sysname, sizeof("Darwin"))) { if (!cdio_have_driver(DRIVER_OSX)) { fprintf(stderr, "You should have been able to get OS/X driver\n"); return 6; } else { printf("-- Good! You have the OS/X driver installed.\n"); } } else if (0 == strncmp("NetBSD", utsname.sysname, sizeof("NetBSD"))) { if (!cdio_have_driver(DRIVER_NETBSD)) { fprintf(stderr, "You should have been able to get NetBSD driver\n"); return 6; } else { printf("-- Good! You have the OS/X driver installed.\n"); } } } } #endif if (! (cdio_have_driver(DRIVER_NRG) && cdio_have_driver(DRIVER_BINCUE)) ) { printf("You don't have enough drivers for this test\n"); exit(77); } bincue_images = cdio_get_devices(DRIVER_BINCUE); for (imgs=bincue_images; *imgs != NULL; imgs++) { printf("-- bincue image %s\n", *imgs); } if (ret != 0) return ret; if (0 == chdir(DATA_DIR)) { int invalid_images = 0; nrg_images = cdio_get_devices(DRIVER_NRG); for (imgs=nrg_images; *imgs != NULL; imgs++) { printf("-- NRG image %s\n", *imgs); } if (!is_in(nrg_images, nrg_files[0])) { cdio_free_device_list(nrg_images); return 10; } for (i=0; i<2; i++) { if (is_in(bincue_images, cue_files[i])) { printf("-- %s parses as a CDRWIN BIN/CUE csheet.\n", cue_files[i]); } else { printf("-- %s doesn't parse as a CDRWIN BIN/CUE csheet.\n", cue_files[i]); invalid_images += 1; } } printf("invaid images is %d\n", invalid_images); ret = invalid_images != 2; } cdio_free_device_list(nrg_images); cdio_free_device_list(bincue_images); return ret; #endif } libcdio-2.2.0/test/testischar.c000066400000000000000000000027411474051130400164170ustar00rootroot00000000000000/* Copyright (C) 2001, 2008 Herbert Valerio Riedel 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests ISO9660 character sets. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #include int main (int argc, const char *argv[]) { int i, j; printf ("-- "); for (j = 0; j < 0x10; j++) printf (" %1.1x", j); printf (" |"); for (j = 0; j < 0x10; j++) printf (" %1.1x", j); printf ("\n-- "); for (i = 0; i < 0x10; i++) { printf ("%1.1x ", i); for (j = 0; j < 0x10; j++) { int c = (j << 4) + i; printf (" %c", iso9660_is_dchar (c) ? c : ' '); } printf (" |"); for (j = 0; j < 0x10; j++) { int c = (j << 4) + i; printf (" %c", iso9660_is_achar (c) ? c : ' '); } printf ("\n-- "); } printf ("\n"); return 0; } libcdio-2.2.0/test/testiso9660.c000066400000000000000000000202511474051130400162610ustar00rootroot00000000000000/* Copyright (C) 2003, 2006-2009, 2011, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests ISO9660 library routines. */ #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDIO_H #include #endif #include static bool time_compare(struct tm *p_tm1, struct tm *p_tm2) { bool okay = true; if (!p_tm1) { printf("get time is NULL\n"); return false; } if (!p_tm2) { printf("set time is NULL\n"); return false; } if (p_tm1->tm_year != p_tm2->tm_year) { printf("Years aren't equal. get: %d, set %d\n", p_tm1->tm_year, p_tm2->tm_year); okay=false; } if (p_tm1->tm_mon != p_tm2->tm_mon) { printf("Months aren't equal. get: %d, set %d\n", p_tm1->tm_mon, p_tm2->tm_mon); okay=false; } if (p_tm1->tm_mday != p_tm2->tm_mday) { printf("Month days aren't equal. get: %d, set %d\n", p_tm1->tm_mday, p_tm2->tm_mday); okay=false; } if (p_tm1->tm_min != p_tm2->tm_min) { printf("minutes aren't equal. get: %d, set %d\n", p_tm1->tm_min, p_tm2->tm_min); okay=false; } if (p_tm1->tm_hour != p_tm2->tm_hour) { printf("hours aren't equal. get: %d, set %d\n", p_tm1->tm_hour, p_tm2->tm_hour); okay=false; } if (p_tm1->tm_sec != p_tm2->tm_sec) { printf("seconds aren't equal. get: %d, set %d\n", p_tm1->tm_sec, p_tm2->tm_sec); okay=false; } if (p_tm1->tm_wday != p_tm2->tm_wday) { printf("Week days aren't equal. get: %d, set %d\n", p_tm1->tm_wday, p_tm2->tm_wday); okay=false; } if (p_tm1->tm_yday != p_tm2->tm_yday) { printf("Year days aren't equal. get: %d, set %d\n", p_tm1->tm_yday, p_tm2->tm_yday); okay=false; } #ifdef FIXED if (p_tm1->tm_isdst != p_tm2->tm_isdst) { printf("Is daylight savings times aren't equal. get: %d, set %d\n", p_tm1->tm_isdst, p_tm2->tm_isdst); okay=false; } #endif #ifdef HAVE_TM_GMTOFF if (p_tm1->tm_gmtoff != p_tm2->tm_gmtoff) { printf("GMT offsets aren't equal. get: %ld, set %ld\n", p_tm1->tm_gmtoff, p_tm2->tm_gmtoff); okay=false; } if (p_tm1 != p_tm2 && p_tm1 && p_tm2) { #ifdef FIXED if (strcmp(p_tm1->tm_zone, p_tm2->tm_zone) != 0) { printf("Time Zone values. get: %s, set %s\n", p_tm1->tm_zone, p_tm2->tm_zone); /* Argh... sometimes GMT is converted to UTC. So Let's not call this a failure if everything else was okay. */ } #endif } #endif return okay; } int main (int argc, const char *argv[]) { int c; int i; int i_bad = 0; char dst[100]; char *dst_p; int achars[] = {'!', '"', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', '?', '<', '=', '>'}; /********************************************* * Test ACHAR and DCHAR *********************************************/ for (c='A'; c<='Z'; c++ ) { if (!iso9660_is_dchar(c)) { printf("Failed iso9660_is_dchar test on %c\n", c); i_bad++; } if (!iso9660_is_achar(c)) { printf("Failed iso9660_is_achar test on %c\n", c); i_bad++; } } if (i_bad) return i_bad; for (c='0'; c<='9'; c++ ) { if (!iso9660_is_dchar(c)) { printf("Failed iso9660_is_dchar test on %c\n", c); i_bad++; } if (!iso9660_is_achar(c)) { printf("Failed iso9660_is_achar test on %c\n", c); i_bad++; } } if (i_bad) return i_bad; for (i=0; i<=13; i++ ) { c=achars[i]; if (iso9660_is_dchar(c)) { printf("Should not pass iso9660_is_dchar test on %c\n", c); i_bad++; } if (!iso9660_is_achar(c)) { printf("Failed iso9660_is_achar test on symbol %c\n", c); i_bad++; } } if (i_bad) return i_bad; /********************************************* * Test iso9660_strncpy_pad *********************************************/ iso9660_strncpy_pad(dst, "1_3", 5, ISO9660_DCHARS); if ( 0 != strncmp(dst, "1_3 ", 5) ) { printf("Failed iso9660_strncpy_pad DCHARS\n"); return 31; } iso9660_strncpy_pad(dst, "ABC!123", 2, ISO9660_ACHARS); if ( 0 != strncmp(dst, "AB", 2) ) { printf("Failed iso9660_strncpy_pad ACHARS truncation\n"); return 32; } /********************************************* * Test iso9660_dirname_valid_p *********************************************/ if ( iso9660_dirname_valid_p("/NOGOOD") ) { printf("/NOGOOD should fail iso9660_dirname_valid_p\n"); return 33; } if ( iso9660_dirname_valid_p("LONGDIRECTORY/NOGOOD") ) { printf("LONGDIRECTORY/NOGOOD should fail iso9660_dirname_valid_p\n"); return 34; } if ( !iso9660_dirname_valid_p("OKAY/DIR") ) { printf("OKAY/DIR should pass iso9660_dirname_valid_p\n"); return 35; } if ( iso9660_dirname_valid_p("OKAY/FILE.EXT") ) { printf("OKAY/FILENAME.EXT should fail iso9660_dirname_valid_p\n"); return 36; } /********************************************* * Test iso9660_pathname_valid_p *********************************************/ if ( !iso9660_pathname_valid_p("OKAY/FILE.EXT") ) { printf("OKAY/FILE.EXT should pass iso9660_dirname_valid_p\n"); return 37; } if ( iso9660_pathname_valid_p("OKAY/FILENAMETOOLONG.EXT") ) { printf("OKAY/FILENAMETOOLONG.EXT should fail iso9660_dirname_valid_p\n"); return 38; } if ( iso9660_pathname_valid_p("OKAY/FILE.LONGEXT") ) { printf("OKAY/FILE.LONGEXT should fail iso9660_dirname_valid_p\n"); return 39; } dst_p = iso9660_pathname_isofy ("this/file.ext", 1); if ( 0 != strncmp(dst_p, "this/file.ext;1", 16) ) { printf("Failed iso9660_pathname_isofy\n"); free(dst_p); return 40; } free(dst_p); /********************************************* * Test get/set date *********************************************/ { struct tm *p_tm, tm; iso9660_dtime_t dtime; time_t now = time(NULL); memset(&dtime, 0, sizeof(dtime)); p_tm = localtime(&now); iso9660_set_dtime(p_tm, &dtime); iso9660_get_dtime(&dtime, true, &tm); p_tm = gmtime(&now); iso9660_set_dtime_with_timezone(p_tm, 0, &dtime); if (!iso9660_get_dtime(&dtime, false, &tm)) { printf("Error returned by iso9660_get_dtime_with_timezone\n"); return 41; } if ( !time_compare(p_tm, &tm) ) { printf("GMT time retrieved with iso9660_get_dtime_with_timezone() not same as that\n"); printf("set with iso9660_set_dtime().\n"); return 42; } #ifdef HAVE_TM_GMTOFF if ( !time_compare(p_tm, &tm) ) { return 43; } p_tm = gmtime(&now); iso9660_set_dtime(p_tm, &dtime); if (!iso9660_get_dtime(&dtime, false, &tm)) { printf("Error returned by iso9660_get_dtime\n"); return 44; } if ( !time_compare(p_tm, &tm) ) { printf("GMT time retrieved with iso9660_get_dtime() not same as that\n"); printf("set with iso9660_set_dtime().\n"); return 45; } { iso9660_ltime_t ltime; p_tm = localtime(&now); iso9660_set_ltime(p_tm, <ime); if (!iso9660_get_ltime(<ime, &tm)) { printf("Problem running iso9660_get_ltime\n"); return 46; } if ( ! time_compare(p_tm, &tm) ) { printf("local time retrieved with iso9660_get_ltime() not\n"); printf("same as that set with iso9660_set_ltime().\n"); return 47; } p_tm = gmtime(&now); iso9660_set_ltime(p_tm, <ime); iso9660_get_ltime(<ime, &tm); if ( ! time_compare(p_tm, &tm) ) { printf("GMT time retrieved with iso9660_get_ltime() not\n"); printf("same as that set with iso9660_set_ltime().\n"); return 48; } } #endif } return 0; } libcdio-2.2.0/test/testisocd.c000066400000000000000000000114141474051130400162440ustar00rootroot00000000000000/* Copyright (C) 2003-2008, 2011, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests reading ISO 9660 info from a CD. */ #include "portable.h" #include "cdio_assert.h" #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #define SKIP_TEST_RC 77 int main(int argc, const char *argv[]) { char **ppsz_cd_drives = NULL; /* All drives with an ISO9660 filesystem. */ driver_id_t driver_id; /* Driver ID found */ char *psz_drive; /* Name of drive */ CdIo_t *p_cdio; /* See if we can find a device with a loaded CD-DA in it. If successful drive_id will be set. */ ppsz_cd_drives = cdio_get_devices_with_cap_ret(NULL, CDIO_FS_ANAL_ISO9660_ANY, true, &driver_id); if (ppsz_cd_drives && ppsz_cd_drives[0]) { /* Found such a CD-ROM with an ISO 9660 filesystem. Use the first drive in the list. */ psz_drive = strdup(ppsz_cd_drives[0]); /* Don't need a list of CD's with CD-DA's any more. */ cdio_free_device_list(ppsz_cd_drives); ppsz_cd_drives = NULL; } else { printf("-- Unable find or access a CD-ROM drive with an ISO-9660 " "filesystem.\n"); if (ppsz_cd_drives) cdio_free_device_list(ppsz_cd_drives); exit(SKIP_TEST_RC); } p_cdio = cdio_open (psz_drive, driver_id); if (!p_cdio) { fprintf(stderr, "Sorry, couldn't open %s\n", psz_drive); free(psz_drive); return 1; } else { /* You make get different results looking up "/" versus "/." and the latter may give more complete information. "/" will take information from the PVD only, whereas "/." will force a directory read of "/" and find "." and in that Rock-Ridge information might be found which fills in more stat information that iso9660_fs_find_lsn also will find. . Ideally iso9660_fs_stat should be fixed. */ iso9660_stat_t *p_statbuf = iso9660_fs_stat (p_cdio, "/."); free(psz_drive); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file /.\n"); cdio_destroy(p_cdio); exit(2); } else { /* Now try getting the statbuf another way */ char buf[ISO_BLOCKSIZE]; char *psz_path = NULL; const lsn_t i_lsn = p_statbuf->lsn; iso9660_stat_t *p_statbuf2 = iso9660_fs_find_lsn (p_cdio, i_lsn); iso9660_stat_t *p_statbuf3 = iso9660_fs_find_lsn_with_path (p_cdio, i_lsn, &psz_path); int rc=0; const unsigned int statbuf_test_size = 100; /* Compare the two statbufs. */ if (p_statbuf->lsn != p_statbuf2->lsn || p_statbuf->total_size != p_statbuf2->total_size || p_statbuf->type != p_statbuf2->type) { fprintf(stderr, "File stat information between fs_stat and " "fs_find_lsn isn't the same\n"); rc=3; goto exit; } cdio_assert(statbuf_test_size < sizeof(iso9660_stat_t)); if (0 != memcmp(p_statbuf3, p_statbuf2, statbuf_test_size)) { fprintf(stderr, "File stat information between fs_find_lsn and " "fs_find_lsn_with_path isn't the same\n"); rc=4; goto exit; } if (psz_path != NULL) { if (0 != strncmp("/./", psz_path, strlen("/./"))) { fprintf(stderr, "Path returned for fs_find_lsn_with_path " "is not correct should be /./, is %s\n", psz_path); free(psz_path); rc=5; goto exit; } } else { fprintf(stderr, "Path returned for fs_find_lsn_with_path is NULL\n"); rc=6; goto exit; } /* Try reading from the directory. */ memset (buf, 0, ISO_BLOCKSIZE); if ( 0 != cdio_read_data_sectors (p_cdio, buf, i_lsn, ISO_BLOCKSIZE, 1) ) { fprintf(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) p_statbuf->lsn); rc=7; } exit: iso9660_stat_free(p_statbuf); iso9660_stat_free(p_statbuf2); iso9660_stat_free(p_statbuf3); cdio_destroy(p_cdio); if (NULL != psz_path) free(psz_path); exit(rc); } } exit(0); } libcdio-2.2.0/test/testisocd2.c000066400000000000000000000112171474051130400163270ustar00rootroot00000000000000/* Copyright (C) 2003-2008, 2012-2013, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests reading ISO 9660 info from an ISO 9660 image. */ #include "portable.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include "filemode.h" #ifndef DATA_DIR #define DATA_DIR "./data" #endif /* Set up a CD image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH DATA_DIR "/" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "copying.iso" #define SKIP_TEST_RC 77 int main(int argc, const char *argv[]) { iso9660_t *p_iso; iso9660_stat_t *p_statbuf; p_iso = iso9660_open(ISO9660_IMAGE); if (!p_iso) { fprintf(stderr, "Sorry, couldn't open ISO9660 image %s\n", ISO9660_IMAGE); return 1; } else { unsigned int rc=0; uint8_t joliet_level = iso9660_ifs_get_joliet_level(p_iso); if (joliet_level != 0) { printf("Expecting joliet level to be 0, got %u\n", joliet_level); exit(10); } else { printf("-- No joliet, as expected.\n"); } iso9660_close(p_iso); p_iso = iso9660_open_ext(ISO9660_IMAGE, ISO_EXTENSION_ALL); joliet_level = iso9660_ifs_get_joliet_level(p_iso); if ( joliet_level != 0) { printf("Expecting joliet level to still be 0, got %d\n", joliet_level); exit(11); } else { printf("-- joliet level 0 again, as expected.\n"); } /* You make get different results looking up "/" versus "/." and the latter may give more complete information. "/" will take information from the PVD only, whereas "/." will force a directory read of "/" and find "." and in that Rock-Ridge information might be found which fills in more stat information that iso9660_fs_find_lsn also will find. . Ideally iso9660_fs_stat should be fixed. */ p_statbuf = iso9660_ifs_stat (p_iso, "/."); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file /.\n"); iso9660_close(p_iso); iso9660_stat_free(p_statbuf); exit(2); } else { /* Now try getting the statbuf another way */ char buf[ISO_BLOCKSIZE]; char *psz_path = NULL; const lsn_t i_lsn = p_statbuf->lsn; iso9660_stat_t *p_statbuf2 = iso9660_ifs_find_lsn (p_iso, i_lsn); iso9660_stat_t *p_statbuf3 = iso9660_ifs_find_lsn_with_path (p_iso, i_lsn, &psz_path); /* Compare the two statbufs. */ if (p_statbuf->lsn != p_statbuf2->lsn || p_statbuf->total_size != p_statbuf2->total_size || p_statbuf->type != p_statbuf2->type) { fprintf(stderr, "File stat information between fs_stat and " "iso9660_ifs_find_lsn isn't the same\n"); rc = 3; goto exit; } if (p_statbuf3->lsn != p_statbuf2->lsn || p_statbuf3->total_size != p_statbuf2->total_size || p_statbuf3->type != p_statbuf2->type) { rc = 4; goto exit; } if (psz_path != NULL) { if (0 != strncmp("/./", psz_path, strlen("/./"))) { fprintf(stderr, "Path returned for ifs_find_lsn_with_path " "is not correct should be /./, is %s\n", psz_path); rc = 5; goto exit; } } else { fprintf(stderr, "Path returned for fs_find_lsn_with_path is NULL\n"); rc = 6; goto exit; exit(6); } /* Try reading from the directory. */ memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, i_lsn, 1) ) { fprintf(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) p_statbuf->lsn); rc = 7; goto exit; } exit: if (psz_path != NULL) free(psz_path); iso9660_stat_free(p_statbuf2); iso9660_stat_free(p_statbuf3); iso9660_stat_free(p_statbuf); iso9660_close(p_iso); exit(rc); } } exit(0); } libcdio-2.2.0/test/testisocd_joliet.c000066400000000000000000000120671474051130400176170ustar00rootroot00000000000000/* Copyright (C) 2013, 2017 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests reading ISO 9660 info from an ISO 9660 image. */ #include "portable.h" #include "cdio_assert.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include "filemode.h" #ifndef DATA_DIR #define DATA_DIR "./data" #endif /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH DATA_DIR "/" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "joliet.iso" #define SKIP_TEST_RC 77 int main(int argc, const char *argv[]) { iso9660_t *p_iso; iso9660_stat_t *p_statbuf; p_iso = iso9660_open(ISO9660_IMAGE); if (!p_iso) { fprintf(stderr, "Sorry, couldn't open ISO9660 image %s\n", ISO9660_IMAGE); return 1; } else { uint8_t joliet_level = iso9660_ifs_get_joliet_level(p_iso); if ( joliet_level != 0) { printf("Expecting joliet level to be 0, got %d\n", joliet_level); exit(10); } else { printf("-- joliet level 0, as expected.\n"); } #ifdef HAVE_JOLIET iso9660_close(p_iso); p_iso = iso9660_open_ext(ISO9660_IMAGE, ISO_EXTENSION_ALL); joliet_level = iso9660_ifs_get_joliet_level(p_iso); if ( joliet_level != 3) { printf("Expecting joliet level to be 3, got %d\n", joliet_level); exit(11); } else { printf("-- joliet level 3, as expected.\n"); } #endif /* You make get different results looking up "/" versus "/." and the latter may give more complete information. "/" will take information from the PVD only, whereas "/." will force a directory read of "/" and find "." and in that Rock-Ridge information might be found which fills in more stat information that iso9660_fs_find_lsn also will find. . Ideally iso9660_fs_stat should be fixed. */ p_statbuf = iso9660_ifs_stat (p_iso, "/."); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file /.\n"); iso9660_close(p_iso); exit(2); } else { /* Now try getting the statbuf another way */ char buf[ISO_BLOCKSIZE]; char *psz_path = NULL; const lsn_t i_lsn = p_statbuf->lsn; iso9660_stat_t *p_statbuf2 = iso9660_ifs_find_lsn (p_iso, i_lsn); iso9660_stat_t *p_statbuf3 = iso9660_ifs_find_lsn_with_path (p_iso, i_lsn, &psz_path); int rc=0; const unsigned int statbuf_test_size = 100; double total_size; /* Compare the two statbufs. */ if (p_statbuf->lsn != p_statbuf2->lsn || p_statbuf->total_size != p_statbuf2->total_size || p_statbuf->type != p_statbuf2->type) { fprintf(stderr, "File stat information between fs_stat and " "iso9660_ifs_find_lsn isn't the same\n"); total_size = p_statbuf->total_size; printf("statbuf lsn: %d, size: %4.f, type: %d\n", p_statbuf->lsn, total_size, p_statbuf->type); total_size = p_statbuf2->total_size; printf("statbuf2 lsn: %d, size: %4.f, type: %d\n", p_statbuf2->lsn, total_size, p_statbuf2->type); rc=3; goto exit; } cdio_assert(statbuf_test_size < sizeof(iso9660_stat_t)); if (0 != memcmp(p_statbuf3, p_statbuf2, statbuf_test_size)) { fprintf(stderr, "File stat information between fs_find_lsn and " "fs_find_lsn_with_path isn't the same\n"); rc=4; goto exit; } if (psz_path != NULL) { if (0 != strncmp("/./", psz_path, strlen("/./"))) { fprintf(stderr, "Path returned for ifs_find_lsn_with_path " "is not correct should be /./, is %s\n", psz_path); free(psz_path); rc=5; goto exit; } free(psz_path); } else { fprintf(stderr, "Path returned for fs_find_lsn_with_path is NULL\n"); free(psz_path); rc=6; goto exit; } /* Try reading from the directory. */ memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, i_lsn, 1) ) { fprintf(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) p_statbuf->lsn); rc=7; } exit: iso9660_stat_free(p_statbuf); iso9660_stat_free(p_statbuf2); iso9660_stat_free(p_statbuf3); iso9660_close(p_iso); exit(rc); } } exit(0); } libcdio-2.2.0/test/testisorr.c000066400000000000000000000051701474051130400163030ustar00rootroot00000000000000/* Copyright (C) 2013 Rocky Bernstein 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests reading ISO 9660 info from an ISO 9660 image. */ #ifndef DATA_DIR #define DATA_DIR "./data" #endif /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define ISO9660_IMAGE_PATH DATA_DIR "/" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "copying.iso" #define ISO9660_IMAGE_RR ISO9660_IMAGE_PATH "copying-rr.iso" #define SKIP_TEST_RC 77 #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include int main(int argc, const char *argv[]) { char const *psz_fname; iso9660_t *p_iso; psz_fname = ISO9660_IMAGE; p_iso = iso9660_open_ext(psz_fname, ISO_EXTENSION_ROCK_RIDGE); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 1; } if (iso9660_have_rr(p_iso, 0) != nope) { fprintf(stderr, "-- Should not find Rock Ridge for %s\n", psz_fname); return 2; } else { printf("-- Good! Did not find Rock Ridge in %s\n", psz_fname); } iso9660_close(p_iso); psz_fname = ISO9660_IMAGE_RR; p_iso = iso9660_open_ext(psz_fname, ISO_EXTENSION_ROCK_RIDGE); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname); return 3; } if (iso9660_have_rr(p_iso, 0) == yep) { printf("-- Good! found Rock Ridge in %s\n", psz_fname); } else { fprintf(stderr, "-- Should have found Rock Ridge for %s\n", psz_fname); return 2; } if (iso9660_have_rr(p_iso, 3) == yep) { printf("-- Good! Found Rock Ridge again in %s\n", psz_fname); } else { fprintf(stderr, "-- Should have found Rock Ridge for %s\n", psz_fname); return 3; } iso9660_close(p_iso); return 0; } libcdio-2.2.0/test/testpregap.c000066400000000000000000000061211474051130400164200ustar00rootroot00000000000000/* Copyright (C) 2003-2005, 2011-2013, 2016 Rocky Bernstein Copyright (C) 2008 Robert W. Fuller 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Regression test for cdio_get_pregap_lsn() To compile as a standalone program: gcc -g3 -Wall -DHAVE_CONFIG_H -I.. -I../include testpregap.c ../lib/driver/.libs/libcdio.a -o testpregap */ #ifndef DATA_DIR #define DATA_DIR "./data" #endif #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #ifndef DATA_DIR #define DATA_DIR "./data" #endif static void log_handler (cdio_log_level_t level, const char message[]) { switch(level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: return; default: printf("cdio %d message: %s\n", level, message); } } typedef struct _pregap_list_t { const char *image; track_t track; lsn_t pregap; } pregap_list_t; static pregap_list_t pregapList[] = { { DATA_DIR "/t2.toc", 1, 4425 }, { DATA_DIR "/t2.toc", 2, CDIO_INVALID_LSN }, { DATA_DIR "/p1.cue", 1, 0 }, { DATA_DIR "/p1.cue", 2, 150 }, { DATA_DIR "/p1.cue", 3, CDIO_INVALID_LSN }, /* { "p1.nrg", 1, 0 }, Nero did not create the proper pre-gap - bleh */ { DATA_DIR "/p1.nrg", 2, 225 }, { DATA_DIR "/p1.nrg", 3, CDIO_INVALID_LSN } }; #define NELEMS(v) (sizeof(v) / sizeof(v[0])) int main(int argc, const char *argv[]) { CdIo_t *cdObj; const char *image; lsn_t pregap; int i; int rc = 0; cdio_log_set_handler (log_handler); if (! (cdio_have_driver(DRIVER_NRG) && cdio_have_driver(DRIVER_BINCUE) && cdio_have_driver(DRIVER_CDRDAO)) ) { printf("-- You don't have enough drivers for this test\n"); exit(77); } for (i = 0; i < NELEMS(pregapList); ++i) { image = pregapList[i].image; cdObj = cdio_open(image, DRIVER_UNKNOWN); if (!cdObj) { printf("-- unrecognized image: %s\n", image); return 50; } pregap = cdio_get_track_pregap_lsn(cdObj, pregapList[i].track); if (pregap != pregapList[i].pregap) { printf("%s should have had pregap of lsn=%d instead of lsn=%d\n", image, pregapList[i].pregap, pregap); rc = i + 1; } else { printf("-- %s had expected pregap\n", image); } cdio_destroy(cdObj); } return rc; } libcdio-2.2.0/test/testudf.c000066400000000000000000000053621474051130400157260ustar00rootroot00000000000000/* Copyright (C) 2013 Rocky Bernstein Copyright (C) 2013-2014 Pete Batard 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 the Free Software Foundation, either version 3 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Tests reading UDF info from an UDF image. */ #ifndef DATA_DIR #define DATA_DIR "./data" #endif #define UDF_IMAGE DATA_DIR "/udf102.iso" #ifdef HAVE_CONFIG_H #include "config.h" #define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #define EXPECTED_NAME "FéжΘvrier" #define EXPECTED_LENGTH 10 int main(int argc, const char *argv[]) { char const *psz_fname = UDF_IMAGE; char volume_id[192]; /* 3*64 to account for UTF-8 */ udf_t* p_udf = NULL; udf_dirent_t *p_udf_root = NULL, *p_udf_file = NULL; int64_t file_length; int rc=0; p_udf = udf_open(psz_fname); if (NULL == p_udf) { fprintf(stderr, "Couldn't open %s as an UDF image\n", psz_fname); return 1; } p_udf_root = udf_get_root(p_udf, true, 0); if (NULL == p_udf_root) { fprintf(stderr, "Could not locate UDF root directory\n"); rc=2; goto exit; } if ( (udf_get_logical_volume_id(p_udf, volume_id, sizeof(volume_id)) <= 0) || (strcmp(EXPECTED_NAME, volume_id) != 0) ) { fprintf(stderr, "Unexpected UDF logical volume ID\n"); rc=3; goto exit; } printf("-- Good! Volume id matches expected UTF-8 data\n"); p_udf_file = udf_fopen(p_udf_root, EXPECTED_NAME); if (!p_udf_file) { fprintf(stderr, "Could not locate expected file in UDF image\n"); rc=4; goto exit; } printf("-- Good! File name matches expected UTF-8 data\n"); file_length = udf_get_file_length(p_udf_file); if (file_length != EXPECTED_LENGTH) { fprintf(stderr, "Unexpected UDF file length\n"); rc=5; goto exit; } printf("-- Good! File length matches expected length\n"); exit: if (p_udf_root != NULL) udf_dirent_free(p_udf_root); if (p_udf_file != NULL) udf_dirent_free(p_udf_file); udf_close(p_udf); return rc; } libcdio-2.2.0/test/vcd_demo.cue000066400000000000000000000004011474051130400163470ustar00rootroot00000000000000FILE "vcd_demo.bin" BINARY TRACK 01 MODE2/2352 FLAGS DCP INDEX 01 00:00:00 TRACK 02 MODE2/2352 FLAGS DCP INDEX 00 00:13:57 INDEX 01 00:15:57 TRACK 03 MODE2/2352 FLAGS DCP INDEX 00 00:20:71 INDEX 01 00:22:71 libcdio-2.2.0/test/vcd_demo.right000066400000000000000000000113441474051130400167200ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 3) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 XA true yes 2: 00:17:57 001182 XA true yes 3: 00:24:71 001721 XA true yes 170: 00:30:10 002110 leadout (4 MB raw, 4 MB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with CD-RTOS and ISO 9660 filesystem ISO 9660: 1032 blocks, label `V0469 ' Application: Preparer : LKVCDIMAGER 5.0.7.10(WIN32) Publisher : LAURENS KOEHOORN System : CD-RTOS CD-BRIDGE Volume : V0469 Volume Set : ISO9660 filesystem /: d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 ext d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 mpegav d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 segment d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 sources d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00:00 vcd /EXT/: d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 375] 65536 Jul 14 1978 00:00:00 lot_x.vcd ----1xrxrxr 0 0 [fn 01] [LSN 407] 144 Jul 14 1978 00:00:00 psd_x.vcd /MPEGAV/: d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 01] [LSN 1182] 904036 ( 796672) Jul 14 1978 00:00:00 avseq01.dat ---2-xrxrxr 0 0 [fn 02] [LSN 1721] 904036 ( 796672) Jul 14 1978 00:00:00 avseq02.dat /SEGMENT/: d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 01] [LSN 225] 220780 ( 194560) Jul 14 1978 00:00:00 item0001.dat /Sources/: d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00:00 html ----1xrxrxr 0 0 [fn 01] [LSN 434] 842 Dec 11 2002 10:33:47 index.htm ----1xrxrxr 0 0 [fn 01] [LSN 435] 1216557 Jan 07 2003 18:01:37 menu.ppm ----1xrxrxr 0 0 [fn 01] [LSN 1030] 2793 Jan 07 2003 18:08:20 source.xml /Sources/HTML/: d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 425] 1067 Jan 07 2003 17:51:17 0.xml ----1xrxrxr 0 0 [fn 01] [LSN 426] 1067 Jan 07 2003 17:51:17 1.xml d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00:00 img ----1xrxrxr 0 0 [fn 01] [LSN 427] 1327 Jan 07 2003 17:51:16 movies.css ----1xrxrxr 0 0 [fn 01] [LSN 428] 12024 Jan 07 2003 17:51:16 toc.xsl /Sources/HTML/img/: d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 408] 1999 Nov 13 2002 07:27:30 al.gif ----1xrxrxr 0 0 [fn 01] [LSN 409] 7626 Jan 07 2003 17:42:53 loeki_groep_01.gif ----1xrxrxr 0 0 [fn 01] [LSN 413] 9986 Jan 07 2003 17:42:53 loeki_groep_02.gif ----1xrxrxr 0 0 [fn 01] [LSN 418] 207 Nov 14 2002 19:33:19 a_left.gif ----1xrxrxr 0 0 [fn 01] [LSN 419] 207 Nov 14 2002 19:33:19 a_right.gif ----1xrxrxr 0 0 [fn 01] [LSN 420] 441 Nov 13 2002 10:54:14 animatie.gif ----1xrxrxr 0 0 [fn 01] [LSN 421] 250 Nov 14 2002 11:44:14 face_up2.gif ----1xrxrxr 0 0 [fn 01] [LSN 422] 259 Nov 13 2002 11:09:06 familie.gif ----1xrxrxr 0 0 [fn 01] [LSN 423] 1010 Nov 14 2002 11:52:28 goldstar2.gif ----1xrxrxr 0 0 [fn 01] [LSN 424] 1783 Nov 13 2002 07:15:09 vcd.gif /VCD/: d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Jul 14 1978 00:00:00 entries.vcd ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Jul 14 1978 00:00:00 info.vcd ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Jul 14 1978 00:00:00 lot.vcd ----1xrxrxr 0 0 [fn 00] [LSN 184] 72 Jul 14 1978 00:00:00 psd.vcd XA sectors Video CD session #2 starts at track 2, LSN: 1182, ISO 9660 blocks: 1032 ISO 9660: 1032 blocks, label `V0469 ' libcdio-2.2.0/test/vcd_demo_vcdinfo.right000066400000000000000000000114621474051130400204310ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 3) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 XA true yes 2: 00:17:57 001182 XA true yes 3: 00:24:71 001721 XA true yes 170: 00:30:10 002110 leadout (4 MB raw, 4 MB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with CD-RTOS and ISO 9660 filesystem ISO 9660: 1032 blocks, label `V0469 ' Application: Preparer : LKVCDIMAGER 5.0.7.10(WIN32) Publisher : LAURENS KOEHOORN System : CD-RTOS CD-BRIDGE Volume : V0469 Volume Set : ISO9660 filesystem /: d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 ext d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 mpegav d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 segment d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 sources d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00:00 vcd /EXT/: d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 375] 65536 Jul 14 1978 00:00:00 lot_x.vcd ----1xrxrxr 0 0 [fn 01] [LSN 407] 144 Jul 14 1978 00:00:00 psd_x.vcd /MPEGAV/: d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 01] [LSN 1182] 904036 ( 796672) Jul 14 1978 00:00:00 avseq01.dat ---2-xrxrxr 0 0 [fn 02] [LSN 1721] 904036 ( 796672) Jul 14 1978 00:00:00 avseq02.dat /SEGMENT/: d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 01] [LSN 225] 220780 ( 194560) Jul 14 1978 00:00:00 item0001.dat /Sources/: d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00:00 html ----1xrxrxr 0 0 [fn 01] [LSN 434] 842 Dec 11 2002 10:33:47 index.htm ----1xrxrxr 0 0 [fn 01] [LSN 435] 1216557 Jan 07 2003 18:01:37 menu.ppm ----1xrxrxr 0 0 [fn 01] [LSN 1030] 2793 Jan 07 2003 18:08:20 source.xml /Sources/HTML/: d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 425] 1067 Jan 07 2003 17:51:17 0.xml ----1xrxrxr 0 0 [fn 01] [LSN 426] 1067 Jan 07 2003 17:51:17 1.xml d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00:00 img ----1xrxrxr 0 0 [fn 01] [LSN 427] 1327 Jan 07 2003 17:51:16 movies.css ----1xrxrxr 0 0 [fn 01] [LSN 428] 12024 Jan 07 2003 17:51:16 toc.xsl /Sources/HTML/img/: d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 01] [LSN 408] 1999 Nov 13 2002 07:27:30 al.gif ----1xrxrxr 0 0 [fn 01] [LSN 409] 7626 Jan 07 2003 17:42:53 loeki_groep_01.gif ----1xrxrxr 0 0 [fn 01] [LSN 413] 9986 Jan 07 2003 17:42:53 loeki_groep_02.gif ----1xrxrxr 0 0 [fn 01] [LSN 418] 207 Nov 14 2002 19:33:19 a_left.gif ----1xrxrxr 0 0 [fn 01] [LSN 419] 207 Nov 14 2002 19:33:19 a_right.gif ----1xrxrxr 0 0 [fn 01] [LSN 420] 441 Nov 13 2002 10:54:14 animatie.gif ----1xrxrxr 0 0 [fn 01] [LSN 421] 250 Nov 14 2002 11:44:14 face_up2.gif ----1xrxrxr 0 0 [fn 01] [LSN 422] 259 Nov 13 2002 11:09:06 familie.gif ----1xrxrxr 0 0 [fn 01] [LSN 423] 1010 Nov 14 2002 11:52:28 goldstar2.gif ----1xrxrxr 0 0 [fn 01] [LSN 424] 1783 Nov 13 2002 07:15:09 vcd.gif /VCD/: d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Jul 14 1978 00:00:00 entries.vcd ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Jul 14 1978 00:00:00 info.vcd ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Jul 14 1978 00:00:00 lot.vcd ----1xrxrxr 0 0 [fn 00] [LSN 184] 72 Jul 14 1978 00:00:00 psd.vcd XA sectors Video CD Format : VCD 2.0 Album : `LOEKI' Volume count: 1 volume number: 1 session #2 starts at track 2, LSN: 1182, ISO 9660 blocks: 1032 ISO 9660: 1032 blocks, label `V0469 ' libcdio-2.2.0/test/vcd_demo_vcdinfo_toc.right000066400000000000000000000113431474051130400212740ustar00rootroot00000000000000__________________________________ CD-ROM Track List (1 - 3) #: MSF LSN Type Green? Copy? Channels Premphasis? 1: 00:02:00 000000 XA true yes 2: 00:17:57 001182 XA true yes 3: 00:24:71 001721 XA true yes 170: 00:30:10 002110 leadout (4 MB raw, 4 MB formatted) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report CD-ROM with CD-RTOS and ISO 9660 filesystem ISO 9660: 1032 blocks, label `V0469 ' Application: Preparer : LKVCDIMAGER 5.0.7.10(WIN32) Publisher : LAURENS KOEHOORN System : CD-RTOS CD-BRIDGE Volume : V0469 Volume Set : ISO9660 filesystem /: d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. d d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00 ext d d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00 mpegav d d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00 segment d d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00 sources d d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00 vcd /EXT/: d d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. - ----1xrxrxr 0 0 [fn 01] [LSN 375] 65536 Jul 14 1978 00:00 lot_x.vcd - ----1xrxrxr 0 0 [fn 01] [LSN 407] 144 Jul 14 1978 00:00 psd_x.vcd /MPEGAV/: d d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. - ---2-xrxrxr 0 0 [fn 01] [LSN 1182] 904036 ( 796672) Jul 14 1978 00:00 avseq01.dat - ---2-xrxrxr 0 0 [fn 02] [LSN 1721] 904036 ( 796672) Jul 14 1978 00:00 avseq02.dat /SEGMENT/: d d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. - ---2-xrxrxr 0 0 [fn 01] [LSN 225] 220780 ( 194560) Jul 14 1978 00:00 item0001.dat /Sources/: d d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. d d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00 html - ----1xrxrxr 0 0 [fn 01] [LSN 434] 842 Dec 11 2002 10:33 index.htm - ----1xrxrxr 0 0 [fn 01] [LSN 435] 1216557 Jan 07 2003 18:01 menu.ppm - ----1xrxrxr 0 0 [fn 01] [LSN 1030] 2793 Jan 07 2003 18:08 source.xml /Sources/HTML/: d d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00 .. - ----1xrxrxr 0 0 [fn 01] [LSN 425] 1067 Jan 07 2003 17:51 0.xml - ----1xrxrxr 0 0 [fn 01] [LSN 426] 1067 Jan 07 2003 17:51 1.xml d d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00 img - ----1xrxrxr 0 0 [fn 01] [LSN 427] 1327 Jan 07 2003 17:51 movies.css - ----1xrxrxr 0 0 [fn 01] [LSN 428] 12024 Jan 07 2003 17:51 toc.xsl /Sources/HTML/img/: d d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00 .. - ----1xrxrxr 0 0 [fn 01] [LSN 408] 1999 Nov 13 2002 07:27 al.gif - ----1xrxrxr 0 0 [fn 01] [LSN 409] 7626 Jan 07 2003 17:42 loeki_groep_01.gif - ----1xrxrxr 0 0 [fn 01] [LSN 413] 9986 Jan 07 2003 17:42 loeki_groep_02.gif - ----1xrxrxr 0 0 [fn 01] [LSN 418] 207 Nov 14 2002 19:33 a_left.gif - ----1xrxrxr 0 0 [fn 01] [LSN 419] 207 Nov 14 2002 19:33 a_right.gif - ----1xrxrxr 0 0 [fn 01] [LSN 420] 441 Nov 13 2002 10:54 animatie.gif - ----1xrxrxr 0 0 [fn 01] [LSN 421] 250 Nov 14 2002 11:44 face_up2.gif - ----1xrxrxr 0 0 [fn 01] [LSN 422] 259 Nov 13 2002 11:09 familie.gif - ----1xrxrxr 0 0 [fn 01] [LSN 423] 1010 Nov 14 2002 11:52 goldstar2.gif - ----1xrxrxr 0 0 [fn 01] [LSN 424] 1783 Nov 13 2002 07:15 vcd.gif /VCD/: d d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00 . d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. - ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Jul 14 1978 00:00 entries.vcd - ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Jul 14 1978 00:00 info.vcd - ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Jul 14 1978 00:00 lot.vcd - ----1xrxrxr 0 0 [fn 00] [LSN 184] 72 Jul 14 1978 00:00 psd.vcd XA sectors Video CD Format : VCD 2.0 Album : `LOEKI' Volume count: 1 volume number: 1 session #2 starts at track 2, LSN: 1182, ISO 9660 blocks: 1032 ISO 9660: 1032 blocks, label `V0469 ' libcdio-2.2.0/test/videocd.right000066400000000000000000000064251474051130400165610ustar00rootroot00000000000000__________________________________ Disc mode is listed as: CD DATA (Mode 2) CD-ROM Track List (1 - 5) #: MSF LSN Type Green? Copy? 1: 00:02:00 000000 XA true no 2: 00:13:01 000826 XA true no 3: 00:16:01 001051 XA true no 4: 00:19:01 001276 XA true no 5: 00:22:01 001501 XA true no 170: 00:25:01 001726 leadout (3 MB raw, 3 MB formatted) Media Catalog Number (MCN): not available Last CD Session LSN: not supported by drive/driver __________________________________ CD Analysis Report CD-ROM with CD-RTOS and ISO 9660 filesystem ISO 9660: 676 blocks, label `SVIDEOCD ' Application: SVIDEOCD.APP;1 Preparer : GNU VCDIMAGER CHECK MODE Publisher : PUBL_ID System : CD-RTOS CD-BRIDGE Volume : SVIDEOCD Volume Set : ISO9660 filesystem /: d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 ext d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 mpeg2 d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 segment d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 svcd /EXT/: d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 675] 78 Jul 14 1978 00:00:00 scandata.dat /MPEG2/: d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 00] [LSN 826] 174300 ( 153600) Jul 14 1978 00:00:00 avseq01.mpg ---2-xrxrxr 0 0 [fn 00] [LSN 1051] 174300 ( 153600) Jul 14 1978 00:00:00 avseq02.mpg ---2-xrxrxr 0 0 [fn 00] [LSN 1276] 174300 ( 153600) Jul 14 1978 00:00:00 avseq03.mpg ---2-xrxrxr 0 0 [fn 00] [LSN 1501] 174300 ( 153600) Jul 14 1978 00:00:00 avseq04.mpg /SEGMENT/: d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ---2-xrxrxr 0 0 [fn 00] [LSN 225] 65072 ( 57344) Jul 14 1978 00:00:00 item0001.mpg ---2-xrxrxr 0 0 [fn 00] [LSN 375] 65072 ( 57344) Jul 14 1978 00:00:00 item0002.mpg ---2-xrxrxr 0 0 [fn 00] [LSN 525] 65072 ( 57344) Jul 14 1978 00:00:00 item0003.mpg /SVCD/: d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00:00 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00:00 .. ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Jul 14 1978 00:00:00 entries.svd ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Jul 14 1978 00:00:00 info.svd ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Jul 14 1978 00:00:00 lot.svd ----1xrxrxr 0 0 [fn 00] [LSN 184] 112 Jul 14 1978 00:00:00 psd.svd ----1xrxrxr 0 0 [fn 00] [LSN 186] 40 Jul 14 1978 00:00:00 search.dat ----1xrxrxr 0 0 [fn 00] [LSN 185] 2048 Jul 14 1978 00:00:00 tracks.svd XA sectors Super Video CD (SVCD) or Chaoji Video CD (CVD) session #2 starts at track 2, LSN: 826, ISO 9660 blocks: 676 ISO 9660: 676 blocks, label `SVIDEOCD ' libcdio-2.2.0/visualC-config.rb000077500000000000000000000046451474051130400163310ustar00rootroot00000000000000#!/usr/bin/env ruby # Alternative configuration for Visual C written in Ruby. ABS_TOP_SRCDIR = File.dirname(__FILE__) # Text substitutions performed on files SUBST = { # Put in what you want for the build string. :build => ARGV[0] || 'pc-windows-visualstudio', :abs_top_srcdir => ABS_TOP_SRCDIR.dup, :abs_top_builddir => ABS_TOP_SRCDIR.dup, :native_abs_top_srcdir => File.expand_path(ABS_TOP_SRCDIR), :LIBCDIO_SOURCE_PATH => File.expand_path(ABS_TOP_SRCDIR) } # Get substitution information from configure.ac def extract_from_configure_ac config_file = File.dirname(__FILE__) + '/configure.ac' lines = File.readlines(config_file) relnum_regexp = Regexp.new('^define\(RELEASE_NUM, (\d+)') relnum_line = lines.grep(relnum_regexp) if relnum_line.size != 1 if relnum.size > 1 STDERR.puts("Multiple define(RELEASE_NUM, ...) in #{config_file}") else STDERR.puts("Can't find define(RELEASE_NUM, ...) in #{config_file}") end exit 1 end if relnum_line[0] !~ relnum_regexp STDERR.puts("Something went wrong in matching release number in #{config_file}") exit 2 end SUBST[:LIBCDIO_VERSION_NUM] = $1 SUBST[:VERSION] = "0.#{$1}" ac_init_regexp = Regexp.new('^AC_INIT\(\[(.+?)\]') ac_init_line = lines.grep(ac_init_regexp) if ac_init_line.size != 1 if ac_init_line.size > 1 STDERR.puts("Multiple AC_INIT in #{config_file}") else STDERR.puts("Can't find AC_INIT([...],) in #{config_file}") end exit 2 end if ac_init_line[0] !~ ac_init_regexp STDERR.puts("Something went wrong in getting package name #{config_file}") exit 3 end SUBST[:PACKAGE] = $1 end # Write #{filename} from #{filename}.in and SUBST def perform_substitutions(filename) builddir = SUBST[:abs_top_builddir] version_file = builddir + '/' + filename version_file_template = version_file + '.in' text = File.read(version_file_template) SUBST.each do |key, val| from_str = "@#{key.to_s}@" text.gsub!(from_str, val) end File.open(version_file, 'w') { |f| f.write(text) } end extract_from_configure_ac %w(include/cdio/version.h test/testgetdevices.c test/testisocd2.c test/testisocd_joliet.c test/driver/bincue.c test/driver/track.c test/testisocd_joliet.c test/driver/cdrdao.c test/testgetdevices.c test/testpregap.c test/driver/nrg.c test/testisocd2.c test/testpregap.c doc/doxygen/Doxyfile ).each do |file| perform_substitutions(file) end