parent
c16264cabb
commit
3ccc42f0c0
@ -0,0 +1,3 @@
|
||||
Vreixo Formoso
|
||||
Mario Danic
|
||||
Thomas Schmitt
|
@ -0,0 +1,19 @@
|
||||
Vreixo Formoso <metalpain2002@yahoo.es>,
|
||||
Mario Danic <mario.danic@gmail.com>,
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2007-2008 Vreixo Formoso, 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 @@
|
||||
|
@ -0,0 +1,234 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
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,180 @@
|
||||
pkgconfigdir=$(libdir)/pkgconfig
|
||||
libincludedir=$(includedir)/libisofs
|
||||
|
||||
lib_LTLIBRARIES = libisofs/libisofs.la
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
# Build libraries
|
||||
|
||||
libisofs_libisofs_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
libisofs_libisofs_la_SOURCES = \
|
||||
libisofs/builder.h \
|
||||
libisofs/builder.c \
|
||||
libisofs/node.h \
|
||||
libisofs/node.c \
|
||||
libisofs/tree.h \
|
||||
libisofs/tree.c \
|
||||
libisofs/image.h \
|
||||
libisofs/image.c \
|
||||
libisofs/fsource.h \
|
||||
libisofs/fsource.c \
|
||||
libisofs/fs_local.c \
|
||||
libisofs/fs_image.c \
|
||||
libisofs/messages.h \
|
||||
libisofs/messages.c \
|
||||
libisofs/libiso_msgs.h \
|
||||
libisofs/libiso_msgs.c \
|
||||
libisofs/stream.h \
|
||||
libisofs/stream.c \
|
||||
libisofs/util.h \
|
||||
libisofs/util.c \
|
||||
libisofs/util_rbtree.c \
|
||||
libisofs/util_htable.c \
|
||||
libisofs/filesrc.h \
|
||||
libisofs/filesrc.c \
|
||||
libisofs/ecma119.h \
|
||||
libisofs/ecma119.c \
|
||||
libisofs/ecma119_tree.h \
|
||||
libisofs/ecma119_tree.c \
|
||||
libisofs/writer.h \
|
||||
libisofs/buffer.h \
|
||||
libisofs/buffer.c \
|
||||
libisofs/rockridge.h \
|
||||
libisofs/rockridge.c \
|
||||
libisofs/rockridge_read.c \
|
||||
libisofs/joliet.h \
|
||||
libisofs/joliet.c \
|
||||
libisofs/eltorito.h \
|
||||
libisofs/eltorito.c \
|
||||
libisofs/iso1999.h \
|
||||
libisofs/iso1999.c \
|
||||
libisofs/data_source.c
|
||||
libinclude_HEADERS = \
|
||||
libisofs/libisofs.h
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
## Build demo applications
|
||||
noinst_PROGRAMS = \
|
||||
demo/lsl \
|
||||
demo/cat \
|
||||
demo/catbuffer \
|
||||
demo/tree \
|
||||
demo/ecma119tree \
|
||||
demo/iso \
|
||||
demo/isoread \
|
||||
demo/isocat \
|
||||
demo/isomodify \
|
||||
demo/isoms \
|
||||
demo/isogrow
|
||||
|
||||
demo_lsl_CPPFLAGS = -Ilibisofs
|
||||
demo_lsl_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_lsl_SOURCES = demo/lsl.c
|
||||
|
||||
demo_cat_CPPFLAGS = -Ilibisofs
|
||||
demo_cat_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_cat_SOURCES = demo/cat.c
|
||||
|
||||
demo_catbuffer_CPPFLAGS = -Ilibisofs
|
||||
demo_catbuffer_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_catbuffer_SOURCES = demo/cat_buffer.c
|
||||
|
||||
demo_tree_CPPFLAGS = -Ilibisofs
|
||||
demo_tree_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_tree_SOURCES = demo/tree.c
|
||||
|
||||
demo_ecma119tree_CPPFLAGS = -Ilibisofs
|
||||
demo_ecma119tree_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_ecma119tree_SOURCES = demo/ecma119_tree.c
|
||||
|
||||
demo_iso_CPPFLAGS = -Ilibisofs
|
||||
demo_iso_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_iso_SOURCES = demo/iso.c
|
||||
|
||||
demo_isoread_CPPFLAGS = -Ilibisofs
|
||||
demo_isoread_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_isoread_SOURCES = demo/iso_read.c
|
||||
|
||||
demo_isocat_CPPFLAGS = -Ilibisofs
|
||||
demo_isocat_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_isocat_SOURCES = demo/iso_cat.c
|
||||
|
||||
demo_isomodify_CPPFLAGS = -Ilibisofs
|
||||
demo_isomodify_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_isomodify_SOURCES = demo/iso_modify.c
|
||||
|
||||
demo_isoms_CPPFLAGS = -Ilibisofs
|
||||
demo_isoms_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
|
||||
demo_isoms_SOURCES = demo/iso_ms.c
|
||||
|
||||
demo_isogrow_CPPFLAGS = -Ilibisofs -Ilibburn
|
||||
demo_isogrow_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS) -lburn
|
||||
demo_isogrow_SOURCES = demo/iso_grow.c
|
||||
|
||||
|
||||
## Build unit test
|
||||
|
||||
check_PROGRAMS = \
|
||||
test/test
|
||||
|
||||
test_test_CPPFLAGS = -Ilibisofs
|
||||
test_test_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS) -lcunit
|
||||
test_test_LDFLAGS = -L.. -lm
|
||||
|
||||
test_test_SOURCES = \
|
||||
test/test.h \
|
||||
test/test.c \
|
||||
test/test_node.c \
|
||||
test/test_image.c \
|
||||
test/test_tree.c \
|
||||
test/test_util.c \
|
||||
test/test_rockridge.c \
|
||||
test/test_stream.c \
|
||||
test/mocked_fsrc.h \
|
||||
test/mocked_fsrc.c
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
## Build documentation (You need Doxygen for this to work)
|
||||
|
||||
docdir = $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)-$(VERSION)
|
||||
|
||||
doc: doc/html
|
||||
|
||||
doc/html: doc/doxygen.conf
|
||||
$(RM) -r doc/html; \
|
||||
doxygen doc/doxygen.conf;
|
||||
|
||||
install-data-local:
|
||||
if [ -d doc/html ]; then \
|
||||
$(mkinstalldirs) $(docdir)/html; \
|
||||
$(INSTALL_DATA) doc/html/* $(docdir)/html; \
|
||||
fi
|
||||
|
||||
uninstall-local:
|
||||
rm -rf $(docdir)
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
# Extra things
|
||||
nodist_pkgconfig_DATA = \
|
||||
libisofs-1.pc
|
||||
|
||||
EXTRA_DIST = \
|
||||
libisofs-1.pc.in \
|
||||
version.h.in \
|
||||
doc/doxygen.conf.in \
|
||||
doc/Tutorial \
|
||||
README \
|
||||
AUTHORS \
|
||||
COPYRIGHT \
|
||||
COPYING \
|
||||
NEWS \
|
||||
INSTALL \
|
||||
TODO \
|
||||
ChangeLog \
|
||||
Roadmap
|
||||
|
@ -0,0 +1,20 @@
|
||||
== unknown ==
|
||||
|
||||
Libisofs v0.6.4
|
||||
===============
|
||||
|
||||
-
|
||||
|
||||
== Fri Feb 22 2008 ==
|
||||
|
||||
Libisofs v0.6.2.1
|
||||
=================
|
||||
|
||||
- FIX: missing buffer.h in tarball
|
||||
|
||||
== Thu Feb 14 2008 ==
|
||||
|
||||
Libisofs v0.6.2
|
||||
================
|
||||
|
||||
- Initial release
|
@ -0,0 +1,341 @@
|
||||
------------------------------------------------------------------------------
|
||||
libisofs
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Released under GPL (see COPYING file for details).
|
||||
|
||||
Copyright (C) 2008 Vreixo Formoso, Mario Danic, Thomas Schmitt
|
||||
|
||||
libisofs is part of the libburnia project (libburnia-project.org)
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
libisofs is a library to create an ISO-9660 filesystem, and supports extensions
|
||||
like RockRidge or Joliet. It is also a full featured ISO-9660 editor, allowing
|
||||
you to modify an ISO image or multisession disc, including file addition and
|
||||
removal, change of file names and attributes, etc
|
||||
|
||||
Features:
|
||||
---------
|
||||
|
||||
- Image creation
|
||||
- Creates ISO-9660 images from local files.
|
||||
- Support for RockRidge and Joliet extensions.
|
||||
- Support for ISO-9660:1999 (version 2)
|
||||
- Support for El-Torito bootable images.
|
||||
- Full featured edition of file names and attributes on the image.
|
||||
- Several options to relax ISO-9660 constraints.
|
||||
- Special options for images intended for distribution (suitable default
|
||||
modes for files, hiding of real timestamps...)
|
||||
- Multisession
|
||||
- Support for growing an existing image
|
||||
- Full-featured edition of the image files, including: addition of new
|
||||
files, removing of existent files, moving files, renaming files,
|
||||
change file attributes (permissions, timestamps...)
|
||||
- Support for "emulated multisession" or image growing, suitable for non
|
||||
multisession media such as DVD+RW
|
||||
- Image modification
|
||||
- It can create a completely new image from files on another image.
|
||||
- Full-featured edition of image contents
|
||||
- Others
|
||||
- Handling of different input and output charset
|
||||
- Good integration with libburn for image burning.
|
||||
- Reliable, good handling of different kind of errors.
|
||||
|
||||
Requirements:
|
||||
-------------
|
||||
|
||||
- libburn 0.4.2 headers must be installed at compile time. It is not required
|
||||
at runtime.
|
||||
|
||||
Know bugs:
|
||||
----------
|
||||
|
||||
Multisession and image growing can lead to undesired results in several cases:
|
||||
|
||||
a) Images with unsupported features, such as:
|
||||
- UDF.
|
||||
- HSF/HFS+ or other Mac extensions.
|
||||
- El-Torito with multiple entries.
|
||||
- ECMA-119 with extended attributes, multiple extends per file.
|
||||
- Non El-Torito boot info.
|
||||
- zisofs compressed images.
|
||||
- ...
|
||||
In all these cases, the resulting new image (or new session) could lack some
|
||||
features of the original image.
|
||||
In some cases libisofs will issue warning messages, or even refuse to grow
|
||||
or modify the image. Others remain undetected. Images created with libisofs
|
||||
do not have this problems.
|
||||
|
||||
b) Bootable El-Torito images may have several problems, that result in a new
|
||||
image that is not bootable, or that boots from an outdated session. In many
|
||||
cases it is recommended to add boot info again in the new session.
|
||||
|
||||
- isolinux images won't be bootable after a modify. This is because
|
||||
isolinux images need to have hardcoded the root dir lba. libisofs cannot
|
||||
know whether an image is an isolinux image or not, so the user is
|
||||
responsible to tell libisofs that it must patch the image, with the
|
||||
el_torito_patch_isolinux_image() function. This problem could also exists
|
||||
on other boot images.
|
||||
- Most boot images are highly dependent of the image contents, so if the
|
||||
user moves or removes some files on image it is possible they won't boot
|
||||
anymore.
|
||||
- There is no safer way to modify hidden boot images, as the size of the
|
||||
boot image can't be figured out.
|
||||
|
||||
c) Generated images could have different ECMA-119 low level names, due to
|
||||
different way to mangle names, to new files added that force old files to
|
||||
be renamed, to different relaxed contraints... This only affect the
|
||||
ISO-9660 info, not the RR names, so it shouldn't be a problem in most
|
||||
cases. If your app. relies on low level ISO-9660 names, you will need to
|
||||
ensure all node names are valid ISO names (maybe together with some
|
||||
relaxed contraints), otherwise libisofs might arbitrarily change the names.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Download, Build and Installation
|
||||
|
||||
libisofs code is mantained in a Bazaar repository at Launchpad
|
||||
(https://launchpad.net/libisofs/). You can download it with:
|
||||
|
||||
$ bzr branch lp:libisofs
|
||||
|
||||
Our build system is based on autotools. For preparing the build you will need
|
||||
autotools of at least version 1.7. If you have download the code from the
|
||||
repository, first of all you need to execute
|
||||
|
||||
./autogen.sh
|
||||
|
||||
on toplevel dir to execute autotools.
|
||||
|
||||
Alternatively you may unpack a release tarball for which you do not need
|
||||
autotools installed.
|
||||
|
||||
To build libisofs it should be sufficient to go into its toplevel directory
|
||||
and execute
|
||||
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
To make the libraries accessible for running resp. developing applications
|
||||
make install
|
||||
|
||||
See INSTALL file for further details.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Overview of libburnia-project.org
|
||||
|
||||
libburnia-project.org is an open-source software project for reading, mastering
|
||||
and writing optical discs.
|
||||
For now this means only CD media and all single layer DVD media except DVD+R.
|
||||
|
||||
The project comprises of several more or less interdependent parts which
|
||||
together strive to be a usable foundation for application development.
|
||||
These are libraries, language bindings, and middleware binaries which emulate
|
||||
classical (and valuable) Linux tools.
|
||||
|
||||
Our scope is currently Linux 2.4 and 2.6 only. For ports to other systems
|
||||
we would need : login on a development machine resp. a live OS on CD or DVD,
|
||||
advise from a system person about the equivalent of Linux sg or FreeBSD CAM,
|
||||
volunteers for testing of realistic use cases.
|
||||
|
||||
We have a workable code base for burning CD and most single layer DVD.
|
||||
The burn API is quite comprehensively documented and can be used to build a
|
||||
presentable application.
|
||||
We have a functional binary which emulates parts of cdrecord in order to
|
||||
prove that usability, and in order to allow you to explore libburnia's scope
|
||||
by help of existing cdrecord frontends.
|
||||
|
||||
The project components (list subject to growth, hopefully):
|
||||
|
||||
- libburn is the library by which preformatted data get onto optical media.
|
||||
It uses either /dev/sgN (e.g. on kernel 2.4 with ide-scsi) or
|
||||
/dev/hdX (e.g. on kernel 2.6).
|
||||
libburn is the foundation of our cdrecord emulation. Its code is
|
||||
independent of cdrecord. Its DVD capabilities are learned from
|
||||
studying the code of dvd+rw-tools and MMC-5 specs. No code but only
|
||||
the pure SCSI knowledge has been taken from dvd+rw-tools, though.
|
||||
|
||||
- libisofs is the library to pack up hard disk files and directories into a
|
||||
ISO 9660 disk image. This may then be brought to media via libburn.
|
||||
libisofs is to be the foundation of our upcoming mkisofs emulation.
|
||||
|
||||
- cdrskin is a limited cdrecord compatibility wrapper for libburn.
|
||||
Cdrecord is a powerful GPL'ed burn program included in Joerg
|
||||
Schilling's cdrtools. cdrskin strives to be a second source for
|
||||
the services traditionally provided by cdrecord. Additionally it
|
||||
provides libburn's DVD capabilities, where only -sao is compatible
|
||||
with cdrecord.
|
||||
cdrskin does not contain any bytes copied from cdrecord's sources.
|
||||
Many bytes have been copied from the message output of cdrecord
|
||||
runs, though.
|
||||
See cdrskin/README and man cdrskin/cdrskin.1 for more.
|
||||
|
||||
- test is a collection of application gestures and examples given by the
|
||||
authors of the library features. The main API example for libburn
|
||||
is test/libburner.c .
|
||||
Explore these examples if you look for inspiration.
|
||||
|
||||
We plan to be a responsive upstream. Bear with us. We are still practicing.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Project history as far as known to me:
|
||||
|
||||
- Founded in 2002 as it seems. See mailing list archives
|
||||
http://lists.freedesktop.org/archives/libburn/
|
||||
The site of this founder team is reachable and offers download of a
|
||||
(somewhat outdated) tarball and from CVS :
|
||||
http://icculus.org/burn/
|
||||
Copyright holders and most probably founders:
|
||||
Derek Foreman and Ben Jansens.
|
||||
|
||||
- I came to using libburn in 2005. Founded the cdrskin project and submitted
|
||||
necessary patches which were accepted or implemented better. Except one
|
||||
remaining patch which prevented cdrskin from using vanilla libburn from CVS.
|
||||
The cdrskin project site is reachable and offers download of the heavily
|
||||
patched (elsewise outdated) tarball under the name cdrskin-0.1.2 :
|
||||
http://scdbackup.sourceforge.net/cdrskin_eng.html
|
||||
It has meanwhile moved to use vanilla libburn.pykix.org , though.
|
||||
Version 0.1.4 constitutes the first release of this kind.
|
||||
|
||||
- In July 2006 our team mate Mario Danic announced a revival of libburn
|
||||
which by about nearly everybody else was perceived as unfriendly fork.
|
||||
Derek Foreman four days later posted a message which expressed his
|
||||
discontent.
|
||||
The situation first caused me to publically regret it and then - after i
|
||||
got the opportunity to move in with cdrskin - gave me true reason to
|
||||
personally apologize to Derek Foreman, Ben Jansens and the contibutors at
|
||||
icculus.org/burn. Posted to both projects:
|
||||
http://lists.freedesktop.org/archives/libburn/2006-August/000446.html
|
||||
http://mailman-mail1.webfaction.com/pipermail/libburn-hackers/2006-August/000024.html
|
||||
|
||||
- Mid August 2006 project cdrskin established a branch office in
|
||||
libburn.pykix.org so that all maintainers of our tools have one single place
|
||||
to get the current (at least slightely) usable coordinated versions of
|
||||
everything.
|
||||
Project cdrskin will live forth independendly for a while but it is committed
|
||||
to stay in sync with libburn.pykix.org (or some successor, if ever).
|
||||
cdrskin is also committed to support icculus.org/burn if the pending fork
|
||||
is made reality by content changes in that project. It will cease to maintain
|
||||
a patched version of icculus.org/burn though. Precondition for a new
|
||||
release of cdrskin on base of icculus.org/burn would be the pending
|
||||
"whitelist patch" therefore.
|
||||
I would rather prefer if both projects find consense and merge, or at least
|
||||
cooperate. I have not given up hope totally, yet.
|
||||
I, personally, will honor any approach.
|
||||
|
||||
- 2nd September 2006 the decision is made to strive for a consolidation of
|
||||
copyright and a commitment to GPL in a reasonable and open minded way.
|
||||
This is to avoid long term problems with code of unknown origin and
|
||||
with finding consense among the not so clearly defined group of copyright
|
||||
claimers and -holders.
|
||||
libisofs is already claimed sole copyright Mario Danic.
|
||||
cdrskin and libburner are already claimed sole copyright Thomas Schmitt.
|
||||
Rewrites of other components will follow and concluded by claiming full
|
||||
copyright within the group of libburn.pykix.org-copyright holders.
|
||||
|
||||
- 16th September 2006 feature freeze for release of libburn-0.2.2 .
|
||||
|
||||
- 20th September 2006 release of libburn-0.2.2 .
|
||||
|
||||
- 26th October 2006 feature freeze for cdrskin-0.2.4 based on libburn-0.2.3 .
|
||||
This version of cdrskin is much more cdrecord compatible in repect
|
||||
to drive addressing and audio features.
|
||||
|
||||
- 30th October 2006 release of cdrskin-0.2.4 .
|
||||
|
||||
- 13th November 2006 splitting releases of libburn+cdrskin from libisofs.
|
||||
|
||||
- 24th November 2006 release of libburn-0.2.6 and cdrskin-0.2.6 . cdrskin has
|
||||
become suitable for unaware frontends as long as they perform only the core
|
||||
of cdrecord use cases (including open-ended input streams, audio, and
|
||||
multi-session).
|
||||
|
||||
- 28th November 2006 the umbrella project which encloses both, libisofs and
|
||||
libburn, is now called libburnia. For the origin of this name, see
|
||||
http://en.wikipedia.org/wiki/Liburnians .
|
||||
|
||||
- 16th January 2007 release of libburn-0.3.0 and cdrskin-0.3.0 . Now the scope
|
||||
is widened to a first class of DVD media: overwriteable single layer types
|
||||
DVD-RAM, DVD+RW, DVD-RW. This is not a cdrecord emulation but rather inspired
|
||||
by dvd+rw-tools' "poor man" writing facility for this class of media.
|
||||
Taking a bow towards Andy Polyakov.
|
||||
|
||||
- 11th February 2007 version 0.3.2 covers sequential DVD-RW and DVD-R with
|
||||
multi-session and with DAO.
|
||||
|
||||
- 12th March 2007 version 0.3.4 supports DVD+R and thus covers all single layer
|
||||
DVD media. Code for double layer DVD+/-R is implemented but awaits a tester
|
||||
yet.
|
||||
|
||||
- 23th April 2007 version 0.3.6 follows the unanimous opinion of Linux kernel
|
||||
people that one should not use /dev/sg on kernel 2.6.
|
||||
|
||||
- 31st July 2007 version 0.3.8 marks the first anniversary of libburn revival.
|
||||
We look back on improved stability, a substantially extended list of media
|
||||
and write modes, and better protection against typical user mishaps.
|
||||
|
||||
- 24th October 2007 version 0.4.0 is the foundation of new library libisoburn
|
||||
and an upcomming integrated application for manipulating and writing
|
||||
ISO 9660 + Rock Ridge images. cdrskin-0.4.0 got capabilities like growisofs
|
||||
by these enhancements: growing of overwriteable media and disk files.
|
||||
Taking again a bow towards Andy Polyakov.
|
||||
|
||||
- 26th Januar 2008 version 0.4.2 rectifies the version numbering so that we
|
||||
reliably release libburn.so.4 as should have been done since libburn-0.3.2.
|
||||
cdrskin now is by default linked dynamically and does a runtime check
|
||||
to ensure not to be started with a libburn which is older than itself.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
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. To be exact: version 2 of that License.
|
||||
|
||||
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
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Clarification in my name and in the name of Mario Danic, upcoming copyright
|
||||
holders on toplevel of libburnia. To be fully in effect after the remaining
|
||||
other copyrighted code has been replaced by ours and by copyright-free
|
||||
contributions of our friends:
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
We, the copyright holders, agree on the interpretation that
|
||||
dynamical linking of our libraries constitutes "use of" and
|
||||
not "derivation from" our work in the sense of GPL, provided
|
||||
those libraries are compiled from our unaltered code.
|
||||
|
||||
Thus you may link our libraries dynamically with applications
|
||||
which are not under GPL. You may distribute our libraries and
|
||||
application tools in binary form, if you fulfill the usual
|
||||
condition of GPL to offer a copy of the source code -altered
|
||||
or unaltered- under GPL.
|
||||
|
||||
We ask you politely to use our work in open source spirit
|
||||
and with the due reference to the entire open source community.
|
||||
|
||||
If there should really arise the case where above clarification
|
||||
does not suffice to fulfill a clear and neat request in open source
|
||||
spirit that would otherwise be declined for mere formal reasons,
|
||||
only in that case we will duely consider to issue a special license
|
||||
covering only that special case.
|
||||
It is the open source idea of responsible freedom which will be
|
||||
decisive and you will have to prove that you exhausted all own
|
||||
means to qualify for GPL.
|
||||
|
||||
For now we are firmly committed to maintain one single license: GPL.
|
||||
|
||||
signed: Mario Danic, Thomas Schmitt
|
||||
|
@ -0,0 +1,33 @@
|
||||
|
||||
>>>>>>>>>> RELEASE 0.6.1 (development) >>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
- Review error severities
|
||||
OK - Prepare API for stability and compatibility check
|
||||
- Documentation
|
||||
|
||||
>>>>>>>>>> RELEASE 0.6.2 (stable) >>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
- Intensive testing and bug fixing
|
||||
|
||||
>>>>>>>>>> RELEASE 0.6.3 (development) >>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
- Improves to public tree
|
||||
-> Expose node extended info. Always compile it.
|
||||
(little memory cost)
|
||||
-> Review builder / tree / node relation
|
||||
-> Optimize storage of children in node?
|
||||
-> Inode object?
|
||||
- Expose Builder and Streams
|
||||
- Implement filters: compression, encryption...
|
||||
- Consider some kind of plugin system for Builders, Filesystems and Filters.
|
||||
- ECMA-119, Joliet, and ISO-9660:1999 writers can share most of the code.
|
||||
Create a new writer as a generalization of these.
|
||||
- Update Java bindings
|
||||
|
||||
>>>>>>>>>>> ......
|
||||
|
||||
>>>>>>>>>>> RELEASE 1.0.0 (stable) >>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
- UDF
|
||||
- HFS
|
||||
|
@ -0,0 +1,35 @@
|
||||
FEATURES
|
||||
========
|
||||
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
#00001 (node.h) -> consider adding new timestamps to IsoTreeNode
|
||||
#00004 (libisofs.h) -> Add a get_mime_type() function.
|
||||
#00005 (node.c) -> optimize iso_dir_iter_take.
|
||||
#00006 (libisofs.h) -> define more replace values when adding a node to a dir
|
||||
#00007 (libisofs.h) -> expose iso_tree_add_new_file
|
||||
#00008 (data_dource.c) -> guard against partial reads
|
||||
#00009 (ecma119_tree.c/h) -> add true support for harlinks and inode numbers
|
||||
#00010 (buffer.c) -> optimize ring buffer
|
||||
#00011 (ecma119.c) -> guard against bad path table usage with more than 65535 dirs
|
||||
#00012 (fs_image.c) -> support follow symlinks on imafe filesystem
|
||||
#00013 (fs_image.c) -> check for unsupported flags when reading a dir record
|
||||
#00014 (fs_image.c) -> more sanity checks to ensure dir record info is valid
|
||||
#00015 (fs_image.c) -> take care of CD-ROM XA discs when reading SP entry
|
||||
#00016 (fs_image.c) -> handle non RR ER entries
|
||||
#00017 (fs_image.c) -> take advantage of other atts of PVD
|
||||
#00018 (fs_image.c) -> check if there are more entries in the boot catalog
|
||||
#00019 (fs_image.c) -> set IsoImage attribs from Joliet SVD?
|
||||
#00020 (fs_image.c) -> handle RR info in Joliet tree
|
||||
#00021 (fs_image.c) -> handle RR info in ISO 9660:1999 tree
|
||||
#00022 (joliet.c) -> support relaxed constraints in joliet filenames
|
||||
#00024 (libisofs.h) -> option to convert names to lower case for iso reading
|
||||
#00025 (libisofs.h) -> support for merging old image files
|
||||
#00026 (libisofs.h) -> add support for "hidden" bootable images.
|
||||
#00027 (iso1999.h) -> Follow ISO 9660:1999 specs when sorting files
|
||||
|
||||
FIXME
|
||||
=====
|
||||
|
@ -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,10 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
aclocal
|
||||
libtoolize --copy --force
|
||||
autoconf
|
||||
|
||||
# ts A61101 : libburn is not prepared for config.h
|
||||
# autoheader
|
||||
|
||||
automake --foreign --add-missing --copy --include-deps
|
@ -0,0 +1,155 @@
|
||||
AC_INIT([libisofs], [0.6.3], [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 A61101 This breaks Linux build (makes 32 bit off_t)
|
||||
dnl http://sourceware.org/autobook/autobook/autobook_96.html says
|
||||
dnl one must include some config.h and this was a pitfall.
|
||||
dnl So why dig the pit at all ?
|
||||
dnl AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl
|
||||
dnl if MAJOR or MINOR version changes, be sure to change AC_INIT above to match
|
||||
dnl
|
||||
dnl CURRENT and AGE describe the binary compatibility interval of a
|
||||
dnl dynamic library.
|
||||
dnl See also http://www.gnu.org/software/libtool/manual.html#Interfaces
|
||||
dnl
|
||||
dnl The name of the library will be libisofs.so.$CURRENT-$AGE.$AGE.$REV
|
||||
dnl In the terminology of this file:
|
||||
dnl CURRENT = LT_CURRENT
|
||||
dnl REV = LT_REVISION
|
||||
dnl AGE = LT_AGE
|
||||
dnl
|
||||
dnl LT_CURRENT, LT_REVISION and LT_AGE get set directly now.
|
||||
dnl
|
||||
dnl SONAME of the emerging library is LT_CURRENT - LT_AGE.
|
||||
dnl The linker will do no finer checks. Especially no age range check for
|
||||
dnl the cdrskin binary. If SONAME matches, then the couple starts.
|
||||
dnl
|
||||
dnl Therefore a run time check is provided by libisofs function
|
||||
dnl iso_lib_version(). It returns the major, minor and micro revision of the
|
||||
dnl library. This means LIBISOFS_*_VERSION kept its second job which does not
|
||||
dnl comply to the usual ways of configure.ac . I.e. now *officially* this is
|
||||
dnl the source code release version as announced to the public. It has no
|
||||
dnl conection to SONAME or libtool version numbering.
|
||||
dnl It rather feeds the API function iso_lib_version().
|
||||
dnl
|
||||
dnl If LIBISOFS_*_VERSION changes, be sure to change AC_INIT above to match.
|
||||
dnl
|
||||
LIBISOFS_MAJOR_VERSION=0
|
||||
LIBISOFS_MINOR_VERSION=6
|
||||
LIBISOFS_MICRO_VERSION=3
|
||||
LIBISOFS_VERSION=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION.$LIBISOFS_MICRO_VERSION
|
||||
|
||||
AC_SUBST(LIBISOFS_MAJOR_VERSION)
|
||||
AC_SUBST(LIBISOFS_MINOR_VERSION)
|
||||
AC_SUBST(LIBISOFS_MICRO_VERSION)
|
||||
AC_SUBST(LIBISOFS_VERSION)
|
||||
|
||||
dnl Libtool versioning
|
||||
LT_RELEASE=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION
|
||||
# SONAME = 6 - 0 = 6 . Library name = libisofs.6.0.0
|
||||
LT_CURRENT=6
|
||||
LT_REVISION=0
|
||||
LT_AGE=0
|
||||
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_MSG_ERROR([Libisofs requires largefile support.])
|
||||
fi
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
AC_SUBST(LIBTOOL_DEPS)
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_CHECK_HEADERS()
|
||||
|
||||
dnl Use GNU extensions if available
|
||||
AC_DEFINE(_GNU_SOURCE, 1)
|
||||
|
||||
dnl Check for tm_gmtoff field in struct tm
|
||||
AC_CHECK_MEMBER([struct tm.tm_gmtoff],
|
||||
[AC_DEFINE(HAVE_TM_GMTOFF, 1,
|
||||
[Define this if tm structure includes a tm_gmtoff entry.])],
|
||||
,
|
||||
[#include <time.h>])
|
||||
|
||||
dnl Check if non standard timegm() function is available
|
||||
AC_CHECK_DECL([timegm],
|
||||
[AC_DEFINE(HAVE_TIMEGM, 1, [Define this if timegm function is available])],
|
||||
,
|
||||
[#include <time.h>])
|
||||
|
||||
dnl Check if non standard eaccess() function is available
|
||||
AC_CHECK_DECL([eaccess],
|
||||
[AC_DEFINE(HAVE_EACCESS, 1, [Define this if eaccess function is available])],
|
||||
,
|
||||
[#include <unistd.h>])
|
||||
|
||||
THREAD_LIBS=-lpthread
|
||||
AC_SUBST(THREAD_LIBS)
|
||||
|
||||
TARGET_SHIZZLE
|
||||
AC_SUBST(ARCH)
|
||||
AC_SUBST(LIBBURN_ARCH_LIBS)
|
||||
|
||||
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
|
||||
|
||||
dnl Verbose debug to make libisofs issue more debug messages
|
||||
AC_ARG_ENABLE(verbose-debug,
|
||||
[ --enable-verbose-debug Enable verbose debug messages [default=no]],
|
||||
AC_DEFINE(LIBISOFS_VERBOSE_DEBUG, 1))
|
||||
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
doc/doxygen.conf
|
||||
version.h
|
||||
libisofs-1.pc
|
||||
])
|
||||
AC_OUTPUT
|
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Vreixo Formoso
|
||||
*
|
||||
* This file is part of the libisofs project; 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. See COPYING file for details.
|
||||
*/
|
||||
|
||||
#include "libisofs.h"
|
||||
#include "fsource.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*
|
||||
* Little test program to test filesystem implementations.
|
||||
* Outputs file contents to stdout!
|
||||
*/
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int res;
|
||||
IsoFilesystem *fs;
|
||||
IsoFileSource *file;
|
||||
struct stat info;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: cat /path/to/file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* create filesystem object */
|
||||
res = iso_local_filesystem_new(&fs);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Can't get local fs object, err = %d\n", res);
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = fs->get_by_path(fs, argv[1], &file);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Can't get file, err = %d\n", res);
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = iso_file_source_lstat(file, &info);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Can't stat file, err = %d\n", res);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (S_ISDIR(info.st_mode)) {
|
||||
fprintf(stderr, "Path refers to a directory!!\n");
|
||||
return 1;
|
||||
} else {
|
||||
char buf[1024];
|
||||
res = iso_file_source_open(file);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Can't open file, err = %d\n", res);
|
||||
return 1;
|
||||
}
|
||||
while ((res = iso_file_source_read(file, buf, 1024)) > 0) {
|
||||
fwrite(buf, 1, res, stdout);
|
||||
}
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Error reading, err = %d\n", res);
|
||||
return 1;
|
||||
}
|
||||
iso_file_source_close(file);
|
||||
}
|
||||
|
||||
iso_file_source_unref(file);
|
||||
iso_filesystem_unref(fs);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Vreixo Formoso
|
||||
*
|
||||
* This file is part of the libisofs project; 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. See COPYING file for details.
|
||||
*/
|
||||
|
||||
#include "libisofs.h"
|
||||
#include "buffer.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
* Little test program that reads a file and outputs it to stdout, using
|
||||
* the libisofs ring buffer as intermediate memory
|
||||
*/
|
||||
|
||||
struct th_data
|
||||
{
|
||||
IsoRingBuffer *rbuf;
|
||||
char *path;
|
||||
};
|
||||
|
||||
#define WRITE_CHUNK 2048
|
||||
#define READ_CHUNK 2048
|
||||
|
||||
static
|
||||
void *write_function(void *arg)
|
||||
{
|
||||
ssize_t bytes;
|
||||
int res;
|
||||
unsigned char tmp[WRITE_CHUNK];
|
||||
struct th_data *data = (struct th_data *) arg;
|
||||
|
||||
int fd = open(data->path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Writer thread error: Can't open file");
|
||||
iso_ring_buffer_writer_close(data->rbuf, 1);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
res = 1;
|
||||
while ( (bytes = read(fd, tmp, WRITE_CHUNK)) > 0) {
|
||||
res = iso_ring_buffer_write(data->rbuf, tmp, bytes);
|
||||
if (res <= 0) {
|
||||
break;
|
||||
}
|
||||
/* To test premature reader exit >>>>>>>>>>>
|
||||
iso_ring_buffer_writer_close(data->rbuf);
|
||||
pthread_exit(NULL);
|
||||
<<<<<<<<<<<<<<<<<<<<<<<<< */
|
||||
// if (rand() > 2000000000) {
|
||||
// fprintf(stderr, "Writer sleeping\n");
|
||||
// sleep(1);
|
||||
// }
|
||||
}
|
||||
fprintf(stderr, "Writer finish: %d\n", res);
|
||||
|
||||
close(fd);
|
||||
iso_ring_buffer_writer_close(data->rbuf, 0);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static
|
||||
void *read_function(void *arg)
|
||||
{
|
||||
unsigned char tmp[READ_CHUNK];
|
||||
int res = 1;
|
||||
struct th_data *data = (struct th_data *) arg;
|
||||
|
||||
while ( (res = iso_ring_buffer_read(data->rbuf, tmp, READ_CHUNK)) > 0) {
|
||||
write(1, tmp, READ_CHUNK);
|
||||
/* To test premature reader exit >>>>>>>>>>>
|
||||
iso_ring_buffer_reader_close(data->rbuf);
|
||||
pthread_exit(NULL);
|
||||
<<<<<<<<<<<<<<<<<<<<<<<<< */
|
||||
// if (rand() > 2000000000) {
|
||||
// fprintf(stderr, "Reader sleeping\n");
|
||||
// sleep(1);
|
||||
// }
|
||||
}
|
||||
fprintf(stderr, "Reader finish: %d\n", res);
|
||||
|
||||
iso_ring_buffer_reader_close(data->rbuf, 0);
|
||||
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int res;
|
||||
struct th_data data;
|
||||
pthread_t reader;
|
||||
pthread_t writer;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: catbuffer /path/to/file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = iso_ring_buffer_new(1024, &data.rbuf);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Can't create buffer\n");
|
||||
return 1;
|
||||
}
|
||||
data.path = argv[1];
|
||||
|
||||
res = pthread_create(&writer, NULL, write_function, (void *) &data);
|
||||
res = pthread_create(&reader, NULL, read_function, (void *) &data);
|
||||
|
||||
pthread_join(writer, NULL);
|
||||
pthread_join(reader, NULL);
|
||||
|
||||
fprintf(stderr, "Buffer was %d times full and %d times empty.\n",
|
||||
iso_ring_buffer_get_times_full(data.rbuf),
|
||||
iso_ring_buffer_get_times_empty(data.rbuf));
|
||||
|
||||
free(data.rbuf);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Little program that imports a directory to iso image, generates the
|
||||
* ecma119 low level tree and prints it.
|
||||
* Note that this is not an API example, but a little program for test
|
||||
* purposes.
|
||||
*/
|
||||
|
||||
#include "libisofs.h"
|
||||
#include "ecma119.h"
|
||||
#include "ecma119_tree.h"
|
||||
#include "util.h"
|
||||
#include "filesrc.h"
|
||||
#include "node.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void
|
||||
print_permissions(mode_t mode)
|
||||
{
|
||||
char perm[10];
|
||||
|
||||
//TODO suid, sticky...
|
||||
|
||||
perm[9] = '\0';
|
||||
perm[8] = mode & S_IXOTH ? 'x' : '-';
|
||||
perm[7] = mode & S_IWOTH ? 'w' : '-';
|
||||
perm[6] = mode & S_IROTH ? 'r' : '-';
|
||||
perm[5] = mode & S_IXGRP ? 'x' : '-';
|
||||
perm[4] = mode & S_IWGRP ? 'w' : '-';
|
||||
perm[3] = mode & S_IRGRP ? 'r' : '-';
|
||||
perm[2] = mode & S_IXUSR ? 'x' : '-';
|
||||
perm[1] = mode & S_IWUSR ? 'w' : '-';
|
||||
perm[0] = mode & S_IRUSR ? 'r' : '-';
|
||||
printf("[%s]",perm);
|
||||
}
|
||||
|
||||
static void
|
||||
print_dir(Ecma119Node *dir, int level)
|
||||
{
|
||||
int i;
|
||||
char *sp = alloca(level * 2 + 1);
|
||||
|
||||
for (i = 0; i < level * 2; i += 2) {
|
||||
sp[i] = '|';
|
||||
sp[i+1] = ' ';
|
||||
}
|
||||
|
||||
sp[level * 2-1] = '-';
|
||||
sp[level * 2] = '\0';
|
||||
|
||||
for (i = 0; i < dir->info.dir->nchildren; i++) {
|
||||
Ecma119Node *child = dir->info.dir->children[i];
|
||||
|
||||
if (child->type == ECMA119_DIR) {
|
||||
printf("%s+[D] ", sp);
|
||||
print_permissions(iso_node_get_permissions(child->node));
|
||||
printf(" %s\n", child->iso_name);
|
||||
print_dir(child, level+1);
|
||||
} else if (child->type == ECMA119_FILE) {
|
||||
printf("%s-[F] ", sp);
|
||||
print_permissions(iso_node_get_permissions(child->node));
|
||||
printf(" %s {%p}\n", child->iso_name, (void*)child->info.file);
|
||||
} else if (child->type == ECMA119_SYMLINK) {
|
||||
printf("%s-[L] ", sp);
|
||||
print_permissions(iso_node_get_permissions(child->node));
|
||||
printf(" %s -> %s\n", child->iso_name,
|
||||
((IsoSymlink*)child->node)->dest);
|
||||
} else if (child->type == ECMA119_SPECIAL) {
|
||||
printf("%s-[S] ", sp);
|
||||
print_permissions(iso_node_get_permissions(child->node));
|
||||
printf(" %s\n", child->iso_name);
|
||||
} else if (child->type == ECMA119_PLACEHOLDER) {
|
||||
printf("%s-[RD] ", sp);
|
||||
print_permissions(iso_node_get_permissions(child->node));
|
||||
printf(" %s\n", child->iso_name);
|
||||
} else {
|
||||
printf("%s-[????] ", sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int result;
|
||||
IsoImage *image;
|
||||
Ecma119Image *ecma119;
|
||||
|
||||
if (argc != 2) {
|
||||
printf ("You need to specify a valid path\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
iso_init();
|
||||
iso_set_msgs_severities("NEVER", "ALL", "");
|
||||
result = iso_image_new("volume_id", &image);
|
||||
if (result < 0) {
|
||||
printf ("Error creating image\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[1]);
|
||||
if (result < 0) {
|
||||
printf ("Error adding directory %d\n", result);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ecma119 = calloc(1, sizeof(Ecma119Image));
|
||||
iso_rbtree_new(iso_file_src_cmp, &(ecma119->files));
|
||||
ecma119-> |