parent
a1740048c5
commit
39ee321f3b
@ -0,0 +1,3 @@
|
||||
Thomas Schmitt
|
||||
Vreixo Formoso Lopes
|
||||
|
@ -0,0 +1,23 @@
|
||||
Mario Danic <mario.danic@gmail.com>,
|
||||
Vreixo Formoso <metalpain2002@yahoo.es>
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
libisoburn is Copyright (C) 2007-2008 Vreixo Formoso, Thomas Schmitt
|
||||
xorriso is Copyright (C) 2007-2008 Thomas Schmitt
|
||||
libisofs (if included) is Copyright (C) 2007-2008 Vreixo Formoso, Mario Danic
|
||||
libburn (if included) is Copyright (C) 2002-2006 Derek Foreman, Ben Jansens
|
||||
and Copyright (C) 2006-2008 Mario Danic, 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 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
|
@ -0,0 +1,237 @@
|
||||
|
||||
See file README for libisoburn and xorriso specific installation instructions.
|
||||
This file here is rather a manual for advanced usage of ./configure
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
|
||||
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').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
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 mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') 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' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. 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 in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
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.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
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'.
|
||||
|
||||
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.
|
||||
|
||||
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'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
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 the options to `configure', and exit.
|
||||
|
||||
`--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.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
@ -0,0 +1,131 @@
|
||||
pkgconfigdir=$(libdir)/pkgconfig
|
||||
libincludedir=$(includedir)/libisoburn
|
||||
|
||||
lib_LTLIBRARIES = libisoburn/libisoburn.la
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
# Build libraries
|
||||
libisoburn_libisoburn_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
libisoburn_libisoburn_la_SOURCES = \
|
||||
libisoburn/burn_wrap.c \
|
||||
libisoburn/data_source.c \
|
||||
libisoburn/isoburn.c \
|
||||
libisoburn/isoburn.h \
|
||||
libisoburn/isofs_wrap.c \
|
||||
libisoburn/libisoburn.h \
|
||||
version.h
|
||||
libisoburn_libisoburn_la_LIBADD = \
|
||||
-lisofs \
|
||||
-lburn
|
||||
libinclude_HEADERS = \
|
||||
libisoburn/libisoburn.h
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
|
||||
# This is the reference application of libisoburn. See man xorriso/xorriso.1
|
||||
#
|
||||
bin_PROGRAMS = \
|
||||
xorriso/xorriso
|
||||
|
||||
xorriso_xorriso_CPPFLAGS = -Ilibisoburn
|
||||
xorriso_xorriso_CFLAGS = -DXorriso_with_maiN -DXorriso_with_regeX $(READLINE_DEF)
|
||||
xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn $(THREAD_LIBS)
|
||||
xorriso_xorriso_SOURCES = \
|
||||
xorriso/xorriso.h \
|
||||
xorriso/xorriso_private.h \
|
||||
xorriso/xorriso.c \
|
||||
xorriso/xorrisoburn.h \
|
||||
xorriso/xorrisoburn.c \
|
||||
xorriso/xorriso_timestamp.h
|
||||
|
||||
|
||||
## Build test applications
|
||||
noinst_PROGRAMS = \
|
||||
test/compare_file
|
||||
|
||||
# A program to compare two files in mirrored trees in mounted filesystems
|
||||
# To compare tree /media/dvd and /original/dir :
|
||||
# find /media/dvd -exec test/compare_file '{}' /media/dvd /original/dir ';'
|
||||
#
|
||||
test_compare_file_CPPFLAGS =
|
||||
test_compare_file_CFLAGS =
|
||||
test_compare_file_LDADD =
|
||||
test_compare_file_SOURCES = test/compare_file.c
|
||||
|
||||
# ts A80110 - A80210 : we need as minimal demo something better than test.c
|
||||
# test/test
|
||||
|
||||
# test_test_CPPFLAGS = -Ilibisofs -Ilibburn -Ilibisoburn
|
||||
# test_test_LDADD = $(libisoburn_libisoburn_la_OBJECTS) $(THREAD_LIBS) -lburn -lisofs
|
||||
# test_test_SOURCES = test/test.c
|
||||
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
## Build documentation (You need Doxygen for this to work)
|
||||
webhost = http://libburn-api.pykix.org
|
||||
webpath = /
|
||||
docdir = $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)-$(VERSION)
|
||||
|
||||
doc: doc/html
|
||||
|
||||
doc/html: doc/doxygen.conf
|
||||
if [ -f ./doc/doc.lock ]; then \
|
||||
$(RM) -r doc/html; \
|
||||
doxygen doc/doxygen.conf; \
|
||||
fi
|
||||
|
||||
doc-upload: doc/html
|
||||
scp -r $</* $(webhost):$(webpath)
|
||||
|
||||
all: doc
|
||||
|
||||
install-data-local:
|
||||
if [ -f ./doc/doc.lock ]; then \
|
||||
$(mkinstalldirs) $(docdir)/html; \
|
||||
$(INSTALL_DATA) doc/html/* $(docdir)/html; \
|
||||
fi
|
||||
|
||||
uninstall-local:
|
||||
rm -rf $(docdir)
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
# Indent source files
|
||||
indent_files = \
|
||||
$(libisoburn_libisoburn_la_SOURCES)
|
||||
|
||||
|
||||
indent: $(indent_files)
|
||||
indent -bad -bap -nbbb -nbbo -nbc -bli0 -br -bls \
|
||||
-cdw -ce -cli0 -ncs -nbfda -i8 -l79 -lc79 \
|
||||
-lp -saf -sai -nprs -npsl -saw -sob -ss -ut \
|
||||
-sbi0 -nsc -ts8 -npcs -ncdb -fca \
|
||||
$^
|
||||
|
||||
.PHONY: indent
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
# Extra things
|
||||
nodist_pkgconfig_DATA = \
|
||||
libisoburn-1.pc
|
||||
|
||||
man_MANS = xorriso/xorriso.1
|
||||
|
||||
EXTRA_DIST = \
|
||||
libisoburn-1.pc.in \
|
||||
version.h.in \
|
||||
README \
|
||||
AUTHORS \
|
||||
CONTRIBUTORS \
|
||||
COPYRIGHT \
|
||||
COPYING \
|
||||
INSTALL \
|
||||
xorriso/changelog.txt \
|
||||
xorriso/README \
|
||||
$(man_MANS)
|
||||
|
@ -0,0 +1,152 @@
|
||||
------------------------------------------------------------------------------
|
||||
libburnia-project.org
|
||||
------------------------------------------------------------------------------
|
||||
libisoburn. By Vreixo Formoso <metalpain2002@yahoo.es>
|
||||
and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Integrated sub project of libburnia-project.org.
|
||||
Copyright (C) 2006-2008 Vreixo Formoso, Thomas Schmitt.
|
||||
Provided under GPL version 2.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
libisoburn is a frontend for libraries libburn and libisofs which enables
|
||||
creation and expansion of ISO-9660 filesystems on all CD/DVD media supported
|
||||
by libburn. This includes media like DVD+RW, which do not support multi-session
|
||||
management on media level and even plain disk files or block devices.
|
||||
|
||||
The price for that is thorough specialization on data files in ISO-9660
|
||||
filesystem images. So libisoburn is not suitable for audio (CD-DA) or any
|
||||
other CD layout which does not entirely consist of ISO-9660 sessions.
|
||||
|
||||
Currently it is only supported on Linux with kernels >= 2.4.
|
||||
|
||||
By using this software you agree to the disclaimer at the end of this text:
|
||||
"... without even the implied warranty ..."
|
||||
|
||||
|
||||
Compilation, First Glimpse, Installation
|
||||
|
||||
Dynamic library and compile time header requirements for libisoburn-0.1.1 :
|
||||
- libburn.so.4 , version libburn-0.4.2 or higher
|
||||
- libisofs.so.6 , version libisofs-0.6.2 or higher
|
||||
libisoburn and xorriso will not start with libraries which are older than their
|
||||
headers seen at compile time. So compile in the oldest possible installation
|
||||
setup unless you have reason to enforce a newer bug fix level.
|
||||
|
||||
Obtain libisoburn-0.1.1.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf libisoburn-0.1.1.tar.gz
|
||||
cd libisoburn-0.1.1
|
||||
|
||||
Within that directory execute:
|
||||
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
Then become superuser and execute
|
||||
make install
|
||||
which will make available libisoburn.so.1 .
|
||||
|
||||
For the API concepts and calls see
|
||||
./libisoburn/libisoburn.h
|
||||
as well as
|
||||
/usr/lib/libisofs/libisofs.h
|
||||
/usr/lib/libburn/libburn.h
|
||||
|
||||
|
||||
xorriso
|
||||
|
||||
libisoburn includes a command line and dialog application named xorriso,
|
||||
which offers a substantial part of libisoburn features to shell scripts and
|
||||
users. Its file xorriso/README describes a standlone tarball as first
|
||||
preference for xorriso installation.
|
||||
The installation described here produces a dynamically linked xorriso binary
|
||||
as described in chapter "libisoburn" at the end of that text.
|
||||
|
||||
After installation documentation is available via
|
||||
man xorriso
|
||||
|
||||
|
||||
Drives and Disk File Objects
|
||||
|
||||
The user of libisoburn applications needs rw-permission for the CD/DVD burner
|
||||
devices which shall be used.
|
||||
A list of rw-accessible drives can be obtained by
|
||||
xorriso -devices
|
||||
resp. by libburn API call
|
||||
burn_drive_scan()
|
||||
|
||||
|
||||
A possible source of problems are hald or other automounters.
|
||||
If you can spot a process "hald-addon-storage" with the address of
|
||||
your desired drive, then consider to kill it.
|
||||
|
||||
If you cannot get rid of the automounter that easily, try whether it helps
|
||||
to always load the drive tray manually before starting a write run of
|
||||
xorriso. Wait until the drive light is off.
|
||||
Better try to unmount an eventually mounted media before a write run.
|
||||
|
||||
|
||||
Besides true optical drives, libisoburn can also address disk files as input or
|
||||
output drives. The addresses of the disk files have to be preceded by "stdio:".
|
||||
Like:
|
||||
"stdio:/tmp/pseudo_drive"
|
||||
|
||||
|
||||
Testing
|
||||
|
||||
We are quite sure that libisofs produces accurate representations of the disk
|
||||
files. This opinion is founded on a lot of test burns and checks by a little
|
||||
test program which compares files from the mounted image with the orignals
|
||||
on disk. It uses the normal POSIX filesystem calls, i.e. no libburnia stuff.
|
||||
|
||||
This program is not installed systemwide but stays in the installation
|
||||
directory of the xorriso tarball as test/compare_file . Usually it is
|
||||
run as -exec payload of a find command. It demands at least three arguments:
|
||||
The path of the first file to compare, the prefix1 to be cut off from path
|
||||
and the prefix2 which gets prepended afterwards to obtain the path of the
|
||||
second file to compare.
|
||||
As further argument there can be -no_ctime which suppresses the comparison
|
||||
of ctime date stamps.
|
||||
The exit value is 0 if no difference was detected, non-0 else.
|
||||
|
||||
Example: After
|
||||
xorriso ... -pathspecs on -add /=/original/dir --
|
||||
mount /media/dvd
|
||||
cd test
|
||||
compare tree /media/dvd with tree /original/dir :
|
||||
find /original/dir -exec ./compare_file '{}' /original/dir /media/dvd ';' \
|
||||
| less
|
||||
and vice versa:
|
||||
find /media/dvd -exec ./compare_file '{}' /media/dvd /original/dir ';' \
|
||||
| less
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
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
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Based on and sub project of:
|
||||
libburnia-project.org
|
||||
By Mario Danic <mario.danic@gmail.com>,
|
||||
Vreixo Formoso <metalpain2002@yahoo.es>
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2008 Mario Danic, Vreixo Formoso, Thomas Schmitt.
|
||||
|
||||
libburnia-project.org is inspired by and in other components still containing
|
||||
parts of old
|
||||
Libburn. By Derek Foreman <derek@signalmarketing.com> and
|
||||
Ben Jansens <xor@orodu.net>
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
|
@ -0,0 +1,11 @@
|
||||
[Task] Figure out how to use "Requires" in pc.in (libisoburn and libisofs would benefit)
|
||||
[Task] Figure out the usage of Libs.private (used in libburn)
|
||||
[Task] Improve build system
|
||||
[Task] Investigate build system, so other libburnia components can benefit
|
||||
[Task] Write Doxygen files
|
||||
[Task] Explain to Thomas & Vreixo about NEWS importance (all libburnia components
|
||||
will benefit
|
||||
[Task] Write a document about ABI & API
|
||||
[Task] Create following targets for make: Src, Indent, Docs, Test, All [Any other suggestions?)
|
||||
|
||||
All those tasks are currently assigned to Mario.
|
@ -0,0 +1,22 @@
|
||||
AC_DEFUN([TARGET_SHIZZLE],
|
||||
[
|
||||
ARCH=""
|
||||
|
||||
AC_MSG_CHECKING([target operating system])
|
||||
|
||||
case $target in
|
||||
*-*-linux*)
|
||||
ARCH=linux
|
||||
LIBBURN_ARCH_LIBS=
|
||||
;;
|
||||
*-*-freebsd*)
|
||||
ARCH=freebsd
|
||||
LIBBURN_ARCH_LIBS=-lcam
|
||||
;;
|
||||
*)
|
||||
AC_ERROR([You are attempting to compile for an unsupported platform])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_RESULT([$ARCH])
|
||||
])
|
@ -0,0 +1,7 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
aclocal
|
||||
libtoolize --copy --force
|
||||
autoconf
|
||||
automake --foreign --add-missing --copy --include-deps
|
||||
|
@ -0,0 +1,125 @@
|
||||
AC_INIT([libisoburn], [0.1.1], [http://libburnia-project.org])
|
||||
AC_PREREQ([2.50])
|
||||
dnl AC_CONFIG_HEADER([config.h])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
|
||||
dnl The API version codes are now defined in libisoburn/libisoburn.h
|
||||
dnl #define isoburn_header_version_*
|
||||
dnl configure.ac only rules the libtool revision numbering about
|
||||
dnl LT_CURREN, LT_AGE, LT_REVISION where SONAME becomes LT_CURRENT - LT_AGE
|
||||
dnl
|
||||
dnl These three are only copies to provide libtool with unused LT_RELEASE
|
||||
ISOBURN_MAJOR_VERSION=0
|
||||
ISOBURN_MINOR_VERSION=1
|
||||
ISOBURN_MICRO_VERSION=1
|
||||
dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
|
||||
|
||||
AC_SUBST(ISOBURN_MAJOR_VERSION)
|
||||
AC_SUBST(ISOBURN_MINOR_VERSION)
|
||||
AC_SUBST(ISOBURN_MICRO_VERSION)
|
||||
dnl AC_SUBST(ISOBURN_VERSION)
|
||||
|
||||
dnl Libtool versioning
|
||||
dnl Generate libisoburn.so.1.x.y
|
||||
dnl SONAME will become LT_CURRENT - LT_AGE
|
||||
dnl
|
||||
dnl ts A80215
|
||||
dnl This is the developmen t version after stable release libisoburn.so.1.1.0
|
||||
dnl LT_CURRENT++, LT_AGE++ has not happened yet.
|
||||
dnl
|
||||
dnl SONAME = 2 - 1 = 1 . Library name = libburn.so.1.1.1
|
||||
LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
|
||||
LT_CURRENT=2
|
||||
LT_AGE=1
|
||||
LT_REVISION=1
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
|
||||
AC_SUBST(LT_RELEASE)
|
||||
AC_SUBST(LT_CURRENT)
|
||||
AC_SUBST(LT_REVISION)
|
||||
AC_SUBST(LT_AGE)
|
||||
AC_SUBST(LT_CURRENT_MINUS_AGE)
|
||||
|
||||
AC_PREFIX_DEFAULT([/usr/local])
|
||||
test "$prefix" = "NONE" && prefix=$ac_default_prefix
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl Large file support
|
||||
AC_SYS_LARGEFILE
|
||||
AC_FUNC_FSEEKO
|
||||
AC_CHECK_FUNC([fseeko])
|
||||
if test ! $ac_cv_func_fseeko; then
|
||||
AC_ERROR([Libburn requires largefile support.])
|
||||
fi
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
AC_SUBST(LIBTOOL_DEPS)
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_CHECK_HEADERS()
|
||||
|
||||
THREAD_LIBS=-lpthread
|
||||
AC_SUBST(THREAD_LIBS)
|
||||
|
||||
TARGET_SHIZZLE
|
||||
AC_SUBST(ARCH)
|
||||
AC_SUBST(LIBBURN_ARCH_LIBS)
|
||||
|
||||
|
||||
dnl Check whether there is readline-devel and readline-runtime.
|
||||
dnl If not, erase this macro which would enable use of readline(),add_history()
|
||||
READLINE_DEF="-DXorriso_with_readlinE"
|
||||
dnl The empty yes case obviously causes -lreadline to be linked
|
||||
AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= )
|
||||
dnl The X= in the yes case prevents that -lreadline gets linked twice
|
||||
AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
|
||||
AC_SUBST(READLINE_DEF)
|
||||
|
||||
|
||||
AC_CHECK_HEADER(libburn/libburn.h)
|
||||
AC_CHECK_HEADER(libisofs/libisofs.h)
|
||||
|
||||
dnl Check for proper library versions
|
||||
LIBBURN_REQUIRED=0.4.2
|
||||
LIBISOFS_REQUIRED=0.6.2
|
||||
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
|
||||
PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)
|
||||
|
||||
dnl Add compiler-specific flags
|
||||
|
||||
dnl See if the user wants aggressive optimizations of the code
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Disable aggressive optimizations [default=yes]],
|
||||
, enable_debug=yes)
|
||||
if test x$enable_debug != xyes; then
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="$CFLAGS -O3"
|
||||
CFLAGS="$CFLAGS -fexpensive-optimizations"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
else
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="$CFLAGS -g -pedantic -Wall"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -DDEBUG"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
doc/doxygen.conf
|
||||
version.h
|
||||
libisoburn-1.pc
|
||||
])
|
||||
AC_OUTPUT
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,12 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libisoburn
|
||||
Description: Multi-session filesystem extension to libisofs, libburn.
|
||||
Version: @VERSION@
|
||||
Requires:
|
||||
Libs: -L${libdir} -lisoburn
|
||||
Cflags: -I${includedir}/libisoburn
|
||||
|
@ -0,0 +1,892 @@
|
||||
|
||||
/*
|
||||
cc -g -c \
|
||||
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE \
|
||||
burn_wrap.c
|
||||
*/
|
||||
/* libburn wrappers for libisoburn
|
||||
|
||||
Copyright 2007 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
*/
|
||||
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo
|
||||
#define Hardcoded_cd_rW 1
|
||||
#define Hardcoded_cd_rw_c1 12999
|
||||
#define Hardcoded_cd_rw_nwA 152660
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
#ifndef Xorriso_standalonE
|
||||
|
||||
#include <libburn/libburn.h>
|
||||
|
||||
#include <libisofs/libisofs.h>
|
||||
|
||||
#else /* ! Xorriso_standalonE */
|
||||
|
||||
#include "../libisofs/libisofs.h"
|
||||
#include "../libburn/libburn.h"
|
||||
|
||||
#endif /* Xorriso_standalonE */
|
||||
|
||||
|
||||
#include "libisoburn.h"
|
||||
#include "isoburn.h"
|
||||
|
||||
|
||||
/* The global list of isoburn objects. Usually there is only one. */
|
||||
extern struct isoburn *isoburn_list_start; /* in isoburn.c */
|
||||
|
||||
|
||||
int isoburn_initialize(char msg[1024], int flag)
|
||||
{
|
||||
int major, minor, micro, bad_match= 0;
|
||||
|
||||
|
||||
/* First two ugly compile time checks for header version compatibility.
|
||||
If everthing matches, then they produce no C code. In case of mismatch,
|
||||
intentionally faulty C code will be inserted.
|
||||
*/
|
||||
|
||||
#ifdef iso_lib_header_version_major
|
||||
/* The minimum requirement of libisoburn towards the libisofs header
|
||||
at compile time is defined in libisoburn/libisoburn.h :
|
||||
isoburn_libisofs_req_major
|
||||
isoburn_libisofs_req_minor
|
||||
isoburn_libisofs_req_micro
|
||||
It gets compared against the version macros in libisofs/libisofs.h :
|
||||
iso_lib_header_version_major
|
||||
iso_lib_header_version_minor
|
||||
iso_lib_header_version_micro
|
||||
If the header is too old then the following code shall cause failure of
|
||||
cdrskin compilation rather than to allow production of a program with
|
||||
unpredictable bugs or memory corruption.
|
||||
The compiler messages supposed to appear in this case are:
|
||||
error: 'LIBISOFS_MISCONFIGURATION' undeclared (first use in this function)
|
||||
error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h' undeclared (first use in this function)
|
||||
error: 'LIBISOFS_MISCONFIGURATION_' undeclared (first use in this function)
|
||||
*/
|
||||
/* The indendation is an advise of man gcc to help old compilers ignoring */
|
||||
#if isoburn_libisofs_req_major > iso_lib_header_version_major
|
||||
#define Isoburn_libisofs_dot_h_too_olD 1
|
||||
#endif
|
||||
#if isoburn_libisofs_req_major == iso_lib_header_version_major && isoburn_libisofs_req_minor > iso_lib_header_version_minor
|
||||
#define Isoburn_libisofs_dot_h_too_olD 1
|
||||
#endif
|
||||
#if isoburn_libisofs_req_minor == iso_lib_header_version_minor && isoburn_libisofs_req_micro > iso_lib_header_version_micro
|
||||
#define Isoburn_libisofs_dot_h_too_olD 1
|
||||
#endif
|
||||
|
||||
#ifdef Isoburn_libisofs_dot_h_too_olD
|
||||
LIBISOFS_MISCONFIGURATION = 0;
|
||||
INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h = 0;
|
||||
LIBISOFS_MISCONFIGURATION_ = 0;
|
||||
#endif
|
||||
|
||||
#endif /* iso_lib_header_version_major */
|
||||
|
||||
/* The minimum requirement of libisoburn towards the libburn header
|
||||
at compile time is defined in libisoburn/libisoburn.h :
|
||||
isoburn_libburn_req_major
|
||||
isoburn_libburn_req_minor
|
||||
isoburn_libburn_req_micro
|
||||
It gets compared against the version macros in libburn/libburn.h :
|
||||
burn_header_version_major
|
||||
burn_header_version_minor
|
||||
burn_header_version_micro
|
||||
If the header is too old then the following code shall cause failure of
|
||||
cdrskin compilation rather than to allow production of a program with
|
||||
unpredictable bugs or memory corruption.
|
||||
The compiler messages supposed to appear in this case are:
|
||||
error: 'LIBBURN_MISCONFIGURATION' undeclared (first use in this function)
|
||||
error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h' undeclared (first use in this function)
|
||||
error: 'LIBBURN_MISCONFIGURATION_' undeclared (first use in this function)
|
||||
*/
|
||||
|
||||
/* The indendation is an advise of man gcc to help old compilers ignoring */
|
||||
#if isoburn_libburn_req_major > burn_header_version_major
|
||||
#define Isoburn_libburn_dot_h_too_olD 1
|
||||
#endif
|
||||
#if isoburn_libburn_req_major == burn_header_version_major && isoburn_libburn_req_minor > burn_header_version_minor
|
||||
#define Isoburn_libburn_dot_h_too_olD 1
|
||||
#endif
|
||||
#if isoburn_libburn_req_minor == burn_header_version_minor && isoburn_libburn_req_micro > burn_header_version_micro
|
||||
#define Isoburn_libburn_dot_h_too_olD 1
|
||||
#endif
|
||||
|
||||
#ifdef Isoburn_libburn_dot_h_too_olD
|
||||
LIBBURN_MISCONFIGURATION = 0;
|
||||
INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h = 0;
|
||||
LIBBURN_MISCONFIGURATION_ = 0;
|
||||
#endif
|
||||
|
||||
/* End of ugly compile time tests (scroll up for explanation) */
|
||||
|
||||
|
||||
|
||||
msg[0]= 0;
|
||||
if(iso_init()<0) {
|
||||
sprintf(msg+strlen(msg), "Cannot initialize libisofs\n");
|
||||
return(0);
|
||||
}
|
||||
iso_lib_version(&major, &minor, µ);
|
||||
sprintf(msg+strlen(msg), "libisofs-%d.%d.%d ", major, minor, micro);
|
||||
#ifdef iso_lib_header_version_major
|
||||
if(iso_lib_is_compatible(iso_lib_header_version_major,
|
||||
iso_lib_header_version_minor,
|
||||
iso_lib_header_version_micro)) {
|
||||
sprintf(msg+strlen(msg), "ok, ");
|
||||
} else {
|
||||
sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n",
|
||||
iso_lib_header_version_major, iso_lib_header_version_minor,
|
||||
iso_lib_header_version_micro);
|
||||
bad_match= 1;
|
||||
}
|
||||
#else
|
||||
if(iso_lib_is_compatible(isoburn_libisofs_req_major,
|
||||
isoburn_libisofs_req_minor,
|
||||
isoburn_libisofs_req_micro)) {
|
||||
sprintf(msg+strlen(msg), "suspicious, ");
|
||||
} else {
|
||||
sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n",
|
||||
isoburn_libisofs_req_major, isoburn_libisofs_req_minor,
|
||||
isoburn_libisofs_req_micro);
|
||||
bad_match= 1;
|
||||
}
|
||||
#endif /* ! iso_lib_header_version_major */
|
||||
|
||||
if(!burn_initialize()) {
|
||||
sprintf(msg+strlen(msg), "Cannot initialize libburn\n");
|
||||
return(0);
|
||||
}
|
||||
burn_version(&major, &minor, µ);
|
||||
sprintf(msg+strlen(msg), "libburn-%d.%d.%d ", major, minor, micro);
|
||||
if(major > burn_header_version_major
|
||||
|| (major == burn_header_version_major
|
||||
&& (minor > burn_header_version_minor
|
||||
|| (minor == burn_header_version_minor
|
||||
&& micro >= burn_header_version_micro)))) {
|
||||
sprintf(msg+strlen(msg), "ok, ");
|
||||
} else {
|
||||
sprintf(msg+strlen(msg), "- TOO OLD -, need at least libburn-%d.%d.%d ,\n",
|
||||
burn_header_version_major, burn_header_version_minor,
|
||||
burn_header_version_micro);
|
||||
bad_match= 1;
|
||||
}
|
||||
|
||||
isoburn_version(&major, &minor, µ);
|
||||
sprintf(msg+strlen(msg), "for libisoburn-%d.%d.%d", major, minor, micro);
|
||||
if(bad_match)
|
||||
return(0);
|
||||
|
||||
isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* API @since 0.1.0 */
|
||||
int isoburn_libisofs_req(int *major, int *minor, int *micro)
|
||||
{
|
||||
*major= iso_lib_header_version_major;
|
||||
*minor= iso_lib_header_version_minor;
|
||||
*micro= iso_lib_header_version_micro;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* API @since 0.1.0 */
|
||||
int isoburn_libburn_req(int *major, int *minor, int *micro)
|
||||
{
|
||||
*major= burn_header_version_major;
|
||||
*minor= burn_header_version_minor;
|
||||
*micro= burn_header_version_micro;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/** Examine the media and sets appropriate emulation if needed.
|
||||
@param flag bit0= pretent blank on overwriteable media
|
||||
*/
|
||||
static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
|
||||
int flag)
|
||||
{
|
||||
int ret, lba, nwa;
|
||||
struct burn_multi_caps *caps= NULL;
|
||||
|
||||
ret= burn_disc_get_multi_caps(d, BURN_WRITE_NONE, &caps, 0);
|
||||
if(ret<0) /* == 0 is read-only media, but it is too early to reject it here */
|
||||
goto ex;
|
||||
ret= isoburn_new(o, 0);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
(*o)->drive= d;
|
||||
|
||||
#ifdef Hardcoded_cd_rW
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
|
||||
caps->start_adr= 0;
|
||||
(*o)->fabricated_disc_status= BURN_DISC_APPENDABLE;
|
||||
#endif
|
||||
|
||||
if(caps->start_adr) { /* set emulation to overwriteable */
|
||||
(*o)->emulation_mode= 1;
|
||||
|
||||
if(flag&1) {
|
||||
(*o)->nwa= 0;
|
||||
(*o)->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
} else {
|
||||
ret= isoburn_start_emulation(*o, 0);
|
||||
if(ret<=0) {
|
||||
(*o)->emulation_mode= -1;
|
||||
goto ex;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
/* >>> recognize unsuitable media (but allow read-only media) */;
|
||||
|
||||
#ifdef Hardcoded_cd_rW
|
||||
(*o)->nwa= Hardcoded_cd_rw_nwA;
|
||||
#else
|
||||
ret= burn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
|
||||
if(ret>0)
|
||||
(*o)->nwa= nwa;
|
||||
#endif
|
||||
|
||||
}
|
||||
ret= 1;
|
||||
ex:
|
||||
if(caps!=NULL)
|
||||
burn_disc_free_multi_caps(&caps);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@param flag bit0= load
|
||||
bit1= regard overwriteable media as blank
|
||||
bit2= if the drive is a regular disk file: truncate it to
|
||||
the write start address
|
||||
*/
|
||||
int isoburn_drive_aquire(struct burn_drive_info *drive_infos[],
|
||||
char *adr, int flag)
|
||||
{
|
||||
int ret, conv_ret, drive_grabbed= 0;
|
||||
char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
|
||||
struct isoburn *o= NULL;
|
||||
char msg[BURN_MSGS_MESSAGE_LEN+4096];
|
||||
|
||||
conv_ret= burn_drive_convert_fs_adr(adr, libburn_drive_adr);
|
||||
if(conv_ret<=0) {
|
||||
sprintf(msg, "Unsuitable drive address: '%s'\n",adr);
|
||||
msg[BURN_MSGS_MESSAGE_LEN-1]= 0;
|
||||
burn_msgs_submit(0x00060000, msg, 0, "FAILURE", NULL);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
|
||||
ret= burn_drive_scan_and_grab(drive_infos, libburn_drive_adr, flag&1);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
drive_grabbed= 1;
|
||||
ret= isoburn_welcome_media(&o, (*drive_infos)[0].drive, !!(flag&2));
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
|
||||
if(flag&4) {
|
||||
ret= isoburn_find_emulator(&o, (*drive_infos)[0].drive, 0);
|
||||
if(ret>0 && o!=NULL)
|
||||
o->truncate= 1;
|
||||
}
|
||||
|
||||
ret= 1;
|
||||
ex:
|
||||
if(ret<=0) {
|
||||
if(drive_grabbed)
|
||||
burn_drive_release((*drive_infos)[0].drive, 0);
|
||||
isoburn_destroy(&o, 0);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
|
||||
char *adr, int load)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret= isoburn_drive_aquire(drive_infos, adr, !!load);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_drive_grab(struct burn_drive *drive, int load)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o= NULL;
|
||||
|
||||
ret= burn_drive_grab(drive, load);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
ret= isoburn_welcome_media(&o, drive, 0);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
|
||||
ret= 1;
|
||||
ex:
|
||||
if(ret<=0)
|
||||
isoburn_destroy(&o,0);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/** Retrieve media emulation and eventual isoburn emulator of drive.
|
||||
@return -1 unsuitable media, 0 generic media, 1 emulated media.
|
||||
*/
|
||||
int isoburn_find_emulator(struct isoburn **pt,
|
||||
struct burn_drive *drive, int flag)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret= isoburn_find_by_drive(pt, drive, 0);
|
||||
if(ret<=0)
|
||||
return(0);
|
||||
if((*pt)->emulation_mode==-1) {
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Unsuitable drive and media state", 0, "FAILURE", NULL);
|
||||
return(-1);
|
||||
}
|
||||
if((*pt)->emulation_mode==0)
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret= isoburn_find_emulator(&o, drive, 0);
|
||||
if(ret<0)
|
||||
return(BURN_DISC_UNSUITABLE);
|
||||
if(o!=NULL)
|
||||
if(o->fabricated_disc_status!=BURN_DISC_UNREADY)
|
||||
return(o->fabricated_disc_status);
|
||||
if(ret==0)
|
||||
return(burn_disc_get_status(drive));
|
||||
|
||||
/* emulated status */
|
||||
if(o->emulation_mode==-1)
|
||||
return(BURN_DISC_UNSUITABLE);
|
||||
if(o->nwa>0)
|
||||
return(BURN_DISC_APPENDABLE);
|
||||
return(BURN_DISC_BLANK);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_disc_erasable(struct burn_drive *d)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret>0)
|
||||
if(o->emulation_mode==1)
|
||||
return(1);
|
||||
return burn_disc_erasable(d);
|
||||
}
|
||||
|
||||
|
||||
void isoburn_disc_erase(struct burn_drive *drive, int fast)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret= isoburn_find_emulator(&o, drive, 0);
|
||||
if(ret>0) {
|
||||
if(o->emulation_mode==-1) {
|
||||
/* To cause a negative reply with burn_drive_wrote_well() */
|
||||
burn_drive_cancel(drive);
|
||||
return;
|
||||
}
|
||||
if(o->emulation_mode>0) {
|
||||
ret= isoburn_invalidate_iso(o, 0);
|
||||
if(ret<=0)
|
||||
burn_drive_cancel(drive);
|
||||
return;
|
||||
}
|
||||
}
|
||||
burn_disc_erase(drive, fast);
|
||||
}
|
||||
|
||||
|
||||
off_t isoburn_disc_available_space(struct burn_drive *d,
|
||||
struct burn_write_opts *opts)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
off_t avail;
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret>0 && o!=NULL)
|
||||
if(o->emulation_mode!=0)
|
||||
burn_write_opts_set_start_byte(opts, ((off_t) o->nwa) * (off_t) 2048);
|
||||
avail= burn_disc_available_space(d, opts);
|
||||
return(avail);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
#ifdef Hardcoded_cd_rW
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
|
||||
*start_lba= Hardcoded_cd_rw_c1;
|
||||
return(1);
|
||||
#endif
|
||||
|
||||
if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE &&
|
||||
isoburn_disc_get_status(d)!=BURN_DISC_FULL) {
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Media contains no recognizable data", 0, "SORRY",NULL);
|
||||
return(0);
|
||||
}
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret<0)
|
||||
return(0);
|
||||
if(ret>0) if(o->emulation_mode>0) {
|
||||
*start_lba= 0;
|
||||
return(1);
|
||||
}
|
||||
return(burn_disc_get_msc1(d, start_lba));
|
||||
}
|
||||
|
||||
|
||||
int isoburn_disc_track_lba_nwa(struct burn_drive *d,
|
||||
struct burn_write_opts *opts,
|
||||
int trackno, int *lba, int *nwa)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
#ifdef Hardcoded_cd_rW
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
|
||||
*lba= Hardcoded_cd_rw_c1;
|
||||
*nwa= Hardcoded_cd_rw_nwA;
|
||||
return(1);
|
||||
#endif
|
||||
|
||||
*nwa= *lba= 0;
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret<0)
|
||||
return(0);
|
||||
if(ret>0) if(o->emulation_mode>0) {
|
||||
*lba= 0;
|
||||
*nwa= o->nwa;
|
||||
return(1);
|
||||
}
|
||||
if(burn_drive_get_drive_role(d) != 1)
|
||||
return(1);
|
||||
return(burn_disc_track_lba_nwa(d, opts, trackno, lba, nwa));
|
||||
}
|
||||
|
||||
|
||||
void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
{
|
||||
int ret;
|
||||
off_t nwa= 0;
|
||||
struct isoburn *o;
|
||||
struct burn_drive *drive;
|
||||
char reasons[BURN_REASONS_LEN],msg[160+BURN_REASONS_LEN];
|
||||
char adr[BURN_DRIVE_ADR_LEN];
|
||||
enum burn_write_types write_type;
|
||||
struct stat stbuf;
|
||||
|
||||
drive= burn_write_opts_get_drive(opts);
|
||||
ret= isoburn_find_emulator(&o, drive, 0);
|
||||
if(ret<0)
|
||||
return;
|
||||
if(o!=NULL) {
|
||||
o->wrote_well= -1;
|
||||
if(o->emulation_mode!=0) {
|
||||
burn_write_opts_set_multi(opts, 0);
|
||||
if(o->emulation_mode>0 && o->nwa >= 0) {
|
||||
burn_write_opts_set_start_byte(opts, ((off_t) o->nwa) * (off_t) 2048);
|
||||
nwa= o->nwa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
write_type= burn_write_opts_auto_write_type(opts, disc, reasons, 0);
|
||||
if (write_type == BURN_WRITE_NONE) {
|
||||
sprintf(msg, "Failed to find a suitable write mode:\n%s", reasons);
|
||||
burn_msgs_submit(0x00060000, msg, 0, "FAILURE", NULL);
|
||||
if(o!=NULL)
|
||||
o->wrote_well= 0;
|
||||
/* To cause a negative reply with burn_drive_wrote_well() */
|
||||
burn_drive_cancel(drive);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
sprintf(reasons, "%d", (int) write_type);
|
||||
fprintf(stderr, "isoburn_EXPERIMENTAL: write_type = %s\n",
|
||||
(write_type == BURN_WRITE_SAO ? "SAO" :
|
||||
(write_type == BURN_WRITE_TAO ? "TAO" : reasons)));
|
||||
*/
|
||||
|
||||
#ifdef Hardcoded_cd_rW
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
|
||||
fprintf(stderr, "Setting write address to LBA %d\n", Hardcoded_cd_rw_nwA);
|
||||
burn_write_opts_set_start_byte(opts,
|
||||
((off_t) Hardcoded_cd_rw_nwA) * (off_t) 2048);
|
||||
#endif
|
||||
|
||||
if(o->truncate) {
|
||||
ret= burn_drive_get_drive_role(drive);
|
||||
if(ret==2) {
|
||||
ret= burn_drive_d_get_adr(drive, adr);
|
||||
if(ret>0) {
|
||||
ret= lstat(adr, &stbuf);
|
||||
if(ret!=-1)
|
||||
if(S_ISREG(stbuf.st_mode))
|
||||
truncate(adr, nwa * (off_t) 2048);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
burn_disc_write(opts, disc);
|
||||
}
|
||||
|
||||
|
||||
void isoburn_drive_release(struct burn_drive *drive, int eject)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret= isoburn_find_emulator(&o, drive, 0);
|
||||
if(ret<0)
|
||||
return;
|
||||
if(o!=NULL) {
|
||||
isoburn_destroy(&o, 0);
|
||||
}
|
||||
burn_drive_release(drive, eject);
|
||||
}
|
||||
|
||||
|
||||
void isoburn_finish(void)
|
||||
{
|
||||
isoburn_destroy_all(&isoburn_list_start, 0);
|
||||
burn_finish();
|
||||
iso_finish();
|
||||
}
|
||||
|
||||
|
||||
int isoburn_needs_emulation(struct burn_drive *drive)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
enum burn_disc_status s;
|
||||
|
||||
s= isoburn_disc_get_status(drive);
|
||||
if(s!=BURN_DISC_BLANK && s!=BURN_DISC_APPENDABLE)
|
||||
return(-1);
|
||||
ret= isoburn_find_emulator(&o, drive, 0);
|
||||
if(ret<0)
|
||||
return(-1);
|
||||
if(ret>0)
|
||||
if(o->emulation_mode>0)
|
||||
return(1);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag)
|
||||
{
|
||||
int ret;
|
||||
struct burn_drive *drive = o->drive;
|
||||
struct burn_multi_caps *caps= NULL;
|
||||
|
||||
ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
if(!caps->start_adr) {
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Cannot set start byte address with this type of media",
|
||||
0, "FAILURE", NULL);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||