From 451b7eb2aaf0e9f981585a19bf1c6c3fecb34844 Mon Sep 17 00:00:00 2001
From: Mario Danic
Date: Tue, 11 Mar 2008 19:34:19 +0000
Subject: [PATCH] Some svn admin magic
---
libisoburn/branches/XorrisoZeroOneTwo/AUTHORS | 3 +
.../branches/XorrisoZeroOneTwo/CONTRIBUTORS | 0
libisoburn/branches/XorrisoZeroOneTwo/COPYING | 280 +
.../branches/XorrisoZeroOneTwo/COPYRIGHT | 23 +
libisoburn/branches/XorrisoZeroOneTwo/INSTALL | 237 +
.../branches/XorrisoZeroOneTwo/Makefile.am | 131 +
libisoburn/branches/XorrisoZeroOneTwo/README | 152 +
libisoburn/branches/XorrisoZeroOneTwo/TODO | 11 +
.../branches/XorrisoZeroOneTwo/acinclude.m4 | 22 +
.../branches/XorrisoZeroOneTwo/bootstrap | 7 +
.../branches/XorrisoZeroOneTwo/configure.ac | 125 +
.../XorrisoZeroOneTwo/doc/doxygen.conf.in | 1300 ++
.../XorrisoZeroOneTwo/libisoburn-1.pc.in | 12 +
.../XorrisoZeroOneTwo/libisoburn/burn_wrap.c | 892 ++
.../libisoburn/data_source.c | 190 +
.../XorrisoZeroOneTwo/libisoburn/isoburn.c | 839 ++
.../XorrisoZeroOneTwo/libisoburn/isoburn.h | 325 +
.../XorrisoZeroOneTwo/libisoburn/isofs_wrap.c | 398 +
.../XorrisoZeroOneTwo/libisoburn/libisoburn.h | 1054 ++
.../XorrisoZeroOneTwo/test/compare_file.c | 275 +
.../branches/XorrisoZeroOneTwo/test/test.c | 312 +
.../branches/XorrisoZeroOneTwo/version.h.in | 6 +
.../branches/XorrisoZeroOneTwo/xorriso/README | 201 +
.../XorrisoZeroOneTwo/xorriso/changelog.txt | 1906 +++
.../xorriso/compile_xorriso.sh | 155 +
.../xorriso/configure_ac.txt | 114 +
.../xorriso/convert_man_to_html.sh | 107 +
.../xorriso/make_timestamp.sh | 9 +
.../xorriso/make_xorriso_standalone.sh | 235 +
.../XorrisoZeroOneTwo/xorriso/xorriso.1 | 1858 +++
.../XorrisoZeroOneTwo/xorriso/xorriso.c | 11073 ++++++++++++++++
.../XorrisoZeroOneTwo/xorriso/xorriso.h | 452 +
.../xorriso/xorriso_eng.html | 431 +
.../xorriso/xorriso_makefile_am.txt | 189 +
.../xorriso/xorriso_pc_in.txt | 12 +
.../xorriso/xorriso_private.h | 427 +
.../xorriso/xorriso_timestamp.h | 1 +
.../XorrisoZeroOneTwo/xorriso/xorrisoburn.c | 4745 +++++++
.../XorrisoZeroOneTwo/xorriso/xorrisoburn.h | 195 +
libisofs/tags/ForXorrisoZeroOneTwo/AUTHORS | 3 +
libisofs/tags/ForXorrisoZeroOneTwo/COPYING | 280 +
libisofs/tags/ForXorrisoZeroOneTwo/COPYRIGHT | 19 +
libisofs/tags/ForXorrisoZeroOneTwo/ChangeLog | 1 +
libisofs/tags/ForXorrisoZeroOneTwo/INSTALL | 234 +
.../tags/ForXorrisoZeroOneTwo/Makefile.am | 191 +
libisofs/tags/ForXorrisoZeroOneTwo/NEWS | 20 +
libisofs/tags/ForXorrisoZeroOneTwo/README | 341 +
libisofs/tags/ForXorrisoZeroOneTwo/Roadmap | 33 +
libisofs/tags/ForXorrisoZeroOneTwo/TODO | 35 +
.../tags/ForXorrisoZeroOneTwo/acinclude.m4 | 22 +
libisofs/tags/ForXorrisoZeroOneTwo/bootstrap | 10 +
.../tags/ForXorrisoZeroOneTwo/configure.ac | 155 +
libisofs/tags/ForXorrisoZeroOneTwo/demo/cat.c | 74 +
.../ForXorrisoZeroOneTwo/demo/cat_buffer.c | 127 +
.../ForXorrisoZeroOneTwo/demo/ecma119_tree.c | 136 +
libisofs/tags/ForXorrisoZeroOneTwo/demo/iso.c | 176 +
.../tags/ForXorrisoZeroOneTwo/demo/iso_cat.c | 95 +
.../tags/ForXorrisoZeroOneTwo/demo/iso_grow.c | 257 +
.../ForXorrisoZeroOneTwo/demo/iso_modify.c | 109 +
.../tags/ForXorrisoZeroOneTwo/demo/iso_ms.c | 114 +
.../tags/ForXorrisoZeroOneTwo/demo/iso_read.c | 167 +
libisofs/tags/ForXorrisoZeroOneTwo/demo/lsl.c | 130 +
.../tags/ForXorrisoZeroOneTwo/demo/tree.c | 107 +
.../tags/ForXorrisoZeroOneTwo/doc/Tutorial | 506 +
libisofs/tags/ForXorrisoZeroOneTwo/doc/Wiki | 32 +
.../doc/devel/1. Overview | 0
.../doc/devel/2. Features | 193 +
.../doc/devel/3. Use Cases | 193 +
.../ForXorrisoZeroOneTwo/doc/devel/4. Design | 0
.../doc/devel/5. Implementation | 0
.../ForXorrisoZeroOneTwo/doc/devel/README | 7 +
.../doc/devel/UML/BuilderSec.png | Bin 0 -> 25202 bytes
.../doc/devel/UML/BuilderSec.violet | 821 ++
.../doc/devel/UML/builder.violet | 884 ++
.../doc/devel/UML/builder.violet.png | Bin 0 -> 34098 bytes
.../doc/devel/UML/burn_source.class.violet | 634 +
.../doc/devel/UML/burn_source.png | Bin 0 -> 35652 bytes
.../doc/devel/UML/eltorito.violet | 552 +
.../doc/devel/UML/eltorito.violet.png | Bin 0 -> 24861 bytes
.../doc/devel/UML/iso_tree.violet | 748 ++
.../doc/devel/UML/iso_tree.violet.png | Bin 0 -> 38189 bytes
.../doc/devel/UML/nglibisofs.violet | 1059 ++
.../doc/devel/UML/stream.violet | 492 +
.../doc/devel/UML/stream.violet.png | Bin 0 -> 21694 bytes
.../doc/devel/codestyle.xml | 91 +
.../doc/devel/cookbook/ISO 9660-1999 | 119 +
.../ForXorrisoZeroOneTwo/doc/doxygen.conf.in | 1298 ++
.../ForXorrisoZeroOneTwo/libisofs-1.pc.in | 11 +
.../ForXorrisoZeroOneTwo/libisofs/buffer.c | 328 +
.../ForXorrisoZeroOneTwo/libisofs/buffer.h | 95 +
.../ForXorrisoZeroOneTwo/libisofs/builder.c | 208 +
.../ForXorrisoZeroOneTwo/libisofs/builder.h | 81 +
.../libisofs/data_source.c | 195 +
.../ForXorrisoZeroOneTwo/libisofs/ecma119.c | 1579 +++
.../ForXorrisoZeroOneTwo/libisofs/ecma119.h | 476 +
.../libisofs/ecma119_tree.c | 846 ++
.../libisofs/ecma119_tree.h | 90 +
.../ForXorrisoZeroOneTwo/libisofs/eltorito.c | 908 ++
.../ForXorrisoZeroOneTwo/libisofs/eltorito.h | 103 +
.../ForXorrisoZeroOneTwo/libisofs/filesrc.c | 387 +
.../ForXorrisoZeroOneTwo/libisofs/filesrc.h | 84 +
.../ForXorrisoZeroOneTwo/libisofs/filter.c | 49 +
.../ForXorrisoZeroOneTwo/libisofs/filter.h | 62 +
.../libisofs/filters/xor_encrypt.c | 187 +
.../tags/ForXorrisoZeroOneTwo/libisofs/find.c | 629 +
.../ForXorrisoZeroOneTwo/libisofs/fs_image.c | 2642 ++++
.../ForXorrisoZeroOneTwo/libisofs/fs_local.c | 645 +
.../ForXorrisoZeroOneTwo/libisofs/fsource.c | 111 +
.../ForXorrisoZeroOneTwo/libisofs/fsource.h | 33 +
.../ForXorrisoZeroOneTwo/libisofs/image.c | 277 +
.../ForXorrisoZeroOneTwo/libisofs/image.h | 112 +
.../ForXorrisoZeroOneTwo/libisofs/iso1999.c | 1016 ++
.../ForXorrisoZeroOneTwo/libisofs/iso1999.h | 59 +
.../ForXorrisoZeroOneTwo/libisofs/joliet.c | 1081 ++
.../ForXorrisoZeroOneTwo/libisofs/joliet.h | 56 +
.../libisofs/libiso_msgs.c | 439 +
.../libisofs/libiso_msgs.h | 682 +
.../ForXorrisoZeroOneTwo/libisofs/libisofs.h | 3644 +++++
.../ForXorrisoZeroOneTwo/libisofs/messages.c | 428 +
.../ForXorrisoZeroOneTwo/libisofs/messages.h | 49 +
.../tags/ForXorrisoZeroOneTwo/libisofs/node.c | 1171 ++
.../tags/ForXorrisoZeroOneTwo/libisofs/node.h | 344 +
.../ForXorrisoZeroOneTwo/libisofs/rockridge.c | 1208 ++
.../ForXorrisoZeroOneTwo/libisofs/rockridge.h | 267 +
.../libisofs/rockridge_read.c | 419 +
.../ForXorrisoZeroOneTwo/libisofs/stream.c | 434 +
.../ForXorrisoZeroOneTwo/libisofs/stream.h | 45 +
.../tags/ForXorrisoZeroOneTwo/libisofs/tree.c | 804 ++
.../tags/ForXorrisoZeroOneTwo/libisofs/tree.h | 21 +
.../tags/ForXorrisoZeroOneTwo/libisofs/util.c | 1264 ++
.../tags/ForXorrisoZeroOneTwo/libisofs/util.h | 438 +
.../libisofs/util_htable.c | 340 +
.../libisofs/util_rbtree.c | 296 +
.../ForXorrisoZeroOneTwo/libisofs/writer.h | 43 +
.../ForXorrisoZeroOneTwo/test/mocked_fsrc.c | 378 +
.../ForXorrisoZeroOneTwo/test/mocked_fsrc.h | 31 +
.../tags/ForXorrisoZeroOneTwo/test/test.c | 26 +
.../tags/ForXorrisoZeroOneTwo/test/test.h | 14 +
.../ForXorrisoZeroOneTwo/test/test_image.c | 354 +
.../ForXorrisoZeroOneTwo/test/test_node.c | 690 +
.../test/test_rockridge.c | 1395 ++
.../ForXorrisoZeroOneTwo/test/test_stream.c | 155 +
.../ForXorrisoZeroOneTwo/test/test_tree.c | 566 +
.../ForXorrisoZeroOneTwo/test/test_util.c | 1072 ++
.../tags/ForXorrisoZeroOneTwo/version.h.in | 3 +
145 files changed, 68539 insertions(+)
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/AUTHORS
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/CONTRIBUTORS
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/COPYING
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/COPYRIGHT
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/INSTALL
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/Makefile.am
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/README
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/TODO
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/acinclude.m4
create mode 100755 libisoburn/branches/XorrisoZeroOneTwo/bootstrap
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/configure.ac
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/doc/doxygen.conf.in
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn-1.pc.in
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn/burn_wrap.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn/data_source.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.h
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isofs_wrap.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/libisoburn/libisoburn.h
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/test/compare_file.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/test/test.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/version.h.in
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/README
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/changelog.txt
create mode 100755 libisoburn/branches/XorrisoZeroOneTwo/xorriso/compile_xorriso.sh
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/configure_ac.txt
create mode 100755 libisoburn/branches/XorrisoZeroOneTwo/xorriso/convert_man_to_html.sh
create mode 100755 libisoburn/branches/XorrisoZeroOneTwo/xorriso/make_timestamp.sh
create mode 100755 libisoburn/branches/XorrisoZeroOneTwo/xorriso/make_xorriso_standalone.sh
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso.1
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso.h
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_eng.html
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_makefile_am.txt
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_pc_in.txt
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_private.h
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_timestamp.h
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorrisoburn.c
create mode 100644 libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorrisoburn.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/AUTHORS
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/COPYING
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/COPYRIGHT
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/ChangeLog
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/INSTALL
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/Makefile.am
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/NEWS
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/README
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/Roadmap
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/TODO
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/acinclude.m4
create mode 100755 libisofs/tags/ForXorrisoZeroOneTwo/bootstrap
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/configure.ac
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/cat.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/cat_buffer.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/ecma119_tree.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/iso.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_cat.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_grow.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_modify.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_ms.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_read.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/lsl.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/demo/tree.c
create mode 100755 libisofs/tags/ForXorrisoZeroOneTwo/doc/Tutorial
create mode 100755 libisofs/tags/ForXorrisoZeroOneTwo/doc/Wiki
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/1. Overview
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/2. Features
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/3. Use Cases
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/4. Design
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/5. Implementation
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/README
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/BuilderSec.png
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/BuilderSec.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/builder.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/builder.violet.png
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/burn_source.class.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/burn_source.png
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/eltorito.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/eltorito.violet.png
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/iso_tree.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/iso_tree.violet.png
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/nglibisofs.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/stream.violet
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/stream.violet.png
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/codestyle.xml
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/cookbook/ISO 9660-1999
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/doc/doxygen.conf.in
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs-1.pc.in
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/buffer.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/buffer.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/builder.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/builder.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/data_source.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/ecma119.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/ecma119.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/ecma119_tree.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/ecma119_tree.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/eltorito.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/eltorito.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/filesrc.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/filesrc.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/filter.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/filter.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/filters/xor_encrypt.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/find.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/fs_image.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/fs_local.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/fsource.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/fsource.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/image.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/image.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/iso1999.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/iso1999.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/joliet.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/joliet.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/libiso_msgs.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/libiso_msgs.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/libisofs.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/messages.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/messages.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/node.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/node.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/rockridge.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/rockridge.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/rockridge_read.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/stream.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/stream.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/tree.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/tree.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/util.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/util.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/util_htable.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/util_rbtree.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/libisofs/writer.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/mocked_fsrc.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/mocked_fsrc.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test.h
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test_image.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test_node.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test_rockridge.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test_stream.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test_tree.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/test/test_util.c
create mode 100644 libisofs/tags/ForXorrisoZeroOneTwo/version.h.in
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/AUTHORS b/libisoburn/branches/XorrisoZeroOneTwo/AUTHORS
new file mode 100644
index 00000000..0547ea18
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/AUTHORS
@@ -0,0 +1,3 @@
+Thomas Schmitt
+Vreixo Formoso Lopes
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/CONTRIBUTORS b/libisoburn/branches/XorrisoZeroOneTwo/CONTRIBUTORS
new file mode 100644
index 00000000..e69de29b
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/COPYING b/libisoburn/branches/XorrisoZeroOneTwo/COPYING
new file mode 100644
index 00000000..5a965fbc
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/COPYING
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/COPYRIGHT b/libisoburn/branches/XorrisoZeroOneTwo/COPYRIGHT
new file mode 100644
index 00000000..104853d2
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/COPYRIGHT
@@ -0,0 +1,23 @@
+Mario Danic ,
+Vreixo Formoso
+Thomas Schmitt
+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
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/INSTALL b/libisoburn/branches/XorrisoZeroOneTwo/INSTALL
new file mode 100644
index 00000000..a6580e5a
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/INSTALL
@@ -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.
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/Makefile.am b/libisoburn/branches/XorrisoZeroOneTwo/Makefile.am
new file mode 100644
index 00000000..e1b4711a
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/Makefile.am
@@ -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)
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/README b/libisoburn/branches/XorrisoZeroOneTwo/README
new file mode 100644
index 00000000..f08ffb65
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/README
@@ -0,0 +1,152 @@
+------------------------------------------------------------------------------
+ libburnia-project.org
+------------------------------------------------------------------------------
+libisoburn. By Vreixo Formoso
+ and Thomas Schmitt
+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 ,
+ Vreixo Formoso
+ Thomas Schmitt
+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 and
+ Ben Jansens
+Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/TODO b/libisoburn/branches/XorrisoZeroOneTwo/TODO
new file mode 100644
index 00000000..23e3b643
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/TODO
@@ -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.
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/acinclude.m4 b/libisoburn/branches/XorrisoZeroOneTwo/acinclude.m4
new file mode 100644
index 00000000..861847bb
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/acinclude.m4
@@ -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])
+])
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/bootstrap b/libisoburn/branches/XorrisoZeroOneTwo/bootstrap
new file mode 100755
index 00000000..3583d1c7
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/bootstrap
@@ -0,0 +1,7 @@
+#!/bin/sh -x
+
+aclocal
+libtoolize --copy --force
+autoconf
+automake --foreign --add-missing --copy --include-deps
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/configure.ac b/libisoburn/branches/XorrisoZeroOneTwo/configure.ac
new file mode 100644
index 00000000..9f4e0af8
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/configure.ac
@@ -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
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/doc/doxygen.conf.in b/libisoburn/branches/XorrisoZeroOneTwo/doc/doxygen.conf.in
new file mode 100644
index 00000000..e36d6010
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/doc/doxygen.conf.in
@@ -0,0 +1,1300 @@
+# Doxyfile 1.5.3
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that
+# follow. The default is UTF-8 which is also the encoding used for all text before
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of
+# possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = @PACKAGE_NAME@
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = @PACKAGE_VERSION@
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = @top_srcdir@
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = YES
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be extracted
+# and appear in the documentation as a namespace called 'anonymous_namespace{file}',
+# where file will be replaced with the base name of the file that contains the anonymous
+# namespace. By default anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command , where is the value of
+# the FILE_VERSION_FILTER tag, and is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text "
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = libburn \
+ doc \
+ test
+
+# This tag can be used to specify the character encoding of the source files that
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding.
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS = libburn.h \
+ comments \
+ libburner.c
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the output.
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used,
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = test
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command , where
+# is the value of the INPUT_FILTER tag, and is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH
+# then you must also enable this option. If you don't then doxygen will produce
+# a warning and turn it on anyway
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = YES
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX = OB \
+ OTK \
+ _
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = doc/html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 200
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = letter
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = DOXYGEN
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to
+# be found in the default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the number
+# of direct children of the root node in a graph is already larger than
+# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn-1.pc.in b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn-1.pc.in
new file mode 100644
index 00000000..7fae3f90
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn-1.pc.in
@@ -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
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/burn_wrap.c b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/burn_wrap.c
new file mode 100644
index 00000000..de8c4a68
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/burn_wrap.c
@@ -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,
+*/
+
+/* <<< 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
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#ifndef Xorriso_standalonE
+
+#include
+
+#include
+
+#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;}
+ }
+ o->min_start_byte= value;
+ if(value % caps->start_alignment)
+ value+= caps->start_alignment - (value % caps->start_alignment);
+ o->nwa= value/2048;
+ /* If suitable for alignment, round up to full 16 sector addresses */
+ if((o->nwa%16) && ((16*2048) % caps->start_alignment)==0 )
+ o->nwa+= 16 - (o->nwa%16);
+ ret= 1;
+ex:
+ if(caps!=NULL)
+ burn_disc_free_multi_caps(&caps);
+ return(ret);
+}
+
+
+int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte,
+ int flag)
+{
+ int ret;
+ struct isoburn *o;
+
+ ret= isoburn_find_emulator(&o, d, 0);
+ if(ret<0)
+ return(-1);
+ if(ret==0)
+ return(0);
+ *start_byte= o->min_start_byte;
+ if(o->min_start_byte<=0)
+ return(0);
+ return(1);
+}
+
+
+int isoburn_drive_wrote_well(struct burn_drive *d)
+{
+ int ret;
+ struct isoburn *o;
+
+ ret= isoburn_find_emulator(&o, d, 0);
+ if(ret<0)
+ return(-1);
+ if(o!=NULL)
+ if(o->wrote_well>=0)
+ return(o->wrote_well);
+ ret= burn_drive_wrote_well(d);
+ return ret;
+}
+
+
+int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
+ char **status_text)
+{
+ int ret;
+ struct isoburn *o;
+#ifdef Libisoburn_no_fifO
+ size_t hsize= 0, hfree_bytes= 0;
+#endif
+
+ ret= isoburn_find_emulator(&o, d, 0);
+ if(ret<0)
+ return(-1);
+
+#ifdef Libisoburn_no_fifO
+ if(o==NULL)
+ return(-1);
+ if(o->iso_source==NULL)
+ return(-1);
+ ret= iso_ring_buffer_get_status(o->iso_source, &hsize, &hfree_bytes);
+ if(hsize > 1024*1024*1024)
+ *size= 1024*1024*1024;
+ else
+ *size= hsize;
+ if(hfree_bytes > 1024*1024*1024)
+ *free_bytes= 1024*1024*1024;
+ else
+ *free_bytes= hfree_bytes;
+ *status_text= "";
+ if(ret==0)
+ *status_text= "standby";
+ else if(ret==1)
+ *status_text= "active";
+ else if(ret==2)
+ *status_text= "ending";
+ else if(ret==3)
+ *status_text= "failing";
+ else if(ret==4)
+ *status_text= "unused";
+ else if(ret==5)
+ *status_text= "abandoned";
+ else if(ret==6)
+ *status_text= "ended";
+ else if(ret==7)
+ *status_text= "aborted";
+#else
+ if(o==NULL)
+ return(0);
+ if(o->fifo==NULL)
+ return(0);
+ ret= burn_fifo_inquire_status(o->fifo, size, free_bytes, status_text);
+#endif /* ! Libisoburn_no_fifO */
+
+ return(ret);
+}
+
+
+#define Libisoburn_on_libisofs_after_0_6_2 yes
+
+/* >>> todo: throw out the copies of libdax_msgs entrails */
+
+/* <<< to be replaced by libburn-0.4.3 API call burn_sev_to_text().
+ This is a copy of libdax_msgs__sev_to_text() which is not exposed
+ by the API of of libburn-0.4.2 . As soon as xorriso gets based on
+ libburn-0.4.4 this redundancy is to be removed.
+ It is safe, nevertheless, because the severity codes are eternal.
+*/
+#define LIBDAX_MSGS_SEV_ALL 0x00000000
+#define LIBDAX_MSGS_SEV_ERRFILE 0x08000000
+#define LIBDAX_MSGS_SEV_DEBUG 0x10000000
+#define LIBDAX_MSGS_SEV_UPDATE 0x20000000
+#define LIBDAX_MSGS_SEV_NOTE 0x30000000
+#define LIBDAX_MSGS_SEV_HINT 0x40000000
+#define LIBDAX_MSGS_SEV_WARNING 0x50000000
+#define LIBDAX_MSGS_SEV_SORRY 0x60000000
+#define LIBDAX_MSGS_SEV_MISHAP 0x64000000
+#define LIBDAX_MSGS_SEV_FAILURE 0x68000000
+#define LIBDAX_MSGS_SEV_FATAL 0x70000000
+#define LIBDAX_MSGS_SEV_ABORT 0x71000000
+#define LIBDAX_MSGS_SEV_NEVER 0x7fffffff
+
+/* @param flag bit0= -reserved-
+ bit1= this is a libburn severity
+*/
+int isoburn__sev_to_text(int severity, char **severity_name,
+ int flag)
+{
+#ifdef Libisoburn_on_libisofs_after_0_6_2
+ int ret;
+#else
+#ifdef Libisoburn_on__libburn_after_0_4_2
+ int ret;
+#endif
+#endif
+
+#ifdef Libisoburn_on_libisofs_after_0_6_2
+ ret= iso_sev_to_text(severity, severity_name);
+ if(ret>0)
+ return(ret);
+#endif /* Libisoburn_on_libisofs_after_0_6_2 */
+#ifdef Libisoburn_on__libburn_after_0_4_2
+ ret= burn_sev_to_text(severity, severity_name, 0);
+ if(ret>0)
+ return(ret);
+#endif
+
+ if(flag&1) {
+ *severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nERRFILE\nALL";
+ return(1);
+ }
+ *severity_name= "";
+ if(severity>=LIBDAX_MSGS_SEV_NEVER)
+ *severity_name= "NEVER";
+ else if(severity>=LIBDAX_MSGS_SEV_ABORT)
+ *severity_name= "ABORT";
+ else if(severity>=LIBDAX_MSGS_SEV_FATAL)
+ *severity_name= "FATAL";
+ else if(severity>=LIBDAX_MSGS_SEV_FAILURE)
+ *severity_name= "FAILURE";
+ else if(severity>=LIBDAX_MSGS_SEV_MISHAP)
+ *severity_name= "MISHAP";
+ else if(severity>=LIBDAX_MSGS_SEV_SORRY)
+ *severity_name= "SORRY";
+ else if(severity>=LIBDAX_MSGS_SEV_WARNING)
+ *severity_name= "WARNING";
+ else if(severity>=LIBDAX_MSGS_SEV_HINT)
+ *severity_name= "HINT";
+ else if(severity>=LIBDAX_MSGS_SEV_NOTE)
+ *severity_name= "NOTE";
+ else if(severity>=LIBDAX_MSGS_SEV_UPDATE)
+ *severity_name= "UPDATE";
+ else if(severity>=LIBDAX_MSGS_SEV_DEBUG)
+ *severity_name= "DEBUG";
+ else if(severity>=LIBDAX_MSGS_SEV_ERRFILE)
+ *severity_name= "ERRFILE";
+ else if(severity>=LIBDAX_MSGS_SEV_ALL)
+ *severity_name= "ALL";
+ else {
+ *severity_name= "";
+ return(0);
+ }
+ return(1);
+}
+
+
+int isoburn__text_to_sev(char *severity_name, int *severity_number, int flag)
+{
+ int ret= 1;
+
+#ifdef Libisoburn_on_libisofs_after_0_6_2
+ ret= iso_text_to_sev(severity_name, severity_number);
+ if(ret>0)
+ return(ret);
+#endif /* Libisoburn_on_libisofs_after_0_6_2 */
+
+#ifndef Libisoburn_on__libburn_after_0_4_2
+ if(severity_name[0]==0)
+ *severity_number= 0;
+ else if(strcmp(severity_name, "MISHAP")==0)
+ *severity_number= LIBDAX_MSGS_SEV_MISHAP;
+ else if(strcmp(severity_name, "ERRFILE")==0)
+ *severity_number= LIBDAX_MSGS_SEV_ERRFILE;
+ else
+#endif /* ! Libisoburn_on__libburn_after_0_4_2 */
+
+ ret= burn_text_to_sev(severity_name, severity_number, 0);
+ return(ret);
+}
+
+
+int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
+ char min_severity[], int flag)
+{
+ int error_code, iso_sev, min_sev, ret;
+ char *sev_text_pt, *msg_text_pt= NULL;
+
+ error_code= iso_error_get_code(iso_error_code);
+ if(error_code < 0x00030000 || error_code >= 0x00040000)
+ error_code= (error_code & 0xffff) | 0x00050000;
+
+ if(iso_error_code<0)
+ msg_text_pt= (char *) iso_error_to_msg(iso_error_code);
+ if(msg_text_pt==NULL)
+ msg_text_pt= msg_text;
+ iso_sev= iso_error_get_severity(iso_error_code);
+ sev_text_pt= min_severity;
+
+#ifdef Libisoburn_on_libisofs_after_0_6_2
+
+ isoburn__text_to_sev(min_severity, &min_sev, 0);
+ if(min_sev < iso_sev)
+ isoburn__sev_to_text(iso_sev, &sev_text_pt, 0);
+ ret= iso_msgs_submit(error_code, msg_text_pt, os_errno, sev_text_pt, 0);
+
+#else
+
+ burn_text_to_sev(min_severity, &min_sev, 0);
+
+ /* <<< Tunnel MISHAP through libburn which knows no MISHAP
+ with libburn-0.4.4 this is not necessary */
+ if(iso_sev==LIBDAX_MSGS_SEV_MISHAP) {
+ iso_sev= LIBDAX_MSGS_SEV_SORRY;
+ error_code= 0x0005ff73;
+ } else if(iso_sev==LIBDAX_MSGS_SEV_ERRFILE) { /* same with ERRFILE */
+ iso_sev= LIBDAX_MSGS_SEV_DEBUG;
+ error_code= 0x00051001;
+ }
+ if(min_sev < iso_sev)
+ isoburn__sev_to_text(iso_sev, &sev_text_pt, 0);
+ ret= burn_msgs_submit(error_code, msg_text_pt, os_errno, sev_text_pt, NULL);
+
+#endif /* ! Libisoburn_on_libisofs_after_0_6_2 */
+
+ return(ret);
+}
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/data_source.c b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/data_source.c
new file mode 100644
index 00000000..01443086
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/data_source.c
@@ -0,0 +1,190 @@
+/*
+ data source for libisoburn.
+
+ Copyright 2007 Vreixo Formoso Lopes
+*/
+
+#include
+#include
+
+#include
+
+
+#ifndef Xorriso_standalonE
+
+#include
+
+#include
+
+#else /* ! Xorriso_standalonE */
+
+#include "../libisofs/libisofs.h"
+#include "../libburn/libburn.h"
+
+#endif /* Xorriso_standalonE */
+
+
+#include "isoburn.h"
+
+
+/* Cached reading of image tree data */
+/* Current implementation : single tile 128 kB */
+
+/* powers of 2 only ! */
+#define Libisoburn_cache_blockS 64
+
+struct isoburn_cached_drive {
+ struct burn_drive *drive;
+
+ char cache_data[Libisoburn_cache_blockS * 2048];
+ uint32_t cache_lba;
+ uint32_t last_error_lba;
+ uint32_t last_aligned_error_lba;
+ int cache_hits;
+};
+
+
+/* Debugging only: This reports cache loads on stderr.
+#define Libisoburn_read_cache_reporT 1
+*/
+#define Libisoburn_use_read_cachE
+
+#ifdef Libisoburn_use_read_cachE
+
+int
+ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
+{
+ int ret;
+ struct burn_drive *d;
+ off_t count;
+ uint32_t aligned_lba;
+ char msg[80];
+
+ struct isoburn_cached_drive *icd;
+
+ if(src == NULL || buffer == NULL)
+ return -1;
+
+ icd = (struct isoburn_cached_drive *) src->data;
+ d = (struct burn_drive*) icd->drive;
+
+ aligned_lba= lba & ~(Libisoburn_cache_blockS - 1);
+ if(aligned_lba == icd->cache_lba && icd->cache_lba != 0xffffffff) {
+ (icd->cache_hits)++;
+ memcpy(buffer, icd->cache_data + (lba - aligned_lba) * 2048, 2048);
+ count= 2048;
+ return 1;
+ }
+
+ icd->cache_lba= 0xffffffff; /* invalidate cache */
+ if(icd->last_aligned_error_lba == aligned_lba) {
+ ret = 0;
+ } else {
+ ret = burn_read_data(d, (off_t) aligned_lba * (off_t) 2048,
+ (char *) icd->cache_data,
+ Libisoburn_cache_blockS * 2048, &count, 0);
+ }
+ if (ret <= 0 ) {
+ icd->last_aligned_error_lba = aligned_lba;
+
+ /* Read-ahead failure ? Try to read 2048 directly. */
+ if(icd->last_error_lba == lba)
+ ret = 0;
+ else
+ ret = burn_read_data(d, (off_t) lba * (off_t) 2048, (char *) buffer,
+ 2048, &count, 0);
+ if (ret > 0)
+ return 1;
+ icd->last_error_lba = lba;
+ sprintf(msg, "ds_read_block(%lu) returns -1", (unsigned long) lba);
+ burn_msgs_submit(0x00060000, msg, 0, "DEBUG", NULL);
+ return -1;
+ }
+
+#ifdef Libisoburn_read_cache_reporT
+ fprintf(stderr, "After %3d hits, new load from %8x , count= %d\n",
+ icd->cache_hits, aligned_lba, (int) count);
+#endif
+
+ icd->cache_lba= aligned_lba;
+ icd->cache_hits= 1;
+ memcpy(buffer, icd->cache_data + (lba - aligned_lba) * 2048, 2048);
+ count= 2048;
+
+ return 1;
+}
+
+#else /* Libisoburn_use_read_cachE */
+
+static int
+ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
+{
+ int ret;
+ struct burn_drive *d;
+ off_t count;
+
+ if(src == NULL || buffer == NULL)
+ return -1;
+
+ d = (struct burn_drive*) ((struct isoburn_cached_drive *) src->data)->drive;
+
+ ret = burn_read_data(d, (off_t) lba * (off_t) 2048, (char *) buffer,
+ 2048, &count, 0);
+ if (ret <= 0 )
+ return -1;
+
+ return 1;
+}
+
+#endif /* ! Libisoburn_use_read_cachE */
+
+
+static int
+ds_open(IsoDataSource *src)
+{
+ /* nothing to do, device is always grabbed */
+ return 1;
+}
+
+static int
+ds_close(IsoDataSource *src)
+{
+ /* nothing to do, device is always grabbed */
+ return 1;
+}
+
+static void
+ds_free_data(IsoDataSource *src)
+{
+ /* nothing to do */;
+ if(src->data != NULL)
+ free(src->data);
+ src->data= NULL;
+}
+
+IsoDataSource *
+isoburn_data_source_new(struct burn_drive *d)
+{
+ IsoDataSource *ret;
+ struct isoburn_cached_drive *icd= NULL;
+
+ if (d==NULL)
+ return NULL;
+ ret = malloc(sizeof(IsoDataSource));
+ icd = calloc(1,sizeof(struct isoburn_cached_drive));
+ if (ret == NULL || icd == NULL)
+ return NULL;
+ ret->refcount = 1;
+ ret->read_block = ds_read_block;
+ ret->open = ds_open;
+ ret->close = ds_close;
+ ret->free_data = ds_free_data;
+ ret->data = icd;
+ icd->drive = d;
+ icd->cache_lba = 0xffffffff;
+ icd->cache_hits = 0;
+ icd->last_error_lba = 0xffffffff;
+ icd->last_aligned_error_lba = 0xffffffff;
+ return ret;
+}
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.c b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.c
new file mode 100644
index 00000000..61623e7c
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.c
@@ -0,0 +1,839 @@
+
+/*
+ cc -g -c isoburn.c
+*/
+
+/*
+ Class core of libisoburn.
+
+ Copyright 2007 Vreixo Formoso Lopes
+ and Thomas Schmitt
+*/
+
+/* ( derived from stub generated by CgeN on Sat, 01 Sep 2007 12:04:36 GMT ) */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef Xorriso_standalonE
+
+#include
+
+#include
+
+#else /* ! Xorriso_standalonE */
+
+#include "../libisofs/libisofs.h"
+#include "../libburn/libburn.h"
+
+#endif /* Xorriso_standalonE */
+
+
+#include "libisoburn.h"
+
+#include "isoburn.h"
+
+/* No more: version numbers out of configure.ac
+ major.minor.micro now comes from libisoburn.h
+#include "../version.h"
+*/
+
+/* -------------------------- isoburn ----------------------- */
+
+
+/* The global list of isoburn objects. Usually there is only one.
+ >>> we are not ready for multiple control threads yet. See >>> mutex .
+ Multiple burns under one control thread should work.
+*/
+struct isoburn *isoburn_list_start= NULL;
+
+
+int isoburn_new(struct isoburn **objpt, int flag)
+{
+ struct isoburn *o;
+ int i, ret;
+
+ *objpt= o= (struct isoburn *) malloc(sizeof(struct isoburn));
+ if(o==NULL) {
+ burn_msgs_submit(0x00060000,
+ "Cannot allocate memory for isoburn control object",
+ 0, "FATAL", NULL);
+ return(-1);
+ }
+
+ o->drive= NULL;
+ o->emulation_mode= 0;
+ o->min_start_byte= 0;
+ o->nwa= 0;
+ o->truncate= 0;
+
+#ifdef Libisoburn_no_fifO
+ o->iso_source= NULL;
+#else
+ o->fifo= NULL;
+#endif
+
+ o->wrote_well= -1;
+ o->fabricated_disc_status= BURN_DISC_UNREADY;
+ for(i=0;i<65536;i++)
+ o->target_iso_head[i]= 0;
+ o->image= NULL;
+ o->read_pacifier= NULL;
+ o->read_pacifier_handle= NULL;
+ o->prev= NULL;
+ o->next= NULL;
+ ret= iso_image_new("ISOIMAGE", &o->image);
+ if(ret<0) {
+ isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
+ goto failed;
+ }
+ isoburn_link(o, isoburn_list_start, 1);
+ return(1);
+failed:;
+ isoburn_destroy(objpt, 0);
+ return(-1);
+}
+
+
+int isoburn_destroy(struct isoburn **objpt, int flag)
+{
+ struct isoburn *o;
+
+ o= *objpt;
+ if(o==NULL)
+ return(0);
+
+ /* >>> mutex */
+
+ if(o==isoburn_list_start)
+ isoburn_list_start= o->next;
+ if(o->prev!=NULL)
+ o->prev->next= o->next;
+ if(o->next!=NULL)
+ o->next->prev= o->prev;
+
+ /* >>> end mutex */
+
+ if(o->image!=NULL)
+ iso_image_unref(o->image);
+
+#ifdef Libisoburn_no_fifO
+ if(o->iso_source!=NULL)
+ burn_source_free(o->iso_source);
+#else
+ if(o->fifo!=NULL)
+ burn_source_free(o->fifo);
+#endif /* ! Libisoburn_no_fifO */
+
+
+ free((char *) o);
+ *objpt= NULL;
+ return(1);
+}
+
+
+int isoburn_destroy_all(struct isoburn **objpt, int flag)
+{
+ struct isoburn *o,*n;
+
+ o= *objpt;
+ if(o==NULL)
+ return(0);
+ for(;o->prev!=NULL;o= o->prev);
+ for(;o!=NULL;o= n) {
+ n= o->next;
+ isoburn_destroy(&o,0);
+ }
+ *objpt= NULL;
+ return(1);
+}
+
+
+int isoburn_get_target_image(struct isoburn *o, IsoImage **pt, int flag)
+{
+ *pt= o->image;
+ return(1);
+}
+
+
+int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag)
+{
+ *pt= o->prev;
+ return(1);
+}
+
+
+int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag)
+{
+ *pt= o->next;
+ return(1);
+}
+
+
+int isoburn_link(struct isoburn *o, struct isoburn *link, int flag)
+/*
+ bit0= insert as link->prev rather than as link->next
+*/
+{
+
+ /* >>> mutex */
+
+ if(isoburn_list_start==NULL ||
+ (isoburn_list_start==link && (flag&1)))
+ isoburn_list_start= o;
+ if(o->prev!=NULL)
+ o->prev->next= o->next;
+ if(o->next!=NULL)
+ o->next->prev= o->prev;
+ o->prev= o->next= NULL;
+ if(link==NULL)
+ return(1);
+ if(flag&1) {
+ o->next= link;
+ o->prev= link->prev;
+ if(o->prev!=NULL)
+ o->prev->next= o;
+ link->prev= o;
+ } else {
+ o->prev= link;
+ o->next= link->next;
+ if(o->next!=NULL)
+ o->next->prev= o;
+ link->next= o;
+ }
+
+ /* >>> end mutex */
+
+ return(1);
+}
+
+
+int isoburn_count(struct isoburn *o, int flag)
+/* flag: bit1= count from start of list */
+{
+ int counter= 0;
+
+ if(flag&2)
+ for(;o->prev!=NULL;o= o->prev);
+ for(;o!=NULL;o= o->next)
+ counter++;
+ return(counter);
+}
+
+
+int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag)
+/* flag: bit0= fetch first (idx<0) or last (idx>0) item in list
+ bit1= address from start of list */
+{
+ int i,abs_idx;
+ struct isoburn *npt;
+
+ if(flag&2)
+ for(;o->prev!=NULL;o= o->prev);
+ abs_idx= (idx>0?idx:-idx);
+ *pt= o;
+ for(i= 0;(i0)
+ npt= o->next;
+ else
+ npt= o->prev;
+ if(npt==NULL && (flag&1))
+ break;
+ *pt= npt;
+ }
+ return(*pt!=NULL);
+}
+
+
+int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag)
+{
+ struct isoburn *o;
+
+ *pt= NULL;
+ for(o= isoburn_list_start;o!=NULL;o= o->next)
+ if(o->drive==d) {
+ *pt= o;
+ return(1);
+ }
+ return(0);
+}
+
+static
+int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
+ struct isoburn_imgen_opts *opts, int new_img)
+{
+ struct burn_source *wsrc;
+ struct burn_session *session;
+ struct burn_track *track;
+ struct isoburn *o;
+ IsoWriteOpts *wopts= NULL;
+ enum burn_disc_status state;
+ int ret, fifo_chunks;
+
+ ret= isoburn_find_emulator(&o, d, 0);
+ if(ret<0 || o==NULL)
+ {ret= -1; goto ex;}
+ o->wrote_well= 0; /* early end will be registered as failure */
+
+ state = isoburn_disc_get_status(d);
+ if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE
+ && (state != BURN_DISC_FULL || ! new_img)) {
+ /* unsuitable status */
+ burn_msgs_submit(0x00060000, "Unsuitable media state", 0, "FAILURE", NULL);
+ {ret= -2; goto ex;}
+ }
+
+ fifo_chunks= 32;
+ if(opts->fifo_size >= 64*1024 && opts->fifo_size <= 1024.0 * 1024.0 * 1024.0){
+ fifo_chunks= opts->fifo_size/2048;
+ if(fifo_chunks*2048 < opts->fifo_size)
+ fifo_chunks++;
+ }
+
+ ret = iso_write_opts_new(&wopts, 0);
+ if (ret < 0) {
+ isoburn_report_iso_error(ret, "Cannot create iso_write_opts", 0, "FATAL",0);
+ goto ex;
+ }
+ iso_write_opts_set_iso_level(wopts, opts->level);
+ iso_write_opts_set_rockridge(wopts, opts->rockridge);
+ iso_write_opts_set_joliet(wopts, opts->joliet);
+ iso_write_opts_set_iso1999(wopts, opts->iso1999);
+ iso_write_opts_set_omit_version_numbers(wopts, opts->omit_version_numbers);
+ iso_write_opts_set_allow_deep_paths(wopts, opts->allow_deep_paths);
+ iso_write_opts_set_allow_longer_paths(wopts, opts->allow_longer_paths);
+ iso_write_opts_set_max_37_char_filenames(wopts, opts->max_37_char_filenames);
+ iso_write_opts_set_no_force_dots(wopts, opts->no_force_dots);
+ iso_write_opts_set_allow_lowercase(wopts, opts->allow_lowercase);
+ iso_write_opts_set_allow_full_ascii(wopts, opts->allow_full_ascii);
+ iso_write_opts_set_relaxed_vol_atts(wopts, 1);
+ iso_write_opts_set_joliet_longer_paths(wopts, opts->joliet_longer_paths);
+ iso_write_opts_set_sort_files(wopts, opts->sort_files);
+ iso_write_opts_set_replace_mode(wopts, opts->replace_dir_mode,
+ opts->replace_file_mode, opts->replace_uid, opts->replace_gid);
+ iso_write_opts_set_default_dir_mode(wopts, opts->dir_mode);
+ iso_write_opts_set_default_file_mode(wopts, opts->file_mode);
+ iso_write_opts_set_default_uid(wopts, opts->uid);
+ iso_write_opts_set_default_gid(wopts, opts->gid);
+ iso_write_opts_set_output_charset(wopts, opts->output_charset);
+#ifdef Libisoburn_no_fifO
+ iso_write_opts_set_fifo_size(wopts, fifo_chunks);
+#endif /* Libisoburn_no_fifO */
+
+ if (new_img) {
+ iso_write_opts_set_ms_block(wopts, 0);
+ iso_write_opts_set_appendable(wopts, 0);
+ iso_write_opts_set_overwrite_buf(wopts, NULL);
+ } else {
+ int lba, nwa;
+ ret = isoburn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
+ if (ret != 1) {
+ burn_msgs_submit(0x00060000, "Cannot determine next writeable address", 0,
+ "FAILURE", NULL);
+ {ret= -3; goto ex;}
+ }
+ if (nwa == 0 && state == BURN_DISC_APPENDABLE) {
+ /* invalid nwa */
+ burn_msgs_submit(0x00060000, "Encountered 0 as next writeable address", 0,
+ "FAILURE", NULL);
+ {ret= -4; goto ex;}
+ }
+ iso_write_opts_set_ms_block(wopts, nwa);
+ iso_write_opts_set_appendable(wopts, 1);
+ iso_write_opts_set_overwrite_buf(wopts, o->target_iso_head);
+ }
+
+ ret = iso_image_create_burn_source(o->image, wopts, &wsrc);
+ if (ret < 0) {
+ isoburn_report_iso_error(ret, "Cannot create burn source", 0, "FAILURE", 0);
+ {ret= -1; goto ex;}
+ }
+
+ /* TODO check return values for failure. propertly clean-up on error */
+
+#ifdef Libisoburn_no_fifO
+ o->iso_source= wsrc;
+#else
+ o->fifo = burn_fifo_source_new(wsrc, 2048, fifo_chunks, 0);
+ burn_source_free(wsrc);
+ if (o->fifo == NULL) {
+ burn_msgs_submit(0x00060000, "Cannot attach fifo", 0, "FATAL", NULL);
+ {ret= -1; goto ex;}
+ }
+#endif /* ! Libisoburn_no_fifO */
+
+ *disc = burn_disc_create();
+ session = burn_session_create();
+ burn_disc_add_session(*disc, session, BURN_POS_END);
+ track = burn_track_create();
+
+#ifdef Libisoburn_no_fifO
+ burn_track_set_source(track, o->iso_source);
+#else
+ burn_track_set_source(track, o->fifo);
+#endif /* ! Libisoburn_no_fifO */
+
+ burn_session_add_track(session, track, BURN_POS_END);
+
+ /* give up local references */
+ burn_track_free(track);
+ burn_session_free(session);
+
+ o->wrote_well= -1; /* neutral */
+ ret= 1;
+ex:
+ if(wopts!=NULL)
+ {iso_write_opts_free(wopts); wopts= NULL;}
+ return ret;
+}
+
+int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc,
+ struct isoburn_imgen_opts *opts)
+{
+ return isoburn_prepare_disc_aux(d, disc, opts, 0);
+}
+
+int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
+ struct isoburn_imgen_opts *opts,
+ struct burn_drive *out_drive)
+{
+ int ret;
+ struct isoburn *in_o, *out_o;
+
+ ret= isoburn_prepare_disc_aux(d, disc, opts, 1);
+ if (ret<=0)
+ return ret;
+
+#ifdef Libisoburn_no_fifO
+ /* Hand over source reference for optional fifo status inquiry */
+ if(out_drive==NULL)
+ return 1;
+ ret= isoburn_find_emulator(&out_o, out_drive, 0);
+ if(ret<0 || out_o==NULL)
+ return 1;
+ ret= isoburn_find_emulator(&in_o, d, 0);
+ if(ret<0 || in_o==NULL)
+ return 1; /* then without fifo status inquiry */
+ if(out_o->iso_source!=NULL)
+ burn_source_free(out_o->iso_source);
+ out_o->iso_source= in_o->iso_source;
+ in_o->iso_source= NULL;
+#endif /* Libisoburn_no_fifO */
+
+ return 1;
+}
+
+
+/* API @since 0.1.0
+ @param flag bit0= this is a regular end, not an abort
+ give up source reference
+*/
+int isoburn_cancel_prepared_write(struct burn_drive *d,
+ struct burn_drive *output_drive, int flag)
+{
+ int ret;
+ struct isoburn *o= NULL;
+
+ if(output_drive!=NULL) {
+ ret= isoburn_find_emulator(&o, output_drive, 0);
+ if(ret<0 || o==NULL)
+ o= NULL;
+ else if(o->iso_source==NULL)
+ o= NULL;
+ }
+ if(o==NULL) {
+ ret= isoburn_find_emulator(&o, d, 0);
+ if(ret<0)
+ return(-1);
+ if(o==NULL)
+ return(0);
+ if(o->iso_source==NULL)
+ return(0);
+ }
+ if(o->iso_source->read!=NULL)
+ return(0);
+ if(o->iso_source->version<1)
+ return(0);
+ o->iso_source->cancel(o->iso_source);
+ burn_source_free(o->iso_source);
+ o->iso_source= NULL;
+ return(1);
+}
+
+
+/* API @since 0.1.0 */
+int isoburn_sync_after_write(struct burn_drive *d,
+ struct burn_drive *output_drive, int flag)
+{
+ return isoburn_cancel_prepared_write(d, output_drive, 1);
+}
+
+
+void isoburn_version(int *major, int *minor, int *micro)
+{
+ *major= isoburn_header_version_major;
+ *minor= isoburn_header_version_minor;
+ *micro= isoburn_header_version_micro;
+
+/* No more: values from version.h generated from version.h.in and
+ macro values defined in configure.ac
+
+ *major = ISOBURN_MAJOR_VERSION;
+ *minor = ISOBURN_MINOR_VERSION;
+ *micro = ISOBURN_MICRO_VERSION;
+*/
+}
+
+
+int isoburn_is_compatible(int major, int minor, int micro, int flag)
+{
+ int own_major, own_minor, own_micro;
+
+ isoburn_version(&own_major, &own_minor, &own_micro);
+ return(own_major > major ||
+ (own_major == major && (own_minor > minor ||
+ (own_minor == minor && own_micro >= micro))));
+}
+
+
+/* ----------------------------------------------------------------------- */
+/*
+ Options for image reading.
+*/
+/* ----------------------------------------------------------------------- */
+
+
+int isoburn_ropt_new(struct isoburn_read_opts **new_o, int flag)
+{
+ struct isoburn_read_opts *o;
+
+ o= (*new_o)= calloc(1, sizeof(struct isoburn_read_opts));
+ if(o==NULL) {
+ burn_msgs_submit(0x00060000, "Cannot allocate memory for read options",
+ 0, "FATAL", NULL);
+ return(-1);
+ }
+ o->norock= 0;
+ o->nojoliet= 0;
+ o->noiso1999= 1;
+ o->preferjoliet= 0;
+ o->uid= geteuid();
+ o->gid= getegid();
+ o->mode= 0444;
+ o->dirmode= 0555;
+ o->input_charset= NULL;
+ o->hasRR= 0;
+ o->hasJoliet= 0;
+ o->hasIso1999= 0;
+ o->hasElTorito= 0;
+ o->size= 0;
+ o->pretend_blank= 1;
+ return(1);
+}
+
+
+int isoburn_ropt_destroy(struct isoburn_read_opts **o, int flag)
+{
+ if(*o==NULL)
+ return(0);
+ free(*o);
+ *o= NULL;
+ return(1);
+}
+
+
+int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext)
+{
+ o->norock= !!(ext&1);
+ o->nojoliet= !!(ext&2);
+ o->noiso1999= !!(ext&4);
+ o->preferjoliet= !!(ext&8);
+ o->pretend_blank= !!(ext&16);
+ return(1);
+}
+
+
+int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext)
+{
+ *ext= (!!o->norock) | ((!!o->nojoliet)<<1) | ((!!o->noiso1999)<<2) |
+ ((!!o->preferjoliet)<<3) | ((!!o->pretend_blank)<<4);
+ return(1);
+}
+
+
+int isoburn_ropt_set_default_perms(struct isoburn_read_opts *o,
+ uid_t uid, gid_t gid, mode_t mode)
+{
+ mode_t dirmode;
+
+ o->uid= uid;
+ o->gid= gid;
+ o->mode= mode;
+ dirmode= mode;
+ if(dirmode & S_IRUSR)
+ dirmode|= S_IXUSR;
+ if(dirmode & S_IRGRP)
+ dirmode|= S_IXGRP;
+ if(dirmode & S_IROTH)
+ dirmode|= S_IXOTH;
+ o->dirmode= dirmode;
+ return(1);
+}
+
+
+int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o,
+ uid_t *uid, gid_t *gid, mode_t *mode)
+{
+ *uid= o->uid;
+ *gid= o->gid;
+ *mode= o->mode;
+ return(1);
+}
+
+
+int isoburn_ropt_set_default_dirperms(struct isoburn_read_opts *o,
+ mode_t mode)
+{
+ o->dirmode= mode;
+ return(1);
+}
+
+
+int isoburn_ropt_get_default_dirperms(struct isoburn_read_opts *o,
+ mode_t *mode)
+{
+ *mode= o->dirmode;
+ return(1);
+}
+
+
+int isoburn_ropt_set_input_charset(struct isoburn_read_opts *o,
+ char *input_charset)
+{
+ o->input_charset= input_charset;
+ return(1);
+}
+
+
+int isoburn_igopt_get_in_charset(struct isoburn_read_opts *o,
+ char **input_charset)
+{
+ *input_charset= o->input_charset;
+ return(1);
+}
+
+
+int isoburn_ropt_get_size_what(struct isoburn_read_opts *o,
+ uint32_t *size, int *has_what)
+{
+ *size= o->size;
+ *has_what= (!!o->hasRR) | ((!!o->hasJoliet)<<1) |
+ ((!!o->hasIso1999)<<2) | ((!!o->hasElTorito)<<3);
+ return(1);
+}
+
+
+/* ----------------------------------------------------------------------- */
+/*
+ Options for image generation by libisofs and image transport to libburn.
+*/
+/* ----------------------------------------------------------------------- */
+
+
+int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
+{
+ struct isoburn_imgen_opts *o;
+
+ o= (*new_o)= calloc(1, sizeof(struct isoburn_imgen_opts));
+ if(o==NULL) {
+ burn_msgs_submit(0x00060000,
+ "Cannot allocate memory for image generation options",
+ 0, "FATAL", NULL);
+ return(-1);
+ }
+ o->level= 2;
+ o->rockridge= 1;
+ o->joliet= 0;
+ o->iso1999= 0;
+ o->omit_version_numbers= 0;
+ o->allow_deep_paths= 1;
+ o->allow_longer_paths= 0;
+ o->max_37_char_filenames= 0;
+ o->no_force_dots= 0;
+ o->allow_lowercase= 0;
+ o->allow_full_ascii= 0;
+ o->joliet_longer_paths= 0;
+ o->sort_files= 0;
+ o->replace_dir_mode= 0;
+ o->replace_file_mode= 0;
+ o->replace_uid= 0;
+ o->replace_gid= 0;
+ o->dir_mode= 0555;
+ o->file_mode= 0444;
+ o->uid= 0;
+ o->gid= 0;
+ o->output_charset= 0;
+ o->fifo_size= 4*1024*1024;
+ return(1);
+}
+
+
+int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag)
+{
+ if(*o==NULL)
+ return(0);
+ free(*o);
+ *o= NULL;
+ return(1);
+}
+
+
+int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level)
+{
+ o->level= level;
+ return(1);
+}
+
+
+int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level)
+{
+ *level= o->level;
+ return(1);
+}
+
+
+int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext)
+{
+ o->rockridge= !!(ext&1);
+ o->joliet= !!(ext&2);
+ o->iso1999= !!(ext&4);
+ return(1);
+}
+
+
+int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext)
+{
+ *ext= (!!o->rockridge) | ((!!o->joliet)<<1) | ((!!o->iso1999)<<2);
+ return(1);
+}
+
+
+int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax)
+{
+ o->omit_version_numbers= !!(relax&1);
+ o->allow_deep_paths= !!(relax&2);
+ o->allow_longer_paths= !!(relax&4);
+ o->max_37_char_filenames= !!(relax&8);
+ o->no_force_dots= !!(relax&16);
+ o->allow_lowercase= !!(relax&32);
+ o->allow_full_ascii= !!(relax&64);
+ o->joliet_longer_paths= !!(relax&128);
+ return(1);
+}
+
+
+int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax)
+{
+ *relax= (!!o->omit_version_numbers) | ((!!o->allow_deep_paths)<<1) |
+ ((!!o->allow_longer_paths)<<2) | ((!!o->max_37_char_filenames)<<3) |
+ ((!!o->no_force_dots)<<4) | ((!!o->allow_lowercase)<<5) |
+ ((!!o->allow_full_ascii)<<6) | ((!!o->joliet_longer_paths)<<7);
+ return(1);
+}
+
+
+int isoburn_igopt_set_sort_files(struct isoburn_imgen_opts *o, int value)
+{
+ o->sort_files= !!(value&1);
+ return(1);
+}
+
+
+int isoburn_igopt_get_sort_files(struct isoburn_imgen_opts *o, int *value)
+{
+ *value= !!o->sort_files;
+ return(1);
+}
+
+
+int isoburn_igopt_set_over_mode(struct isoburn_imgen_opts *o,
+ int replace_dir_mode, int replace_file_mode,
+ mode_t dir_mode, mode_t file_mode)
+{
+ o->replace_dir_mode= replace_dir_mode%3;
+ o->replace_file_mode= replace_file_mode%3;
+ o->dir_mode= dir_mode;
+ o->file_mode= file_mode;
+ return(1);
+}
+
+
+int isoburn_igopt_get_over_mode(struct isoburn_imgen_opts *o,
+ int *replace_dir_mode, int *replace_file_mode,
+ mode_t *dir_mode, mode_t *file_mode)
+{
+ *replace_dir_mode= o->replace_dir_mode%3;
+ *replace_file_mode= o->replace_file_mode%3;
+ *dir_mode= o->dir_mode;
+ *file_mode= o->file_mode;
+ return(1);
+}
+
+
+int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o,
+ int replace_uid, int replace_gid,
+ uid_t uid, gid_t gid)
+{
+ o->replace_uid= replace_uid%3;
+ o->replace_gid= replace_gid%3;
+ o->uid= uid;
+ o->gid= gid;
+ return(1);
+}
+
+int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o,
+ int *replace_uid, int *replace_gid,
+ uid_t *uid, gid_t *gid)
+{
+ *replace_uid= o->replace_uid%3;
+ *replace_gid= o->replace_gid%3;
+ *uid= o->uid;
+ *gid= o->gid;
+ return(1);
+}
+
+
+int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o,
+ char *output_charset)
+{
+ o->output_charset= output_charset;
+ return(1);
+}
+
+
+int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o,
+ char **output_charset)
+{
+ *output_charset= o->output_charset;
+ return(1);
+}
+
+
+int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size)
+{
+ o->fifo_size= fifo_size;
+ return(1);
+}
+
+
+int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size)
+{
+ *fifo_size= o->fifo_size;
+ return(1);
+}
+
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.h b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.h
new file mode 100644
index 00000000..d613f68b
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isoburn.h
@@ -0,0 +1,325 @@
+
+/*
+ Class struct of libisoburn.
+
+ Copyright 2007 Vreixo Formoso Lopes
+ and Thomas Schmitt
+*/
+
+#ifndef Isoburn_includeD
+#define Isoburn_includeD
+
+
+/* <<< transition macro */
+#define Libisoburn_no_fifO 1
+
+
+/* for uint8_t */
+#include
+
+
+struct isoburn {
+
+
+ /* The libburn drive to which this isoburn object is related
+ Most isoburn calls will use a burn_drive as object handle */
+ struct burn_drive *drive;
+
+ /* -1= inappropriate media state detected
+ 0= libburn multi-session media, resp. undecided yet
+ 1= random access media */
+ int emulation_mode;
+
+ /* Although rarely used, libburn can operate on several
+ drives simultaneously. */
+ struct isoburn *prev;
+ struct isoburn *next;
+
+
+ /* Start address as given by image examination (bytes, not blocks) */
+ off_t min_start_byte;
+
+ /* Aligned start address to be used for processing (counted in blocks) */
+ int nwa;
+
+ /* Truncate to .nwa an eventual regular file serving as output drive */
+ int truncate;
+
+ /* Eventual freely fabricated isoburn_disc_get_status().
+ BURN_DISC_UNREADY means that this variable is disabled
+ and normally emulated status is in effect.
+ */
+ enum burn_disc_status fabricated_disc_status;
+
+#ifndef Libisoburn_no_fifO
+ /* The fifo which is installed between track and libisofs burn_source
+ */
+ struct burn_source *fifo;
+#endif /* ! Libisoburn_no_fifO */
+
+ /* Indicator wether the most recent burn run worked :
+ -1 = undetermined, ask libburn , 0 = failure , 1 = success
+ To be inquired by isoburn_drive_wrote_well()
+ */
+ int wrote_well;
+
+
+ /* Buffered ISO head from media (should that become part of
+ ecma119_read_opts ?) */
+ uint8_t target_iso_head[65536];
+
+ /* Libisofs image context */
+ IsoImage *image;
+
+#ifdef Libisoburn_no_fifO
+ /* The burn source which transfers data from libisofs to libburn.
+ It has its own fifo.
+ */
+ struct burn_source *iso_source;
+#endif /* Libisoburn_no_fifO */
+
+ /* For iso_tree_set_report_callback() */
+ int (*read_pacifier)(IsoImage*, IsoFileSource*);
+
+ /* For iso_image_attach_data() */
+ void *read_pacifier_handle;
+
+};
+
+
+/* Creation and disposal function */
+int isoburn_new(struct isoburn **objpt, int flag);
+int isoburn_destroy(struct isoburn **objpt, int flag);
+
+/* Eventual readers for public attributes */
+/* ( put into separate .h file then ) */
+int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag);
+int isoburn_get_target_volset(struct isoburn *o, IsoImage **pt, int flag);
+
+/* List management */
+int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag);
+int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag);
+int isoburn_destroy_all(struct isoburn **objpt, int flag);
+int isoburn_link(struct isoburn *o, struct isoburn *link, int flag);
+int isoburn_count(struct isoburn *o, int flag);
+int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag);
+int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag);
+
+
+/* Non API inner interfaces */
+
+/* Submit a libisofs error to the libburn messenger. An application message
+ reader shall recognize the error code range and attribute it to the
+ libisofs message channel to which one cannot submit via API.
+ @param iso_error_code return value <= 0 from a libisofs API call.
+ @param default_msg_text is to be put out if iso_error_code leads to no
+ error message
+ @param os_errno operating system errno, submit 0 if none is known
+ @param min_severity minimum severity, might be be increased if libisofs
+ error severity surpasses min_severity.
+ @param flag Bitfield, submit 0 for now
+*/
+int isoburn_report_iso_error(int iso_error_code, char default_msg_text[],
+ int os_errno, char min_severity[], int flag);
+
+/* Calls from burn_wrap.c into isofs_wrap.c */
+
+int isoburn_start_emulation(struct isoburn *o, int flag);
+int isoburn_invalidate_iso(struct isoburn *o, int flag);
+
+
+/* Calls from isofs_wrap.c into burn_wrap.c */
+
+/** Get an eventual isoburn object which is wrapped around the drive.
+ @param pt Eventually returns a pointer to the found object.
+ It is allowed to become NULL if return value is -1 or 0.
+ In this case, the drive is a genuine libburn drive
+ with no emulation activated by isoburn.
+ @param drive The drive to be searched for
+ @param flag unused yet
+ @return -1 unsuitable media, 0 generic media, 1 emulated media.
+*/
+int isoburn_find_emulator(struct isoburn **pt,
+ struct burn_drive *drive, int flag);
+
+
+/** Set the start address for an emulated add-on session. The value will
+ be rounded up to the alignment necessary for the media. The aligned
+ value will be divided by 2048 and then put into o->nwa .
+ @param o The isoburn object to be programmed.
+ @param value The start address in bytes
+ @param flag unused yet
+ @return <=0 is failure , >0 success
+*/
+int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag);
+
+/** Get a data source suitable for read from a drive using burn_read_data()
+ function.
+ @param d drive to read from. Must be grabbed.
+ @return the data source, NULL on error. Must be freed with libisofs
+ iso_data_source_unref() function. Note: this doesn't release
+ the drive.
+*/
+IsoDataSource *
+isoburn_data_source_new(struct burn_drive *d);
+
+
+/**
+ * Options for image reading.
+ (Comments here may be outdated. API getter/setter function descriptions
+ may override the descriptions here. Any difference is supposed to be a
+ minor correction only.)
+ */
+struct isoburn_read_opts {
+ unsigned int norock:1; /*< Do not read Rock Ridge extensions */
+ unsigned int nojoliet:1; /*< Do not read Joliet extensions */
+ unsigned int noiso1999:1; /*< Do not read ISO 9660:1999 enhanced tree */
+ unsigned int preferjoliet:1;
+ /*< When both Joliet and RR extensions are present, the RR
+ * tree is used. If you prefer using Joliet, set this to 1. */
+ uid_t uid; /**< Default uid when no RR */
+ gid_t gid; /**< Default uid when no RR */
+ mode_t mode; /**< Default mode when no RR (only permissions) */
+ mode_t dirmode; /**< Default mode for directories
+ when no RR (only permissions) */
+
+ /**
+ * Input charset for RR file names. NULL to use default locale charset.
+ */
+ char *input_charset;
+
+ /* modified by the function isoburn_read_image */
+ unsigned int hasRR:1; /*< It will be set to 1 if RR extensions are present,
+ to 0 if not. */
+ unsigned int hasJoliet:1; /*< It will be set to 1 if Joliet extensions are
+ present, to 0 if not. */
+
+ /**
+ * It will be set to 1 if the image is an ISO 9660:1999, i.e. it has
+ * a version 2 Enhanced Volume Descriptor.
+ */
+ unsigned int hasIso1999:1;
+
+ /** It will be set to 1 if El-Torito boot record is present, to 0 if not.*/
+ unsigned int hasElTorito:1;
+
+ uint32_t size; /**< Will be filled with the size (in 2048 byte block) of
+ * the image, as reported in the PVM. */
+ unsigned int pretend_blank:1; /* always create empty image */
+};
+
+
+/**
+ * Options for image generation by libisofs and image transport to libburn.
+ (Comments here may be outdated. API getter/setter function descriptions
+ may override the descriptions here. Any difference is supposed to be a
+ minor correction only.)
+ */
+struct isoburn_imgen_opts {
+
+ /* Options for image generation */
+
+ int level; /**< ISO level to write at. */
+
+ /** Which extensions to support. */
+ unsigned int rockridge :1;
+ unsigned int joliet :1;
+ unsigned int iso1999 :1;
+
+ /* relaxed constraints */
+
+ /*
+ * Relaxed constraints. Setting any of these to 1 break the specifications,
+ * but it is supposed to work on most moderns systems. Use with caution.
+ */
+
+ /**
+ * Omit the version number (";1") at the end of the ISO-9660 identifiers.
+ * Version numbers are usually not used.
+ */
+ unsigned int omit_version_numbers :1;
+
+ /**
+ * Allow ISO-9660 directory hierarchy to be deeper than 8 levels.
+ */
+ unsigned int allow_deep_paths :1;
+
+ /**
+ * Allow path in the ISO-9660 tree to have more than 255 characters.
+ */
+ unsigned int allow_longer_paths :1;
+
+ /**
+ * Allow a single file or directory hierarchy to have up to 37 characters.
+ * This is larger than the 31 characters allowed by ISO level 2, and the
+ * extra space is taken from the version number, so this also forces
+ * omit_version_numbers.
+ */
+ unsigned int max_37_char_filenames :1;
+
+ /**
+ * ISO-9660 forces filenames to have a ".", that separates file name from
+ * extension. libisofs adds it if original filename doesn't has one. Set
+ * this to 1 to prevent this behavior
+ */
+ unsigned int no_force_dots :1;
+
+ /**
+ * Allow lowercase characters in ISO-9660 filenames. By default, only
+ * uppercase characters, numbers and a few other characters are allowed.
+ */
+ unsigned int allow_lowercase :1;
+
+ /**
+ * Allow all ASCII characters to be appear on an ISO-9660 filename. Note
+ * that "/" and "\0" characters are never allowed, even in RR names.
+ */
+ unsigned int allow_full_ascii :1;
+
+ /**
+ * Allow paths in the Joliet tree to have more than 240 characters.
+ */
+ unsigned int joliet_longer_paths :1;
+
+ unsigned int sort_files:1;
+ /**< If files should be sorted based on their weight. */
+
+ /**
+ * The following options set the default values for files and directory
+ * permissions, gid and uid. All these take one of three values: 0, 1 or 2.
+ * If 0, the corresponding attribute will be kept as set in the IsoNode.
+ * Unless you have changed it, it corresponds to the value on disc, so it
+ * is suitable for backup purposes. If set to 1, the corresponding attrib.
+ * will be changed by a default suitable value. Finally, if you set it to
+ * 2, the attrib. will be changed with the value specified in the options
+ * below. Note that for mode attributes, only the permissions are set, the
+ * file type remains unchanged.
+ */
+ unsigned int replace_dir_mode :2;
+ unsigned int replace_file_mode :2;
+ unsigned int replace_uid :2;
+ unsigned int replace_gid :2;
+
+ mode_t dir_mode; /** Mode to use on dirs when replace_dir_mode == 2. */
+ mode_t file_mode; /** Mode to use on files when replace_file_mode == 2. */
+ uid_t uid; /** uid to use when replace_uid == 2. */
+ gid_t gid; /** gid to use when replace_gid == 2. */
+
+ char *output_charset; /**< NULL to use default charset */
+
+
+ /* Options for image transport */
+
+ /** The number of bytes to be used for the fifo which decouples libisofs
+ and libburn for better throughput and for reducing the risk of
+ interrupting signals hitting the libburn thread which operates the
+ MMC drive.
+ The size will be rounded up to the next full 2048.
+ Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway).
+ */
+ int fifo_size;
+
+};
+
+#endif /* Isoburn_includeD */
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isofs_wrap.c b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isofs_wrap.c
new file mode 100644
index 00000000..4ee8c765
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/isofs_wrap.c
@@ -0,0 +1,398 @@
+
+/*
+ cc -g -c isofs_wrap.c
+*/
+
+/*
+ libisofs related functions of libisoburn.
+
+ Copyright 2007 Vreixo Formoso Lopes
+ Thomas Schmitt
+*/
+
+#include
+#include
+
+#ifndef Xorriso_standalonE
+
+#include
+
+#include
+
+#else /* ! Xorriso_standalonE */
+
+#include "../libisofs/libisofs.h"
+#include "../libburn/libburn.h"
+
+#endif /* Xorriso_standalonE */
+
+
+#include "isoburn.h"
+#include "libisoburn.h"
+
+#define BP(a,b) [(b) - (a) + 1]
+
+struct ecma119_pri_vol_desc
+{
+ uint8_t vol_desc_type BP(1, 1);
+ uint8_t std_identifier BP(2, 6);
+ uint8_t vol_desc_version BP(7, 7);
+ uint8_t unused1 BP(8, 8);
+ uint8_t system_id BP(9, 40);
+ uint8_t volume_id BP(41, 72);
+ uint8_t unused2 BP(73, 80);
+ uint8_t vol_space_size BP(81, 88);
+ uint8_t unused3 BP(89, 120);
+ uint8_t vol_set_size BP(121, 124);
+ uint8_t vol_seq_number BP(125, 128);
+ uint8_t block_size BP(129, 132);
+ uint8_t path_table_size BP(133, 140);
+ uint8_t l_path_table_pos BP(141, 144);
+ uint8_t opt_l_path_table_pos BP(145, 148);
+ uint8_t m_path_table_pos BP(149, 152);
+ uint8_t opt_m_path_table_pos BP(153, 156);
+ uint8_t root_dir_record BP(157, 190);
+ uint8_t vol_set_id BP(191, 318);
+ uint8_t publisher_id BP(319, 446);
+ uint8_t data_prep_id BP(447, 574);
+ uint8_t application_id BP(575, 702);
+ uint8_t copyright_file_id BP(703, 739);
+ uint8_t abstract_file_id BP(740, 776);
+ uint8_t bibliographic_file_id BP(777, 813);
+ uint8_t vol_creation_time BP(814, 830);
+ uint8_t vol_modification_time BP(831, 847);
+ uint8_t vol_expiration_time BP(848, 864);
+ uint8_t vol_effective_time BP(865, 881);
+ uint8_t file_structure_version BP(882, 882);
+ uint8_t reserved1 BP(883, 883);
+ uint8_t app_use BP(884, 1395);
+ uint8_t reserved2 BP(1396, 2048);
+};
+
+static
+uint32_t iso_read_lsb(const uint8_t *buf, int bytes)
+{
+ int i;
+ uint32_t ret = 0;
+
+ for (i=0; iimage);
+ return o->image;
+}
+
+
+static void isoburn_idle_free_function(void *ignored)
+{
+ return;
+}
+
+
+/* API function. See libisoburn.h
+*/
+int isoburn_read_image(struct burn_drive *d,
+ struct isoburn_read_opts *read_opts,
+ IsoImage **image)
+{
+ int ret, int_num;
+ IsoReadOpts *ropts= NULL;
+ IsoReadImageFeatures *features= NULL;
+ uint32_t ms_block;
+
+ enum burn_disc_status status= BURN_DISC_BLANK;
+ IsoDataSource *ds= NULL;
+ struct isoburn *o= NULL;
+
+ if(read_opts==NULL) {
+ burn_msgs_submit(0x00060000,
+ "Program error: isoburn_read_image: read_opts==NULL",
+ 0, "FATAL", NULL);
+ return(-1);
+ }
+ if(d != NULL) {
+ ret = isoburn_find_emulator(&o, d, 0);
+ if (ret < 0 || o == NULL)
+ return 0;
+ status = isoburn_disc_get_status(d);
+ }
+ if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) {
+
+ /*
+ * Blank disc, we create a new image without files.
+ */
+
+ if (d == NULL) {
+ /* New empty image without relation to a drive */
+ if (image==NULL) {
+ burn_msgs_submit(0x00060000,
+ "Program error: isoburn_read_image: image==NULL",
+ 0, "FATAL", NULL);
+ return -1;
+ }
+ /* create a new image */
+ ret = iso_image_new("ISOIMAGE", image);
+ if (ret < 0) {
+ isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
+ return ret;
+ }
+ } else {
+ /* Blank new image for the drive */
+ iso_image_unref(o->image);
+ ret = iso_image_new("ISOIMAGE", &o->image);
+ if (ret < 0) {
+ isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
+ return ret;
+ }
+ if (image) {
+ *image = o->image;
+ iso_image_ref(*image); /*protects object from premature free*/
+ }
+ }
+ return 1;
+ }
+
+ if (status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL) {
+ burn_msgs_submit(0x00060000,
+ "Program error: isoburn_read_image: incorrect disc status",
+ 0, "FATAL", NULL);
+ return -4;
+ }
+
+ memset((char *) &ropts, 0, sizeof(ropts));
+
+ ret = isoburn_disc_get_msc1(d, &int_num);
+ if (ret <= 0)
+ return -2;
+ ms_block= int_num;
+
+ /* create the data source */
+ ret = iso_read_opts_new(&ropts, 0);
+ if (ret < 0) {
+ isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
+ return ret;
+ }
+ /* Important: do not return until iso_read_opts_free() */
+ iso_read_opts_set_start_block(ropts, ms_block);
+ iso_read_opts_set_no_rockridge(ropts, read_opts->norock);
+ iso_read_opts_set_no_joliet(ropts, read_opts->nojoliet);
+ iso_read_opts_set_no_iso1999(ropts, read_opts->noiso1999);
+ iso_read_opts_set_preferjoliet(ropts, read_opts->preferjoliet);
+ iso_read_opts_set_default_permissions(ropts,
+ read_opts->mode, read_opts->dirmode);
+ iso_read_opts_set_default_uid(ropts, read_opts->uid);
+ iso_read_opts_set_default_gid(ropts, read_opts->gid);
+ iso_read_opts_set_input_charset(ropts, read_opts->input_charset);
+ ds = isoburn_data_source_new(d);
+ iso_image_attach_data(o->image, o->read_pacifier_handle,
+ isoburn_idle_free_function);
+ if(o->read_pacifier_handle==NULL)
+ iso_tree_set_report_callback(o->image, NULL);
+ else
+ iso_tree_set_report_callback(o->image, o->read_pacifier);
+ ret = iso_image_import(o->image, ds, ropts, &features);
+ iso_tree_set_report_callback(o->image, NULL);
+ iso_read_opts_free(ropts);
+ iso_data_source_unref(ds);
+ if (ret < 0) {
+ isoburn_report_iso_error(ret, "Cannot import image", 0, "FAILURE", 0);
+ return ret;
+ }
+ /* Important: do not return until free(features) */
+ if (image!=NULL) {
+ *image = o->image;
+ iso_image_ref(*image); /*protects object from premature free*/
+ }
+ read_opts->hasRR = iso_read_image_features_has_rockridge(features);
+ read_opts->hasJoliet = iso_read_image_features_has_joliet(features);
+ read_opts->hasIso1999 = iso_read_image_features_has_iso1999(features);
+ read_opts->hasElTorito = iso_read_image_features_has_eltorito(features);
+ read_opts->size = iso_read_image_features_get_size(features);
+
+#ifdef NIX
+ read_opts->hasRR = features->hasRR;
+ read_opts->hasJoliet = features->hasJoliet;
+ read_opts->hasIso1999 = features->hasIso1999;
+ read_opts->hasElTorito = features->hasElTorito;
+ read_opts->size = features->size;
+#endif
+
+ iso_read_image_features_destroy(features);
+ return 1;
+}
+
+
+/* API function. See libisoburn.h
+*/
+int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
+{
+ int ret;
+ struct isoburn *o;
+
+ if (image == NULL) {
+ burn_msgs_submit(0x00060000,
+ "Program error: isoburn_attach_image: image==NULL",
+ 0, "FATAL", NULL);
+ return -1;
+ }
+ ret = isoburn_find_emulator(&o, d, 0);
+ if (ret < 0 || o == NULL)
+ return 0;
+ if(o->image != NULL)
+ iso_image_unref(o->image);
+ o->image = image;
+ return(1);
+}
+
+
+/* API function. See libisoburn.h
+*/
+int isoburn_activate_session(struct burn_drive *drive)
+{
+ int ret;
+ struct isoburn *o;
+
+ ret = isoburn_find_emulator(&o, drive, 0);
+ if (ret < 0)
+ return -1;
+
+ if (o->emulation_mode != 1)
+ return 1; /* don't need to activate session */
+
+ if (o->fabricated_disc_status != BURN_DISC_APPENDABLE)
+ return 1;
+
+ ret = burn_random_access_write(drive, 0, (char*)o->target_iso_head,
+ 32*2048, 1);
+
+ return ret;
+}
+
+
+/** Initialize the emulation of multi-session on random access media.
+ The need for emulation is confirmed already.
+ @param o A freshly created isoburn object. isoburn_create_data_source() was
+ already called, nevertheless.
+ @return <=0 error , 1 = success
+*/
+int isoburn_start_emulation(struct isoburn *o, int flag)
+{
+ int ret, i;
+ off_t data_count;
+ struct burn_drive *drive;
+ struct ecma119_pri_vol_desc *pvm;
+
+ if(o==NULL) {
+ burn_msgs_submit(0x00060000,
+ "Program error: isoburn_start_emulation: o==NULL",
+ 0, "FATAL", NULL);
+ return -1;
+ }
+
+ drive= o->drive;
+
+ /* we can assume 0 as start block for image */
+ /* TODO what about ms? where we validate valid iso image in ms disc? */
+ ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head,
+ sizeof(o->target_iso_head), &data_count, 2);
+
+ /* an error means an empty disc */
+ if (ret <= 0) {
+ o->fabricated_disc_status= BURN_DISC_BLANK;
+ return 1;
+ }
+
+ /* check first 64K. If 0's, the disc is treated as a blank disc, and thus
+ overwritten without extra check. */
+ i = sizeof(o->target_iso_head);
+ while (i && !o->target_iso_head[i-1])
+ --i;
+
+ if (!i) {
+ o->fabricated_disc_status= BURN_DISC_BLANK;
+ return 1;
+ }
+
+ pvm = (struct ecma119_pri_vol_desc *)(o->target_iso_head + 16 * 2048);
+
+ if (!strncmp((char*)pvm->std_identifier, "CD001", 5)) {
+ off_t size;
+
+ /* sanity check */
+ if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1
+ || pvm->file_structure_version[0] != 1 ) {
+ /* TODO for now I treat this as a full disc */
+ o->fabricated_disc_status= BURN_DISC_FULL;
+ return 1;
+ }
+
+ /* ok, PVM found, set size */
+ size = (off_t) iso_read_lsb(pvm->vol_space_size, 4);
+ size *= (off_t) 2048; /* block size in bytes */
+ isoburn_set_start_byte(o, size, 0);
+ o->fabricated_disc_status= BURN_DISC_APPENDABLE;
+ } else if (!strncmp((char*)pvm->std_identifier, "CDXX1", 5)) {
+
+ /* empty image */
+ isoburn_set_start_byte(o, (off_t) 0, 0);
+ o->fabricated_disc_status= BURN_DISC_BLANK;
+ } else {
+ /* treat any disc in an unknown format as full */
+ o->fabricated_disc_status= BURN_DISC_FULL;
+ }
+ return 1;
+}
+
+
+/** Alters and writes the first 64 kB of a "media" to invalidate
+ an ISO image. (It shall stay restorable by skilled humans, though).
+ The result shall especially keep libisoburn from accepting the media
+ image as ISO filesystem.
+ @param o A fully activated isoburn object. isoburn_start_emulation()
+ was already called.
+ @return <=0 error , 1 = success
+*/
+int isoburn_invalidate_iso(struct isoburn *o, int flag)
+{
+ /*
+ * replace CD001 with CDXX1 in PVM.
+ * I think this is enought for invalidating an iso image
+ */
+ strncpy((char*)o->target_iso_head + 16 * 2048 + 1, "CDXX1", 5);
+ return isoburn_activate_session(o->drive);
+}
+
+
+/* API @since 0.1.0 */
+int isoburn_set_read_pacifier(struct burn_drive *drive,
+ int (*read_pacifier)(IsoImage*, IsoFileSource*),
+ void *read_handle)
+{
+ int ret;
+ struct isoburn *o;
+
+ ret = isoburn_find_emulator(&o, drive, 0);
+ if(ret < 0 || o == NULL)
+ return -1;
+ o->read_pacifier_handle= read_handle;
+ o->read_pacifier= read_pacifier;
+ return(1);
+}
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/libisoburn.h b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/libisoburn.h
new file mode 100644
index 00000000..c9efa65e
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/libisoburn/libisoburn.h
@@ -0,0 +1,1054 @@
+
+/*
+ API definition of libisoburn.
+
+ Copyright 2007-2008 Vreixo Formoso Lopes
+ and Thomas Schmitt
+*/
+
+/** Overview
+
+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.
+
+
+ Connector functions
+
+libisofs and libburn do not depend on each other but share some interfaces
+by which they can cooperate.
+libisoburn establishes the connection between both modules by creating the
+necessary interface objects and attaching them to the right places.
+
+
+ Wrapper functions
+
+The priciple of this frontend is that you may use any call of libisofs or
+libburn unless it has a isoburn_*() wrapper listed in the following function
+documentation.
+
+E.g. call isoburn_initialize() rather than iso_init(); burn_initialize();
+and call isoburn_drive_scan_and_grab() rather than burn_drive_scan_and_grab().
+But you may call burn_disc_get_profile() directly if you want to display
+the media type.
+
+The wrappers will transparently provide the necessary emulations which
+are appropriate for particular target drives and media states.
+To learn about them you have to read both API descriptions: the one of
+the wrapper and the one of the underlying libburn or libisofs call.
+
+Macros BURN_* and functions burn_*() are documented in
+Macros ISO_* and functions iso_*() are documented in
+
+
+ Usage model
+
+There may be an input drive and an output drive. Either of them may be missing
+with the consequence that no reading resp. writing is possible.
+Both drive roles can be fulfilled by the same drive.
+
+Input can be a random access readable libburn drive:
+ optical media, regular files, block devices.
+Output can be any writeable libburn drive:
+ writeable optical media in burner, writeable file objects (no directories).
+
+libburn demands rw-permissions to drive device file resp. file object.
+
+If the input drive provides a suitable ISO RockRidge image, then its tree
+may be loaded into memory and can then be manipulated by libisofs API calls.
+The loading is done by isoburn_read_image() under control of
+struct isoburn_read_opts which the application obtains from libisoburn
+and manipulates by the family of isoburn_ropt_set_*() functions.
+
+Writing of result images is controlled by libisofs related parameters
+in a struct isoburn_imgen_opts which the application obtains from libisoburn
+and manipulates by the family of isoburn_igopt_set_*() functions.
+
+All multi-session aspects are handled by libisoburn according to these
+settings. The application does not have to analyze media state and write
+job parameters. It rather states its desires which libisoburn tries to
+fulfill, or else will refuse to start the write run.
+
+
+ Setup for Growing or Modifying
+
+The connector function family offers two alternative API calls for performing
+the setup for two alternative image generation strategies.
+
+Growing:
+If input and output drive is the same, then isoburn_prepare_disc() is to
+be used. It will lead to an add-on session on appendable or overwriteable
+media with existing ISO image. With blank media it will produce a first
+session.
+
+Modifying:
+If the output drive is not the input drive, then it has to bear blank media
+or overwriteable without a valid ISO image. To prepare for such an image
+generation run, use isoburn_prepare_new_image(). The run will copy file data
+from an eventual input drive with valid image, add any newly introduced data
+from the local filesystem, and produce a first session on output media.
+
+After either of these setups, some peripheral libburn drive parameter settings
+like burn_write_opts_set_simulate(), burn_write_opts_set_multi(),
+ burn_drive_set_speed(), burn_write_opts_set_underrun_proof() should be made.
+Do not set the write mode. It will be chosen by libisoburn so it matches job
+and media state.
+
+ Writing the image
+
+Then one may start image generation and write threads by isoburn_disc_write().
+Progress may be watched at the output drive by burn_drive_get_status() and
+isoburn_get_fifo_status().
+
+At some time, the output drive will be BURN_DRIVE_IDLE indicating that
+writing has ended.
+One should inquire isoburn_drive_wrote_well() to learn about overall success.
+
+Finally one must call isoburn_activate_session() which will complete any
+eventual multi-session emulation.
+
+*/
+
+
+ /* API functions */
+
+
+/** Initialize libisoburn, libisofs and libburn.
+ Wrapper for : iso_init() and burn_initialize()
+ @since 0.1.0
+ @param msg A character array for eventual messages (e.g. with errors)
+ @param flag Bitfield for control purposes (unused yet, submit 0)
+ @return 1 indicates success, 0 is failure
+*/
+int isoburn_initialize(char msg[1024], int flag);
+
+
+/** Check whether all features of header file libisoburn.h from the given
+ major.minor.micro revision triple can be delivered by the library version
+ which is performing this call.
+ An application of libisoburn can easily memorize the version of the
+ libisofs.h header in its own code. Immediately after isoburn_initialize()
+ it should simply do this check:
+ if (! isoburn_is_compatible(isoburn_header_version_major,
+ isoburn_header_version_minor,
+ isoburn_header_version_micro, 0))
+ ...refuse to start the program with this dynamic library version...
+ @since 0.1.0
+ @param major obtained at build time
+ @param minor obtained at build time
+ @param micro obtained at build time
+ @param flag Bitfield for control purposes. Unused yet. Submit 0.
+ @return 1= library can work for caller
+ 0= library is not usable in some aspects. Caller must restrict
+ itself to an earlier API version or must not use this libray
+ at all.
+*/
+int isoburn_is_compatible(int major, int minor, int micro, int flag);
+
+
+/** Obtain the three release version numbers of the library. These are the
+ numbers encountered by the application when linking with libisoburn,
+ i.e. possibly not before run time.
+ Better do not base the fundamental compatibility decision of an application
+ on these numbers. For a reliable check use isoburn_is_compatible().
+ @since 0.1.0
+ @param major The maturity version (0 for now, as we are still learning)
+ @param minor The development goal version.
+ @param micro The development step version. This has an additional meaning:
+
+ Pare numbers indicate a version with frozen API. I.e. you can
+ rely on the same set of features to be present in all
+ published releases with that major.minor.micro combination.
+ Features of a pare release will stay available and ABI
+ compatible as long as the SONAME of libisoburn stays "1".
+ Currently there are no plans to ever change the SONAME.
+
+ Odd numbers indicate that API upgrades are in progress.
+ I.e. new features might be already present or they might
+ be still missing. Newly introduced features may be changed
+ incompatibly or even be revoked before release of a pare
+ version.
+ So micro revisions {1,3,5,7,9} should never be used for
+ dynamic linking unless the proper library match can be
+ guaranteed by external circumstances.
+
+ @return 1 success, <=0 might in future become an error indication
+*/
+void isoburn_version(int *major, int *minor, int *micro);
+
+
+/** The minimum version of libisofs to be used with this version of libisoburn
+ at compile time.
+ @since 0.1.0
+*/
+#define isoburn_libisofs_req_major 0
+#define isoburn_libisofs_req_minor 6
+#define isoburn_libisofs_req_micro 3
+
+/** The minimum version of libburn to be used with this version of libisoburn
+ at compile time.
+ @since 0.1.0
+*/
+#define isoburn_libburn_req_major 0
+#define isoburn_libburn_req_minor 4
+#define isoburn_libburn_req_micro 2
+
+
+/** The minimum version of libisofs to be used with this version of libisoburn
+ at runtime. This is checked already in isoburn_initialize() which will
+ refuse on outdated version. So this call is for information purposes after
+ successful startup only.
+ @since 0.1.0
+ @param major isoburn_libisofs_req_major as seen at build time
+ @param minor as seen at build time
+ @param micro as seen at build time
+ @return 1 success, <=0 might in future become an error indication
+*/
+int isoburn_libisofs_req(int *major, int *minor, int *micro);
+
+
+/** The minimum version of libburn to be used with this version of libisoburn
+ at runtime. This is checked already in isoburn_initialize() which will
+ refuse on outdated version. So this call is for information purposes after
+ successful startup only.
+ @since 0.1.0
+ @param major isoburn_libburn_req_major as seen at build time
+ @param minor as seen at build time
+ @param micro as seen at build time
+ @return 1 success, <=0 might in future become an error indication
+*/
+int isoburn_libburn_req(int *major, int *minor, int *micro);
+
+
+/** These three release version numbers tell the revision of this header file
+ and of the API it describes. They are memorized by applications at build
+ time.
+ @since 0.1.0
+*/
+#define isoburn_header_version_major 0
+#define isoburn_header_version_minor 1
+#define isoburn_header_version_micro 1
+/** Note:
+ Above version numbers are also recorded in configure.ac because libtool
+ wants them as parameters at build time.
+ For the library compatibility check, ISOBURN_*_VERSION in configure.ac
+ are not decisive. Only the three numbers here do matter.
+*/
+/** Usage discussion:
+
+Some developers of the libburnia project have differing
+opinions how to ensure the compatibility of libaries
+and applications.
+
+It is about whether to use at compile time and at runtime
+the version numbers isoburn_header_version_* provided here.
+Thomas Schmitt advises to use them.
+Vreixo Formoso advises to use other means.
+
+At compile time:
+
+Vreixo Formoso advises to leave proper version matching
+to properly programmed checks in the the application's
+build system, which will eventually refuse compilation.
+
+Thomas Schmitt advises to use the macros defined here
+for comparison with the application's requirements of
+library revisions and to eventually break compilation.
+
+Both advises are combinable. I.e. be master of your
+build system and have #if checks in the source code
+of your application, nevertheless.
+
+At runtime (via *_is_compatible()):
+
+Vreixo Formoso advises to compare the application's
+requirements of library revisions with the runtime
+library. This is to allow runtime libraries which are
+young enough for the application but too old for
+the lib*.h files seen at compile time.
+
+Thomas Schmitt advises to compare the header
+revisions defined here with the runtime library.
+This is to enforce a strictly monotonous chain
+of revisions from app to header to library,
+at the cost of excluding some older libraries.
+
+These two advises are mutually exclusive.
+
+-----------------------------------------------------
+
+For an implementation of the Thomas Schmitt approach,
+see libisoburn/burn_wrap.c : isoburn_initialize()
+This connects libisoburn as "application" with libisofs
+as "library".
+
+The compatible part of Vreixo Formoso's approach is implemented
+in configure.ac LIBBURN_REQUIRED, LIBISOFS_REQUIRED.
+In isoburn_initialize() it would rather test by
+ iso_lib_is_compatible(isoburn_libisofs_req_major,...
+than by
+ iso_lib_is_compatible(iso_lib_header_version_major,...
+and would leave out the ugly compile time traps.
+
+*/
+
+
+/** Aquire a target drive by its filesystem path resp. libburn persistent
+ address.
+ Wrapper for: burn_drive_scan_and_grab()
+ @since 0.1.0
+ @param drive_infos On success returns a one element array with the drive
+ (cdrom/burner). Thus use with driveno 0 only. On failure
+ the array has no valid elements at all.
+ The returned array should be freed via burn_drive_info_free()
+ when the drive is no longer needed.
+ @param adr The persistent address of the desired drive.
+ @param load 1 attempt to load the disc tray. 0 no attempt,rather failure.
+ @return 1 = success , 0 = drive not found , <0 = other error
+*/
+int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
+ char* adr, int load);
+
+
+/** Aquire a target drive by its filesystem path resp. libburn persistent
+ address. This is a modern successor of isoburn_drive_scan_and_grab().
+ Wrapper for: burn_drive_scan_and_grab()
+ @since 0.1.2
+ @param drive_infos On success returns a one element array with the drive
+ (cdrom/burner). Thus use with driveno 0 only. On failure
+ the array has no valid elements at all.
+ The returned array should be freed via burn_drive_info_free()
+ when the drive is no longer needed.
+ @param adr The persistent address of the desired drive.
+ @param flag bit0= attempt to load the disc tray.
+ Else: failure if not loaded.
+ bit1= regard overwriteable media as blank
+ bit2= if the drive is a regular disk file: truncate it to
+ the write start address
+ @return 1 = success , 0 = drive not found , <0 = other error
+*/
+int isoburn_drive_aquire(struct burn_drive_info *drive_infos[],
+ char* adr, int flag);
+
+
+/** Aquire a drive from the burn_drive_info[] array which was obtained by
+ a previous call of burn_drive_scan().
+ Wrapper for: burn_drive_grab()
+ @since 0.1.0
+ @param drive The drive to grab. E.g. drive_infos[1].drive .
+ @param load 1 attempt to load the disc tray. 0 no attempt, rather failure.
+ @return 1 success, <=0 failure
+*/
+int isoburn_drive_grab(struct burn_drive *drive, int load);
+
+
+/** Inquire the media status. Expect the whole spectrum of libburn BURN_DISC_*
+ with multi-session media. Emulated states with random access media are
+ BURN_DISC_BLANK and BURN_DISC_APPENDABLE.
+ Wrapper for: burn_disc_get_status()
+ @since 0.1.0
+ @param drive The drive to inquire.
+ @return The status of the drive, or what kind of disc is in it.
+ Note: BURN_DISC_UNGRABBED indicates wrong API usage
+*/
+enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive);
+
+
+/** Tells whether the media can be treated by isoburn_disc_erase().
+ Wrapper for: burn_disc_erasable()
+ @since 0.1.0
+ @param drive The drive to inquire.
+ @return 0=not erasable , else erasable
+*/
+int isoburn_disc_erasable(struct burn_drive *d);
+
+
+/** Mark the media as blank. With multi-session media this will call
+ burn_disc_erase(). With random access media, an eventual ISO-9660
+ filesystem will get invalidated by altering its start blocks on media.
+ In case of success, the media is in status BURN_DISC_BLANK afterwards.
+ Wrapper for: burn_disc_erase()
+ @since 0.1.0
+ @param drive The drive with the media to erase.
+ @param fast 1=fast erase, 0=thorough erase
+ With DVD-RW, fast erase yields media incapable of multi-session.
+*/
+void isoburn_disc_erase(struct burn_drive *drive, int fast);
+
+
+/* ----------------------------------------------------------------------- */
+/*
+
+ Options for image reading.
+
+ An application shall create an option set object by isoburn_ropt_new(),
+ program it by isoburn_ropt_set_*(), use it with isoburn_read_image(),
+ and finally delete it by isoburn_ropt_destroy().
+
+*/
+/* ----------------------------------------------------------------------- */
+
+struct isoburn_read_opts;
+
+/** Produces a set of image read options, initialized with default values.
+ @since 0.1.0
+ @param o the newly created option set object
+ @param flag Bitfield for control purposes. Submit 0 for now.
+ @return 1=ok , <0 = failure
+*/
+int isoburn_ropt_new(struct isoburn_read_opts **o, int flag);
+
+
+/** Deletes an option set which was created by isoburn_ropt_new().
+ @since 0.1.0
+ @param o The option set to work on
+ @param flag Bitfield for control purposes. Submit 0 for now.
+ @return 1= **o destroyed , 0= *o was already NULL (harmless)
+*/
+int isoburn_ropt_destroy(struct isoburn_read_opts **o, int flag);
+
+
+/** Which existing ISO 9660 extensions in the image to read or not to read.
+ Whether to read the content of an existing image at all.
+ The bits can be combined by | resp. inquired by &.
+ @since 0.1.0
+ @param ext Bitfield:
+ bit0= norock
+ Do not read Rock Ridge extensions
+ bit1= nojoliet
+ Do not read Joliet extensions
+ bit2= noiso1999
+ Do not read ISO 9660:1999 enhanced tree
+ bit3= preferjoliet
+ When both Joliet and RR extensions are present, the RR
+ tree is used. If you prefer using Joliet, set this to 1.
+ bit4= pretend_blank
+ Always create empty image.Ignore any image on input drive.
+ @return 1 success, <=0 failure
+*/
+#define isoburn_ropt_norock 1
+#define isoburn_ropt_nojoliet 2
+#define isoburn_ropt_noiso1999 4
+#define isoburn_ropt_preferjoliet 8
+#define isoburn_ropt_pretend_blank 16
+int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext);
+int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext);
+
+
+/** Default attributes to use if no RockRidge extension gets loaded.
+ @since 0.1.0
+ @param o The option set to work on
+ @param uid user id number (see /etc/passwd)
+ @param gid group id number (see /etc/group)
+ @param mode permissions (not file type) as of man 2 stat.
+ With directories, r-permissions will automatically imply
+ x-permissions. See isoburn_ropt_set_default_dirperms() below.
+ @return 1 success, <=0 failure
+*/
+int isoburn_ropt_set_default_perms(struct isoburn_read_opts *o,
+ uid_t uid, gid_t gid, mode_t mode);
+int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o,
+ uid_t *uid, gid_t *gid, mode_t *mode);
+
+/** Default attributes to use on directories if no RockRidge extension
+ gets loaded.
+ Above call isoburn_ropt_set_default_perms() automatically adds
+ x-permissions to r-permissions for directories. This call here may
+ be done afterwards to set independend permissions for directories,
+ especially to override the automatically added x-permissions.
+ @since 0.1.0
+ @param o The option set to work on
+ @param mode permissions (not file type) as of man 2 stat.
+ @return 1 success, <=0 failure
+*/
+int isoburn_ropt_set_default_dirperms(struct isoburn_read_opts *o,
+ mode_t mode);
+int isoburn_ropt_get_default_dirperms(struct isoburn_read_opts *o,
+ mode_t *mode);
+
+
+
+/** Set the character set for reading RR file names from ISO images.
+ @since 0.1.0
+ @param o The option set to work on
+ @param input_charset Set this to NULL to use the default locale charset.
+ For selecting a particular character set, submit its
+ name, e.g. as listed by program iconv -l.
+ Example: "UTF-8".
+ @return 1 success, <=0 failure
+*/
+int isoburn_ropt_set_input_charset(struct isoburn_read_opts *o,
+ char *input_charset);
+int isoburn_ropt_get_input_charset(struct isoburn_read_opts *o,
+ char **input_charset);
+
+
+/** After calling function isoburn_read_image() there are informations
+ available in the option set.
+ This info can be obtained as bits in parameter has_what. Like:
+ joliet_available = (has_what & isoburn_ropt_has_joliet);
+ @since 0.1.0
+ @param o The option set to work on
+ @param size Number of image data blocks, 2048 bytes each.
+ @param has_what Bitfield:
+ bit0= has_rockridge
+ RockRidge extension info is available (POSIX filesystem)
+ bit1= has_joliet
+ Joliet extension info is available (suitable for MS-Windows)
+ bit2= has_iso1999
+ ISO version 2 Enhanced Volume Descriptor is available.
+ This is rather exotic.
+ bit3= has_el_torito
+ El-Torito boot record is present
+ @return 1 success, <=0 failure
+*/
+#define isoburn_ropt_has_rockridge 1
+#define isoburn_ropt_has_joliet 2
+#define isoburn_ropt_has_iso1999 4
+#define isoburn_ropt_has_el_torito 8
+int isoburn_ropt_get_size_what(struct isoburn_read_opts *o,
+ uint32_t *size, int *has_what);
+
+
+/* ----------------------------------------------------------------------- */
+/* End of Options for image reading */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/*
+
+ Options for image generation by libisofs and image transport to libburn.
+
+ An application shall create an option set by isoburn_igopt_new(),
+ program it by isoburn_igopt_set_*(), use it with either
+ isoburn_prepare_new_image() or isoburn_prepare_disc(), and finally delete
+ it by isoburn_igopt_destroy().
+
+*/
+/* ----------------------------------------------------------------------- */
+
+struct isoburn_imgen_opts;
+
+/** Produces a set of generation and transfer options, initialized with default
+ values.
+ @since 0.1.0
+ @param o the newly created option set object
+ @param flag Bitfield for control purposes. Submit 0 for now.
+ @return 1=ok , <0 = failure
+*/
+int isoburn_igopt_new(struct isoburn_imgen_opts **o, int flag);
+
+
+/** Deletes an option set which was created by isoburn_igopt_new().
+ @since 0.1.0
+ @param o The option set to give up
+ @param flag Bitfield for control purposes. Submit 0 for now.
+ @return 1= **o destroyed , 0= *o was already NULL (harmless)
+*/
+int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag);
+
+
+/** ISO level to write at.
+ @since 0.1.0
+ @param o The option set to work on
+ @param level is a term of the ISO 9660 standard. It should be one of:
+ 1= filenames restricted to form 8.3
+ 2= filenames allowed up to 31 characters
+ @return 1 success, <=0 failure
+*/
+int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level);
+int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level);
+
+
+/** Which extensions to support.
+ @since 0.1.0
+ @param o The option set to work on
+ @param ext Bitfield:
+ bit0= rockridge
+ Rock Ridge extensions add POSIX file attributes like
+ owner, group, access permissions, long filenames. Very
+ advisable if the designed audience has Unix style systems.
+ bit1= joliet
+ Longer filenames for Windows systems.
+ Weaker than RockRidge, but also readable with Linux.
+ bit2= iso1999
+ This is rather exotic. Better do not surprise the readers.
+ @return 1 success, <=0 failure
+*/
+#define isoburn_igopt_rockridge 1
+#define isoburn_igopt_joliet 2
+#define isoburn_igopt_iso1999 4
+int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext);
+int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext);
+
+/** Relaxed constraints. Setting any of the bits to 1 break the specifications,
+ but it is supposed to work on most moderns systems. Use with caution.
+ @since 0.1.0
+ @param o The option set to work on
+ @param relax Bitfield:
+ bit0= omit_version_numbers
+ Omit the version number (";1") at the end of the
+ ISO-9660 identifiers. Version numbers are usually
+ not used.
+ bit1= allow_deep_paths
+ Allow ISO-9660 directory hierarchy to be deeper
+ than 8 levels.
+ bit2= allow_longer_paths
+ Allow path in the ISO-9660 tree to have more than
+ 255 characters.
+ bit3= max_37_char_filenames
+ Allow a single file or directory hierarchy to have
+ up to 37 characters. This is larger than the 31
+ characters allowed by ISO level 2, and the extra space
+ is taken from the version number, so this also forces
+ omit_version_numbers.
+ bit4= no_force_dots
+ ISO-9660 forces filenames to have a ".", that separates
+ file name from extension. libisofs adds it if original
+ filename has none. Set this to 1 to prevent this
+ behavior.
+ bit5= allow_lowercase
+ Allow lowercase characters in ISO-9660 filenames.
+ By default, only uppercase characters, numbers and
+ a few other characters are allowed.
+ bit6= allow_full_ascii
+ Allow all ASCII characters to be appear on an ISO-9660
+ filename. Note * that "/" and "\0" characters are never
+ allowed, even in RR names.
+ bit7= joliet_longer_paths
+ Allow paths in the Joliet tree to have more than
+ 240 characters.
+ @return 1 success, <=0 failure
+*/
+#define isoburn_igopt_omit_version_numbers 1
+#define isoburn_igopt_allow_deep_paths 2
+#define isoburn_igopt_allow_longer_paths 4
+#define isoburn_igopt_max_37_char_filenames 8
+#define isoburn_igopt_no_force_dots 16
+#define isoburn_igopt_allow_lowercase 32
+#define isoburn_igopt_allow_full_ascii 64
+#define isoburn_igopt_joliet_longer_paths 128
+int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax);
+int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax);
+
+
+/** Whether and how files should be sorted.
+ @since 0.1.0
+ @param o The option set to work on
+ @param value Bitfield: bit0= sort_files_by_weight
+ files should be sorted based on their weight.
+ Weight is attributed to files in the image
+ by libisofs call iso_node_set_sort_weight().
+ @return 1 success, <=0 failure
+*/
+#define isoburn_igopt_sort_files_by_weight 1
+int isoburn_igopt_set_sort_files(struct isoburn_imgen_opts *o, int value);
+int isoburn_igopt_get_sort_files(struct isoburn_imgen_opts *o, int *value);
+
+
+/** Set the override values for files and directory permissions.
+ The parameters replace_* these take one of three values: 0, 1 or 2.
+ If 0, the corresponding attribute will be kept as set in the IsoNode
+ at the time of image generation.
+ If set to 1, the corresponding attrib. will be changed by a default
+ suitable value.
+ With value 2, the attrib. will be changed with the value specified
+ in the corresponding *_mode options. Note that only the permissions
+ are set, the file type remains unchanged.
+ @since 0.1.0
+ @param o The option set to work on
+ @param replace_dir_mode whether and how to override directories
+ @param replace_file_mode whether and how to override files of other type
+ @param dir_mode Mode to use on dirs with replace_dir_mode == 2.
+ @param file_mode; Mode to use on files with replace_file_mode == 2.
+ @return 1 success, <=0 failure
+*/
+int isoburn_igopt_set_over_mode(struct isoburn_imgen_opts *o,
+ int replace_dir_mode, int replace_file_mode,
+ mode_t dir_mode, mode_t file_mode);
+int isoburn_igopt_get_over_mode(struct isoburn_imgen_opts *o,
+ int *replace_dir_mode, int *replace_file_mode,
+ mode_t *dir_mode, mode_t *file_mode);
+
+/** Set the override values values for group id and user id.
+ The rules are like with above overriding of mode values. replace_* controls
+ whether and how. The other two parameters provide values for eventual use.
+ @since 0.1.0
+ @param o The option set to work on
+ @param replace_uid whether and how to override user ids
+ @param replace_gid whether and how to override group ids
+ @param uid User id to use with replace_uid == 2.
+ @param gid Group id to use on files with replace_gid == 2.
+ @return 1 success, <=0 failure
+*/
+int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o,
+ int replace_uid, int replace_gid,
+ uid_t uid, gid_t gid);
+int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o,
+ int *replace_uid, int *replace_gid,
+ uid_t *uid, gid_t *gid);
+
+/** Set the charcter set to use for representing filenames in the image.
+ @since 0.1.0
+ @param o The option set to work on
+ @param output_charset Set this to NULL to use the default output charset.
+ For selecting a particular character set, submit its
+ name, e.g. as listed by program iconv -l.
+ Example: "UTF-8".
+ @return 1 success, <=0 failure
+*/
+int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o,
+ char *output_charset);
+int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o,
+ char **output_charset);
+
+
+/** The number of bytes to be used for the fifo which decouples libisofs
+ and libburn for better throughput and for reducing the risk of
+ interrupting signals hitting the libburn thread which operates the
+ MMC drive.
+ The size will be rounded up to the next full 2048.
+ Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway).
+ @since 0.1.0
+ @param o The option set to work on
+ @param fifo_size Number of bytes to use
+ @return 1 success, <=0 failure
+*/
+int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size);
+int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size);
+
+
+/* ----------------------------------------------------------------------- */
+/* End of Options for image generation */
+/* ----------------------------------------------------------------------- */
+
+
+/** Get the image attached to a drive, if any.
+ @since 0.1.0
+ @param d The drive to inquire
+ @return A reference to attached image, or NULL if the drive has no image
+ attached. This reference needs to be released via iso_image_unref()
+ when it is not longer needed.
+*/
+IsoImage *isoburn_get_attached_image(struct burn_drive *d);
+
+
+/** Load the ISO filesystem directory tree from the media in the given drive.
+ This will give libisoburn the base on which it can let libisofs perform
+ image growing or image modification. The loaded volset gets attached
+ to the drive object and handed out to the application.
+ Not a wrapper, but peculiar to libisoburn.
+ @since 0.1.0
+ @param d The drive which holds an existing ISO filesystem or blank media.
+ d is allowed to be NULL which produces an empty ISO image. In
+ this case one has to call before writing isoburn_attach_volset()
+ with the volset from this call and with the intended output
+ drive.
+ @param read_opts The read options which can be chosen by the application
+ @param image the image read, if the disc is blank it will have no files.
+ This reference needs to be released via iso_image_unref() when
+ it is not longer needed. The drive, if not NULL, will hold an
+ own reference which it will release when it gets a new volset
+ or when it gets released via isoburn_drive_release().
+ You can pass NULL if you already have a reference or you plan to
+ obtain it later with isoburn_get_attached_image(). Of course, if
+ you haven't specified a valid drive (i.e., if d == NULL), this
+ parameter can't be NULL.
+ @return <=0 error , 1 = success
+*/
+int isoburn_read_image(struct burn_drive *d,
+ struct isoburn_read_opts *read_opts,
+ IsoImage **image);
+
+/** Set a callback function for producing pacifier messages during the lengthy
+ process of image reading. The callback function and the application handle
+ are stored until they are needed for the underlying call to libisofs.
+ Other than with libisofs the handle is managed entirely by the application.
+ An idle .free() function is exposed to libisofs. The handle has to stay
+ valid until isoburn_read_image() is done. It has to be detached by
+ isoburn_set_read_pacifier(drive, NULL, NULL);
+ before it may be removed from memory.
+ @since 0.1.0
+ @param drive The drive which will be used with isoburn_read_image()
+ It has to be aquired by an isoburn_* wrapper call.
+ @param read_pacifier The callback function
+ @param app_handle The app handle which the callback function can obtain
+ via iso_image_get_attached_data() from its IsoImage*
+ @return 1 success, <=0 failure
+*/
+int isoburn_set_read_pacifier(struct burn_drive *drive,
+ int (*read_pacifier)(IsoImage*, IsoFileSource*),
+ void *app_handle);
+
+
+/** Set the IsoImage to be used with a drive. This eventually releases
+ the reference to the old IsoImage attached to the drive.
+ Caution: Use with care. It hardly makes sense to replace an image that
+ reflects a valid ISO image on media.
+ This call is rather intended for writing a newly created and populated
+ image to blank media. The use case in xorriso is to let an image survive
+ the change or demise of the outdev target drive.
+ @since 0.1.0
+ @param d The drive which shall be write target of the volset.
+ @param image The image that represents the image to be written.
+ This image pointer MUST already be a valid reference suitable
+ for iso_image_unref().
+ It may have been obtained by appropriate libisofs calls or by
+ isoburn_read_image() with d==NULL.
+ @return <=0 error , 1 = success
+*/
+int isoburn_attach_image(struct burn_drive *d, IsoImage *image);
+
+
+/** Return the best possible estimation of the currently available capacity of
+ the media. This might depend on particular write option settings and on
+ drive state.
+ An eventual start address for emulated multi-session will be subtracted
+ from the capacity estimation given by burn_disc_available_space().
+ Negative results get defaulted to 0.
+ Wrapper for: burn_disc_available_space()
+ @since 0.1.0
+ @param d The drive to query.
+ @param o If not NULL: write parameters to be set on drive before query
+ @return number of most probably available free bytes
+*/
+off_t isoburn_disc_available_space(struct burn_drive *d,
+ struct burn_write_opts *o);
+
+
+/** Obtain the start block number of the most recent session on media. In
+ case of random access media this will always be 0. Succesfull return is
+ not a guarantee that there is a ISO-9660 image at all. The call will fail,
+ nevertheless,if isoburn_disc_get_status() returns not BURN_DISC_APPENDABLE.
+ Wrapper for: burn_disc_get_msc1()
+ @since 0.1.0
+ @param d The drive to inquire
+ @param start_lba Contains on success the start address in 2048 byte blocks
+ @return <=0 error , 1 = success
+*/
+int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba);
+
+
+/** Use this with trackno==0 to obtain the predicted start block number of the
+ new session. The interesting number is returned in parameter nwa.
+ Wrapper for: burn_disc_track_lba_nwa()
+ @since 0.1.0
+ @param d The drive to inquire
+ @param o If not NULL: write parameters to be set on drive before query
+ @param trackno Submit 0.
+ @param lba return value: start lba
+ @param nwa return value: Next Writeable Address
+ @return 1=nwa is valid , 0=nwa is not valid , -1=error
+*/
+int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
+ int trackno, int *lba, int *nwa);
+
+
+/** Obtain the size which was attributed to an emulated appendable on actually
+ overwriteable media. This value is supposed to be <= 2048 * nwa as of
+ isoburn_disc_track_lba_nwa().
+ @since 0.1.0
+ @param drive The drive holding the media.
+ @param start_byte The reply value counted in bytes, not in sectors.
+ @param flag Unused yet. Submit 0.
+ @return 1=stat_byte is valid, 0=not an emulated appendable, -1=error
+*/
+int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte,
+ int flag);
+
+
+/** Create a disc object for writing the new session from the created or loaded
+ iso_volset which has been manipulated via libisofs, to the same media from
+ where the image was eventually loaded. This struct burn_disc is ready for
+ use by a subsequent call to isoburn_disc_write().
+ After this asynchronous writing has ended and the drive is BURN_DRIVE_IDLE
+ again, the burn_disc object has to be disposed by burn_disc_free().
+ @since 0.1.0
+ @param drive The combined source and target drive, grabbed with
+ isoburn_drive_scan_and_grab(). .
+ @param disc Returns the newly created burn_disc object.
+ @param opts Image generation options, see isoburn_igopt_*()
+ @return <=0 error , 1 = success
+*/
+int isoburn_prepare_disc(struct burn_drive *drive, struct burn_disc **disc,
+ struct isoburn_imgen_opts *opts);
+
+
+/** Create a disc object for producing a new image from a previous image
+ plus the changes made by user. The generated burn_disc is suitable
+ to be written to any grabbed libburn drive with blank writeable media.
+ But you must not use the same drive for input and output, because data
+ will be read from the source drive while at the same time the target
+ drive is already writing.
+ The resulting burn_disc object has to be disposed when all its writing
+ is done and the drive is BURN_DRIVE_IDLE again after asynchronous
+ burn_disc_write().
+ @since 0.1.0
+ @param in_drive The input drive,grabbed with isoburn_drive_scan_and_grab().
+ @param disc Returns the newly created burn_disc object.
+ @param opts Options for image generation and data transport to media.
+ @param out_drive The libburn drive which shall be write target.
+ If the drive was grabbed via libisoburn then it can later
+ access the libisofs source fifo via
+ isoburn_get_fifo_status().
+ Mere libburn drives cannot obtain this info.
+ In that case out_drive may be NULL, as well.
+ @return <=0 error , 1 = success
+*/
+int isoburn_prepare_new_image(struct burn_drive *in_drive,
+ struct burn_disc **disc,
+ struct isoburn_imgen_opts *opts,
+ struct burn_drive *out_drive);
+
+/** @since 0.1.0
+ Revoke isoburn_prepare_new_image() or isoburn_prepare_disc() instead of
+ running isoburn_disc_write().
+ libisofs reserves resources and maybe already starts generating the
+ image stream when one of above two calls is performed. It is mandatory to
+ either run isoburn_disc_write() or to revoke the preparations by the
+ call described here.
+ @since 0.1.0
+ @param input_drive The drive resp. in_drive which was used with the
+ preparation call.
+ @param output_drive The out_drive used with isoburn_prepare_new_image(),
+ NULL if none.
+ @param flag Bitfield, submit 0 for now.
+ bit0= -reserved for internal use-
+ @return <0 error, 0= no pending preparations detectable, 1 = canceled
+*/
+int isoburn_cancel_prepared_write(struct burn_drive *input_drive,
+ struct burn_drive *output_drive, int flag);
+
+
+/** Start writing of the new session.
+ This call is asynchrounous. I.e. it returns quite soon and the progress has
+ to be watched by a loop with call burn_drive_get_status() until
+ BURN_DRIVE_IDLE is returned.
+ Wrapper for: burn_disc_write()
+ @since 0.1.0
+ @param o Options which control the burn process. See burnwrite_opts_*()
+ in libburn.h.
+ @param disc Disc object created either by isoburn_prepare_disc() or by
+ isoburn_prepare_new_image().
+*/
+void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
+
+
+/** Inquire state and fill parameters of the fifo which is attached to
+ the emerging track. This should be done in the pacifier loop while
+ isoburn_disc_write() or burn_disc_write() are active.
+ This works only with drives obtained by isoburn_drive_scan_and_grab()
+ or isoburn_drive_grab(). If isoburn_prepare_new_image() was used, then
+ parameter out_drive must have announced the track output drive.
+ Hint: If only burn_write_opts and not burn_drive is known, then the drive
+ can be obtained by burn_write_opts_get_drive().
+ @since 0.1.0
+ @parm d The drive to which the track with the fifo gets burned.
+ @param size The total size of the fifo
+ @param free_bytes The current free capacity of the fifo
+ @param status_text Returns a pointer to a constant text, see below
+ @return <0 reply invalid, >=0 fifo status code:
+ bit0+1=input status, bit2=consumption status, i.e:
+ 0="standby" : data processing not started yet
+ 1="active" : input and consumption are active
+ 2="ending" : input has ended without error
+ 3="failing" : input had error and ended,
+ 4="unused" : ( consumption has ended before processing start )
+ 5="abandoned" : consumption has ended prematurely
+ 6="ended" : consumption has ended without input error
+ 7="aborted" : consumption has ended after input error
+*/
+int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
+ char **status_text);
+
+
+/** Inquire whether the most recent write run was successful.
+ Wrapper for: burn_drive_wrote_well()
+ @since 0.1.0
+ @param d The drive to inquire
+ @return 1=burn seems to have went well, 0=burn failed
+*/
+int isoburn_drive_wrote_well(struct burn_drive *d);
+
+
+/** Call this after isoburn_disc_write has finished and burn_drive_wrote_well()
+ indicates success. It will eventually complete the emulation of
+ multi-session functionality, if needed at all. Let libisoburn decide.
+ Not a wrapper, but peculiar to libisoburn.
+ @since 0.1.0
+ @param d The output drive to which the session was written
+ @return 1 success , <=0 failure
+*/
+int isoburn_activate_session(struct burn_drive *drive);
+
+
+/** @since 0.1.0
+ Wait after normal end of operations until libisofs ended all write
+ threads and freed resource reservations.
+ This call is not mandatory. But without it, messages from the ending
+ threads might appear after the application ended its write procedure.
+ @since 0.1.0
+ @param input_drive The drive resp. in_drive which was used with the
+ preparation call.
+ @param output_drive The out_drive used with isoburn_prepare_new_image(),
+ NULL if none.
+ @param flag Bitfield, submit 0 for now.
+ @return <=0 error , 1 = success
+*/
+int isoburn_sync_after_write(struct burn_drive *input_drive,
+ struct burn_drive *output_drive, int flag);
+
+
+#if 0
+/* >>> NOT YET IMPLEMENTED <<< */
+/** Write a new session to a disc.
+ This is a synchronous call equivalent to isoburn_prepare_disc +
+ isoburn_disc_write + isoburn_activate_session
+ @param pacifier_func If not NULL: a function to produce appeasing messages.
+ See burn_abort_pacifier() in libburn.h for an example.
+*/
+/* TODO implement this */
+int isoburn_perform_write(struct burn_write_opts *o,
+ int (*pacifier_func)(void *handle, int patience,
+ int elapsed));
+#endif /* 0 */
+
+
+/** Release an aquired drive.
+ Wrapper for: burn_drive_release()
+ @since 0.1.0
+ @param drive The drive to be released
+ @param eject 1= eject media from drive , 0= do not eject
+*/
+void isoburn_drive_release(struct burn_drive *drive, int eject);
+
+
+/** Shutdown all three libraries.
+ Wrapper for : iso_finish() and burn_finish().
+ @since 0.1.0
+*/
+void isoburn_finish(void);
+
+
+/*
+ The following calls are for expert applications only.
+ An application should have a special reason to use them.
+*/
+
+
+/** Inquire wether the media needs emulation or would be suitable for
+ generic multi-session via libburn.
+ @since 0.1.0
+ @param d The drive to inquire
+ @return 0 is generic multi-session
+ 1 is emulated multi-session
+ -1 is not suitable for isoburn
+*/
+int isoburn_needs_emulation(struct burn_drive *drive);
+
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/test/compare_file.c b/libisoburn/branches/XorrisoZeroOneTwo/test/compare_file.c
new file mode 100644
index 00000000..2d460f54
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/test/compare_file.c
@@ -0,0 +1,275 @@
+/*
+ Compare two copies of a file object in as many aspects as i can imagine
+ to make sense. (E.g.: comparing atime makes no sense.)
+
+ To compare tree /media/dvd and /original/dir :
+ find /media/dvd -exec compare_file '{}' /media/dvd /original/dir ';'
+
+ Copyright 2008 Thomas Schmitt,
+
+ Provided under GPL version 2.
+
+
+ cc -g -o compare_file compare_file.c
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/* @param flag bit0= single letters */
+char *Ftypetxt(mode_t st_mode, int flag)
+{
+ if(flag&1)
+ goto single_letters;
+ if(S_ISDIR(st_mode))
+ return("directory");
+ else if(S_ISREG(st_mode))
+ return("regular_file");
+ else if(S_ISLNK(st_mode))
+ return("symbolic_link");
+ else if(S_ISBLK(st_mode))
+ return("block_device");
+ else if(S_ISCHR(st_mode))
+ return("char_device");
+ else if(S_ISFIFO(st_mode))
+ return("name_pipe");
+ else if(S_ISSOCK(st_mode))
+ return("unix_socket");
+ return("unknown");
+single_letters:;
+ if(S_ISDIR(st_mode))
+ return("d");
+ else if(S_ISREG(st_mode))
+ return("-");
+ else if(S_ISLNK(st_mode))
+ return("l");
+ else if(S_ISBLK(st_mode))
+ return("b");
+ else if(S_ISCHR(st_mode))
+ return("c");
+ else if(S_ISFIFO(st_mode))
+ return("p");
+ else if(S_ISSOCK(st_mode))
+ return("s");
+ return("?");
+}
+
+
+char *Ftimetxt(time_t t, char timetext[40], int flag)
+{
+ char *rpt;
+ struct tm tms, *tmpt;
+ static char months[12][4]= { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+
+ tmpt= localtime_r(&t, &tms);
+ rpt= timetext;
+ rpt[0]= 0;
+ if(tmpt==0)
+ sprintf(rpt+strlen(rpt), "%12.f", (double) t);
+ else if(time(NULL)-t < 180*86400 && time(NULL)-t >= 0)
+ sprintf(rpt+strlen(rpt), "%3s %2d %2.2d:%2.2d",
+ months[tms.tm_mon], tms.tm_mday, tms.tm_hour, tms.tm_min);
+ else
+ sprintf(rpt+strlen(rpt), "%3s %2d %4.4d",
+ months[tms.tm_mon], tms.tm_mday, 1900+tms.tm_year);
+ return(timetext);
+}
+
+
+/* @param flag bit0= compare atime
+ bit1= compare ctime
+*/
+int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
+{
+ struct stat s1, s2;
+ int ret, differs= 0, r1, r2, fd1= -1, fd2= -1, i, done;
+ char buf1[4096], buf2[4096], a[4096], ttx1[40], ttx2[40];
+ off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
+
+ ret= lstat(adr1, &s1);
+ if(ret==-1) {
+ printf("? %s : cannot lstat() : %s\n", adr1, strerror(errno));
+ return(0);
+ }
+ strcpy(a, Ftypetxt(s1.st_mode, 1));
+ strcat(a, " ");
+ if(adrc[0])
+ strcat(a, adrc);
+ else
+ strcat(a, ".");
+
+ ret= lstat(adr2, &s2);
+ if(ret==-1) {
+ printf("? %s : cannot lstat() : %s\n", adr2, strerror(errno));
+ return(0);
+ }
+
+ /* Attributes */
+ if(s1.st_mode != s2.st_mode) {
+ if((s1.st_mode&~S_IFMT)!=(s2.st_mode&~S_IFMT))
+ printf("%s : st_mode : %7.7o <> %7.7o\n", a, s1.st_mode, s2.st_mode);
+ if((s1.st_mode&S_IFMT)!=(s2.st_mode&S_IFMT))
+ printf("%s : type : %s <> %s\n",
+ a, Ftypetxt(s1.st_mode, 0), Ftypetxt(s2.st_mode, 0));
+ differs= 1;
+ }
+ if(s1.st_uid != s2.st_uid) {
+ printf("%s : st_uid : %d <> %d\n", a, s1.st_uid, s2.st_uid);
+ differs= 1;
+ }
+ if(s1.st_gid != s2.st_gid) {
+ printf("%s : st_gid : %d <> %d\n", a, s1.st_gid, s2.st_gid);
+ differs= 1;
+ }
+ if((S_ISCHR(s1.st_mode) && S_ISCHR(s2.st_mode)) ||
+ (S_ISBLK(s1.st_mode) && S_ISBLK(s2.st_mode))) {
+ if(s1.st_rdev != s2.st_rdev) {
+ printf("%s : %s st_rdev : %lu <> %lu\n", a,
+ (S_ISCHR(s1.st_mode) ? "S_IFCHR" : "S_IFBLK"),
+ (unsigned long) s1.st_rdev, (unsigned long) s1.st_rdev);
+ differs= 1;
+ }
+ }
+ if(S_ISREG(s2.st_mode) && s1.st_size != s2.st_size) {
+ printf("%s : st_size : %.f <> %.f diff= %.f\n",
+ a, (double) s1.st_size, (double) s2.st_size,
+ ((double) s1.st_size) - (double) s2.st_size);
+ differs= 1;
+ }
+ if(s1.st_mtime != s2.st_mtime) {
+ printf("%s : st_mtime : %s <> %s diff= %.f s\n",
+ a, Ftimetxt(s1.st_mtime, ttx1, 0),
+ Ftimetxt(s2.st_mtime, ttx2, 0),
+ ((double) s1.st_mtime) - (double) s2.st_mtime);
+ differs= 1;
+ }
+ if(flag&1) {
+ if(s1.st_atime != s2.st_atime) {
+ printf("%s : st_atime : %s <> %s diff= %.f s\n",
+ a, Ftimetxt(s1.st_atime, ttx1, 0),
+ Ftimetxt(s2.st_atime, ttx2, 0),
+ ((double) s1.st_atime) - (double) s2.st_atime);
+ differs= 1;
+ }
+ }
+ if(flag&2) {
+ if(s1.st_ctime != s2.st_ctime) {
+ printf("%s : st_ctime : %s <> %s diff= %.f s\n",
+ a, Ftimetxt(s1.st_ctime, ttx1, 0),
+ Ftimetxt(s2.st_ctime, ttx2, 0),
+ ((double) s1.st_ctime) - (double) s2.st_ctime);
+ differs= 1;
+ }
+ }
+ if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)) {
+ fd1= open(adr1, O_RDONLY);
+ if(fd1==-1) {
+ printf("- %s : cannot open() : %s\n", adr1, strerror(errno));
+ return(0);
+ }
+ fd2= open(adr2, O_RDONLY);
+ if(fd2==-1) {
+ printf("- %s : cannot open() : %s\n", adr2, strerror(errno));
+ close(fd1);
+ return(0);
+ }
+
+ /* Content */
+ done= 0;
+ while(!done) {
+ r1= read(fd1, buf1, sizeof(buf1));
+ r2= read(fd2, buf2, sizeof(buf2));
+ if((r1==EOF && r2==EOF) || (r1==0 && r2==0))
+ break;
+ if(r1==EOF || r1==0) {
+ if(r1==EOF)
+ r1= 0;
+ if(s1.st_size > r1count + r1)
+ printf("- %s : early EOF after %.f bytes\n", adr1, (double) r1count);
+ differs= 1;
+ }
+ r1count+= r1;
+ if(r2==EOF || r2 r2count + r2)
+ printf("- %s : early EOF after %.f bytes\n", adr2, (double) r2count);
+ differs= 1;
+ done= 1;
+ }
+ if(r2>r1) {
+ if(s1.st_size > r1count + r1)
+ printf("- %s : early EOF after %.f bytes\n", adr1, (double) r1count);
+ differs= 1;
+ done= 1;
+ }
+ r2count+= r2;
+ if(r1>r2)
+ r1= r2;
+ for(i= 0; i0 || r1count!=r2count) {
+ if(first_diff<0)
+ first_diff= (r1count>r2count ? r2count : r1count);
+ printf("%s : %s : differs by at least %.f bytes. First at %.f\n", a,
+ (s1.st_mtime==s2.st_mtime ? "CONTENT":"content"),
+ (double) (diffcount + abs(r1count-r2count)), (double) first_diff);
+ differs= 1;
+ }
+ }
+ if(fd1!=-1)
+ close(fd1);
+ if(fd2!=-1)
+ close(fd2);
+ return(!differs);
+}
+
+
+int main(int argc, char **argv)
+{
+ int ret, i, with_ctime= 1;
+ char adr1[4096], adr2[4096], adrc[4096];
+
+ if(argc<4) {
+ fprintf(stderr, "usage: %s path prefix1 prefix2\n", argv[0]);
+ exit(2);
+ }
+ for(i= 4; i
+ and Thomas Schmitt
+*/
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#include
+#include
+#include "../src/libisoburn.h"
+
+const char * const optstring = "JRh";
+extern char *optarg;
+extern int optind;
+
+
+/** Activates the usage of function graft_point() rather than
+ plain iso_tree_radd_dir() from libisofs
+*/
+#define With_graft_poinT 1
+
+
+static int graft_point(struct iso_volume *volume, const char *disk_path,
+ const char *img_path, struct iso_tree_radd_dir_behavior *behav)
+{
+ char path[4096], *apt, *npt;
+ struct iso_tree_node_dir *dir;
+ struct iso_tree_node *node;
+ int done= 0, is_dir= 0;
+ struct stat stbuf;
+
+ strncpy(path, img_path, sizeof(path)-1);
+ path[sizeof(path)-1]= 0;
+ apt= npt= path;
+
+ if(lstat(disk_path, &stbuf) == -1) {
+ fprintf(stderr, "Cannot determine attributes of '%s' : %s (%d)\n",
+ disk_path, (errno > 0 ? strerror(errno) : "unknown error"), errno);
+ return(0);
+ }
+ if(S_ISDIR(stbuf.st_mode))
+ is_dir= 1;
+ else if(!(S_ISREG(stbuf.st_mode) || S_ISLNK(stbuf.st_mode))) {
+ fprintf(stderr, "File object '%s' is of non-supported file type\n",
+ disk_path);
+ return(0);
+ }
+
+ dir= iso_volume_get_root(volume);
+ if(dir==NULL) {
+ fprintf(stderr, "While grafting '%s' : no root node available\n", img_path);
+ return(0);
+ }
+ for(npt= apt; !done; apt= npt+1) {
+ npt= strchr(apt, '/');
+ if(npt==NULL) {
+ npt= apt+strlen(apt);
+ done= 1;
+ } else
+ *npt= 0;
+ if(*apt==0) {
+ *apt= '/';
+ apt++;
+ continue;
+ }
+ node= iso_tree_volume_path_to_node(volume,path);
+ if(node!=NULL) {
+ if(iso_tree_node_get_type(node)!=LIBISO_NODE_DIR) {
+ fprintf(stderr, "While grafting '%s' : '%s' is not a directory\n",
+ img_path, path);
+ return(0);
+ }
+ dir= (struct iso_tree_node_dir *) node;
+ } else {
+ dir= iso_tree_add_dir(dir, apt);
+ if(dir==NULL) {
+ fprintf(stderr, "While grafting '%s' : could not insert '%s'\n",
+ img_path, path);
+ return(0);
+ }
+ }
+ if(done) {
+ if(is_dir) {
+ iso_tree_radd_dir(dir, disk_path, behav);
+ } else {
+ node= iso_tree_add_node(dir, disk_path);
+ if(node == NULL) {
+ fprintf(stderr, "While grafting '%s'='%s' : libisofs_errno = %d\n",
+ img_path, disk_path, libisofs_errno);
+ }
+ }
+ } else
+ *npt= '/';
+ }
+ fprintf(stderr, "NOTE: added %s '%s'='%s'\n", (is_dir ? "directory" : "node"),
+ img_path, disk_path);
+ return(1);
+}
+
+
+static
+void usage()
+{
+ printf("test [OPTIONS] DRIVE DIRECTORY\n");
+}
+
+static
+void help()
+{
+ printf(
+"Options:\n"
+" -J Add Joliet support\n"
+" -R Add Rock Ridge support\n"
+" -h Print this message\n"
+);
+}
+
+int main(int argc, char **argv)
+{
+ struct burn_drive_info *drives;
+ struct iso_volset *volset;
+ struct burn_drive *drive;
+ struct burn_disc *disc;
+ enum burn_disc_status state;
+ struct isoburn_read_opts ropts;
+ struct isoburn_source_opts sopts;
+ int c;
+ struct iso_tree_radd_dir_behavior behav = {0,0,0};
+ int flags=0;
+ int ret=0, i;
+ int size, free_bytes;
+ char *status_text;
+
+ while ((c = getopt(argc, argv, optstring)) != -1) {
+ switch(c) {
+ case 'h':
+ usage();
+ help();
+ exit(0);
+ break;
+ case 'J':
+ flags |= ECMA119_JOLIET;
+ break;
+ case 'R':
+ flags |= ECMA119_ROCKRIDGE;
+ break;
+ case '?':
+ usage();
+ exit(1);
+ break;
+ }
+ }
+
+ if (argc < optind + 1) {
+ fprintf(stderr, "Please supply device name\n");
+ usage();
+ exit(1);
+ }
+ if (argc < optind + 2) {
+ fprintf(stderr, "Please supply directory to add to disc\n");
+ usage();
+ exit(1);
+ }
+
+
+ if (!isoburn_initialize()) {
+ fprintf(stderr, "Can't init libisoburn\n");
+ exit(1);
+ }
+
+ /* TODO change this. maybe we can add wrapp in libisoburn */
+ iso_msgs_set_severities("NEVER", "DEBUG", "libisofs : ");
+ burn_msgs_set_severities("NEVER", "DEBUG", "libburn : ");
+ burn_set_signal_handling("libisoburn/test/test : ", NULL, 0);
+
+ printf("Growing drive %s\n", argv[optind]);
+
+ if (isoburn_drive_scan_and_grab(&drives, argv[optind], 1) <= 0) {
+ fprintf(stderr,
+ "Can't open device. Are you sure it is a valid drive?\n");
+ exit(1);
+ }
+ drive = drives[0].drive;
+
+ /* check for invalid state */
+ state = isoburn_disc_get_status(drive);
+ if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) {
+ fprintf(stderr, "Unsuitable disc status\n");
+ goto exit_cleanup;
+ }
+
+ /* fill read opts */
+ memset(&ropts, sizeof(ropts), 0);
+ ropts.norock = 0;
+ ropts.nojoliet = 0;
+ ropts.preferjoliet = 0;
+ ropts.uid = 0;
+ ropts.gid = 0;
+ ropts.mode = 0555;
+ ropts.pretend_blank= 0;
+
+ if (isoburn_read_volset(drive, &ropts, &volset) <= 0) {
+ fprintf(stderr, "Can't read volset\n");
+ goto exit_cleanup;
+ }
+
+
+#ifdef With_graft_poinT
+ for (i = optind + 1; i < argc; i++) {
+ if (graft_point(iso_volset_get_volume(volset, 0),
+ argv[i], argv[i], &behav) <= 0) {
+ fprintf(stderr, "Canot graft '%s'\n", argv[optind+1]);
+ goto exit_cleanup;
+ }
+ }
+
+#else
+ struct iso_tree_node_dir *root;
+ root = iso_volume_get_root(iso_volset_get_volume(volset, 0));
+ /* add a new dir */
+ iso_tree_radd_dir(root, argv[optind+1], &behav);
+#endif /* ! With_graft_poinT */
+
+
+ sopts.level = 2;
+ sopts.flags = flags;
+ sopts.relaxed_constraints = 0;
+ sopts.copy_eltorito = 1;
+ sopts.no_cache_inodes = 0;
+ sopts.sort_files = 1;
+ sopts.default_mode = 0;
+ sopts.replace_dir_mode = 0;
+ sopts.replace_file_mode = 0;
+ sopts.replace_uid = 0;
+ sopts.replace_gid = 0;
+ sopts.dir_mode = 0555;
+ sopts.file_mode = 0444;
+ sopts.gid = 0;
+ sopts.uid = 0;
+ sopts.input_charset = NULL;
+ sopts.ouput_charset = NULL;
+
+ if (isoburn_prepare_disc(drive, &disc, &sopts) <= 0) {
+ fprintf(stderr, "Can't prepare disc\n");
+ goto volset_cleanup;
+ }
+
+ /* a. write the new image */
+ printf("Adding new data...\n");
+ {
+ struct burn_write_opts *burn_options;
+ struct burn_progress progress;
+
+ burn_options = burn_write_opts_new(drive);
+ burn_drive_set_speed(drive, 0, 0);
+ burn_write_opts_set_underrun_proof(burn_options, 1);
+
+ /* ok, write the new track */
+ isoburn_disc_write(burn_options, disc);
+ burn_write_opts_free(burn_options);
+
+ while (burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
+ usleep(100002);
+
+ while (burn_drive_get_status(drive, &progress)
+ != BURN_DRIVE_IDLE) {
+
+ printf("Writing: sector %d of %d",
+ progress.sector, progress.sectors);
+ ret = isoburn_get_fifo_status(drive, &size,
+ &free_bytes, &status_text);
+ if (ret > 0 )
+ printf(" [fifo %s, %2d%% fill]", status_text,
+ (int) (100.0 - 100.0 *
+ ((double) free_bytes) /
+ (double) size));
+ printf("\n");
+ sleep(1);
+ }
+ }
+
+ /* b. write the new vol desc */
+ printf("Writing the new vol desc...\n");
+ if (isoburn_activate_session(drive) <= 0) {
+ fprintf(stderr, "Ups, new vol desc write failed\n");
+ }
+
+ ret= 0;
+volset_cleanup:;
+/*
+ iso_volset_free(volset);
+*/
+
+exit_cleanup:;
+ isoburn_drive_release(drive, 0);
+ isoburn_finish();
+
+ exit(ret);
+}
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/version.h.in b/libisoburn/branches/XorrisoZeroOneTwo/version.h.in
new file mode 100644
index 00000000..cf529233
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/version.h.in
@@ -0,0 +1,6 @@
+
+/* <<< this file is on its way out
+#define ISOBURN_MAJOR_VERSION @ISOBURN_MAJOR_VERSION@
+#define ISOBURN_MINOR_VERSION @ISOBURN_MINOR_VERSION@
+#define ISOBURN_MICRO_VERSION @ISOBURN_MICRO_VERSION@
+*/
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/README b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/README
new file mode 100644
index 00000000..fd4636ee
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/README
@@ -0,0 +1,201 @@
+------------------------------------------------------------------------------
+ libburnia-project.org scdbackup.sourceforge.net/xorriso_eng.html
+------------------------------------------------------------------------------
+xorriso. By Thomas Schmitt
+Integrated sub project of libburnia-project.org but also published via:
+http://scdbackup.sourceforge.net/xorriso_eng.html
+http://scdbackup.sourceforge.net/xorriso-0.1.1.tar.gz
+Copyright (C) 2006-2008 Thomas Schmitt, provided under GPL version 2.
+------------------------------------------------------------------------------
+
+
+xorriso is a program which maps file objects from POSIX compliant
+filesystems into Rock Ridge enhanced ISO 9660 filesystems and allows
+session-wise manipulation of such filesystems. It can load the management
+information of existing ISO images and it writes the session results to
+optical media or to filesystem objects.
+
+Currently it is only supported on Linux with kernels >= 2.4.
+
+A special property of xorriso is that it needs neither an external ISO 9660
+formatter program nor an external burn program for CD or DVD but rather
+incorporates the libraries of libburnia-project.org .
+
+By using this software you agree to the disclaimer at the end of this text:
+"... without even the implied warranty ..."
+
+
+ Compilation, First Glimpse, Installation
+
+The most simple way to get xorriso from source code is the xorriso standalone
+tarball.
+
+Prerequisites:
+The tarball contains anything that is needed except libc and libpthread.
+libreadline and the readline-dev headers will make dialog mode more convenient,
+but are not mandatory.
+
+Obtain xorriso-0.1.1.tar.gz, take it to a directory of your choice and do:
+
+ tar xzf xorriso-0.1.1.tar.gz
+ cd xorriso-0.1.1
+
+Within that directory execute:
+
+ ./configure --prefix=/usr
+ make
+
+This will produce a binary named
+ ./xorriso/xorriso
+
+which you may strip to reduce it in size
+ strip ./xorriso/xorriso
+
+You may copy or move it to a directory where it can be found by the shell,
+you may execute xorriso at the place where it was built, or you may execute
+as superuser:
+ make install
+
+For general concepts, options and usage examples see
+ man 1 xorriso
+
+This man page is part of the tarball as
+ xorriso/xorriso.1
+You may get a first glimpse by
+ man ./xorriso/xorriso.1
+
+It gets installed with "make install" but may also be placed manually in the
+./man1 directory below one of the directories mentioned in environment
+variable $MANPATH.
+
+
+ Drives and Disk File Objects
+
+The user of xorriso needs rw-permission for the CD burner device.
+A list of rw-accessible drives can be obtained by
+
+ xorriso -devices
+
+CD devices which offer no rw-permission are invisible to normal users.
+The superuser should be able to see any usable drive and then set the
+permissions as needed.
+
+The output of xorriso -devices might look like
+
+0 -dev '/dev/sr0' rwrw-- : 'TSSTcorp' 'CDDVDW SH-S203B'
+1 -dev '/dev/hda' rwrw-- : 'HL-DT-ST' 'DVD-ROM GDR8162B'
+
+Full and insecure enabling of both for everybody would look like
+ chmod a+rw /dev/sr0 /dev/hda
+This is equivalent to the traditional setup chmod a+x,u+s cdrecord.
+
+I strongly discourage to run xorriso with setuid root or via sudo !
+It is not checked for the necessary degree of hacker safety.
+
+Consider to put all authorized users into group "floppy", to chgrp the
+device file to that group and to disallow w-access to others.
+
+
+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, xorriso can also address disk files as input or
+output drives. The addresses of the disk files have to be preceded by "stdio:".
+Like:
+ xorriso -dev stdio:/tmp/pseudo_drive ...more arguments...
+
+
+ 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
+
+
+ libisoburn
+
+xorriso is based on libisofs which does ISO 9600 filesystem aspects and on
+libburn which does the input and output aspects. Parts of this foundation
+are accessed via libisoburn, which is closely related to xorriso.
+
+libisoburn provides two services:
+- Encapsulation of coordination between libisofs and libburn.
+- Emulation of ISO 9660 multi-session on overwriteable media
+ or random access files.
+
+The sourcecode of all three libraries is included in the xorriso standalone
+tarball. It is compiled with xorriso and linked statically.
+But you may as well get and install releases of libburn and libisofs, in order
+to be able to install a release of libisoburn which produces libisoburn.so.1
+and a matching dynamically linked xorriso binary.
+This binary is leaner but depends on properly installed libraries of suitable
+revision.
+
+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.
+
+Standalone xorriso has less runtime dependencies and can be moved more freely.
+
+
+------------------------------------------------------------------------------
+
+ 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 ,
+ Vreixo Formoso
+ Thomas Schmitt
+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 and
+ Ben Jansens
+Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/changelog.txt b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/changelog.txt
new file mode 100644
index 00000000..e064ef27
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/changelog.txt
@@ -0,0 +1,1906 @@
+------------------------------------------------------------------------------
+ libburnia-project.org libisoburn , xorriso
+------------------------------------------------------------------------------
+
+------------------------------------------------------------------------------
+ Changelog
+------------------------------------------------------------------------------
+
+
+1 Sep 2007 [983]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+libisoburn/isofs_wrap.c
+Initial content of libisoburn
+
+1 Sep 2007 [985]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/isofs_wrap.c
+Should have used copy+paste when writing Vreixos name
+
+5 Sep 2007 [990]
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+Implemented use of stdio-pseudo-drives
+
+5 Sep 2007 [993]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+Changes in plans as discussed up to Sep 5 2007
+
+5 Sep 2007 [994]
+libisoburn/libisoburn.h
+Updated explanations about the usage principles of libisoburn
+
+6 Sep 2007 [998]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+Updated to state of discussion
+
+9 Sep 2007 [1025]
+libisoburn/burn_wrap.c
+New wrapper isoburn_disc_erasable() declares ISO DVD-RAM, DVD+RW erasable
+
+10 Sep 2007 [1027]
+libisoburn/libisoburn.h
+New wrapper isoburn_disc_erasable() declares ISO DVD-RAM, DVD+RW erasable
+
+11 Sep 2007 [1029]
+libisoburn/burn_wrap.c
+libisoburn/isoburn.h
+New inner function isoburn_set_start_byte()
+
+12 Sep 2007 [1031]
+libisoburn/libisoburn.h
+libisoburn/burn_wrap.c
+Removed isoburn_write_opts_set_start_byte()
+
+13 Sep 2007 [1043]
+libisoburn/burn_wrap.c
+Took into respect fabricated_disc_status
+
+21 Sep 2007 [1092]
+Makefile.am
+Removed libburn file addresses
+
+22 Sep 2007 [1093]
++ doc/doxygen.conf.in
+Added file demanded by build system
+
+22 Sep 2007 [1094]
+src/burn_wrap.c
+Prevented SIGSEGV in isoburn_drive_scan_and_grab()
+
+22 Sep 2007 [1095]
+src/burn_wrap.c
+Enabled treatment==2 in isoburn_drive_scan_and_grab()
+
+22 Sep 2007 [1099]
+src/burn_wrap.c
+Made use of burn_msgs_submit() for error messages
+
+23 Sep 2007 [1102]
+src/burn_wrap.c
+Removed all references to isoburn.treatment from burn_wrap.c
+
+23 Sep 2007 [1105]
+src/burn_wrap.c
+Called isoburn_create_data_source() and isoburn_free_data_source()
+
+28 Sep 2007 [1129] libisofs
+libisofs/libiso_msgs.h
+Removed apostrophes which my compiler does not like
+
+29 Sep 2007 [1133]
+src/burn_wrap.c
+Added optional code for a pseudo CD-RW to test the code for MMC multi-session
+
+29 Sep 2007 [1134]
+src/burn_wrap.c
+Released drive in case welcome_media fails
+
+1 Oct 2007 [1141]
+src/burn_wrap.c
+Allowed isoburn_disc_get_msc1() for closed media
+
+2 Oct 2007 [1149]
+test/test.c
+Function graft_point(),some general polishing, call of iso_volset_free disabled
+
+8 Oct 2007 [1169]
+src/libisoburn.h
+src/isoburn.h
+src/isoburn.c
+src/burn_wrap.c
+Introduced fifo reference into isoburn object
+
+8 Oct 2007 [1170]
+test/test.c
+Several directories and files in one session, added display of fifo
+
+12 Oct 2007 [1171]
++ test/xorriso.h
++ test/xorriso.c
++ test/xorriso.txt
+The stub of new application xorriso
+
+12 Oct 2007 [1172]
++ test/compile_xorriso.sh
++ test/make_timestamp.sh
++ test/xorriso_timestamp.h
+A build facility to circumvent autotools during development
+
+12 Oct 2007 [1173]
+test/xorriso.c
+Introduced version and build timestamps, library headers
+
+13 Oct 2007 [1174]
+test/xorriso.c
++ test/changelog.txt
+Made -dialog and -options_from_file work
+
+2007.10.13.141503 [1175]
+test/xorriso.c
+Implemented -speed and enlarged -status list
+
+2007.10.13.152252 [1176]
+test/xorriso.c
+test/xorriso.txt
+Implemented xorriso setter level of -fs, -gid, -uid
+
+2007.10.14.110003 [1177]
+test/xorriso.c
+Implemented setter level of -abort_on, fixed bugs about -f,-no_rc,startup files
+
+2007.10.14.122456 [1178]
+test/xorriso.c
++ test/xorriso_private.h
++ test/xorrisoburn.h
++ test/xorrisoburn.c
+Began to implement interface to our libraries
+
+2007.10.15.152705 [1183]
+test/xorriso.h
+test/xorriso.c
+test/xorriso_private.h
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented -dev, -add, -commit
+
+2007.10.15.160303 [1184]
+test/xorriso.c
+Made -end give up drives
+
+2007.10.15.203554 [1185]
+test/xorriso.c
+Some safety precautions against malicious input, enabled -cdx, -cdi for -add
+
+2007.10.15.203714 [1186]
+test/xorrisoburn.c
+Corrected image path bug with -add of regular files, and -add /=/some/dir
+
+2007.10.15.224005 [1187]
+test/xorriso.c
+test/xorrisoburn.c
+Implemented -rollback
+
+2007.10.16.210911 [1188]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Worked on failure severities, message system, program abort decision
+
+2007.10.17.130041 [1190] [1191
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Worked on failure severities, message system, program abort decision
+
+2007.10.17.130311 [1192]
+src/isofs_wrap.c
+Told burn_read_data() to stay silent on non-existent drive or read error
+
+2007.10.17.150142 [1193]
+test/xorriso.c
+test/xorrisoburn.c
+Reinstated the distinction of message sources, respected '#' in dialog
+
+2007.10.17.165352 [1194]
+test/xorriso.c
+Prepended a "-" to any input line if missing
+
+2007.10.17.183024 [1195]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented core of option -toc
+
+2007.10.17.200241 [1196]
+test/xorrisoburn.c
+Continued work with -toc
+
+2007.10.17.213852 [1197]
+test/compile_xorriso.sh
+Forgot to make off_t 64 bit
+
+2007.10.17.214228 [1198]
+src/libisoburn.h
+src/burn_wrap.c
+test/xorrisoburn.c
+Rounding up fabricated nwa to full 32k addresses, API call for exact image size
+
+2007.10.17.215809 [1199]
+test/xorriso.c
+Activated -ban_stdio_write
+
+2007.10.17.224924 [1200]
+test/xorrisoburn.c
+Fixed obvious bug with -J. (Still wondering wether it works)
+
+2007.10.17.225039 [1201]
+test/xorriso.c
+Fixed bug with -speed.
+
+2007.10.17.225837 [1202]
+test/xorriso.c
+Fixed bug with -prompt. Fixed bug with # comments. (of rev 1194)
+
+18 Oct 2007 [1203]
+test/changelog.txt
+Updated changelog and todo list
+
+2007.10.18.144841 [1205]
+src/isofs_wrap.c
+test/xorrisoburn.c
+isoburn_read_volset() now hands out an official volset reference
+
+2007.10.18.171415 [1206]
+test/xorriso.c
+test/xorriso.txt
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented option -devices
+
+2007.10.18.183200 [1207]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented option -tell_media_space
+
+2007.10.18.185731 [1208]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.c
+Fixed a SIGSEGV with xorriso -version run
+
+2007.10.18.221756 [1211]
+test/xorrisoburn.c
+src/libisoburn.h
+Took care of disposal of burn_disc ovbject
+
+18 Oct 2007 [1212]
+test/test.c
+Silenced compile warning
+
+2007.10.18.225654 [1213]
+src/isofs_wrap.c
+test/xorriso.c
+test/xorrisoburn.c
+Fixed a SIGSEGV with empty drive
+
+2007.10.19.140031 [1218]
+test/xorrisoburn.c
+Made reports with -add normal infos (formerly NOTE events)
+
+2007.10.19.151339 [1219]
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.txt
+Implemented -print-size
+
+2007.10.19.164957 [1220]
+test/xorriso_private.h
+test/xorriso.c
+test/xorriso.h
+test/xorrisoburn.c
+test/xorriso.txt
+Implemented verbosity control by option -report_about
+
+2007.10.19.173547 [1221]
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.txt
+Implemented option -eject
+
+2007.10.19.204155 [1222]
+test/xorriso_private.h
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented option -blank
+
+2007.10.20.170731 [1223]
+src/burn_wrap.c
+Directed write mode failure message to libburn queue, repaired wrote_well
+
+2007.10.20.171046 [1224]
+test/xorrisoburn.c
+test/xorriso_private.h
+test/xorriso.c
+Implemented options -format and -blank deformat, -close and closed media
+
+20 Oct 2007 [1225]
+test/xorriso.txt
++ test/xorriso.1
+test/changelog.txt
+Splitted think text from emerging man page, formatted man page
+
+2007.10.20.194918 [1226]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Completed -tell_media_space, checked space before burn, failed -end exits >0
+
+20 Oct 2007 [1227]
+test/xorriso.1
+Polished man page
+
+2007.10.21.094818 [1228]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented -rm and -rm_r
+
+2007.10.21.105228 [1229]
+src/data_source.c
+Silenced compiler warning about C++ style comment
+
+2007.10.21.124315 [1230]
+test/xorriso.c
+test/xorrisoburn.c
+test/xorrisoburn.h
+Began to implement -ls and -ls_l, enhanced -cdi, not done yet
+
+2007.10.21.151124 [1231]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorrisoburn.h
+Hopefully completed -cd alias -cdi
+
+2007.10.21.185248 [1232]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Hopefully completed -cdx
+
+2007.10.21.213303 [1233]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented sorting of -ls by node name, implemented leaf name search patterns
+
+2007.10.22.211928 [1237]
+test/xorrisoburn.c
+test/xorriso.1
+Implemented file size and mtime for -ls_l
+
+2007.10.23.122349 [1238]
+src/libisoburn.h
+src/isoburn.c
+Added fifo_size to struct isoburn_source_opts
+
+2007.10.23.122753 [1239]
+test/xorrisoburn.c
+test/xorriso.c
+test/xorriso.1
+Made use of isoburn_source_opts.fifo_size
+
+2007.10.24.100156 [1244]
+test/xorriso.c
+test/xorrisoburn.c
+Normalized paths to target and source before adding or removing from image
+
+2007.10.24.105424 [1245]
+test/xorriso.c
+test/xorriso.h
+Implemented option -path-list
+
+2007.10.24.175337 [1247]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Made -cd useable with no image loaded
+
+2007.10.27.224148 [1257]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented option -mv
+
+2007.10.27.230512 [1258]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Bug fixes with option -mv
+
+2007.10.28.125501 [1260]
+test/xorriso.c
+test/xorrisoburn.c
+Prevented some interesting pitfalls with -mv
+
+2007.10.28.165516 [1261]
+test/xorriso.c
+test/xorriso.1
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented option -mkdir
+
+2007.10.28.174550 [1262]
+test/xorriso.c
+Warning of wildcards in paths
+
+28 Oct 2007 [1263]
+test/xorriso.1
+Updated man page about -path-list
+
+2007.10.29.213920 [1273]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Structured patterns for options -ls and -ls_l
+
+2007.10.30.214242 [1274]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+test/compile_xorriso.sh
+Multiple structured patterns, changed option -ls from single to multi args
+
+2007.10.31.103338 [1275]
+test/xorriso_private.h
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented new option -temp_mem_limit
+
+2007.10.31.165413 [1276]
+test/xorriso.c
+test/xorrisoburn.c
+test/xorrisoburn.h
+Gave simple -ls an implemention with minimal memory consumption
+
+31 Oct 2007 [1277]
+test/xorriso.1
+Overhauled info paragraphs of man page
+
+2007.10.31.175916 [1278]
+test/xorriso_private.h
+Overhauled comments in struct XorrisO
+
+31 Oct 2007 [1279]
+test/changelog.txt
+Updating changelog
+
+2007.11.01.111351 [1280]
+test/xorrisoburn.c
+Got rid of bad pacifier text at end of CD writing
+
+2007.11.01.191106 [1281]
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorrisoburn.h
+test/xorriso.1
+Implemented option -du
+
+2007.11.02.143549 [1282]
+test/xorrisoburn.h
+test/xorrisoburn.c
+Clearer status messages after reading new volume and after burning
+
+2007.11.02.143658 [1283]
+test/xorriso.c
+Made -abort_on and -report_about complain with bad severity names
+
+2007.11.02.184705 [1284]
+test/xorrisoburn.c
+test/xorriso.1
+Polished write success message and man page
+
+2007.11.06.163305 [1285]
+test/xorriso_private.h
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented -overwrite control
+
+2007.11.06.163929 [1286]
+src/libisoburn.h
+Corrected a typo in a comment
+
+2007.11.06.164029 [1287]
+src/isoburn.c
+Closed memory leak by freeing session and track in isoburn_prepare_disc_aux()
+
+2007.11.07.123744 [1288]
+test/xorriso_private.h
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented option -reassure
+
+2007.11.07.150157 [1289]
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented option -rmdir
+
+2007.11.07.191915 [1290]
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Implemented option -chmod (does not get written into image, though)
+
+2007.11.07.225624 [1291]
+test/xorriso.c
+test/xorrisoburn.c
+test/xorrisoburn.h
+Implemented options -chown and -chgrp (not written into image, though)
+
+2007.11.08.144451 [1292]
+test/xorriso.c
+test/xorrisoburn.c
+test/xorrisoburn.h
+test/xorriso.1
+Implemented option -alter_date, corrected write problem with mode and ownership
+
+2007.11.08.145016 [1293]
+test/xorriso_private.h
+Forgotten source file for rev 1292
+
+8 Nov 2007 [1294]
+test/xorriso.1
+Enhanced man page text for options -chmod, -chown, -chgrp
+
+2007.11.08.160302 [1295]
+test/xorriso.c
+Fixed bug with -chmod go=r
+
+2007.11.08.161215 [1296]
+test/xorriso.c
+test/xorrisoburn.c
+Enlarged string size limit of Text_shellsafe()
+
+2007.11.09.193142 [1297]
+test/xorriso_private.h
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+New option -iso_rr_pattern, influencing several options with multiple args
+
+2007.11.11.112321 [1298]
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+Gave problem handling finer granularity within loops
+
+11 Nov 2007 [1299]
+test/xorriso.1
+Clarified man page
+
+2007.11.11.154453 [1300]
+test/xorriso.c
+Added missing commit to normal end of program
+
+11 Nov 2007 [1301]
+test/xorriso.1
+Added some examples to man page
+
+2007.11.14.142904 [1302]
+src/libisoburn.h
+src/isofs_wrap.c
+src/isoburn.c
+test/test.c
+New API call isoburn_attach_volset(), changes with isoburn_read_volset()
+
+2007.11.14.143119 [1303]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented options -outdev and -indev
+
+2007.11.14.175446 [1304]
+test/xorriso.c
+Corrected premature abort bug with misspelled command words
+
+14 Nov 2007 [1305]
+test/xorriso.1
+Polished xorriso man page
+
+14 Nov 2007 [1306]
+test/changelog.txt
+Updated xorriso changelog
+
+2007.11.26.192113 [1311]
+test/xorriso.c
+test/xorrisoburn.c
+Reacted on warnings on a 64 bit system
+
+2007.12.04.074340 [1314]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented -disk_pattern, -lsx, ls_lx, -dux, -du_lx
+
+2007.12.04.205919 [1315]
+test/xorrisoburn.c
+test/xorriso_private.h
+test/xorriso.c
+Removed some redundancy of disk_pattern and iso_rr_pattern matching
+
+4 Dec 2007 [1316]
+test/xorriso.1
+Polished man page
+
+2007.12.05.090438 [1317]
+test/xorriso.h
+test/xorriso.c
+test/xorriso.1
+Option -f-off as counterpart of option -f
+
+2007.12.05.143632 [1318]
+test/xorriso.c
+Made dashes at options optional
+
+5 Dec 2007 [1319]
+test/xorriso.1
+Overhauled description of media types, states and expansion methods
+
+2007.12.06.150102 [1320]
+test/xorriso.h
+test/xorriso.c
+test/xorriso.1
+Changed -f, -f-off to -follow, -graft-points, -graf-points-off to -pathspecs
+
+6 Dec 2007 [1321]
+test/xorriso.1
+Removed references to option -graft-points
+
+2007.12.06.192437 [1322]
+test/xorriso.c
+Corrected warning function about wildcards
+
+8 Dec 2007 [1326]
+test/xorriso.1
+Explained result pager
+
+2007.12.08.175117 [1327]
+test/xorriso.c
+test/xorriso_private.h
+test/xorrisoburn.c
+Removed more code redundancies and fd leak with Xorriso_obtain_pattern_files_x()
+
+2007.12.15.162039 [1328]
+test/compile_xorriso.sh
+Added -O0 to -g to get better gdb behavior on my new system
+
+2007.12.15.183022 [1329]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented option -follow
+
+2007.12.16.103456 [1330]
+test/xorriso.c
+test/xorriso.1
+Added link hop limit to option -follow
+
+2007.12.16.122626 [1331]
+test/xorrisoburn.c
+Added copying of attributes from symbolic link into image
+
+2007.12.16.144615 [1332]
+test/xorrisoburn.c
+Removed waste of time in Xorriso_show_du_subs()
+
+2007.12.18.175924 [1333]
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Changed options -ls* to -lsd*, introduced new family of -ls* without d
+
+2007.12.20.111338 [1334]
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Changed -du_s* into -dus*
+
+2007.12.21.131538 [1335]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented option -find alias -findi
+
+2007.12.21.132017 [1336]
+test/xorriso.c
+test/xorriso.1
+Corrected documentation about -find
+
+2007.12.22.143803 [1337]
+test/xorriso.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented option -findx
+
+2007.12.24.161107 [1339]
+test/xorriso.c
+Repaired options -dus and -dusx
+
+24 Dec 2007 [1340]
+test/changelog.txt
+Updated changelog
+
+2007.12.25.160100 [1341]
+test/xorriso.h
+test/xorriso.c
+test/xorriso.1
+Implemented option -cpr
+
+2007.12.26.160040 [1342]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Changed option -J to -joliet "on"|"off", implemented option -volid
+
+2007.12.28.132741 [1343]
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.c
+Made leaner the local memory of recursive functions (because of ulimit -s)
+
+2007.12.30.190138 [1344]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.c
+test/xorriso.1
+Implemented -find option -exec echo, chown, chgrp, chmod, alter_date, lsdl
+
+2007.12.30.203336 [1345]
+test/xorriso.c
+Corrected superuser behavior of Sfile_lookup_permissions()
+
+2007.12.31.095229 [1346]
+test/xorriso.c
+test/xorrisoburn.c
+Repaired some bugs in -find and -findx
+
+2007.12.31.135237 [1347]
+test/xorriso.h
+test/xorriso.c
+test/xorriso.1
+Implemented options -chown_r, -chgrp_r, -chmod_r, -alter_date_r
+
+2007.12.31.135330 [1348]
+test/xorrisoburn.c
+Repaired a bug in -find
+
+2008.01.01.123118 [1349]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+test/xorriso.1
+Implemented -find actions chown_r, chgrp_r, chmod_r, alter_date_r, find
+
+2008.01.02.175011 [1350]
+test/xorriso.c
+test/xorriso.1
+Implemented -find test -type
+
+2008.01.09.175418 [1351]
+test/xorrisoburn.c
+Corrections made during porting to nglibisofs
+
+2008.01.10.114451 [1352]
++ test/ng_xorrisoburn.h
++ test/ng_xorrisoburn.c
+test/compile_xorriso.sh
+Begin of porting to next generation libisofs
+
+2008.01.10.151924 [1353]
+Makefile.am
++ ng_src
++ ng_src/libisoburn.h
++ ng_src/isoburn.h
++ ng_src/isoburn.c
++ ng_src/isofs_wrap.c
++ ng_src/data_source.c
++ ng_src/burn_wrap.c
+Begin of porting to next generation libisofs
+
+2008.01.10.152353 [1354]
+test/ng_xorrisoburn.c
+test/compile_xorriso.sh
+Made compile_xorriso.sh -nglibisofs work on ./ng_src
+
+2008.01.10.154948 [1355]
+test/ng_xorrisoburn.c
+test/compile_xorriso.sh
+Made compile_xorriso.sh -oglibisofs work on ./og_src
+
+2008.01.11.133319 [1356]
+test/compile_xorriso.sh
+Adapted to existence of nglibisofs eltorito.o
+
+2008.01.11.133631 [1357]
+test/xorriso.c
+test/ng_xorrisoburn.c
+test/xorrisoburn.c
+Removed old and new bugs
+
+2008.01.11.174733 [1358]
+test/xorriso.c
+test/ng_xorrisoburn.c
+test/xorrisoburn.c
+Tracing the different behavior of isoburn_read_image()
+
+2008.01.11.175423 [1359]
+test/ng_xorrisoburn.c
+ng_src/isoburn.c
+ng_src/libisoburn.h
+Changed isoburn_source_opts.ouput_charset to output_charset
+
+2008.01.11.212545 [1361]
+ng_src/isofs_wrap.c
+Made initialization of iso_read_opts safer
+
+13 Jan 2008 [1364]
++ og_src
+- src src/burn_wrap.c
+- src/isoburn.c
+- src/isoburn.h
+- src/data_source.c
+- src/isofs_wrap.c
+- src/libisoburn.h
++ og_src/burn_wrap.c
++ og_src/isoburn.c
++ og_src/isoburn.h
++ og_src/data_source.c
++ og_src/isofs_wrap.c
++ og_src/libisoburn.h
+Moved src to og_src and installed symbolic link instead
+
+13 Jan 2008 [1365]
+ng_src/isofs_wrap.c
+Changes about blanking loaded image
+
+2008.01.13.224929 [1366]
+test/ng_xorrisoburn.c
+Allowed all filetypes as input, silenced debug during image read
+
+14 Jan 2008 [1367]
+test/compile_xorriso.sh
+Added forgotten source module
+
+14 Jan 2006 [1368]
+ng_src/libisoburn.h
+ng_src/isoburn.c
+New members in isoburn_source_opts
+
+2008.01.14.163814 [1369]
+test/ng_xorrisoburn.c
+Closed memory leak, adapted to new members in isoburn_source_opts
+
+2008.01.14.164628 [1370]
+test/ng_xorrisoburn.c
+Repaired memory hog and a freshly introduced bug
+
+2008.01.14.190220 [1371]
+test/xorriso.c
+test/ng_xorrisoburn.c
+test/xorriso.1
+Removed some bugs and made adaptions to nglibisofs
+
+2008.01.14.224645 [1372]
+test/xorriso_private.h
+test/xorriso.c
+test/ng_xorrisoburn.h
+test/ng_xorrisoburn.c
+test/xorriso.1
+Made improvements around volume id
+
+2008.01.15.174409 [1373]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/ng_xorrisoburn.h
+test/ng_xorrisoburn.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Made improvements about pattern matching .., closed small memory leaks
+
+2008.01.15.204057 [1374]
+test/xorriso.c
+test/ng_xorrisoburn.h
+test/ng_xorrisoburn.c
+test/xorrisoburn.h
+test/xorrisoburn.c
+Closed a small memory leak
+
+2008.01.15.211511 [1375]
+test/ng_xorrisoburn.c
+Added a forgotten iso_dir_iter_free()
+
+2008.01.16.132909 [1376]
+ng_src/isofs_wrap.c
+Repaired bug about MMC multi-session image loading
+
+2008.01.16.141631 [1378]
+ng_src/isoburn.c
+Changed default name of initial image to ISOIMAGE
+
+16 Jan 2008 [1378]
+libisoburn.pc.in
+Set correct name of library
+
+2008.01.16.200942 [1379]
+test/xorriso.c
+test/ng_xorrisoburn.c
+Adaption to Xorriso_standalonE, some consequences from compiler warnings
+
+16 Jan 2008 [1380]
++ test/make_xorriso_standalone.sh
++ test/xorriso_makefile_am.txt
++ test/configure_ac.txt
++ test/xorriso_pc_in.txt
+A sketch of a xorriso source standalone release generator
+
+16 Jan 2008 [1381]
+test/configure_ac.txt
+test/xorriso_makefile_am.txt
+Added a test for readline.h and eventually enabled use of libreadline
+
+2008.01.17.145135 [1382]
+test/ng_xorrisoburn.c
+Silenced -pedantic compiler warnings about type punning
+
+17 Jan 2008 [1385]
+test/make_xorriso_standalone.sh
+Silenced most compiler warnings of libisofs in xorriso-standalone
+
+17 Jan 2008 [1386]
++ test/README
+Began a README file for xorriso
+
+18 Jan 2008 [1387]
+test/make_xorriso_standalone.sh
+test/README
++ test/xorriso_eng.html
+Worked on documentation
+
+2008.01.18.101933 [1388]
+test/xorriso.c
+Changed -report_about default to "UPDATE"
+
+18 Jan 2008 [1389]
+test/xorriso.1
+test/make_xorriso_standalone.sh
++ test/convert_man_to_html.sh
+Made a generator for HTML man page
+
+2008.01.19.090417 [1390]
+ng_src/libisoburn.h
+ng_src/isoburn.c
+ng_src/isofs_wrap.c
+test/ng_xorrisoburn.c
+test/compile_xorriso.sh
+test/xorriso_makefile_am.txt
+Adaptions to revision 241 of nglibisofs
+
+2008.01.19.090546 [1391]
+test/xorriso.c
+Added startup message. Removed helptext sentence about unimplemented options
+
+19 Jan 2008 [1392]
+test/xorriso_eng.html
+test/make_xorriso_standalone.sh
+Producing a bootstrapped xorriso standalone tarball
+
+19 Jan 2008 [1393]
+test/README
+test/xorriso.1
+test/xorriso_eng.html
+Some polishing of xorriso documentation
+
+2008.01.19.162244 [1394]
+test/xorriso.c
+test/ng_xorrisoburn.c
+Small corrections with version number and write counter report
+
+19 Jan 2008 [1395]
+test/changelog.txt
+Updated SVN copy of changelog
+
+2008.01.20.102946 [1397]
+ng_src/burn_wrap.c
+ng_src/data_source.c
+ng_src/isoburn.c
+ng_src/isofs_wrap.c
+Made forgotten adaption to Xorriso_standalonE
+
+2008.01.20.131050 [1398]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/ng_xorrisoburn.c
+test/xorriso.1
+Made -outdev stdio:/dev/fd/1 safe for single session runs
+
+2008.01.20.200254 [1399]
+test/xorriso.h
+test/xorriso_private.h
+test/xorriso.c
+test/xorriso.1
+New option -add_plainly
+
+2008.01.21.221939 [1400]
+test/xorriso.c
+test/xorriso.1
+Rejected unsuitable addresses "stdio:" , "stdio:/", "stdio:-", "stdio:."
+
+22 Jan 2008 [1401]
++ test/compare_file.c
+Program which compares two files in different trees. Attributes and content.
+
+22 Jan 2008 [1402]
+test/configure_ac.txt
+Copied test for tm.tm_gmtim from libisofs configure.ac
+
+22 Jan 2008 [1403]
+test/compare_file.c
+Prepended type indication letter to report lines
+
+2008.01.22.224321 [1404]
+test/ng_xorrisoburn.c
+Better attributes with directories
+
+2008.01.23.195855 []
+ng_src/burn_wrap.c
+test/ng_xorrisoburn.c
+Adapted to libisofs revision 261
+
+24 Jan 2008 [1410]
+test/make_xorriso_standalone.sh
+Removed remover of C++ comment lines
+
+2008.01.24.202206 [1411]
+ng_src/isoburn.c
+ng_src/burn_wrap.c
+ng_src/isoburn.h
+Gave up use of libburn fifo. Attached -fs and pacifier to libisofs fifo.
+
+2008.01.25.150902 [1413]
+test/xorriso.h
+test/xorriso.c
+test/xorriso.1
+New option -rollback_end
+
+25 Jan 2008 [1414]
+test/compare_file.c
+Fixed bug about file content comparison.
+
+25 Jan 2008 [1415]
+test/compare_file.c
+Better handling of various content difference situations
+
+2008.01.25.175353 [1416]
+test/xorriso.h
+test/xorriso.c
+test/xorriso.1
+test/ng_xorrisoburn.c
+New option -commit_eject
+
+2008.01.26.002011 [1417]
+- og_src/libisoburn.h
+- og_src/isoburn.h
+- og_src/isoburn.c
+- og_src/isofs_wrap.c
+- og_src/burn_wrap.c
+- og_src/data_source.c
+- og_src/
++ libisoburn/
+- ng_src/libisoburn.h
+- ng_src/isoburn.h
+- ng_src/isoburn.c
+- ng_src/isofs_wrap.c
+- ng_src/burn_wrap.c
+- ng_src/data_source.c
++ libisoburn/libisoburn.h
++ libisoburn/isoburn.h
+*+ libisoburn/isoburn.c
+*+ libisoburn/isofs_wrap.c
+*+ libisoburn/burn_wrap.c
+*+ libisoburn/data_source.c
++ xorriso/
+- test/README
+- test/changelog.txt
+- test/compare_file.c
+- test/compile_xorriso.sh
+- test/configure_ac.txt
+- test/convert_man_to_html.sh
+- test/make_timestamp.sh
+- test/make_xorriso_standalone.sh
+- test/ng_xorrisoburn.c
+- test/ng_xorrisoburn.h
+- test/xorriso.1
+- test/xorriso.c
+- test/xorriso.h
+- test/xorriso_eng.html
+- test/xorriso_makefile_am.txt
+- test/xorriso_pc_in.txt
+- test/xorriso_private.h
+- test/xorriso_timestamp.h
+- test/xorrisoburn.c
+- test/xorrisoburn.h
++ xorriso/README
++ xorriso/changelog.txt
++ xorriso/compare_file.c
+*+ xorriso/compile_xorriso.sh
++ xorriso/configure_ac.txt
+*+ xorriso/convert_man_to_html.sh
+*+ xorriso/make_timestamp.sh
+*+ xorriso/make_xorriso_standalone.sh
++ xorriso/xorriso.1
+*+ xorriso/xorriso.c
++ xorriso/xorriso.h
++ xorriso/xorriso_eng.html
++ xorriso/xorriso_makefile_am.txt
++ xorriso/xorriso_pc_in.txt
++ xorriso/xorriso_private.h
++ xorriso/xorriso_timestamp.h
+*+ xorriso/xorrisoburn.c
++ xorriso/xorrisoburn.h
+Makefile.am
+Gave up adapter to old libisofs. Renaming libisoburn and xorriso dirs.
+
+2008.01.26.113604 [1418]
+libisoburn/libisoburn.h
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+INCOMPATIBLE API CHANGE: isoburn_initialize(char msg[1024], int flag)
+
+2008.01.26.120534 [1419]
+libisoburn/libisoburn.h
+configure.ac
+version.h.in
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+Introduced versioning (still pre-release) and new API function isoburn_version()
+
+2008.01.26.140005 [1423]
+xorriso/make_xorriso_standalone.sh
+xorriso/configure_ac.txt
+xorriso/xorriso_eng.html
+Adapted standalone tarball to version functions
+
+2008.01.26.142130 [1424]
+xorriso/xorriso.c
+Set program revision to 0.0.1 (previous 0.1.0 was too early)
+
+2008.01.26.171156 [1425]
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+INCOMPATIBLE API CHANGE: isoburn_prepare_new_image() now gets output drive
+
+2008.01.27.174454 [1434]
+xorriso/xorriso.c
+xorriso/xorriso.1
+Changed meaning of -add relative/path
+
+2008.01.28.105404 [1435]
+xorriso/xorriso.c
+xorriso/xorrisoburn.h
+xorriso/xorrisoburn.c
+Made use of iso_set_abort_severity() with option -abort_on
+
+2008.01.28.140149 [1436]
+libisoburn/libisoburn.h
+Updated API introduction and marked API instabilities for mending (soon)
+
+2008.01.28.171915 [1437]
+libisoburn/isoburn.c
+libisoburn/isofs_wrap.c
+xorriso/xorrisoburn.c
+xorriso/compile_xorriso.sh
+xorriso/make_xorriso_standalone.sh
+Adapted to libisofs revison 294
+
+2008.01.28.235717 [1438]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+xorriso/xorrisoburn.c
+Changed struct isoburn_source_opts to opaque handle struct isoburn_imgen_opts
+
+2008.01.29.125956 [1439]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+xorriso/xorrisoburn.c
+Changed struct isoburn_read_opts to opaque handle
+
+2008.01.29.184356 [1440]
+configure.ac
+version.h.in
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+xorriso/configure_ac.txt
+New API call isoburn_is_compatible()
+
+29 Jan 2008 [1441]
+libisoburn/libisoburn.h
+Some API documentation enhancements
+
+2008.01.29.211543 [1443]
+libisoburn/burn_wrap.c
+Made use of newest libburn version features
+
+2008.01.31.152131 [1449]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/isofs_wrap.c
+xorriso/make_xorriso_standalone.sh
+Adapted to libisofs revision 313
+
+2008.01.31.214647 [1450]
+xorriso/xorrisoburn.h
+libisoburn/libisoburn.h
+libisoburn/burn_wrap.c
+xorriso/make_xorriso_standalone.sh
+Compile time and runtime checks for library compatibility
+
+2008.02.01.195817 [1455]
+configure.ac
+Makefile.am
+- libisoburn.pc.in
++ libisoburn-1.pc.in
+xorriso/README
+Enabled build of dynamically linked xorriso, joined -1.pc club
+
+2008.02.01.200153 [1456]
+xorriso/xorriso_makefile_am.txt
+Corrected some false paths in xorriso-standalone Makefile.am
+
+2008.02.02.131049 [1457]
+configure.ac
+Added version checks for libburn and libisofs (by Vreixo)
+
+2008.02.02.131903 [1458]
+xorriso/xorriso.h
+xorriso/xorriso.c
+Added argument to option -commit_eject
+
+2 Feb 2008 [1459]
+xorriso/xorriso_eng.html
+Updated to current state of development
+
+2008.02.02.181200 [1460]
+xorriso/xorrisoburn.c
+Compile time check of libisoburn. Enforced minimum track size of 300 sectors.
+
+2008.02.03.131525 [1466]
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+libisoburn/isofs_wrap.c
+xorriso/xorrisoburn.c
+Made use of ISO_ERR_SEV() and ISO_ERR_PRIO()
+
+2008.02.03.155704 [1467]
+libisoburn/isofs_wrap.c
+Adapted to libisofs revisio 328
+
+2008.02.03.164038 [1468]
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+xorriso/xorrisoburn.c
+New API call isoburn_cancel_prepared_write()
+
+2008.02.03.164916 [1469]
+xorriso/xorrisoburn.c
+Reacted on compiler warning
+
+2008.02.03.181259 [1470]
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+Made -abort_on and -report_about preemptive if given as dashed start arguments
+
+2008.02.04.093106 [1471]
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+Adapted to libisofs revision 332
+
+2008.02.04.154405 [1472]
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+xorriso/xorrisoburn.c
+New API call isoburn_sync_after_write()
+
+2008.02.04.184038 [1475]
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+libisoburn/isofs_wrap.c
+xorriso/xorrisoburn.c
+Inserted problem messages where libisoburn API produces own failures
+
+2008.02.04.214133 [1476]
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+xorriso/xorrisoburn.c
+Added parameter to new API calls isoburn_cancel_prepared_write, isoburn_sync_after_write
+
+2008.02.05.162621 [1477]
+xorriso/xorriso.h
+xorriso/xorriso_private.h
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+New option -padding
+
+2008.02.05.175733 [1478]
+xorriso/xorriso.h
+xorriso/xorriso.c
+xorriso/xorriso.1
+Implemented reassure for -rollback, -rollback_end, -end, -commit, -commit_eject
+
+2008.02.05.191456 [1479]
+xorriso/xorriso.h
+xorriso/xorriso.c
+xorriso/xorriso.1
+Implemented reassure for -blank, -format, -dev, -indev, -devices
+
+2008.02.06.131028 [1480]
+xorriso/xorriso.c
+xorriso/xorriso_private.h
+xorriso/xorrisoburn.h
+xorriso/xorrisoburn.c
+libisoburn/libisoburn.h
+libisoburn/burn_wrap.c
+Now loading libraries before -version, pacifier for -add
+
+2008.02.06.153709 [1481]
+libisoburn/burn_wrap.c
+xorriso/xorriso.c
+xorriso/xorriso.1
+xorriso/xorrisoburn.c
+Rectified SORRY,FAILURE,FATAL classification
+
+2008.02.06.183423 [1484]
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+Adapted to libisofs revision 337
+
+2008.02.06.183557 [1485]
+xorriso/xorriso.c
+Removed some unused code
+
+2009.02.06.184008 [1486]
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+Added a missing 0 digit
+
+2008.02.06.214426 [1487]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/isofs_wrap.c
+xorriso/xorrisoburn.c
+Pacifier for isoburn_read_image()
+
+2008.02.07.074248 [1489]
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso_private.h
+Added final message to image read pacifier
+
+2008.02.07.154947 [1490]
+libisoburn/data_source.c
+Implemented a primitive single tile cache for image reading
+
+2008.02.07.211424 [1491]
+libisoburn/data_source.c
+Stuffed memory leak with read cache. Economized on error retries.
+
+8 Feb 2008 [1494]
+- xorriso/compare_file.
++ test/compare_file.c
+- ng_src
+Cleaning up remainings of move to ng_src
+
+8 Feb 2008 [1495]
+test/compare_file.c
+Fixed an endless cycle with early EOF
+
+2008.02.08.102122 [1496]
+xorriso/xorriso_makefile_am.txt
+xorriso/make_xorriso_standalone.sh
+xorriso/configure_ac.txt
+xorriso/README
+Added test/compare_file.c to xorriso-standalone tarball
+
+2008.02.08.173928 [1497]
+2008.02.08.174126 [1498]
+libisoburn/data_source.c
+Renamed macro which controls read caching
+
+2008.02.08.175152 [1499]
+xorriso/xorriso_private.h
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+Protecting volume ids from getting overwritten by predecessor
+
+2008.02.08.195627 [1500]
+xorriso/xorriso.c
+Warning of -volid which are not ECMA 119 compliant
+
+2008.02.08.215113 [1501]
+xorriso/xorriso.h
+xorriso/xorriso.c
+Silenced misleading toc messages with -commit_eject "in"
+
+2008.02.09.092805 [1502]
+libisoburn/libisoburn.h
+libisoburn/isoburn.c
+Adapted to libisofs revision 346
+
+2008.02.09.100750 [1503]
+libisoburn/libisoburn.h
+libisoburn/burn_wrap.c
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+New API function isoburn_disc_available_space() fixes bug with DVD+RW capacity
+
+10 Feb 2008 [1504]
+xorriso/README
+Some adjustments in description of compare_file and libisoburn
+
+2008.02.10.122020 [1505]
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+Fixed bugs about -mv /im/age . -cdx / -cpr di/sk im/age -- -cpr di/sk . --
+
+2008.02.10.130852 [1506]
+Makefile.am
+Added build of test/compare_file as noinst binary
+
+2008.02.10.135822 [1507]
+xorriso/xorriso.c
+xorriso/xorrisoburn.h
+xorriso/xorrisoburn.c
+Better handling of not-yet-existing -cd
+
+2008.02.11.094742 [1509]
+xorriso/xorriso_private.h
+xorriso/xorriso.h
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+Discarding, keeping or patching boot images from existing ISO images
+
+2008.02.11.112917 [1510]
+xorriso/xorrisoburn.c
+Corrected message about isolinux patch option
+
+2008.02.11.113235 [1511]
+xorriso/xorriso.h
+xorriso/xorriso.c
+Final UPDATE message after grafting in files from disk
+
+2008.02.11.135418 [1512]
+xorriso/xorriso_private.h
+xorriso/xorriso.h
+xorriso/xorriso.c
+xorriso/xorriso.1
+New option -return_with
+
+2008.02.11.150123 [1513]
+xorriso/xorrisoburn.c
+isoburn_igopt_allow_full_ascii for -bootimage any keep
+
+2008.02.11.150700 [1514]
+xorriso/xorriso.c
+xorriso/xorriso.1
+Clarifications about -volid rules
+
+11 Feb 2008 [1515]
+xorriso/README
+Adjustments about libisoburn and xorriso dynamic dependencies, compare_file
+
+2008.02.11.162406 [1516]
+xorriso/xorrisoburn.c
+xorriso/xorriso.c
+Changed failure to find a file for removal from FAILURE to SORRY
+
+2008.02.11.174517 [1517]
+xorriso/xorriso.c
+Corrected a bug about -status -return_with
+
+2008.02.11.194807 [1519]
+libisoburn/burn_wrap.c
+xorriso/xorriso_private.h
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+New severity MISHAP
+
+2008.02.11.213918 [1520]
+xorriso/xorrisoburn.c
+Mapping in burn runs -abort_on MISHAP to SORRY
+
+2008.02.12.215327 [1521]
+libisoburn/burn_wrap.c
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+Improved MISHAP - SORRY mapping and tunneling
+
+2008.02.14.084342 [1525]
++ README
++ COPYING
++ COPYRIGHT
++ INSTALL
+libisoburn/libisoburn.h
+Completing documentation
+
+2008.02.14.101916 [1526]
+Makefile.am
+Adjusted EXTRA_DIST list of files
+
+2008.02.14.120557 [1527]
+xorriso/xorrisoburn.c
+Made a final abort check before burning begins
+
+2008.02.14.175623 [1528]
+xorriso/xorriso_private.h
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+Imprinting version of xorriso and libraries into ISO preparer_id
+
+2008.02.14.182351 [1529]
+xorriso/xorrisoburn.c
+Made preparer_id more safe against oversize
+
+14 Feb 2008 [1530]
+xorriso/xorriso.1
+Polished man page
+
+14 Feb 2008 [1531]
+xorriso/changelog.txt
+Updated changelog
+
+2008.02.15.100001 [branch 1533]
+configure.ac
+README
+libisoburn/libisoburn.h
+xorriso/README
+xorriso/xorriso_timestamp.h
+xorriso/xorriso_private.h
+xorriso/xorrisoburn.h
+xorriso/xorriso_eng.html
+xorriso/compile_xorriso.sh
+xorriso/make_xorriso_standalone.sh
+xorriso/configure_ac.txt
+Made version number leap to 0.1.0
+
+15 Feb 2008 [branch 1534]
+xorriso/changelog.txt
+Documented initial release and timestamp
+
+15 Feb 2008 [1536]
+configure.ac
+Increased libisofs requirement to 0.6.2
+
+----------------------------- release - xorriso-0.1.0.pl00 - 2008.02.15.100001
+* Operates on an existing ISO image or creates a new one.
+* Copies files from filesystem into the ISO image.
+* Renames or deletes file objects in the ISO image.
+* Changes file properties in the ISO image.
+* Can write result as completely new image to optical media
+ or filesystem objects.
+* Can write result as add-on session to appendable
+ multi-session media, to overwriteable media,
+ to regular files, and to block devices.
+* Scans for optical drives, blanks re-useable optical media.
+* Reads its instructions from command line arguments, dialog, and batch files.
+* Provides navigation commands for interactive ISO image manipulation.
+* Adjustable thresholds for abort, exit value, and problem reporting.
+
+
+2008.02.15.211836 [1537]
+configure.ac
+README
+libisoburn/libisoburn.h
+xorriso/README
+xorriso/xorriso_timestamp.h
+xorriso/xorriso_private.h
+xorriso/xorrisoburn.h
+xorriso/xorriso_eng.html
+xorriso/compile_xorriso.sh
+xorriso/make_xorriso_standalone.sh
+xorriso/configure_ac.txt
+Version leap to 0.1.1
+
+15 Feb 2008 [1538]
+COPYRIGHT
+Corrected according to content of libisofs/COPYRIGHT
+
+2008.02.15.212030 [1539]
+xorriso/xorriso.c
+Changed pacifier text for 0 nodes read from blank image
+
+------------------------------------ cycle - xorriso-0.1.1 - 2008.02.15.212030
+
+15 Feb 2008 [1540]
+xorriso/changelog.txt
+Updated changelog
+
+16 Feb 2008 [1543]
+xorriso/xorriso.1
+Adjusted CREDITS text
+
+2008.02.16.202533 [1544]
+xorriso/xorriso_private.h
+xorriso/xorrisoburn.c
+Transfering properties from disk to implicit directories in image path
+
+2008.02.16.211549 [1545]
+xorriso/xorriso_eng.html
+xorriso/changelog.txt
+Mentioned better directory attribute copying
+
+------------------------------------ cycle - xorriso-0.1.1 - 2008.02.16.211549
+* Improved attribute transfer from disk for implicit target directories
+
+2008.02.18.210343 [1546]
+xorriso/xorriso.c
+Bug fix: -report_about higher than NOTE did not report at all
+
+19 Feb 2008 [1547]
+test/compare_file.c
+Improved report format
+
+2008.02.19.184432 [1548]
+xorriso/xorriso.c
+xorriso/xorrisoburn.h
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+New option -as cdrecord emulates a narrow set of cdrecord gestures
+
+2008.02.19.212322 [1549]
+xorriso/xorriso.c
+xorriso/xorriso_private.h
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+Improved -as cdrecord
+
+20 Feb 2008 [1550]
+test/compare_file.c
+Revoked inflation of file type characters to words
+
+2008.02.20.234726 [1551]
+libisoburn/libisoburn.h
+libisoburn/burn_wrap.c
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+New option -as mkisofs emulates a narrow set of mkisofs gestures
+
+------------------------------------ cycle - xorriso-0.1.1 - 2008.02.21.090014
+* Bug fix: -report_about HINT or higher did not report at all
+* Bug fix: speed=number without unit or media type letter was always CD speed
+* Bug fix: it was possible to write to appendable media which was not -indev
+* New option -as "cdrecord" emulates a narrow set of cdrecord gestures
+* New option -as "mkisofs" emulates a narrow set of mkisofs gestures
+
+2008.02.21.090014 [1552]
+xorriso/xorriso.h
+xorriso/xorriso_private.h
+xorriso/xorriso.c
+xorriso/xorrisoburn.h
+xorriso/xorrisoburn.c
+New option -publisher
+
+2008.02.21.185203 [1553]
+libisoburn/libisoburn.h
+libisoburn/isoburn.h
+libisoburn/isoburn.c
+libisoburn/burn_wrap.c
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+xorriso/xorriso.1
+Implemented a more reasonable solution for drive truncation with regular files
+
+2008.02.21.204613 [1558]
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+Introduced new severity ERRFILE
+
+2008.02.21.211101 [1559]
+xorriso/xorriso.c
+Updated -help text
+
+2008.02.22.114917 [1561]
+libisoburn/burn_wrap.c
+xorriso/xorriso.c
+xorriso/xorrisoburn.c
+Producing ERRFILE messages where appropriate
+
+2008.02.23.101619 [1568]
+libisoburn/libisoburn.h
+Changed libisofs requirements to 0.6.3
+
+2008.02.23.101619 [1569]
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+Testwise implementation of libisofs.0.6.3 features
+
+2008.02.23.101619 [1570]
+xorriso/xorriso_private.h
+xorriso/xorriso.c
+xorriso/xorriso.1
+New option -errfile_log
+
+2008.02.23.102903 [1571]
+xorriso/configure_ac.txt
+Made libisofs version leap in xorriso-standalone
+
+2008.02.23.113902 [1572]
+xorriso/xorriso.h
+xorriso/xorriso.c
+Directed -as mkisofs -print-size to real stdout
+
+2008.02.23.125537 [1573]
+xorriso/xorrisoburn.c
+Various bugs and deviations around -as mkisofs -print-size
+
+2008.02.23.131825 [1574]
+xorriso/xorrisoburn.c
+Wrong description text
+
+2008.02.25.090001 [ZeroOneZero-pl01 1576 1577]
+libisoburn/burn_wrap.c
+xorriso/xorriso_timestamp.h
+Safety cap for ABI usage bug towards libisofs >= 0.6.2
+
+2008.02.25.174229 [1579]
+libisoburn/burn_wrap.c
+xorriso/xorrisoburn.c
+Adapted to libisofs 362 from Vreixo bzr
+
+2008.02.25.204402 [1580]
+xorriso/xorriso.c
+Adaptions of -as mkisofs and -as cdrecord to enable full use by scdbackup
+
+
+------------------------------------ cycle - xorriso-0.1.1 -
+* New option -publisher
+* New option -errfile_log
+
+
+===============================================================================
+ TODO
+===============================================================================
+
+------------------------------------------------- bugs
+
+
+
+------------------------------------------------- important
+
+< xorriso configurable in scdbackup
+
+------------------------------------------------- development
+
+- mkisofs,cdrecord multi session
+
+- -restore
+- -compare_file
+- -update , -update_r
+> Vreixo wrote:
+> public API to access old images, and extract file
+> contents (look at demo/isoread and demo/isocat for
+> usage examples).
+- iso_file_source_open() iso_file_source_read() iso_file_source_close()
+
+
+> Relative addressing and pattern matching :
+ iso_rr_pattern on
+ cd /u/FERTIG
+ lsd nonexist/..
+
+- regularly do valgrind check for memory leaks
+
+- ??? http://scan.coverity.com/faq.html
+
+- ??? curb depth of tree traversal recursion
+
+- make xorrisoburn.c leaner
+
+- eject a not yet aquired device (e.g. after modifying commit)
+
+- -cd[ix] and pattern
+
+- memory curb for image model
+
+??? semicolon as alias of -- ?
+
+> Make transactional the tree deletions meant for replacing
+
+- Introduce an interrupt key for dialog
+
+-------------------------------------------- jump to libburn 0.4.4
+
+- make use of burn_sev_to_text() in libisoburn and xorriso
+
+- If iso_msgs_submit() : use it in isoburn_report_iso_error()
+
+
+===============================================================================
+ This is the dirty end of the todo list.
+ The recent changelog entries are above the headline "TODO".
+===============================================================================
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/compile_xorriso.sh b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/compile_xorriso.sh
new file mode 100755
index 00000000..85732da9
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/compile_xorriso.sh
@@ -0,0 +1,155 @@
+#!/bin/sh
+
+# compile_xorriso.sh
+# Copyright 2005 - 2008 Thomas Schmitt, scdbackup@gmx.net, GPL
+#
+# Not intended for general use in production installations !
+# Rather use: ./bootstrap ; ./configure ; make
+#
+# This is a development tool which expects a special setup of directories.
+# It is to be executed in a common parent of the directories given with
+# $isofs $isoburn $burn $xorr
+
+isofs=./nglibisofs-develop/libisofs
+burn=./libburn-develop/libburn
+isoburn=./libisoburn-develop/libisoburn
+xorr=./libisoburn-develop/xorriso
+
+debug_opts="-O2"
+def_opts=
+largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
+do_strip=0
+static_opts=
+warn_opts="-Wall"
+nglibisofs=1
+
+for i in "$@"
+do
+ if test "$i" = "-do_diet"
+ then
+ def_opts="$def_opts -DXorriso_no_helP"
+ warn_opts=
+ elif test "$i" = "-do_strip"
+ then
+ do_strip=1
+ elif test "$i" = "-g"
+ then
+ debug_opts="-g -O0"
+ elif test "$i" = "-help" -o "$i" = "--help" -o "$i" = "-h"
+ then
+ echo \
+ "$xorr/compile_xorriso.sh : to be executed above top level directories"
+ echo "Options:"
+ echo " -do_diet produce capability reduced lean version."
+ echo " -do_strip apply program strip to compiled programs."
+ echo " -g produce debuggable programm."
+ echo " -static compile with cc option -static."
+ exit 0
+ elif test "$i" = "-static"
+ then
+ static_opts="-static"
+ fi
+done
+
+libisofs=
+libisofs="$libisofs $isofs"/buffer.o
+libisofs="$libisofs $isofs"/builder.o
+libisofs="$libisofs $isofs"/data_source.o
+libisofs="$libisofs $isofs"/ecma119.o
+libisofs="$libisofs $isofs"/ecma119_tree.o
+libisofs="$libisofs $isofs"/eltorito.o
+libisofs="$libisofs $isofs"/filesrc.o
+libisofs="$libisofs $isofs"/fs_image.o
+libisofs="$libisofs $isofs"/fs_local.o
+libisofs="$libisofs $isofs"/fsource.o
+libisofs="$libisofs $isofs"/image.o
+libisofs="$libisofs $isofs"/iso1999.o
+libisofs="$libisofs $isofs"/joliet.o
+libisofs="$libisofs $isofs"/libiso_msgs.o
+libisofs="$libisofs $isofs"/messages.o
+libisofs="$libisofs $isofs"/node.o
+libisofs="$libisofs $isofs"/rockridge.o
+libisofs="$libisofs $isofs"/rockridge_read.o
+libisofs="$libisofs $isofs"/stream.o
+libisofs="$libisofs $isofs"/tree.o
+libisofs="$libisofs $isofs"/util.o
+libisofs="$libisofs $isofs"/util_htable.o
+libisofs="$libisofs $isofs"/util_rbtree.o
+
+timestamp="$(date -u '+%Y.%m.%d.%H%M%S')"
+echo "Version timestamp : $(sed -e 's/#define Xorriso_timestamP "//' -e 's/"$//' "$xorr"/xorriso_timestamp.h)"
+echo "Build timestamp : $timestamp"
+
+echo "compiling program $xorr/xorriso.c $static_opts $debug_opts $def_opts"
+cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \
+ $warn_opts \
+ $static_opts \
+ $debug_opts \
+ $def_opts \
+ $largefile_opts \
+ \
+ -DXorriso_build_timestamP='"'"$timestamp"'"' \
+ \
+ -o "$xorr"/xorriso \
+ \
+ "$xorr"/xorriso.c \
+ \
+ "$xorr"/xorrisoburn.c \
+ \
+ "$burn"/async.o \
+ "$burn"/debug.o \
+ "$burn"/drive.o \
+ "$burn"/file.o \
+ "$burn"/init.o \
+ "$burn"/options.o \
+ "$burn"/source.o \
+ "$burn"/structure.o \
+ \
+ "$burn"/sg.o \
+ "$burn"/write.o \
+ "$burn"/read.o \
+ "$burn"/libdax_audioxtr.o \
+ "$burn"/libdax_msgs.o \
+ "$burn"/cleanup.o \
+ \
+ "$burn"/mmc.o \
+ "$burn"/sbc.o \
+ "$burn"/spc.o \
+ "$burn"/util.o \
+ \
+ "$burn"/sector.o \
+ "$burn"/toc.o \
+ \
+ "$burn"/crc.o \
+ "$burn"/lec.o \
+ \
+ "$isoburn"/isoburn.o \
+ "$isoburn"/burn_wrap.o \
+ "$isoburn"/data_source.o \
+ "$isoburn"/isofs_wrap.o \
+ \
+ $libisofs \
+ \
+ -lreadline \
+ \
+ -lpthread
+
+ ret=$?
+ if test "$ret" = 0
+ then
+ dummy=dummy
+ else
+ echo >&2
+ echo "+++ FATAL : Compilation of xorriso failed" >&2
+ echo >&2
+ exit 1
+ fi
+
+
+if test "$do_strip" = 1
+then
+ echo "stripping result $xorr/xorriso"
+ strip "$xorr"/xorriso
+fi
+
+echo 'done.'
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/configure_ac.txt b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/configure_ac.txt
new file mode 100644
index 00000000..dad879ff
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/configure_ac.txt
@@ -0,0 +1,114 @@
+AC_INIT([xorriso], [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])
+
+BURN_MAJOR_VERSION=0
+BURN_MINOR_VERSION=4
+BURN_MICRO_VERSION=3
+AC_SUBST(BURN_MAJOR_VERSION)
+AC_SUBST(BURN_MINOR_VERSION)
+AC_SUBST(BURN_MICRO_VERSION)
+
+LIBISOFS_MAJOR_VERSION=0
+LIBISOFS_MINOR_VERSION=6
+LIBISOFS_MICRO_VERSION=3
+AC_SUBST(LIBISOFS_MAJOR_VERSION)
+AC_SUBST(LIBISOFS_MINOR_VERSION)
+AC_SUBST(LIBISOFS_MICRO_VERSION)
+
+dnl The API version codes are defined in libisoburn/libisoburn.h
+dnl #define isoburn_header_version_*
+
+
+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()
+
+AC_CHECK_MEMBER([struct tm.tm_gmtoff],
+ [AC_DEFINE(HAVE_TM_GMTOFF, 1,
+ [Define this if tm structure includes a tm_gmtoff entry.])],
+ ,
+ [#include ])
+
+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 ])
+
+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 ])
+
+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 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_CONFIG_FILES([
+ Makefile
+ version.h
+ xorriso.pc
+ ])
+AC_OUTPUT
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/convert_man_to_html.sh b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/convert_man_to_html.sh
new file mode 100755
index 00000000..f73f24aa
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/convert_man_to_html.sh
@@ -0,0 +1,107 @@
+#!/bin/sh
+
+#
+# convert_man_to_html.sh - ts A80118
+#
+# Generates a HTML version of man page xorriso.1
+#
+# To be executed in the libisoburn toplevel directory (eg. ./libisoburn-0.1.0)
+#
+
+# set -x
+
+man_dir=$(pwd)"/xorriso"
+export MANPATH="$man_dir"
+manpage="xorriso"
+raw_html=$(pwd)/"xorriso/raw_man_1_xorriso.html"
+htmlpage=$(pwd)/"xorriso/man_1_xorriso.html"
+
+if test -r "$man_dir"/"$manpage".1
+then
+ dummy=dummy
+else
+ echo "Cannot find readable man page source $1" >&2
+ exit 1
+fi
+
+if test -e "$man_dir"/man1
+then
+ dummy=dummy
+else
+ ln -s . "$man_dir"/man1
+fi
+
+if test "$1" = "-work_as_filter"
+then
+
+# set -x
+
+ sed \
+ -e 's///' \
+ -e 's///' \
+ -e 's/XORRISO<\/title>/man 1 xorriso<\/title>/' \
+ -e 's/
+A CD/DVD recorder suitable for
+http://libburnia-project.org
+(SCSI , ATA , USB , or SATA writers compliant to standard MMC-3 for CD
+and to MMC-5 for DVD).
+
+
+
+
+
Software requirements :
+
+
Linux with kernel 2.4 or higher (and libc, of course) :
+
With kernel 2.4 an ATA drive has to be under ide-scsi emulation.
+
With kernel 2.6 the drive should not be under ide-scsi.
+
libpthread
+
is supposed to be a standard system component.
+
libreadline and libreadline-dev
+
are optional and eventually make dialog more convenient.
+
+
+
+
+
+GPL software included:
+
+
+
libburn-0.4.3
+
reads and writes data from and to CD and DVD.
+
(founded by Derek Foreman and Ben Jansens,
+furthered by team of libburnia-project.org)
+
libisofs-0.6.2
+
operates ISO 9660 images.
+
(By Vreixo Formoso and Mario Danic from team of libburnia-project.org)
+
libisoburn-0.1.0
+
coordinates libburn and libisofs, emulates multi-session where needed.
+
(By Vreixo Formoso and Thomas Schmitt
+from team of libburnia-project.org)
+
+
The source code of this software is independent of
+cdrecord and mkisofs.
+
+
+
+
+This program system has been tested on Intel/AMD Linux systems only.
+For ports to other usable systems contact us.
+
+
+
+
+
+
Special features:
+
+
+ISO 9660 formatter and burner for CD or DVD are fixely integrated.
+
+
+Operates on an existing ISO image or creates a new one.
+
+
+Copies files from filesystem into the ISO image.
+
+
+Renames or deletes file objects in the ISO image.
+
+Changes file properties in the ISO image.
+
+
+Can write result as completely new image to optical media or
+filesystem objects.
+
+
+Can write result as add-on session to appendable multi-session media,
+to overwriteable media, to regular files, and to block devices.
+
+
+Scans for optical drives, blanks re-useable optical media.
+
+Reads its instructions from command line arguments, dialog, and batch files.
+
+
+Provides navigation commands for interactive ISO image manipulation.
+
+
+Adjustable thresholds for abort, exit value, and problem reporting.
+
+
+
+
+
+
+
Command Examples:
+
+
Get an overview of drives and their addresses
+
# xorriso -devices
+
Being superuser avoids permission problems with /dev/srN resp. /dev/hdX .
+
+
Ordinary users should then get granted rw access to the /dev files
+as listed by option -devices.
+
+
+
Options are either performed as program arguments or as dialog input.
+Some options have a parameter list of variable length. This list has to
+be terminated by word '--' or by the end of the input line. Option -add
+may accept pathspecs of form target=source as known from program mkisofs.
+
+
+
+
Get info about a particular drive and loaded media:
Create new ISO-9660 filesystem image, compose content,
+adjust permissions to make it publicly read-only,
+write it to media and immediately eject media without
+previously reloading the written image.
+
+
$ xorriso -outdev /dev/sr0 -blank fast -pathspecs on \
Load the previous session from media,
+remove (i.e. hide) directory /sounds,
+rename /pictures/private/horses,
+add new directory trees /sounds and /movies,
+disallow any access for group and others.
+Finally write as additional session to media and eject:
Merge the various sessions from old readable media into a single session
+on new writeable media,
+cleaning out all invalidated files and session overhead.
+Touch / in order to mark the image as worth to be written.
+
+Important: -indev and -outdev have to be different drives.
+
+
$ xorriso -indev /dev/dvd \
+
-alter_date a +0 / -- \
+
-outdev /dev/sr0 -blank fast \
+
-commit_eject all
+
+
+
+
+
+
Dialog mode accepts one or more options per line. An option and all its
+arguments have to be given in one single line. Command -end stops the program
+run. It will write eventually pending changes to media, if that has not
+already been done by a previous -commit.
Available navigation commands: -cd, -ls, -du, -find
+
enter option and arguments :
+
-commit
+
... perform further commands and finally do:
+
enter option and arguments :
+
-end
+
+
+
+
+
+
In batch mode it is possible to operate xorriso in a pipeline
+with an external consumer of the generated ISO image. Any message
+output will be redirected to stderr in this case.
Maintainers of dynamically linked xorriso please use SVN of
+ libburnia-project.org.
+xorriso is part of libisoburn/trunk and will get built by its "make".
+
Download: svn co http://svn.libburnia-project.org/libburn/trunk libburn
+
+
Install: cd libburn ; ./bootstrap ; ./configure --prefix /usr ; make ; make install
+
+
Download: bzr branch lp:libisofs
+
Install: cd libisofs ; ./bootstrap ; ./configure --prefix /usr ; make ; make install
+
+
Download: svn co http://svn.libburnia-project.org/libisoburn/trunk libisoburn
+
+
Install: cd libisoburn ; ./bootstrap ; ./configure --prefix /usr ; make ; make install
+
+
Build of SVN versions needs
+autotools of at least version 1.7 installed.
+But after the run of ./bootstrap, only
+vanilla tools like make and gcc are needed.
+
+
+
+
+
+
+
+
+
+
+
+Many thanks to Derek Foreman and Ben Jansens for starting libburn.
+
+Very special thanks to Andy Polyakov whose
+dvd+rw-tools
+provide the libburnia project with invaluable examples on how to deal
+with DVD media and how to emulate multi-session on overwriteable media.
+
+Legal statement: This website does not serve any commercial purpose.
+
+
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_makefile_am.txt b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_makefile_am.txt
new file mode 100644
index 00000000..6cdb689b
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_makefile_am.txt
@@ -0,0 +1,189 @@
+pkgconfigdir=$(libdir)/pkgconfig
+libincludedir=
+
+lib_LTLIBRARIES =
+
+## ========================================================================= ##
+
+libinclude_HEADERS =
+
+## ========================================================================= ##
+
+bin_PROGRAMS = \
+ xorriso/xorriso
+
+xorriso_xorriso_CPPFLAGS = -I./libburn -I./libisofs -I./libisoburn -I./xorriso
+
+# No readline in the vanilla version because the necessary headers
+# are in a separate readline-development package.
+xorriso_xorriso_CFLAGS = -DXorriso_standalonE -DXorriso_with_maiN -DXorriso_with_regeX $(READLINE_DEF)
+
+xorriso_xorriso_LDADD = $(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 \
+ \
+ libisoburn/libisoburn.h \
+ libisoburn/isoburn.h \
+ libisoburn/isoburn.c \
+ libisoburn/isofs_wrap.c \
+ libisoburn/burn_wrap.c \
+ libisoburn/data_source.c \
+ \
+ libisofs/builder.h \
+ libisofs/builder.c \
+ libisofs/error.h \
+ libisofs/node.h \
+ libisofs/node.c \
+ libisofs/tree.h \
+ libisofs/tree.c \
+ libisofs/image.h \
+ libisofs/image.c \
+ libisofs/iso1999.h \
+ libisofs/iso1999.c \
+ libisofs/fsource.h \
+ libisofs/fsource.c \
+ libisofs/fs_local.c \
+ libisofs/fs_image.h \
+ 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.c \
+ libisofs/rockridge.h \
+ libisofs/rockridge.c \
+ libisofs/rockridge_read.c \
+ libisofs/joliet.h \
+ libisofs/joliet.c \
+ libisofs/eltorito.h \
+ libisofs/eltorito.c \
+ libisofs/data_source.c \
+ libisofs/find.c \
+ libisofs/filter.h \
+ libisofs/filter.c \
+ libisofs/filters/xor_encrypt.c \
+ \
+ libburn/async.c \
+ libburn/async.h \
+ libburn/back_hacks.h \
+ libburn/cleanup.c \
+ libburn/cleanup.h \
+ libburn/crc.c \
+ libburn/crc.h \
+ libburn/debug.c \
+ libburn/debug.h \
+ libburn/drive.c \
+ libburn/drive.h \
+ libburn/error.h \
+ libburn/file.c \
+ libburn/file.h \
+ libburn/init.c \
+ libburn/init.h \
+ libburn/lec.c \
+ libburn/lec.h \
+ libburn/libburn.h \
+ libburn/libdax_audioxtr.h \
+ libburn/libdax_audioxtr.c \
+ libburn/libdax_msgs.h \
+ libburn/libdax_msgs.c \
+ libburn/mmc.c \
+ libburn/mmc.h \
+ libburn/null.c \
+ libburn/null.h \
+ libburn/options.c \
+ libburn/options.h \
+ libburn/os.h \
+ libburn/read.c \
+ libburn/read.h \
+ libburn/sbc.c \
+ libburn/sbc.h \
+ libburn/sector.c \
+ libburn/sector.h \
+ libburn/sg.c \
+ libburn/sg.h \
+ libburn/source.h \
+ libburn/source.c \
+ libburn/spc.c \
+ libburn/spc.h \
+ libburn/structure.c \
+ libburn/structure.h \
+ libburn/toc.c \
+ libburn/toc.h \
+ libburn/transport.h \
+ libburn/util.c \
+ libburn/util.h \
+ libburn/write.c \
+ libburn/write.h \
+ \
+ version.h
+
+
+noinst_PROGRAMS = \
+ test/compare_file
+
+# A program to compare two trees of files 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
+
+
+## ========================================================================= ##
+
+# Indent source files
+indent_files =
+
+
+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 = \
+ xorriso.pc
+
+man_MANS = xorriso/xorriso.1
+
+EXTRA_DIST = \
+ xorriso.pc.in \
+ version.h.in \
+ README \
+ AUTHORS \
+ CONTRIBUTORS \
+ COPYRIGHT \
+ COPYING \
+ INSTALL \
+ xorriso/changelog.txt \
+ $(man_MANS)
+
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_pc_in.txt b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_pc_in.txt
new file mode 100644
index 00000000..5e35e873
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_pc_in.txt
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: xorriso
+Description: ISO 9660 filesystem image manipulator
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -lpthread
+Cflags:
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_private.h b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_private.h
new file mode 100644
index 00000000..039a7dbc
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_private.h
@@ -0,0 +1,427 @@
+
+/* Command line oriented batch and dialog tool which creates, loads,
+ manipulates and burns ISO 9660 filesystem images.
+
+ Copyright 2007-2008 Thomas Schmitt,
+
+ Provided under GPL version 2.
+
+ This file contains inner declarations of xorriso.
+ The public interface is in xorriso.h
+*/
+
+
+/* For now, #ifdef Xorriso_is_xorriso_selF has no meaning.
+ But it is already now to be set only by the xorriso.c module.
+*/
+
+#ifndef Xorriso_private_includeD
+#define Xorriso_private_includeD yes
+
+#define Xorriso_program_versioN "0.1.1"
+
+/** The source code release timestamp */
+#include "xorriso_timestamp.h"
+#ifndef Xorriso_timestamP
+#define Xorriso_timestamP "-none-given-"
+#endif
+
+/** The binary build timestamp is to be set externally by the compiler */
+#ifndef Xorriso_build_timestamP
+#define Xorriso_build_timestamP "-none-given-"
+#endif
+
+
+/* Because regex_t is mentioned in struct XorrisO */
+#ifdef Xorriso_with_regeX
+#include
+#endif /* Xorriso_with_regeX */
+
+
+#define Smem_malloC malloc
+#define Smem_freE free
+#define SfileadrL 4096
+
+/* <<< ??? */
+typedef int (*Cleanup_app_handler_T)();
+
+struct LinkiteM;
+
+/* maximum number of history lines to be reported with -status:long_history */
+#define Xorriso_status_history_maX 100
+
+/* <<< ??? */
+/* try to catch signals and ignore them during abort handling */
+#define Xorriso_abort_handler_defaulT (1|(2<<4))
+
+
+/** The list of startup file names */
+#define Xorriso_rc_nuM 4
+
+
+struct XorrisO { /* the global context of xorriso */
+
+ int libs_are_started;
+
+ /* source */
+ char progname[SfileadrL];
+ char initial_wdx[SfileadrL];
+ int no_rc;
+
+ /** List of startupfiles */
+ char rc_filenames[Xorriso_rc_nuM][SfileadrL];
+ int rc_filename_count;
+
+ char wdi[SfileadrL];
+ char wdx[SfileadrL];
+ int did_something_useful;
+
+ int add_plainly;
+
+ /* >>> put libisofs aspects here <<< */
+
+ int do_joliet;
+ int do_follow_pattern;
+ int do_follow_param;
+ int do_follow_links;
+ int follow_link_limit;
+ int do_follow_mount;
+ int do_global_uid;
+ uid_t global_uid;
+ int do_global_gid;
+ gid_t global_gid;
+ int do_global_mode;
+ mode_t global_dir_mode;
+ mode_t global_file_mode;
+
+ int do_overwrite; /* 0=off, 1=on, 2=nondir */
+ int do_reassure; /* 0=off, 1=on, 2=tree */
+
+ char volid[33];
+ int volid_default;
+ char loaded_volid[33];
+
+ char publisher[129];
+
+ /* >>> put libburn/isoburn aspects here */
+
+ char indev[SfileadrL];
+ void *in_drive_handle; /* interpreted only by xorrisoburn.c */
+ void *in_volset_handle; /* interpreted only by xorrisoburn.c */
+
+ int volset_change_pending; /* whether -commit would make sense */
+
+ char outdev[SfileadrL];
+ void *out_drive_handle; /* interpreted only by xorrisoburn.c */
+ int dev_fd_1; /* The fd which substitutes for /dev/fd/1 and is
+ connected to externaly perveived stdout.
+ */
+
+ int ban_stdio_write;
+ int do_dummy;
+ int do_close;
+ int speed; /* in libburn units : 1000 bytes/second , 0 = Max, -1 = Min */
+ int fs; /* fifo size in 2048 byte chunks : at most 1 GB */
+ int padding; /* number of bytes to add after ISO 9660 image */
+
+ int keep_boot_image;
+ int patch_isolinux_image;
+
+
+ /* XORRISO options */
+ int allow_graft_points;
+
+ int dialog;
+
+
+ /* Pattern matching facility. It still carries legacy from scdbackup/askme.c
+ but is fully functional for xorriso.
+ */
+ int search_mode;
+ /* 0= start text
+ 1= fgrep ,
+ 2= regular expression
+ 3= (eventually structured) shell parser expression
+ 4= shell parser expression for leaf name
+ */
+
+ int structured_search;
+ /* 0= flat text search
+ 1= '/' is a significant separator that cannot be matched by wildcards
+ ( 2= like 1 : but report only occurence in tree, no payload, no location )
+ ( 3= like 2 : but report first content level of matching directories )
+ 4= actually not structured but unique find mode (with search_mode 4)
+ */
+
+ int do_iso_rr_pattern; /* 0=off, 1=on, 2=ls */
+ int do_disk_pattern; /* 0=off, 1=on, 2=ls */
+
+ int temp_mem_limit;
+
+ int use_stdin; /* use raw stdin even if readline support is compiled */
+ int result_page_length;
+ int result_page_width;
+ char mark_text[SfileadrL]; /* ( stdout+stderr, M: ) */
+ int packet_output;
+ char logfile[4][SfileadrL];
+ int status_history_max; /* for -status long_history */
+
+ char report_about_text[20];
+ int report_about_severity;
+ int library_msg_direct_print;
+ char abort_on_text[20];
+ int abort_on_severity; /* A severity rank number as threshold */
+ int problem_status; /* Severity rank number. 0= no abort condition present */
+ char problem_status_text[20];
+
+ char errfile_log[SfileadrL]; /* for -errfile_log */
+ int errfile_mode; /* bit0= marked */
+ FILE *errfile_fp;
+
+ char return_with_text[20];
+ int return_with_severity;
+ int return_with_value;
+ int eternal_problem_status;
+ char eternal_problem_status_text[20];
+
+ /* temporary search facilities */
+#ifdef Xorriso_with_regeX
+ regex_t *re;
+ regmatch_t match[1];
+#endif /* Xorriso_with_regeX */
+ char **re_constants;
+ int re_count;
+ int re_fill;
+ char reg_expr[2*SfileadrL];
+
+ /* run state */
+ int run_state; /* 0=preparing , 1=writing image */
+ int is_dialog;
+ int bar_is_fresh;
+ char pending_option[SfileadrL]; /* eventual option entered at page prompt */
+ int request_to_abort; /* abort a single operation like -ls, not the program */
+ int request_not_to_ask; /* suppress reassure and pager */
+ double idle_time;
+ int re_failed_at; /* mismatch position with structured_search */
+ int prepended_wd;
+ double insert_count;
+ double insert_bytes;
+ double error_count; /* double will not roll over */
+
+ /* pacifiers */
+ double pacifier_interval;
+ double start_time;
+ double last_update_time;
+ /* optional global counters for brain reduced callback functions */
+ off_t pacifier_count;
+ off_t pacifier_total;
+
+ void *pacifier_fifo;
+
+ int find_compare_result; /* 1=everything matches , 0=mismatch , -1=error */
+
+ /* result (stdout, R: ) */
+ char result_line[5*SfileadrL];
+ int result_line_counter;
+ int result_page_counter;
+ int result_open_line_len;
+
+
+ /* info (stderr, I:) */
+ char info_text[10*SfileadrL];
+
+};
+
+
+int Xorriso_prepare_regex(struct XorrisO *xorriso, char *adr, int flag);
+
+int Xorriso_result(struct XorrisO *xorriso, int flag);
+
+int Xorriso_info(struct XorrisO *xorriso, int flag);
+
+int Xorriso_request_confirmation(struct XorrisO *xorriso, int flag);
+
+int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv,
+ int flag);
+
+int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag);
+
+/* @return 0=match , else no match
+*/
+int Xorriso_regexec(struct XorrisO *xorriso, char *to_match, int *failed_at,
+ int flag);
+
+int Xorriso_prepare_expansion_pattern(struct XorrisO *xorriso, char *pattern,
+ int flag);
+
+int Xorriso__mode_to_perms(mode_t st_mode, char perms[10], int flag);
+
+int Xorriso_much_too_long(struct XorrisO *xorriso, int len, int flag);
+
+int Xorriso_check_temp_mem_limit(struct XorrisO *xorriso, off_t mem, int flag);
+
+int Xorriso_eval_nonmatch(struct XorrisO *xorriso, char *pattern,
+ int *nonconst_mismatches, off_t *mem, int flag);
+
+/* @param flag bit0= a match count !=1 is a SORRY event
+*/
+int Xorriso_check_matchcount(struct XorrisO *xorriso,
+ int count, int nonconst_mismatches, int num_patterns,
+ char **patterns, int flag);
+
+int Xorriso_no_pattern_memory(struct XorrisO *xorriso, off_t mem, int flag);
+
+int Xorriso_alloc_pattern_mem(struct XorrisO *xorriso, off_t mem,
+ int count, char ***filev, int flag);
+
+/* @param flag bit0= count results rather than storing them
+ @return <=0 error , 1 is root (end processing) ,
+ 2 is not root (go on processing)
+*/
+int Xorriso_check_for_root_pattern(struct XorrisO *xorriso,
+ int *filec, char **filev, int count_limit, off_t *mem, int flag);
+
+/* @param flag bit0= prepend wd only if name does not begin by '/'
+ bit2= prepend wd (automatically done if wd[0]!=0)
+*/
+int Xorriso_make_abs_adr(struct XorrisO *xorriso, char *wd, char *name,
+ char adr[], int flag);
+
+/* @param flag bit0= count result rather than storing it
+ bit1= unexpected change of number is a FATAL event
+*/
+int Xorriso_register_matched_adr(struct XorrisO *xorriso,
+ char *adr, int count_limit,
+ int *filec, char **filev, off_t *mem, int flag);
+
+int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag);
+
+/* @param flag bit0= simple readlink(): no normalization, no multi-hop
+*/
+int Xorriso_resolve_link(struct XorrisO *xorriso,
+ char *link_path, char result_path[SfileadrL], int flag);
+
+/* @param flag bit0= for Xorriso_msgs_submit: use pager
+*/
+int Xorriso_hop_link(struct XorrisO *xorriso, char *link_path,
+ struct LinkiteM **link_stack, struct stat *stbuf, int flag);
+
+/* reg_expr should be twice as large as bourne_expr ( + 2 to be exact) */
+/* return: 2= bourne_expr is surely a constant */
+int Xorriso__bourne_to_reg(char bourne_expr[], char reg_expr[], int flag);
+
+int Xorriso_no_malloc_memory(struct XorrisO *xorriso, char **to_free,
+ int flag);
+
+int Xorriso_pacifier_reset(struct XorrisO *xorriso, int flag);
+
+/* This call is to be issued by long running workers in short intervals.
+ It will check whether enough time has elapsed since the last pacifier
+ message and eventually issue an update message.
+ @param what_done A sparse description of the action, preferrably in past
+ tense. E.g. "done" , "files added".
+ @param count The number of objects processed so far.
+ Is ignored if <=0.
+ @param todo The number of objects to be done in total.
+ Is ignored if <=0.
+ @param current_object A string telling the object currently processed.
+ Ignored if "".
+ @param flag bit0= report unconditionally, no time check
+*/
+int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
+ off_t count, off_t todo, char *current_object,
+ int flag);
+
+/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
+ Set to NULL if calling this function from outside ISO world
+ @param flag bit0= update rather than compare
+*/
+int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter,
+ char *iso_path, char *iso_prefix, char *disk_prefix,
+ int flag);
+
+/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
+ Set to NULL if calling this function from outside ISO world
+*/
+int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter,
+ int compare_result, char *disk_path,
+ char *iso_rr_path, int flag);
+
+int Sfile_str(char target[SfileadrL], char *source, int flag);
+
+double Sfile_microtime(int flag);
+
+int Sfile_add_to_path(char path[SfileadrL], char *addon, int flag);
+
+int Sfile_scale(double value, char *result, int siz, double thresh, int flag);
+
+int Sfile_destroy_argv(int *argc, char ***argv, int flag);
+
+/*
+ bit0= do not ignore trailing slash
+ bit1= do not ignore empty components (other than the empty root name)
+*/
+int Sfile_count_components(char *path, int flag);
+
+
+char *Text_shellsafe(char *in_text, char *out_text, int flag);
+
+int Sort_argv(int argc, char **argv, int flag);
+
+struct DirseQ;
+
+int Dirseq_new(struct DirseQ **o, char *adr, int flag);
+
+int Dirseq_destroy(struct DirseQ **o, int flag);
+
+int Dirseq_next_adr(struct DirseQ *o, char reply[SfileadrL], int flag);
+
+
+int Linkitem_reset_stack(struct LinkiteM **o, struct LinkiteM *to, int flag);
+
+
+struct FindjoB;
+
+/* @return 0=no match , 1=match , <0 = error
+*/
+int Findjob_test(struct FindjoB *job, char *name,
+ struct stat *boss_stbuf, struct stat *stbuf,
+ int depth, int flag);
+
+/* @return <0 error, >=0 see xorriso.c struct FindjoB.action
+*/
+int Findjob_get_action(struct FindjoB *o, int flag);
+
+/* @return <0 error, >=0 see xorriso.c struct FindjoB.action
+*/
+int Findjob_get_action_parms(struct FindjoB *o, char **target,
+ uid_t *user, gid_t *group,
+ mode_t *mode_and, mode_t *mode_or,
+ int *type, time_t *date, struct FindjoB **subjob,
+ int flag);
+
+/* @param flag bit0= recursive
+*/
+int Findjob_set_action_target(struct FindjoB *o, int action, char *target,
+ int flag);
+
+/* @param flag bit0= recursive
+*/
+int Findjob_set_action_chgrp(struct FindjoB *o, gid_t group, int flag);
+
+/* @param flag bit0= recursive
+*/
+int Findjob_set_action_chmod(struct FindjoB *o,
+ mode_t mode_and, mode_t mode_or, int flag);
+
+/* @param flag bit0= recursive
+*/
+int Findjob_set_action_ad(struct FindjoB *o, int type, time_t date, int flag);
+
+int Findjob_set_start_path(struct FindjoB *o, char *start_path, int flag);
+
+int Findjob_get_start_path(struct FindjoB *o, char **start_path, int flag);
+
+
+#endif /* Xorriso_private_includeD */
+
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_timestamp.h b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_timestamp.h
new file mode 100644
index 00000000..e53edaad
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorriso_timestamp.h
@@ -0,0 +1 @@
+#define Xorriso_timestamP "2008.03.08.104231"
diff --git a/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorrisoburn.c b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorrisoburn.c
new file mode 100644
index 00000000..545b11a7
--- /dev/null
+++ b/libisoburn/branches/XorrisoZeroOneTwo/xorriso/xorrisoburn.c
@@ -0,0 +1,4745 @@
+
+
+/* Adapter to libisoburn, libisofs and libburn for xorriso,
+ a command line oriented batch and dialog tool which creates, loads,
+ manipulates and burns ISO 9660 filesystem images.
+
+ Copyright 2007-2008 Thomas Schmitt,
+
+ Provided under GPL version 2.
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#define Xorriso_on_libisofs_after_0_6_2 yes
+
+
+/* ------------------------------------------------------------------------ */
+
+#ifndef Xorriso_standalonE
+
+/* The library which does the ISO 9660 / RockRidge manipulations */
+#include
+
+/* The library which does MMC optical drive operations */
+#include
+
+/* The library which enhances overwriteable media with ISO 9660 multi-session
+ capabilities via the method invented by Andy Polyakov for growisofs */
+#include
+
+/* The official xorriso options API. "No shortcuts" */
+#include "xorriso.h"
+
+/* The inner description of XorrisO */
+#include "xorriso_private.h"
+
+/* The inner isofs- and burn-library interface */
+#include "xorrisoburn.h"
+
+#else /* ! Xorriso_standalonE */
+
+#include "../libisofs/libisofs.h"
+#include "../libburn/libburn.h"
+#include "../libisoburn/libisoburn.h"
+#include "xorriso.h"
+#include "xorriso_private.h"
+#include "xorrisoburn.h"
+
+#endif /* Xorriso_standalonE */
+
+
+int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
+ int flag);
+
+int Xorriso__read_pacifier(IsoImage *image, IsoFileSource *filesource);
+
+
+#define LIBISO_ISDIR(node) (iso_node_get_type(node) == LIBISO_DIR)
+#define LIBISO_ISREG(node) (iso_node_get_type(node) == LIBISO_FILE)
+#define LIBISO_ISLNK(node) (iso_node_get_type(node) == LIBISO_SYMLINK)
+#define LIBISO_ISCHR(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \
+ S_ISCHR(iso_node_get_mode(node)))
+#define LIBISO_ISBLK(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \
+ S_ISBLK(iso_node_get_mode(node)))
+#define LIBISO_ISFIFO(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \
+ S_ISFIFO(iso_node_get_mode(node)))
+#define LIBISO_ISSOCK(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \
+ S_ISSOCK(iso_node_get_mode(node)))
+
+/* CD specs say one shall not write tracks < 600 kiB */
+#define Xorriso_cd_min_track_sizE 300
+
+
+/* ------------------------------------------------------------------------ */
+
+
+int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag)
+{
+ int ret, major, minor, micro;
+ char *handler_prefix= NULL;
+ char *queue_sev, *print_sev, reason[1024];
+
+
+/* First an ugly compile time check for header version compatibility.
+ If everthing matches, then no C code is produced. In case of mismatch,
+ intentionally faulty C code will be inserted.
+*/
+
+/* The minimum requirement of xorriso towards the libisoburn header
+ at compile time is defined in xorriso/xorrisoburn.h
+ xorriso_libisoburn_req_major
+ xorriso_libisoburn_req_minor
+ xorriso_libisoburn_req_micro
+ It gets compared against the version macros in libburn/libburn.h :
+ isoburn_header_version_major
+ isoburn_header_version_minor
+ isoburn_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: 'LIBISOBURN_MISCONFIGURATION' undeclared (first use in this function)
+ error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisoburn_dot_h_TOO_OLD__SEE_xorrisoburn_dot_c' undeclared (first use in this function)
+ error: 'LIBISOBURN_MISCONFIGURATION_' undeclared (first use in this function)
+*/
+/* The indendation is an advise of man gcc to help old compilers ignoring */
+ #if xorriso_libisoburn_req_major > isoburn_header_version_major
+ #define Isoburn_libisoburn_dot_h_too_olD 1
+ #endif
+ #if xorriso_libisoburn_req_major == isoburn_header_version_major && xorriso_libisoburn_req_minor > isoburn_header_version_minor
+ #define Isoburn_libisoburn_dot_h_too_olD 1
+ #endif
+ #if xorriso_libisoburn_req_minor == isoburn_header_version_minor && xorriso_libisoburn_req_micro > isoburn_header_version_micro
+ #define Isoburn_libisoburn_dot_h_too_olD 1
+ #endif
+
+#ifdef Isoburn_libisoburn_dot_h_too_olD
+LIBISOBURN_MISCONFIGURATION = 0;
+INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisoburn_dot_h_TOO_OLD__SEE_xorrisoburn_dot_c = 0;
+LIBISOBURN_MISCONFIGURATION_ = 0;
+#endif
+
+/* End of ugly compile time test (scroll up for explanation) */
+
+
+ sprintf(xorriso->info_text, "Starting up libraries ...\n");
+ Xorriso_info(xorriso, 0);
+
+ handler_prefix= calloc(strlen(xorriso->progname)+3+1, 1);
+ if(handler_prefix==NULL) {
+ sprintf(xorriso->info_text,
+ "Cannot allocate memory for initializing libraries");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+ reason[0]= 0;
+ ret= isoburn_initialize(reason, 0);
+ if(ret==0) {
+ sprintf(xorriso->info_text, "Cannot initialize libraries");
+ if(reason[0])
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ ". Reason given:\n%s", reason);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ free(handler_prefix);
+ return(0);
+ }
+ ret= isoburn_is_compatible(isoburn_header_version_major,
+ isoburn_header_version_minor,
+ isoburn_header_version_micro, 0);
+ if(ret<=0) {
+ isoburn_version(&major, &minor, µ);
+ sprintf(xorriso->info_text,
+ "libisoburn version too old: %d.%d.%d . Need at least: %d.%d.%d .\n",
+ major, minor, micro,
+ isoburn_header_version_major, isoburn_header_version_minor,
+ isoburn_header_version_micro);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+
+ xorriso->libs_are_started= 1;
+
+ queue_sev= "ALL";
+ if(xorriso->library_msg_direct_print) {
+
+ /* >>> need option for controlling this in XorrisO.
+ See also Xorriso_msgs_submit */;
+
+ print_sev= xorriso->report_about_text;
+ } else
+ print_sev= "NEVER";
+
+ iso_set_msgs_severities(queue_sev, print_sev, "libsofs : ");
+ burn_msgs_set_severities(queue_sev, print_sev, "libburn : ");
+
+ /* ??? >>> do we want united queues ? */
+ /* burn_set_messenger(iso_get_messenger()); */
+
+ sprintf(handler_prefix, "%s : ", xorriso->progname);
+ burn_set_signal_handling(handler_prefix, NULL, 0);
+
+ Xorriso_process_msg_queues(xorriso,0);
+ if(reason[0]) {
+ sprintf(xorriso->info_text, "%s", reason);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+ }
+
+ sprintf(xorriso->info_text, "Library startup done.\n");
+ Xorriso_info(xorriso, 0);
+ free(handler_prefix);
+ return(1);
+}
+
+
+/* @param flag bit0= global shutdown of libraries */
+int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag)
+{
+ Xorriso_give_up_drive(xorriso, 3);
+ if(xorriso->in_volset_handle!=NULL) { /* standalone image */
+ iso_image_unref((IsoImage *) xorriso->in_volset_handle);
+ xorriso->in_volset_handle= NULL;
+ }
+ if(flag&1) {
+ if(xorriso->libs_are_started==0)
+ return(0);
+ isoburn_finish();
+ }
+ return(1);
+}
+
+
+/* @param flag bit1= obtain outdrive, else indrive */
+int Xorriso_get_drive_handles(struct XorrisO *xorriso,
+ struct burn_drive_info **dinfo,
+ struct burn_drive **drive,
+ char *attempt, int flag)
+{
+ if(flag&2)
+ *dinfo= (struct burn_drive_info *) xorriso->out_drive_handle;
+ else
+ *dinfo= (struct burn_drive_info *) xorriso->in_drive_handle;
+ if(*dinfo==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text, "No %s drive aquired %s",
+ (flag&2 ? "output" : "input"), attempt);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ *drive= (*dinfo)[0].drive;
+ return((*drive)!=NULL);
+}
+
+
+/* >>> todo: throw out the copies of libdax_msgs entrails */
+
+/* <<< to be replaced by libburn-0.4.3 API call burn_sev_to_text().
+ This is a copy of libdax_msgs__sev_to_text() which is not exposed
+ by the API of of libburn-0.4.2 . As soon as xorriso gets based on
+ libburn-0.4.4 this redundancy is to be removed.
+ It is safe, nevertheless, because the severity codes are eternal.
+*/
+#define LIBDAX_MSGS_SEV_ALL 0x00000000
+#define LIBDAX_MSGS_SEV_ERRFILE 0x08000000
+#define LIBDAX_MSGS_SEV_DEBUG 0x10000000
+#define LIBDAX_MSGS_SEV_UPDATE 0x20000000
+#define LIBDAX_MSGS_SEV_NOTE 0x30000000
+#define LIBDAX_MSGS_SEV_HINT 0x40000000
+#define LIBDAX_MSGS_SEV_WARNING 0x50000000
+#define LIBDAX_MSGS_SEV_SORRY 0x60000000
+#define LIBDAX_MSGS_SEV_MISHAP 0x64000000
+#define LIBDAX_MSGS_SEV_FAILURE 0x68000000
+#define LIBDAX_MSGS_SEV_FATAL 0x70000000
+#define LIBDAX_MSGS_SEV_ABORT 0x71000000
+#define LIBDAX_MSGS_SEV_NEVER 0x7fffffff
+
+
+int Xorriso__sev_to_text(int severity, char **severity_name,
+ int flag)
+{
+#ifdef Xorriso_on_libisofs_after_0_6_2
+ int ret;
+#else
+#ifdef Xorriso_on_libburn_after_0_4_2
+ int ret;
+#endif
+#endif
+
+#ifdef Xorriso_on_libisofs_after_0_6_2
+ ret= iso_sev_to_text(severity, severity_name);
+ if(ret>0)
+ return(ret);
+#endif /* Xorriso_on_libisofs_after_0_6_2 */
+#ifdef Xorriso_on_libburn_after_0_4_2
+ ret= burn_sev_to_text(severity, severity_name, 0);
+ if(ret>0)
+ return(ret);
+#endif
+
+ if(flag&1) {
+ *severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nALL";
+ return(1);
+ }
+ *severity_name= "";
+ if(severity>=LIBDAX_MSGS_SEV_NEVER)
+ *severity_name= "NEVER";
+ else if(severity>=LIBDAX_MSGS_SEV_ABORT)
+ *severity_name= "ABORT";
+ else if(severity>=LIBDAX_MSGS_SEV_FATAL)
+ *severity_name= "FATAL";
+ else if(severity>=LIBDAX_MSGS_SEV_FAILURE)
+ *severity_name= "FAILURE";
+ else if(severity>=LIBDAX_MSGS_SEV_MISHAP)
+ *severity_name= "MISHAP";
+ else if(severity>=LIBDAX_MSGS_SEV_SORRY)
+ *severity_name= "SORRY";
+ else if(severity>=LIBDAX_MSGS_SEV_WARNING)
+ *severity_name= "WARNING";
+ else if(severity>=LIBDAX_MSGS_SEV_HINT)
+ *severity_name= "HINT";
+ else if(severity>=LIBDAX_MSGS_SEV_NOTE)
+ *severity_name= "NOTE";
+ else if(severity>=LIBDAX_MSGS_SEV_UPDATE)
+ *severity_name= "UPDATE";
+ else if(severity>=LIBDAX_MSGS_SEV_DEBUG)
+ *severity_name= "DEBUG";
+ else if(severity>=LIBDAX_MSGS_SEV_ERRFILE)
+ *severity_name= "ERRFILE";
+ else if(severity>=LIBDAX_MSGS_SEV_ALL)
+ *severity_name= "ALL";
+ else {
+ *severity_name= "";
+ return(0);
+ }
+ return(1);
+}
+
+
+int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
+{
+ int ret= 1;
+
+#ifdef Xorriso_on_libisofs_after_0_6_2
+ ret= iso_text_to_sev(severity_name, severity_number);
+ if(ret>0)
+ return(ret);
+#endif /* Xorriso_on_libisofs_after_0_6_2 */
+
+#ifndef Xorriso_on_libburn_after_0_4_2
+ if(severity_name[0]==0)
+ *severity_number= 0;
+ else if(strcmp(severity_name, "MISHAP")==0)
+ *severity_number= LIBDAX_MSGS_SEV_MISHAP;
+ else if(strcmp(severity_name, "ERRFILE")==0)
+ *severity_number= LIBDAX_MSGS_SEV_ERRFILE;
+ else
+#endif /* ! Xorriso_on_libburn_after_0_4_2 */
+
+ ret= burn_text_to_sev(severity_name, severity_number, 0);
+ return(ret);
+}
+
+
+/* @param flag bit0= report libisofs error text
+ bit1= victim is disk_path
+*/
+int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
+ int iso_error_code, char msg_text[], int os_errno,
+ char min_severity[], int flag)
+{
+ int error_code, iso_sev, min_sev, ret;
+ char *sev_text_pt, *msg_text_pt= NULL;
+ char sfe[6*SfileadrL];
+ static int sorry_sev= -1;
+
+ if(sorry_sev<0)
+ Xorriso__text_to_sev("SORRY", &sorry_sev, 0);
+
+ error_code= iso_error_get_code(iso_error_code);
+ if(error_code < 0x00030000 || error_code >= 0x00040000)
+ error_code= (error_code & 0xffff) | 0x00050000;
+
+ if(flag&1)
+ msg_text_pt= (char *) iso_error_to_msg(iso_error_code);
+ if(msg_text_pt==NULL)
+ msg_text_pt= msg_text;
+ iso_sev= iso_error_get_severity(iso_error_code);
+
+ if(iso_sev >= sorry_sev && (flag & 2) && victim[0])
+ Xorriso_msgs_submit(xorriso, 0, victim, 0, "ERRFILE", 0);
+ sev_text_pt= min_severity;
+ Xorriso__text_to_sev(min_severity, &min_sev, 0);
+ if(min_sev < iso_sev)
+ Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0);
+ strcpy(sfe, msg_text_pt);
+ if(victim[0]) {
+ strcat(sfe, ": ");
+ Text_shellsafe(victim, sfe+strlen(sfe), 0);
+ }
+ ret= Xorriso_msgs_submit(xorriso, error_code, sfe, os_errno, sev_text_pt, 4);
+ return(ret);
+}
+
+
+/* @param flag bit0= suppress messages below UPDATE
+ bit1= suppress messages below FAILURE
+*/
+int Xorriso_set_image_severities(struct XorrisO *xorriso, int flag)
+{
+ char *queue_sev, *print_sev;
+
+ if(flag&2)
+ queue_sev= "FAILURE";
+ else if(flag&1)
+ queue_sev= "UPDATE";
+ else
+ queue_sev= "ALL";
+ if(xorriso->library_msg_direct_print)
+ print_sev= xorriso->report_about_text;
+ else
+ print_sev= "NEVER";
+ iso_set_msgs_severities(queue_sev, print_sev, "libisofs : ");
+ return(1);
+}
+
+
+int Xorriso_update_volid(struct XorrisO *xorriso, int flag)
+{
+ int gret, sret= 1;
+
+ gret= Xorriso_get_volid(xorriso, xorriso->loaded_volid, 0);
+ if(gret<=0 || (!xorriso->volid_default) || xorriso->loaded_volid[0]==0)
+ sret= Xorriso_set_volid(xorriso, xorriso->volid, 1);
+ return(gret>0 && sret>0);
+}
+
+
+int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
+{
+ int ret;
+ IsoImage *volset;
+ struct isoburn_read_opts *ropts;
+ struct burn_drive_info *dinfo= NULL;
+ struct burn_drive *drive= NULL;
+
+ if(xorriso->out_drive_handle != NULL) {
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to attach volset to drive", 2);
+ if(ret<=0)
+ return(ret);
+ }
+ if(xorriso->in_volset_handle!=NULL) {
+ iso_image_unref((IsoImage *) xorriso->in_volset_handle);
+ xorriso->in_volset_handle= NULL;
+ xorriso->loaded_volid[0]= 0;
+ xorriso->volset_change_pending= 0;
+ }
+
+ ret= isoburn_ropt_new(&ropts, 0);
+ if(ret<=0)
+ return(ret);
+ /* Note: no return before isoburn_ropt_destroy() */
+ isoburn_ropt_set_extensions(ropts, isoburn_ropt_pretend_blank);
+ isoburn_ropt_set_input_charset(ropts, NULL);
+ isoburn_set_read_pacifier(drive, NULL, NULL);
+ ret= isoburn_read_image(drive, ropts, &volset);
+ Xorriso_process_msg_queues(xorriso,0);
+ isoburn_ropt_destroy(&ropts, 0);
+ if(ret<=0) {
+ sprintf(xorriso->info_text, "Failed to create new empty ISO image object");
+ Xorriso_report_iso_error(xorriso, "", ret, xorriso->info_text, 0, "FATAL",
+ 0);
+ return(-1);
+ }
+ xorriso->in_volset_handle= (void *) volset;
+ Xorriso_update_volid(xorriso, 0);
+ xorriso->volset_change_pending= 0;
+ return(1);
+}
+
+
+/* @param flag bit0= aquire as isoburn input drive
+ bit1= aquire as libburn output drive (as isoburn drive if bit0)
+ bit2= regard overwriteable media as blank
+ bit3= if the drive is a regular disk file: truncate it to
+ the write start address
+ @return <=0 failure , 1= ok
+ 2=success, but not writeable with bit1
+ 3=success, but not blank and not ISO with bit0
+*/
+int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
+{
+ int ret, hret, not_writeable= 0, has_what;
+ uint32_t size;
+ struct burn_drive_info *dinfo= NULL, *out_dinfo, *in_dinfo;
+ struct burn_drive *drive, *out_drive, *in_drive;
+ enum burn_disc_status state;
+ IsoImage *volset = NULL;
+ struct isoburn_read_opts *ropts= NULL;
+ char adr_data[SfileadrL], *libburn_adr, *boot_fate;
+
+ if((flag&3)==0) {
+ sprintf(xorriso->info_text,
+ "XORRISOBURN program error : Xorriso_aquire_drive bit0+bit1 not set");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+ ret= Xorriso_give_up_drive(xorriso, (flag&3)|8);
+ if(ret<=0)
+ return(ret);
+
+ libburn_adr= adr;
+ if(strcmp(adr,"stdio:/dev/fd/1")==0) {
+ if(xorriso->dev_fd_1<0) {
+ sprintf(xorriso->info_text,
+ "-*dev \"stdio:/dev/fd/1\" was not a start argument. Cannot use it now.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ {ret= 0; goto ex;}
+ } else {
+ sprintf(adr_data, "stdio:/dev/fd/%d", xorriso->dev_fd_1);
+ libburn_adr= adr_data;
+ }
+ }
+
+ if((flag&3)==1 && xorriso->out_drive_handle!=NULL) {
+ ret= Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive,
+ "on attempt to compare new indev with outdev", 2);
+ if(ret<=0)
+ goto ex;
+ ret= burn_drive_equals_adr(out_drive, libburn_adr, 1);
+ if(ret==1)
+ dinfo= out_dinfo;
+ } else if((flag&3)==2 && xorriso->in_drive_handle!=NULL) {
+ ret= Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive,
+ "on attempt to compare new indev with outdev", 0);
+ if(ret<=0)
+ goto ex;
+ ret= burn_drive_equals_adr(in_drive, libburn_adr, 1);
+ if(ret==1)
+ dinfo= in_dinfo;
+ }
+
+ if(dinfo==NULL) {
+ ret= isoburn_drive_aquire(&dinfo, libburn_adr, 1|((flag&(8|4))>>1));
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<=0) {
+ sprintf(xorriso->info_text,"Cannot aquire drive '%s'", adr);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ }
+ drive= dinfo[0].drive;
+ state= isoburn_disc_get_status(drive);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(flag&1) {
+ volset= isoburn_get_attached_image(drive);
+ if(volset != NULL) { /* The image object is already created */
+ iso_image_unref(volset);
+ }
+ }
+
+ if(flag&2) {
+ xorriso->out_drive_handle= dinfo;
+ if(Sfile_str(xorriso->outdev, adr, 0)<=0)
+ {ret= -1; goto ex;}
+ if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) {
+ sprintf(xorriso->info_text, "Disc status unsuitable for writing");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
+ not_writeable= 1;
+ }
+ }
+ if(flag&1) {
+ xorriso->in_drive_handle= dinfo;
+ if(Sfile_str(xorriso->indev, adr, 0)<=0)
+ {ret= -1; goto ex;}
+ } else if(flag&2) {
+ if(xorriso->in_volset_handle==NULL) {
+ /* No volume loaded: create empty one */
+ ret= Xorriso_create_empty_iso(xorriso, 0);
+ if(ret<=0)
+ goto ex;
+ } else {
+ iso_image_ref((IsoImage *) xorriso->in_volset_handle);
+ ret= isoburn_attach_image(drive, (IsoImage *) xorriso->in_volset_handle);
+ if(ret<=0) {
+ sprintf(xorriso->info_text,
+ "Failed to attach ISO image object to outdev");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ {ret= -1; goto ex;}
+ }
+ }
+ Xorriso_toc(xorriso, 1|2);
+ {ret= 1+not_writeable; goto ex;}
+ }
+
+ if(xorriso->in_volset_handle!=NULL)
+ iso_image_unref((IsoImage *) xorriso->in_volset_handle);
+ xorriso->in_volset_handle= NULL;
+
+ /* check for invalid state */
+ if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE &&
+ state != BURN_DISC_FULL) {
+ sprintf(xorriso->info_text,
+ "Disc status not blank and unsuitable for reading");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
+ {ret= 0; goto ex;}
+ }
+ /* fill read opts */
+ ret= isoburn_ropt_new(&ropts, 0);
+ if(ret<=0)
+ goto ex;
+ isoburn_ropt_set_extensions(ropts, isoburn_ropt_noiso1999);
+ isoburn_ropt_set_default_perms(ropts, (uid_t) 0, (gid_t) 0, (mode_t) 0555);
+ isoburn_ropt_set_input_charset(ropts, NULL);
+
+ Xorriso_set_image_severities(xorriso, 1); /* No DEBUG messages */
+ Xorriso_pacifier_reset(xorriso, 0);
+ isoburn_set_read_pacifier(drive, Xorriso__read_pacifier, (void *) xorriso);
+ if(isoburn_read_image(drive, ropts, &volset) <= 0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_set_image_severities(xorriso, 0);
+ sprintf(xorriso->info_text,"Cannot read ISO image volset");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 3; goto ex;
+ }
+ Xorriso_pacifier_callback(xorriso, "nodes read", xorriso->pacifier_count, 0,
+ "", 1); /* report end count */
+ xorriso->in_volset_handle= (void *) volset;
+ Xorriso_set_image_severities(xorriso, 0);
+ Xorriso_update_volid(xorriso, 0);
+
+ if(xorriso->out_drive_handle != NULL &&
+ xorriso->out_drive_handle != xorriso->in_drive_handle) {
+ ret= Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive,
+ "on attempt to attach ISO image volset to outdev", 2);
+ if(ret<=0)
+ goto ex;
+ iso_image_ref((IsoImage *) xorriso->in_volset_handle);
+ isoburn_attach_image(out_drive, xorriso->in_volset_handle);
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ isoburn_ropt_get_size_what(ropts, &size, &has_what);
+ if(has_what & isoburn_ropt_has_el_torito) {
+ if(xorriso->patch_isolinux_image)
+ boot_fate= "patched as isolinux image";
+ else if(xorriso->keep_boot_image)
+ boot_fate= "kept unchanged";
+ else
+ boot_fate= "discarded";
+ sprintf(xorriso->info_text,
+ "Detected El-Torito boot information which currently is set to be %s",
+ boot_fate);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ }
+
+ Xorriso_toc(xorriso, 1);
+ if(xorriso->loaded_volid[0]!=0) {
+ sprintf(xorriso->result_line,"Volume id : '%s'\n",xorriso->loaded_volid);
+ Xorriso_result(xorriso,0);
+ if(strcmp(xorriso->loaded_volid, xorriso->volid)!=0 &&
+ !xorriso->volid_default) {
+ sprintf(xorriso->result_line, "New volume id: '%s'\n", xorriso->volid);
+ Xorriso_result(xorriso,0);
+ }
+ }
+ ret= 1+not_writeable;
+ex:
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<=0) {
+ hret= Xorriso_give_up_drive(xorriso, flag&3);
+ if(hretin_drive_handle == xorriso->out_drive_handle);
+ if((flag&4) && in_is_out_too && (flag&(1|2))) {
+ if((flag&3)!=3) {
+ sprintf(xorriso->info_text,"Giving up for -eject whole -dev %s",
+ Text_shellsafe(xorriso->indev, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ }
+ flag|= 3; /* give up in/out drive to eject it */
+ }
+
+ if((flag&1) && xorriso->in_drive_handle != NULL) {
+ Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to give up drive", 0);
+
+ if(!in_is_out_too) {
+ if(drive!=NULL && !in_is_out_too)
+ isoburn_drive_release(drive,!!(flag&4));
+ if(dinfo!=NULL && !in_is_out_too)
+ burn_drive_info_free(dinfo);
+ }
+ xorriso->in_drive_handle= NULL;
+ xorriso->indev[0]= 0;
+
+ if(xorriso->in_volset_handle!=NULL)
+ iso_image_unref((IsoImage *) xorriso->in_volset_handle);
+ xorriso->in_volset_handle= NULL;
+ xorriso->loaded_volid[0]= 0;
+ xorriso->volset_change_pending= 0;
+
+ in_is_out_too= 0;
+ }
+ if((flag&2) && xorriso->out_drive_handle!=NULL) {
+ Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to give up drive", 2);
+ if(!in_is_out_too) {
+ if(drive!=NULL)
+ isoburn_drive_release(drive,!!(flag&4));
+ if(dinfo!=NULL)
+ burn_drive_info_free(dinfo);
+ }
+ xorriso->out_drive_handle= NULL;
+ xorriso->outdev[0]= 0;
+ } else if((flag&1) && xorriso->out_drive_handle!=NULL) {
+ ret= Xorriso_create_empty_iso(xorriso, 0);
+ if(ret<=0)
+ return(ret);
+ if(!(flag&8)) {
+ sprintf(xorriso->info_text,
+ "Only the output drive remains. Created empty ISO image.\n");
+ Xorriso_info(xorriso, 0);
+ Xorriso_toc(xorriso, 1|2);
+ }
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+int Xorriso_make_write_options(
+ struct XorrisO *xorriso, struct burn_drive *drive,
+ struct burn_write_opts **burn_options, int flag)
+{
+ int drive_role;
+
+ *burn_options= burn_write_opts_new(drive);
+ if(*burn_options==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Cannot allocate option set");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ burn_write_opts_set_simulate(*burn_options, !!xorriso->do_dummy);
+ drive_role= burn_drive_get_drive_role(drive);
+ burn_write_opts_set_multi(*burn_options,
+ !(xorriso->do_close || drive_role==0 || drive_role==3));
+ burn_drive_set_speed(drive, xorriso->speed, xorriso->speed);
+ burn_write_opts_set_underrun_proof(*burn_options, 1);
+ return(1);
+}
+
+
+/* @param flag bit0= do not write but only prepare and return size in sectors
+ bit1= do not use isoburn wrappers
+*/
+int Xorriso_sanitize_image_size(struct XorrisO *xorriso,
+ struct burn_drive *drive, struct burn_disc *disc,
+ struct burn_write_opts *burn_options, int flag)
+{
+ int ret, img_sectors, num_sessions= 0, num_tracks= 0, padding= 0, profile;
+ int media_space;
+ char profile_name[80];
+ struct burn_session **sessions;
+ struct burn_track **tracks;
+
+ img_sectors= burn_disc_get_sectors(disc);
+
+ sessions= burn_disc_get_sessions(disc, &num_sessions);
+ if(sessions==NULL || num_sessions < 1) {
+no_track:;
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Program error : no track in prepared disc");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ {ret= -1; goto ex;}
+ }
+ tracks= burn_session_get_tracks(sessions[0], &num_tracks);
+ if(tracks==NULL || num_tracks < 1)
+ goto no_track;
+
+ padding= 0;
+ ret= burn_disc_get_profile(drive, &profile, profile_name);
+ padding= xorriso->padding / 2048;
+ if(xorriso->padding > padding * 2048)
+ padding++;
+ if(img_sectors>0 && (profile==0x09 || profile==0x0a)) { /* CD-R , CD-RW */
+ if(img_sectors + padding < Xorriso_cd_min_track_sizE) {
+ padding= Xorriso_cd_min_track_sizE - img_sectors;
+ sprintf(xorriso->info_text,
+ "Expanded track to minimum size of %d sectors",
+ Xorriso_cd_min_track_sizE);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ }
+ }
+ burn_track_define_data(tracks[0], 0, padding * 2048, 0, BURN_MODE1);
+ Xorriso_process_msg_queues(xorriso,0);
+
+ if(flag&2)
+ media_space= burn_disc_available_space(drive, burn_options) /
+ (off_t) 2048;
+ else
+ media_space= isoburn_disc_available_space(drive, burn_options) /
+ (off_t) 2048;
+ if(media_space < img_sectors + padding) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Image size %ds exceeds free space on media %ds",
+ img_sectors + padding, media_space);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ {ret= 0; goto ex;}
+ }
+ if(flag&1) {
+ ret= img_sectors+padding;
+ } else
+ ret= 1;
+ex:;
+ return(ret);
+}
+
+
+/* @param flag bit0= do not write but only prepare and return size in sectors
+*/
+int Xorriso_write_session(struct XorrisO *xorriso, int flag)
+{
+ int ret, relax= 0, i;
+ int major, minor, micro;
+ char xorriso_id[256], *img_id;
+ struct isoburn_imgen_opts *sopts= NULL;
+ struct burn_drive_info *dinfo, *source_dinfo;
+ struct burn_drive *drive, *source_drive;
+ struct burn_disc *disc= NULL;
+ struct burn_write_opts *burn_options;
+ off_t readcounter= 0,writecounter= 0;
+ int num_sessions= 0, num_tracks= 0;
+ struct burn_session **sessions;
+ struct burn_track **tracks;
+ enum burn_disc_status s;
+ IsoImage *image = NULL;
+ ElToritoBootImage *bootimg;
+
+#ifdef NIX
+ char profile_name[80];
+ int padding= 0, img_sectors, media_space, profile;
+#endif
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to write", 2);
+ if(ret<=0)
+ return(0);
+
+ if(xorriso->out_drive_handle == xorriso->in_drive_handle) {
+ source_drive= drive;
+ } else {
+ if(xorriso->in_drive_handle == NULL) {
+ source_drive= drive;
+ } else {
+ ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive,
+ "on attempt to get source for write", 0);
+ if(ret<=0)
+ goto ex;
+ }
+ s= isoburn_disc_get_status(drive);
+ if(s!=BURN_DISC_BLANK) {
+ s= burn_disc_get_status(drive);
+ if(s!=BURN_DISC_BLANK)
+ sprintf(xorriso->info_text,
+ "-indev differs from -outdev and -outdev media is not blank");
+ else
+ sprintf(xorriso->info_text,
+ "-indev differs from -outdev and -outdev media holds valid ISO image");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ {ret= 0; goto ex;}
+ }
+ }
+
+ ret= isoburn_igopt_new(&sopts, 0);
+ if(ret<=0)
+ return(ret);
+ relax= isoburn_igopt_allow_deep_paths;
+
+ /* Adjust or discard boot image */
+ image= isoburn_get_attached_image(source_drive);
+ /* >>> ??? move down to libisoburn ? */
+ if(image!=NULL && !(flag&1)) {
+ ret= iso_image_get_boot_image(image, &bootimg, NULL, NULL);
+ if(xorriso->patch_isolinux_image) {
+ if(ret==1) {
+ relax|= isoburn_igopt_allow_full_ascii;
+ sprintf(xorriso->info_text, "Patching alleged isolinux boot image");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ el_torito_patch_isolinux_image(bootimg);
+ } else {
+ sprintf(xorriso->info_text,
+ "Could not find any boot image for -boot_image isolinux patch");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
+ }
+ } else if(xorriso->keep_boot_image && ret==1) {
+ relax|= isoburn_igopt_allow_full_ascii;
+ sprintf(xorriso->info_text, "Keeping boot image unchanged");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ } else if(ret==1) {
+ iso_image_remove_boot_image(image);
+ sprintf(xorriso->info_text, "Discarded boot image from old session");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ }
+ }
+ isoburn_igopt_set_level(sopts, 2);
+ isoburn_igopt_set_extensions(sopts, 1|((!!xorriso->do_joliet)<<1));
+ isoburn_igopt_set_relaxed(sopts, isoburn_igopt_allow_deep_paths);
+ isoburn_igopt_set_sort_files(sopts, 1);
+ isoburn_igopt_set_over_mode(sopts, 0, 0, (mode_t) 0, (mode_t) 0);
+ isoburn_igopt_set_over_ugid(sopts, 0, 0, (uid_t) 0, (gid_t) 0);
+ isoburn_igopt_set_out_charset(sopts, NULL);
+ isoburn_igopt_set_fifo_size(sopts, xorriso->fs * 2048);
+
+ if(image!=NULL &&
+ strlen(Xorriso_program_versioN)+strlen(Xorriso_timestamP)<80) {
+ sprintf(xorriso_id, "XORRISO-%s %s",
+ Xorriso_program_versioN, Xorriso_timestamP);
+ isoburn_version(&major, &minor, µ);
+ if(strlen(xorriso_id)<80)
+ sprintf(xorriso_id+strlen(xorriso_id),
+ ", LIBISOBURN-%d.%d.%d", major, minor, micro);
+ iso_lib_version(&major, &minor, µ);
+ if(strlen(xorriso_id)<80)
+ sprintf(xorriso_id+strlen(xorriso_id),
+ ", LIBISOFS-%d.%d.%d", major, minor, micro);
+ burn_version(&major, &minor, µ);
+ if(strlen(xorriso_id)<80)
+ sprintf(xorriso_id+strlen(xorriso_id),
+ ", LIBBURN-%d.%d.%d", major, minor, micro);
+ xorriso_id[128]= 0;
+ img_id= (char *) iso_image_get_data_preparer_id(image);
+ if(img_id!=NULL) {
+ for(i= strlen(img_id)-1; i>=0 && img_id[i]==' '; i--);
+ if(i>0) {
+ sprintf(xorriso->info_text, "Overwrote previous preparer id '%s'",
+ img_id);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+ }
+ }
+ iso_image_set_data_preparer_id(image, xorriso_id);
+ }
+
+ /* Make final abort check before starting expensive activities */
+ ret= Xorriso_eval_problem_status(xorriso, 1, 0);
+ if(ret<0)
+ {ret= 0; goto ex;}
+ Xorriso_set_abort_severity(xorriso, 1);
+ if(xorriso->out_drive_handle == xorriso->in_drive_handle ||
+ xorriso->in_drive_handle == NULL) {
+ ret= isoburn_prepare_disc(source_drive, &disc, sopts);
+ } else {
+ ret= isoburn_prepare_new_image(source_drive, &disc, sopts, drive);
+ }
+ if (ret <= 0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Failed to prepare session write run");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ {ret= 0; goto ex;}
+ }
+
+ ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0);
+ if(ret<=0)
+ goto ex;
+
+#ifndef NIX
+
+ ret= Xorriso_sanitize_image_size(xorriso, drive, disc, burn_options, flag&1);
+ if(ret<=0 || (flag&1)) {
+ Xorriso_process_msg_queues(xorriso,0);
+ if(flag&1) /* set queue severity to FAILURE */
+ Xorriso_set_image_severities(xorriso, 2);
+ isoburn_cancel_prepared_write(source_drive, drive, 0);
+ if(flag&1) /* reset queue severity */
+ Xorriso_set_image_severities(xorriso, 0);
+ goto ex;
+ }
+
+#else
+
+ ret= img_sectors= burn_disc_get_sectors(disc);
+ if(flag&1)
+ goto ex;
+
+ sessions= burn_disc_get_sessions(disc, &num_sessions);
+ if(sessions==NULL || num_sessions < 1) {
+no_track:;
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Program error : no track in prepared disc");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ isoburn_cancel_prepared_write(source_drive, drive, 0);
+ {ret= -1; goto ex;}
+ }
+ tracks= burn_session_get_tracks(sessions[0], &num_tracks);
+ if(tracks==NULL || num_tracks < 1)
+ goto no_track;
+
+ padding= 0;
+ ret= burn_disc_get_profile(drive, &profile, profile_name);
+ padding= xorriso->padding / 2048;
+ if(xorriso->padding > padding * 2048)
+ padding++;
+ if(profile==0x09 || profile==0x0a) { /* CD-R , CD-RW */
+ if(img_sectors + padding < Xorriso_cd_min_track_sizE) {
+ padding= Xorriso_cd_min_track_sizE - img_sectors;
+ sprintf(xorriso->info_text,
+ "Expanded track to minimum size of %d sectors",
+ Xorriso_cd_min_track_sizE);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ }
+ }
+ burn_track_define_data(tracks[0], 0, padding * 2048, 0, BURN_MODE1);
+ Xorriso_process_msg_queues(xorriso,0);
+
+ media_space= isoburn_disc_available_space(drive, burn_options) / (off_t) 2048;
+ if(media_space < img_sectors + padding) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Image size %ds exceeds free space on media %ds",
+ img_sectors + padding, media_space);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ isoburn_cancel_prepared_write(source_drive, drive, 0);
+ {ret= 0; goto ex;}
+ }
+
+#endif /* NIX */
+
+ xorriso->run_state= 1; /* Indicate that burning has started */
+ isoburn_disc_write(burn_options, disc);
+ burn_write_opts_free(burn_options);
+
+ ret= Xorriso_pacifier_loop(xorriso, drive, 0);
+ if(ret<=0)
+ goto ex;
+ if(!isoburn_drive_wrote_well(drive)) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "libburn indicates failure with writing.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+
+ sessions= burn_disc_get_sessions(disc, &num_sessions);
+ if(num_sessions>0) {
+ tracks= burn_session_get_tracks(sessions[0], &num_tracks);
+ if(tracks!=NULL && num_tracks>0) {
+ burn_track_get_counters(tracks[0],&readcounter,&writecounter);
+ sprintf(xorriso->info_text,
+ "ISO image produced: %d sectors. Written to media: %d sectors\n",
+ (int) (readcounter/ (off_t) 2048),
+ (int) (writecounter/ (off_t) 2048));
+ Xorriso_info(xorriso, 0);
+ }
+ }
+
+ ret= isoburn_activate_session(drive);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<=0) {
+ sprintf(xorriso->info_text,
+ "Could not write new set of volume descriptors");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ goto ex;
+ }
+ /* Done early to free any reference to the libisofs resources via disc */
+ if(disc!=NULL)
+ burn_disc_free(disc);
+ disc= NULL;
+ /* To wait for the end of the libisofs threads and their messages. */
+ isoburn_sync_after_write(source_drive, drive, 0);
+ Xorriso_process_msg_queues(xorriso,0);
+
+ sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n");
+ Xorriso_info(xorriso, 0);
+ ret= 1;
+ex:;
+ xorriso->run_state= 0; /* Indicate that burning has ended */
+ Xorriso_set_abort_severity(xorriso, 0);
+
+ if(ret<=0) {
+ /* >>> ??? revive discarded boot image */;
+ }
+
+ if(disc!=NULL)
+ burn_disc_free(disc);
+ isoburn_igopt_destroy(&sopts, 0);
+ Xorriso_process_msg_queues(xorriso,0);
+ return(ret);
+}
+
+
+int Xorriso_check_burn_abort(struct XorrisO *xorriso, int flag)
+{
+ int ret;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+
+ if(xorriso->run_state!=1)
+ return(0);
+ ret= Xorriso_eval_problem_status(xorriso, 1, 1);
+ if(ret>=0)
+ return(0);
+ sprintf(xorriso->info_text,
+ "-abort_on '%s' encountered '%s' during image writing",
+ xorriso->abort_on_text, xorriso->problem_status_text);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0,
+ xorriso->problem_status_text, 0);
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to abort burn run", 2);
+ if(ret<=0)
+ return(0);
+
+ burn_drive_cancel(drive);
+ sprintf(xorriso->info_text,
+ "libburn has now been urged to cancel its operation");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return(1);
+}
+
+
+/* This loop watches burn runs until they end.
+ It issues pacifying update messages to the user.
+ @param flag bit0-3 = emulation mode
+ 0= xorriso
+ 1= cdrskin
+ bit4= report speed in CD units
+*/
+int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
+ int flag)
+{
+ int ret, size, free_bytes, i, aborting= 0, emul, buffer_fill= 50, last_sector;
+ struct burn_progress progress;
+ char *status_text;
+ enum burn_drive_status drive_status;
+ double start_time, current_time, last_time;
+ double measured_speed, speed_factor= 1385000;
+
+ start_time= Sfile_microtime(0);
+ while(burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
+ usleep(100002);
+
+ emul= flag&15;
+ if(flag&16)
+ speed_factor= 150.0*1024;
+ progress.sector= 0;
+ current_time= Sfile_microtime(0);
+ while(1) {
+ last_time= current_time;
+ last_sector= progress.sector;
+ drive_status= burn_drive_get_status(drive, &progress);
+ if(drive_status == BURN_DRIVE_IDLE)
+ break;
+ current_time= Sfile_microtime(0);
+ if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) {
+ if(emul==1) {
+ if(progress.sector<=progress.sectors)
+ sprintf(xorriso->info_text, "%4d of %4d MB written",
+ progress.sector / 512, progress.sectors / 512);
+ else
+ sprintf(xorriso->info_text, "%4d MB written",
+ progress.sector / 512);
+
+ if(xorriso->pacifier_fifo!=NULL) {
+ ret= burn_fifo_inquire_status(xorriso->pacifier_fifo,
+ &size, &free_bytes, &status_text);
+ if(ret>0 )
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ " (fifo %2d%%)",
+ (int) (100.0-100.0*((double) free_bytes)/(double) size));
+ }
+
+ buffer_fill= 50;
+ if(progress.buffer_capacity>0)
+ buffer_fill= (double) (progress.buffer_capacity
+ - progress.buffer_available) * 100.0
+ / (double) progress.buffer_capacity;
+ sprintf(xorriso->info_text+strlen(xorriso->info_text), " [buf %3d%%]",
+ buffer_fill);
+
+ if(current_time-last_time>0.2) {
+ measured_speed= (progress.sector - last_sector) * 2048.0 /
+ (current_time - last_time);
+ sprintf(xorriso->info_text+strlen(xorriso->info_text), " %4.1fx.",
+ measured_speed/speed_factor);
+ }
+
+ } else {
+ if(progress.sector<=progress.sectors)
+ sprintf(xorriso->info_text, "Writing: sector %d of %d",
+ progress.sector, progress.sectors);
+ else
+ sprintf(xorriso->info_text, "Writing: sector %d", progress.sector);
+ ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text);
+ if(ret>0 )
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ " [fifo %s, %2d%% fill]", status_text,
+ (int) (100.0-100.0*((double) free_bytes)/(double) size));
+ }
+ } else if(drive_status == BURN_DRIVE_CLOSING_SESSION ||
+ drive_status == BURN_DRIVE_CLOSING_TRACK)
+ sprintf(xorriso->info_text,
+ "Closing track/session. Working since %.f seconds",
+ current_time-start_time);
+ else if(drive_status == BURN_DRIVE_FORMATTING)
+ sprintf(xorriso->info_text, "Formatting. Working since %.f seconds",
+ current_time-start_time);
+ else
+ sprintf(xorriso->info_text,
+ "Thank you for being patient since %.f seconds",
+ current_time-start_time);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
+
+ for(i= 0; i<10; i++) {
+ Xorriso_process_msg_queues(xorriso, 0);
+ if(aborting<=0)
+ aborting= Xorriso_check_burn_abort(xorriso, 0);
+ usleep(100000);
+ }
+ }
+ return(1);
+}
+
+
+int Xorriso__read_pacifier(IsoImage *image, IsoFileSource *filesource)
+{
+ struct XorrisO *xorriso;
+
+ xorriso= (struct XorrisO *) iso_image_get_attached_data(image);
+ if(xorriso==NULL)
+ return(1);
+ xorriso->pacifier_count++;
+ if(xorriso->pacifier_count%10)
+ return(1);
+ Xorriso_pacifier_callback(xorriso, "nodes read", xorriso->pacifier_count, 0,
+ "", 0);
+ return(1);
+}
+
+
+int Xorriso_get_volume(struct XorrisO *xorriso, IsoImage **volume,
+ int flag)
+{
+ if(xorriso->in_volset_handle==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"No ISO image present.");
+ if(xorriso->indev[0]==0 && xorriso->outdev[0]==0)
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ " No -dev, -indev, or -outdev selected.");
+ else
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ " Possible program error with drive '%s'.", xorriso->indev);
+
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ *volume= (IsoImage *) xorriso->in_volset_handle;
+ return(*volume != NULL);
+}
+
+
+/* @param flag bit0=do not complain about non existent node */
+int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume,
+ char *path, IsoNode **node, int flag)
+{
+ int ret;
+ char sfe[5*SfileadrL], *path_pt;
+
+ path_pt= path;
+ if(path[0]==0)
+ path_pt= "/";
+ *node= NULL;
+ ret= iso_tree_path_to_node(volume, path_pt, node);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<=0) {
+ if(!(flag&1)) {
+ sprintf(xorriso->info_text, "Cannot find path %s in loaded ISO image",
+ Text_shellsafe(path_pt, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ }
+ return(0);
+ }
+ return(1);
+}
+
+
+/* @param eff_path returns resulting effective path.
+ Must provide at least SfileadrL bytes of storage.
+ @param flag bit0= do not produce problem events (unless faulty path format)
+ bit1= work purely literally, do not use libisofs
+ bit2= (with bit1) this is an address in the disk world
+ @return -1 = faulty path format, 0 = not found ,
+ 1 = found simple node , 2 = found directory
+*/
+int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd,
+ char *img_path, char eff_path[], int flag)
+{
+ int ret, is_dir= 0, done= 0;
+ IsoImage *volume;
+ IsoDir *dir= NULL;
+ IsoNode *node= NULL;
+ char path[SfileadrL], *apt, *npt, sfe[5*SfileadrL], *cpt;
+
+ eff_path[0]= 0;
+ if(img_path[0]==0)
+ return(2); /* root directory */
+
+ if(!(flag&2)) {
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ }
+
+ apt= npt= path;
+ if(img_path[0]!='/') {
+ strcpy(path, wd);
+ ret= Sfile_add_to_path(path, img_path, 0);
+ if(ret<=0)
+ goto much_too_long;
+ } else
+ if(Sfile_str(path, img_path, 0)<=0)
+ return(-1);
+
+ if(path[0]!='/') {
+ sprintf(xorriso->info_text,
+ "Internal error: Unresolvable relative addressing in iso_rr_path '%s'",
+ img_path);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FATAL", 0);
+ return(-1);
+ } else if(path[1]==0)
+ return(2); /* root directory */
+
+ for(npt= apt; !done; apt= npt+1) {
+ npt= strchr(apt, '/');
+ if(npt==NULL) {
+ npt= apt+strlen(apt);
+ done= 1;
+ } else
+ *npt= 0;
+ if(*apt==0) {
+ *apt= '/';
+ apt++;
+ if(done)
+ break;
+ continue;
+ }
+ if(strcmp(apt,".")==0) {
+ is_dir= 1;
+ continue;
+ }
+ if(strcmp(apt,"..")==0) {
+ if(!(flag&2)) {
+ node= (IsoNode *) dir;
+ if(node==NULL) {
+bonked_root:;
+ sprintf(xorriso->info_text,
+ "Relative addressing in path exceeds root directory: %s",
+ Text_shellsafe(img_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(-1);
+ }
+ dir= iso_node_get_parent(node);
+ }
+ /* truncate eff_path */;
+ cpt= strrchr(eff_path, '/');
+ if(cpt==NULL) /* ??? if not flag&2 then this is a bug */
+ goto bonked_root;
+ *cpt= 0;
+ is_dir= 1;
+ continue;
+ }
+ ret= Sfile_add_to_path(eff_path, apt, 0);
+ if(ret<=0) {
+much_too_long:;
+ sprintf(xorriso->info_text, "Effective path gets much too long (%d)",
+ (int) (strlen(eff_path)+strlen(apt)+1));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(-1);
+ }
+ if(!(flag&2)) {
+ dir= (IsoDir *) node;
+ ret= Xorriso_node_from_path(xorriso, volume, eff_path, &node, flag&1);
+ if(ret<=0)
+ return(0);
+ if(dir==NULL) /* could be false with "/dir/.." */
+ dir= iso_node_get_parent(node);
+ is_dir= LIBISO_ISDIR(node);
+ }
+ }
+ return(1+!!is_dir);
+}
+
+
+int Xorriso_get_node_by_path(struct XorrisO *xorriso,
+ char *in_path, char *eff_path,
+ IsoNode **node, int flag)
+{
+ int ret;
+ char path[SfileadrL];
+ IsoImage *volume;
+
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, in_path, path, 0);
+ if(ret<=0)
+ return(ret);
+ if(eff_path!=NULL)
+ strcpy(eff_path, path);
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ ret= Xorriso_node_from_path(xorriso, volume, path, node, 0);
+ if(ret<=0)
+ return(0);
+ return(1);
+}
+
+
+int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
+ IsoNode *node, int flag)
+{
+ iso_node_set_permissions(node, stbuf->st_mode & 07777);
+ iso_node_set_uid(node, stbuf->st_uid);
+ iso_node_set_gid(node, stbuf->st_gid);
+ iso_node_set_atime(node, stbuf->st_atime);
+ iso_node_set_mtime(node, stbuf->st_mtime);
+ iso_node_set_ctime(node, stbuf->st_ctime);
+ return(1);
+}
+
+
+/* Ticket 132 : Workaround for missing feature iso_tree_add_new_node() */
+int Xorriso_tree_graft_node(struct XorrisO *xorriso, IsoImage *volume,
+ IsoDir *dir, char *disk_path, char *img_name,
+ char *nominal_source, char *nominal_target,
+ IsoNode **node, int flag)
+{
+ int ret;
+
+#ifdef Xorriso_workaround_ticket_132
+
+ int wa_ret, i;
+ char wa_name[256];
+ IsoDir *hdir;
+
+ ret= iso_tree_add_node(volume, dir, disk_path, node);
+ if(ret==ISO_NODE_NAME_NOT_UNIQUE) {
+ wa_ret= ISO_NODE_NAME_NOT_UNIQUE;
+ for(i= 0; wa_ret==ISO_NODE_NAME_NOT_UNIQUE && i<2000000000; i++) {
+ sprintf(wa_name, "xorriso_works_around_what_is_not_a_bug_try_%d", i);
+ wa_ret= iso_tree_add_new_dir(dir, wa_name, &hdir);
+ }
+ if(wa_ret<0)
+ goto cannot_add;
+ ret= iso_tree_add_node(volume, hdir, disk_path, node);
+ if(ret>0) {
+ ret= iso_node_set_name(*node, img_name);
+ if(ret<0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_report_iso_error(xorriso, nominal_target, 0,
+ "Cannot set name", 0, "FAILURE", 1);
+ return(ret);
+ }
+ iso_node_take(*node);
+ ret= iso_dir_add_node(dir, *node, 0);
+ }
+ iso_node_remove((IsoNode *) hdir);
+ }
+
+#else /* Xorriso_workaround_ticket_132 */
+
+ ret= iso_tree_add_new_node(volume, dir, img_name, disk_path, node);
+
+#endif /* Xorriso_workaround_ticket_132 */
+
+ if(ret<0) {
+
+#ifdef Xorriso_workaround_ticket_132
+cannot_add:;
+#endif /* Xorriso_workaround_ticket_132 */
+
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_report_iso_error(xorriso, nominal_source, ret,
+ "Cannot add node to tree", 0, "FAILURE", 1|2);
+ return(ret);
+ }
+ return(1);
+}
+
+
+/* @param flag bit0= recursion is active
+ bit1= do not report added files
+*/
+int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir,
+ char *img_dir_path, char *disk_dir_path,
+ struct LinkiteM *link_stack, int flag)
+{
+ IsoImage *volume;
+ IsoNode *node;
+ IsoSymlink *iso_symlink;
+ int ret, target_is_dir, source_is_dir, source_is_link, fret, was_failure= 0;
+ int do_not_dive;
+ struct DirseQ *dirseq= NULL;
+ char *name, *img_name, *srcpt, *stbuf_src= "";
+ struct stat stbuf, hstbuf;
+ dev_t dir_dev;
+ struct LinkiteM *own_link_stack;
+
+#ifdef Xorriso_fat_local_meM
+ char sfe[5*SfileadrL], sfe2[5*SfileadrL];
+ char disk_path[2*SfileadrL], img_path[2*SfileadrL], link_target[SfileadrL];
+#else /* Xorriso_fat_local_meM */
+
+ char *sfe= NULL, *sfe2= NULL;
+ char *disk_path= NULL, *img_path= NULL, *link_target= NULL;
+
+ /* Avoiding large local memory objects in order to save stack space */
+ sfe= malloc(5*SfileadrL);
+ sfe2= malloc(5*SfileadrL);
+ disk_path= malloc(2*SfileadrL);
+ img_path= malloc(2*SfileadrL);
+ link_target= malloc(SfileadrL);
+ if(sfe==NULL || sfe2==NULL || disk_path==NULL || img_path==NULL ||
+ link_target==NULL) {
+ Xorriso_no_malloc_memory(xorriso, &sfe, 0);
+ {ret= -1; goto ex;}
+ }
+
+#endif /* ! Xorriso_fat_local_meM */
+
+ own_link_stack= link_stack;
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ goto ex;
+
+ stbuf_src= disk_dir_path;
+ if(lstat(disk_dir_path, &stbuf)==-1)
+ goto cannot_open_dir;
+ dir_dev= stbuf.st_dev;
+ if(S_ISLNK(stbuf.st_mode)) {
+ if(!(xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&1))))
+ {ret= 2; goto ex;}
+ stbuf_src= disk_dir_path;
+ if(stat(disk_dir_path, &stbuf)==-1)
+ goto cannot_open_dir;
+ if(dir_dev != stbuf.st_dev &&
+ !(xorriso->do_follow_mount || (xorriso->do_follow_param && !(flag&1))))
+ {ret= 2; goto ex;}
+ }
+ ret= Dirseq_new(&dirseq, disk_dir_path, 1);
+ if(ret<0) {
+ sprintf(xorriso->info_text,"Failed to create source filesystem iterator");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ {ret= -1; goto ex;}
+ }
+ if(ret==0) {
+cannot_open_dir:;
+ Xorriso_msgs_submit(xorriso, 0, disk_dir_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,"Cannot open as source directory: %s",
+ Text_shellsafe(disk_dir_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ {ret= 0; goto ex;}
+ }
+
+ if(Sfile_str(disk_path, disk_dir_path,0)<=0)
+ {ret= -1; goto ex;}
+ if(disk_path[0]==0 || disk_path[strlen(disk_path)-1]!='/')
+ strcat(disk_path,"/");
+ name= disk_path+strlen(disk_path);
+ if(Sfile_str(img_path, img_dir_path, 0)<=0)
+ {ret= -1; goto ex;}
+ if(img_path[0] || img_path[strlen(img_path)-1]!='/')
+ strcat(img_path,"/");
+ img_name= img_path+strlen(img_path);
+
+ while(1) { /* loop over directory content */
+ stbuf_src= "";
+ Linkitem_reset_stack(&own_link_stack, link_stack, 0);
+ srcpt= disk_path;
+ Xorriso_process_msg_queues(xorriso,0);
+ ret= Dirseq_next_adr(dirseq,name,0);
+ if(ret==0)
+ break;
+ if(ret<0) {
+ sprintf(xorriso->info_text,"Failed to obtain next directory entry");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ {ret= -1; goto ex;}
+ }
+ strcpy(img_name, name);
+ if(Xorriso_much_too_long(xorriso, strlen(img_path), 0)<=0)
+ {ret= 0; goto was_problem;}
+ if(Xorriso_much_too_long(xorriso, strlen(srcpt), 0)<=0)
+ {ret= 0; goto was_problem;}
+ stbuf_src= srcpt;
+ if(lstat(srcpt, &stbuf)==-1) {
+cannot_lstat:;
+ Xorriso_msgs_submit(xorriso, 0, srcpt, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "Cannot determine attributes of source file %s",
+ Text_shellsafe(srcpt, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
+ ret= 0; goto was_problem;
+ }
+ source_is_dir= 0;
+ source_is_link= S_ISLNK(stbuf.st_mode);
+ if(xorriso->do_follow_links && source_is_link) {
+ /* Xorriso_hop_link checks for wide link loops */
+ ret= Xorriso_hop_link(xorriso, srcpt, &own_link_stack, &hstbuf, 0);
+ if(ret<0)
+ goto was_problem;
+ if(ret==1) {
+ ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 0);
+ if(ret<=0)
+ goto was_problem;
+ srcpt= link_target;
+ stbuf_src= srcpt;
+ if(lstat(srcpt, &stbuf)==-1)
+ goto cannot_lstat;
+ } else {
+ if(Xorriso_eval_problem_status(xorriso, 0, 1|2)<0)
+ {ret= 0; goto was_problem;}
+ }
+ } else if (S_ISLNK(stbuf.st_mode)) {
+ ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1);
+ if(ret<=0)
+ goto was_problem;
+ }
+ do_not_dive= 0;
+ if(S_ISDIR(stbuf.st_mode)) {
+ source_is_dir= 1;
+ if(dir_dev != stbuf.st_dev && !xorriso->do_follow_mount)
+ do_not_dive= 1;
+ }
+
+ /* does a node exist with this name ? */
+ node= NULL;
+ ret= Xorriso_node_from_path(xorriso, volume, img_path, &node, 1);
+ if(ret>0) {
+ target_is_dir= LIBISO_ISDIR(node);
+ if(!(target_is_dir && source_is_dir)) {
+ Xorriso_process_msg_queues(xorriso,0);
+
+ /* handle overwrite situation */;
+ if(xorriso->do_overwrite==1 ||
+ (xorriso->do_overwrite==2 && !target_is_dir)) {
+ ret= Xorriso_rmi(xorriso, NULL, (off_t) 0, img_path, 1|8);
+ if(ret<=0)
+ goto was_problem;
+ if(ret==3) {
+ sprintf(xorriso->info_text, "User revoked adding of: %s",
+ Text_shellsafe(img_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ ret= 0; goto was_problem;
+ }
+ node= NULL;
+ } else {
+ Xorriso_msgs_submit(xorriso, 0, srcpt, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "While grafting %s : file object exists and may not be overwritten by %s",
+ Text_shellsafe(img_path,sfe,0), Text_shellsafe(stbuf_src,sfe2,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto was_problem;
+ }
+ }
+ }
+
+ if(node==NULL) {
+ if(S_ISLNK(stbuf.st_mode)) {
+
+ /* ??? NG : A80107 : is this solved now ? */
+ /* <<< One should rather change libisofs so that iso_tree_add_node()
+ adds a disk_link as RR link, if RR is enabled */
+
+ ret= iso_tree_add_new_symlink(dir, img_name, link_target, &iso_symlink);
+ node= (IsoNode *) iso_symlink;
+ if(ret>0) {
+ ret= Xorriso_transfer_properties(xorriso, &stbuf, node, 0);
+ if(ret<=0)
+ goto was_problem;
+ } else {
+ Xorriso_report_iso_error(xorriso, stbuf_src, ret,
+ "Cannot create symbolic link", 0, "FAILURE", 1|2);
+ {ret= 0; goto was_problem;}
+ }
+ } else {
+#ifdef NIX
+ ret= iso_tree_add_node(volume, dir, srcpt, &node);
+ if(ret<0) {
+ Xorriso_report_iso_error(xorriso, stbuf_src, ret,
+ "Cannot add node to tree", 0, "FAILURE", 1|2);
+ goto was_problem;
+ }
+#else
+ ret= Xorriso_tree_graft_node(xorriso, volume, dir, srcpt, img_name,
+ stbuf_src, img_path,
+ &node, 0);
+#endif
+ }
+ }
+ if(node==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_msgs_submit(xorriso, 0, stbuf_src, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text, "Grafting failed: %s = %s",
+ Text_shellsafe(img_path,sfe,0), Text_shellsafe(stbuf_src,sfe2,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret=0; goto was_problem;
+ }
+
+ xorriso->pacifier_count++;
+ if((xorriso->pacifier_count%100)==0)
+ Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count,
+ xorriso->pacifier_total, "", 0);
+
+ xorriso->volset_change_pending= 1;
+ if(source_is_dir) {
+ if(do_not_dive) {
+ sprintf(xorriso->info_text, "Did not follow mount point : %s",
+ Text_shellsafe(disk_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ } else {
+ ret= Xorriso_add_tree(xorriso, (IsoDir *) node,
+ img_path, disk_path, own_link_stack, 1|(flag&2));
+ }
+ if(ret<=0)
+ goto was_problem;
+ }
+
+ continue; /* regular bottom of loop */
+was_problem:;
+ was_failure= 1;
+ fret= Xorriso_eval_problem_status(xorriso, ret, 1|2);
+ if(fret<0)
+ goto ex;
+ }
+
+ ret= 1;
+ex:
+
+#ifndef Xorriso_fat_local_meM
+ if(sfe!=NULL)
+ free(sfe);
+ if(sfe2!=NULL)
+ free(sfe2);
+ if(disk_path!=NULL)
+ free(disk_path);
+ if(img_path!=NULL)
+ free(img_path);
+ if(link_target!=NULL)
+ free(link_target);
+#endif /* ! Xorriso_fat_local_meM */
+
+ Xorriso_process_msg_queues(xorriso,0);
+ Linkitem_reset_stack(&own_link_stack, link_stack, 0);
+ Dirseq_destroy(&dirseq, 0);
+ if(ret<=0)
+ return(ret);
+ return(!was_failure);
+}
+
+
+int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir,
+ char *full_img_path, char *img_path, char *full_disk_path, int flag)
+{
+ int ret, nfic, nic, nfdc, d, i;
+ char nfi[SfileadrL], ni[SfileadrL], nfd[SfileadrL], *cpt;
+ char sfe[5*SfileadrL];
+ struct stat stbuf;
+
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, full_img_path, nfi,
+ 1|2);
+ if(ret<=0)
+ return(ret);
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, img_path, ni, 1|2);
+ if(ret<=0)
+ return(ret);
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, full_disk_path, nfd,
+ 1|2|4);
+ if(ret<=0)
+ return(ret);
+ nfic= Sfile_count_components(nfi, 0);
+ nic= Sfile_count_components(ni, 0);
+ nfdc= Sfile_count_components(nfd, 0);
+ d= nfic-nic;
+ if(d<0)
+ return(-1);
+ if(d>nfdc)
+ return(0);
+ for(i= 0; iinfo_text,
+ "Copied properties for %s", Text_shellsafe(ni, sfe, 0));
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ " from %s", Text_shellsafe(nfd, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+ return(1);
+}
+
+
+/* @param bit0= copy link target properties rather than link properties
+*/
+int Xorriso_copy_properties(struct XorrisO *xorriso,
+ char *disk_path, char *img_path, int flag)
+{
+ int ret;
+ IsoNode *node;
+ struct stat stbuf;
+
+ ret= Xorriso_get_node_by_path(xorriso, img_path, NULL, &node, 0);
+ if(ret<=0)
+ return(ret);
+ if(lstat(disk_path, &stbuf)==-1)
+ return(0);
+ Xorriso_transfer_properties(xorriso, &stbuf, node, 0);
+ xorriso->volset_change_pending= 1;
+ return(1);
+}
+
+
+/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
+ Set to NULL if calling this function from outside ISO world
+ @param flag bit0= mkdir: graft in as empty directory, not as copy from disk
+ bit1= do not report added files
+ bit2= -follow: this is not a command parameter
+ @return <=0 = error , 1 = added simple node , 2 = added directory
+*/
+int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter,
+ char *disk_path, char *img_path, int flag)
+{
+ IsoImage *volume;
+ char path[SfileadrL], *apt, *npt, *cpt, sfe[5*SfileadrL], sfe2[5*SfileadrL];
+ char *disk_path_pt, resolved_disk_path[SfileadrL];
+ IsoDir *dir, *hdir;
+ IsoNode *node;
+ int done= 0, is_dir= 0, l, ret, target_is_dir, source_is_dir, resolve_link= 0;
+ struct stat stbuf;
+
+ for(cpt= img_path; 1; cpt++) {
+/*
+ if(cpt[0]!='/')
+ break;
+*/
+ cpt= strstr(cpt,"/.");
+ if(cpt==NULL)
+ break;
+ if(cpt[2]=='.') {
+ if(cpt[3]=='/' || cpt[3]==0)
+ break;
+ } else if(cpt[2]=='/' || cpt[2]==0)
+ break;
+ }
+ if(cpt!=NULL) {
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "Unsupported relative addressing in iso_rr_path %s (disk: %s)",
+ Text_shellsafe(img_path, sfe, 0), Text_shellsafe(disk_path, sfe2, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
+ return(0);
+ }
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+
+ strncpy(path, img_path, sizeof(path)-1);
+ path[sizeof(path)-1]= 0;
+ apt= npt= path;
+
+ if(!(flag&1)) {
+ ret= lstat(disk_path, &stbuf);
+ if(ret!=-1) {
+ if(S_ISDIR(stbuf.st_mode))
+ is_dir= 1;
+ else if((stbuf.st_mode&S_IFMT)==S_IFLNK &&
+ (xorriso->do_follow_links ||
+ (xorriso->do_follow_param && !(flag&4)))) {
+ resolve_link= 1;
+ ret= stat(disk_path, &stbuf);
+ if(ret!=-1) {
+ if(S_ISDIR(stbuf.st_mode))
+ is_dir= 1;
+ }
+ }
+ }
+ if(ret == -1) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "Cannot determine attributes of source file %s",
+ Text_shellsafe(disk_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
+ return(0);
+ }
+ if(S_ISDIR(stbuf.st_mode)) {
+ is_dir= 1;
+
+#ifdef NIX
+ } else if(!(S_ISREG(stbuf.st_mode) || S_ISLNK(stbuf.st_mode))) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "Source file '%s' is of non-supported file type", disk_path);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+#endif /* NIX */
+
+ } else {
+ l= strlen(img_path);
+ if(l>0)
+ if(img_path[l-1]=='/')
+ l= 0;
+ if(l==0) {
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "Source '%s' is not a directory. Target '%s' would be.",
+ Text_shellsafe(disk_path, sfe, 0), Text_shellsafe(img_path, sfe2, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ }
+ }
+
+ dir= iso_image_get_root(volume);
+ if(dir==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "While grafting '%s' : no root node available", img_path);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(0);
+ }
+ for(npt= apt; !done; apt= npt+1) {
+ npt= strchr(apt, '/');
+ if(npt==NULL) {
+ npt= apt+strlen(apt);
+ done= 1;
+ } else
+ *npt= 0;
+ if(*apt==0) {
+ *apt= '/';
+ apt++;
+ if(done)
+ goto attach_source;
+ continue;
+ }
+ source_is_dir= (is_dir || (flag&1) || !done);
+ ret= Xorriso_node_from_path(xorriso, volume, path, &node, 1);
+ if(ret>0) {
+ target_is_dir= LIBISO_ISDIR(node);
+ if(!(target_is_dir && source_is_dir)) {
+ Xorriso_process_msg_queues(xorriso,0);
+
+ /* handle overwrite situation */;
+ if(xorriso->do_overwrite==1 ||
+ (xorriso->do_overwrite==2 && !target_is_dir)) {
+ ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, path, 1|8);
+ if(ret<=0)
+ return(ret);
+ if(ret==3) {
+ sprintf(xorriso->info_text, "User revoked adding of: %s",
+ Text_shellsafe(disk_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return(0);
+ }
+ node= NULL;
+ goto handle_path_node;
+ }
+
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text,
+ "While grafting '%s' : '%s' exists and may not be overwritten",
+ img_path, path);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ dir= (IsoDir *) node;
+ }
+
+handle_path_node:;
+ if(node==NULL && source_is_dir) { /* make a directory */
+ ret= iso_tree_add_new_dir(dir, apt, &hdir);
+ if(ret<0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ Xorriso_report_iso_error(xorriso, img_path, ret,
+ "Cannot create directory", 0, "FAILURE", 1);
+ sprintf(xorriso->info_text,
+ "While grafting '%s' : could not insert '%s'", img_path, path);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ dir= hdir;
+ xorriso->volset_change_pending= 1;
+ iso_node_set_ctime((IsoNode *) dir, time(NULL));
+ iso_node_set_uid((IsoNode *) dir, geteuid());
+ iso_node_set_gid((IsoNode *) dir, getegid());
+
+ if(disk_path!=NULL && !done)
+ Xorriso_copy_implict_properties(xorriso, dir, img_path, path, disk_path,
+ 0);
+
+ }
+ if(done) {
+attach_source:;
+ xorriso->pacifier_count++;
+ if(xorriso->pacifier_count%100 && !(flag&2))
+ Xorriso_pacifier_callback(xorriso, "files added",
+ xorriso->pacifier_count,
+ xorriso->pacifier_total, "", 0);
+ if(flag&1) {
+ /* directory node was created above */;
+
+ } else if(is_dir) {
+ Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, 0);
+ ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL, flag&2);
+ if(ret<=0)
+ return(ret);
+
+ } else {
+ if(resolve_link) {
+ ret= Xorriso_resolve_link(xorriso, disk_path, resolved_disk_path, 0);
+ if(ret<=0)
+ return(ret);
+ disk_path_pt= resolved_disk_path;
+ } else
+ disk_path_pt= disk_path;
+
+#ifdef NIX
+ ret= iso_tree_add_node(volume, dir, disk_path_pt, &node);
+ if(ret<0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ Xorriso_report_iso_error(xorriso, img_path, ret, "Cannot create node",
+ 0, "FAILURE", 1);
+ sprintf(xorriso->info_text, "Grafting failed: %s = %s",
+ Text_shellsafe(img_path,sfe,0), Text_shellsafe(disk_path,sfe2,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+#else
+ ret= Xorriso_tree_graft_node(xorriso, volume, dir, disk_path_pt, apt,
+ disk_path, img_path, &node, 0);
+ if(ret<0) {
+ Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0);
+ sprintf(xorriso->info_text, "Grafting failed: %s = %s",
+ Text_shellsafe(img_path,sfe,0), Text_shellsafe(disk_path,sfe2,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+#endif
+ xorriso->volset_change_pending= 1;
+ iso_node_set_name(node, apt);
+ }
+ } else
+ *npt= '/';
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1+!!is_dir);
+}
+
+
+int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
+{
+ int ret, error_code= 0, os_errno= 0, count= 0, pass, imgid, tunneled;
+ char severity[80];
+
+ if(!xorriso->libs_are_started)
+ return(1);
+ for(pass= 0; pass< 2; pass++) {
+ while(1) {
+ tunneled= 0;
+ if(pass==0)
+ ret= iso_obtain_msgs("ALL", &error_code, &imgid,
+ xorriso->info_text, severity);
+ else {
+ ret= burn_msgs_obtain("ALL", &error_code, xorriso->info_text, &os_errno,
+ severity);
+ if((error_code>=0x00030000 && error_code<0x00040000) ||
+ (error_code>=0x00050000 && error_code<0x00060000))
+ tunneled= -1; /* "libisofs:" */
+ else if(error_code>=0x00060000 && error_code<0x00070000)
+ tunneled= 1; /* "libisoburn:" */
+ }
+ if(ret<=0)
+ break;
+
+ /* <<< tunneled MISHAP from libisoburn through libburn
+ or well known error codes of MISHAP events
+ With libburn-0.4.4 this is not necessary */
+ if(error_code==0x5ff73 || error_code==0x3ff73 ||
+ error_code==0x3feb9 || error_code==0x3feb2)
+ strcpy(severity, "MISHAP");
+ else if(error_code==0x51001)
+ strcpy(severity, "ERRFILE");
+
+ Xorriso_msgs_submit(xorriso, error_code, xorriso->info_text, os_errno,
+ severity, ((pass+tunneled)+1)<<2);
+ count++;
+ }
+ }
+ if(xorriso->library_msg_direct_print && count>0) {
+ sprintf(xorriso->info_text," (%d library messages repeated by xorriso)\n",
+ count);
+ Xorriso_info(xorriso, 0);
+ }
+ return(1);
+}
+
+
+/* @param flag bit0=short report form
+ bit1=report about output drive
+*/
+int Xorriso_toc(struct XorrisO *xorriso, int flag)
+{
+ int num_sessions= 0, num_tracks= 0, lba= 0, nwa= -1, pmin, psec, pframe, ret;
+ int track_count= 0, session_no, track_no, profile_no= -1;
+ int last_track_start= 0, last_track_size= -1, num_data= 0, is_data= 0;
+ int is_inout_drive= 0, drive_role;
+ char profile_name[80],*respt,*devadr;
+ struct burn_disc *disc= NULL;
+ struct burn_session **sessions;
+ struct burn_track **tracks;
+ struct burn_toc_entry toc_entry;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+ enum burn_disc_status s;
+ char mem_text[80];
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to print Table Of Content", flag&2);
+ if(ret<=0)
+ return(0);
+
+ respt= xorriso->result_line;
+
+ if(strcmp(xorriso->indev, xorriso->outdev)==0)
+ is_inout_drive= 1;
+ if(flag&2)
+ devadr= xorriso->outdev;
+ else
+ devadr= xorriso->indev;
+ sprintf(respt, "Drive current: %s '%s'\n",
+ (is_inout_drive ? "-dev" : (flag&2 ? "-outdev" : "-indev")),
+ devadr);
+ Xorriso_result(xorriso,0);
+ sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n",
+ dinfo[0].vendor, dinfo[0].product, dinfo[0].revision);
+ if(!(flag&1))
+ Xorriso_result(xorriso,0);
+
+ sprintf(respt, "Media current: ");
+ ret= burn_disc_get_profile(drive, &profile_no, profile_name);
+ if (profile_no > 0 && ret > 0) {
+ if (profile_name[0])
+ sprintf(respt+strlen(respt), "%s", profile_name);
+ else
+ sprintf(respt+strlen(respt), "%4.4Xh", profile_no);
+ drive_role= burn_drive_get_drive_role(drive);
+ if(drive_role==2)
+ sprintf(respt+strlen(respt), ", overwriteable");
+ else if(drive_role==0 || drive_role==3)
+ sprintf(respt+strlen(respt), ", sequential");
+ strcat(respt, "\n");
+ } else
+ sprintf(respt+strlen(respt), "is not recognizable\n");
+ Xorriso_result(xorriso,0);
+
+ sprintf(respt, "Media status : ");
+ s= isoburn_disc_get_status(drive);
+ if (s == BURN_DISC_FULL) {
+ sprintf(respt+strlen(respt), "is written , is closed\n");
+ } else if (s == BURN_DISC_APPENDABLE) {
+ sprintf(respt+strlen(respt), "is written , is appendable\n");
+ } else if (s == BURN_DISC_BLANK) {
+ sprintf(respt+strlen(respt), "is blank\n");
+ } else if (s == BURN_DISC_EMPTY)
+ sprintf(respt+strlen(respt), "is not present\n");
+ else
+ sprintf(respt+strlen(respt), "is not recognizable\n");
+ Xorriso_result(xorriso,0);
+
+ if(s != BURN_DISC_FULL && s != BURN_DISC_APPENDABLE)
+ return(1);
+
+ if(xorriso->request_to_abort)
+ return(1);
+
+ disc= burn_drive_get_disc(drive);
+ if (disc==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+
+#define Xorriso_with_isoburn_get_min_start_bytE 1
+#ifdef Xorriso_with_isoburn_get_min_start_bytE
+ { off_t start_byte= 0;
+ ret= isoburn_get_min_start_byte(drive, &start_byte, 0);
+ nwa= start_byte / 2048;
+ }
+#else
+ ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa);
+#endif
+
+ if(ret<=0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ if(flag&1)
+ return(0);
+ sprintf(xorriso->info_text, "Cannot obtain Table Of Content");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
+ return(0);
+ }
+ /* fabricate TOC */
+ sprintf(respt, "Media content: session %2d ", 1);
+ sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n", 1, "data ", 0);
+ if(!(flag&1))
+ Xorriso_result(xorriso,0);
+ last_track_start= lba;
+ sprintf(respt, "Media content: session %2d ", 1);
+ sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
+ if(!(flag&1))
+ Xorriso_result(xorriso,0);
+ num_data= last_track_size= nwa;
+ num_sessions= 1;
+ } else {
+ sessions= burn_disc_get_sessions(disc, &num_sessions);
+ for (session_no= 0; session_norequest_to_abort);
+ session_no++) {
+ tracks = burn_session_get_tracks(sessions[session_no], &num_tracks);
+ if (tracks==NULL)
+ continue;
+ for(track_no= 0; track_norequest_to_abort);
+ track_no++) {
+ track_count++;
+ is_data= 0;
+ burn_track_get_entry(tracks[track_no], &toc_entry);
+ if (toc_entry.extensions_valid & 1) {
+ /* DVD extension valid */
+ lba= toc_entry.start_lba;
+ } else {
+ lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec, toc_entry.pframe);
+ }
+ sprintf(respt, "Media content: session %2d ", session_no+1);
+ sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n",
+ track_count, ((toc_entry.control&7)<4?"audio":"data "), lba);
+ if(!(flag&1))
+ Xorriso_result(xorriso,0);
+ last_track_start= lba;
+ if((toc_entry.control&7)>=4) /* data track */
+ is_data= 1;
+ }
+ burn_session_get_leadout_entry(sessions[session_no], &toc_entry);
+ if (toc_entry.extensions_valid & 1) {
+ lba= toc_entry.start_lba;
+ burn_lba_to_msf(lba, &pmin, &psec, &pframe);
+ } else {
+ lba= burn_msf_to_lba(pmin, psec, pframe);
+ lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec, toc_entry.pframe);
+ }
+ sprintf(respt, "Media content: session %2d ", session_no+1);
+ sprintf(respt+strlen(respt), "leadout lba: %9d\n", lba);
+ if(!(flag&1))
+ Xorriso_result(xorriso,0);
+ last_track_size= lba - last_track_start;
+ if(is_data)
+ num_data+= last_track_size;
+ }
+ }
+ if(xorriso->request_to_abort)
+ return(1);
+ Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1);
+ sprintf(respt, "Media summary: %d session%s, %d data blocks, %s\n",
+ num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text);
+ Xorriso_result(xorriso,0);
+
+ if (s == BURN_DISC_APPENDABLE && nwa!=0) {
+ ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa);
+ if(ret>0) {
+ sprintf(respt, "Media nwa : %ds\n", nwa);
+ if(!(flag&1))
+ Xorriso_result(xorriso,0);
+ }
+ }
+
+ if (disc!=NULL)
+ burn_disc_free(disc);
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+int Xorriso_show_devices(struct XorrisO *xorriso, int flag)
+{
+ char adr[BURN_DRIVE_ADR_LEN];
+ int i;
+ struct burn_drive_info *drive_list= NULL;
+ unsigned int drive_count;
+ char *respt, perms[8];
+ struct stat stbuf;
+
+ sprintf(xorriso->info_text, "Beginning to scan for devices ...\n");
+ Xorriso_info(xorriso,0);
+
+ burn_drive_clear_whitelist();
+ while(!burn_drive_scan(&drive_list, &drive_count)) {
+ Xorriso_process_msg_queues(xorriso,0);
+ usleep(100000);
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ if(drive_count <= 0) {
+
+ /* >>> was a drive_list created at all ? */
+ /* >>> must it be freed ? */
+
+ sprintf(xorriso->info_text, "No drives found");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
+ return(0);
+ }
+ sprintf(xorriso->info_text, "Full drive scan done\n");
+ Xorriso_info(xorriso,0);
+
+ respt= xorriso->result_line;
+ for(i= 0; i < drive_count && !(xorriso->request_to_abort); i++) {
+ if(burn_drive_get_adr(&(drive_list[i]), adr)<=0)
+ strcpy(adr, "-get_adr_failed-");
+ Xorriso_process_msg_queues(xorriso,0);
+ if(stat(adr,&stbuf)==-1) {
+ sprintf(perms,"errno=%d",errno);
+ } else {
+ strcpy(perms,"------");
+ if(stbuf.st_mode&S_IRUSR) perms[0]= 'r';
+ if(stbuf.st_mode&S_IWUSR) perms[1]= 'w';
+ if(stbuf.st_mode&S_IRGRP) perms[2]= 'r';
+ if(stbuf.st_mode&S_IWGRP) perms[3]= 'w';
+ if(stbuf.st_mode&S_IROTH) perms[4]= 'r';
+ if(stbuf.st_mode&S_IWOTH) perms[5]= 'w';
+ }
+ sprintf(respt, "%d -dev '%s' %s : '%-8.8s' '%s' \n",
+ i, adr, perms, drive_list[i].vendor, drive_list[i].product);
+ Xorriso_result(xorriso,0);
+ }
+ burn_drive_info_free(drive_list);
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+int Xorriso_tell_media_space(struct XorrisO *xorriso,
+ int *media_space, int *free_space, int flag)
+{
+ int ret;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+ struct burn_write_opts *burn_options;
+
+ (*free_space)= (*media_space)= 0;
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to -tell_media_space", 2);
+ if(ret<=0)
+ return(0);
+
+ ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0);
+ if(ret<=0)
+ return(-1);
+ (*free_space)= (*media_space)=
+ isoburn_disc_available_space(drive, burn_options) / (off_t) 2048;
+ burn_write_opts_free(burn_options);
+
+ if(xorriso->volset_change_pending) {
+ ret= Xorriso_write_session(xorriso, 1);
+ if(ret>0)
+ (*free_space)-= ret;
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+/* @param flag bit0=fast , bit1=deformat
+ @return 0=failure, did not touch media , -1=failure, altered media
+ 1=success, altered media , 2=success, did not touch media
+*/
+int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
+{
+ int ret, do_deformat= 0;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+ enum burn_disc_status disc_state;
+ struct burn_progress p;
+ double percent = 1.0;
+ int current_profile;
+ char current_profile_name[80];
+ char mode_names[4][80]= {"all", "fast", "deformat", "deformat_quickest"};
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to -blank", 2);
+ if(ret<=0)
+ return(0);
+
+ burn_disc_get_profile(drive, ¤t_profile, current_profile_name);
+
+ /* >>> */;
+
+ disc_state = isoburn_disc_get_status(drive);
+ if(current_profile == 0x13) { /* overwriteable DVD-RW */
+ /* Depending on flag bit1 formatted DVD-RW will get blanked to sequential
+ state or pseudo blanked by invalidating an eventual ISO image. */
+ if(flag&2)
+ do_deformat= 1;
+ } else if(current_profile == 0x14) { /* sequential DVD-RW */
+ if((flag&1) && !(flag&2)) {
+ sprintf(xorriso->info_text,
+ "-blank: DVD-RW present. Mode 'fast' defaulted to mode 'all'.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ sprintf(xorriso->info_text,
+ "Mode 'deformat_quickest' produces single-session-only media.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
+ flag&= ~1;
+ }
+ } else if(disc_state == BURN_DISC_BLANK) {
+ sprintf(xorriso->info_text,"Blank media detected. Will leave it untouched");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return 2;
+ } else if(disc_state==BURN_DISC_FULL || disc_state==BURN_DISC_APPENDABLE) {
+ ;
+ } else if(disc_state == BURN_DISC_EMPTY) {
+ sprintf(xorriso->info_text,"No media detected in drive");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return 0;
+ } else {
+ sprintf(xorriso->info_text, "Unsuitable drive and media state");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return 0;
+ }
+ if(!isoburn_disc_erasable(drive)) {
+ sprintf(xorriso->info_text, "Media is not of erasable type");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return 0;
+ }
+ if(xorriso->do_dummy) {
+ sprintf(xorriso->info_text,
+ "-dummy mode prevents blanking of media in mode '%s'.",
+ mode_names[flag&3]);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return(1);
+ }
+ sprintf(xorriso->info_text, "Beginning to blank media in mode '%s'.\n",
+ mode_names[flag&3]);
+ Xorriso_info(xorriso,0);
+
+ if(do_deformat)
+ burn_disc_erase(drive, (flag&1));
+ else
+ isoburn_disc_erase(drive, (flag&1));
+ usleep(1000000);
+ while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
+ if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */
+ percent = 1.0 + ((double) p.sector+1.0) / ((double) p.sectors) * 98.0;
+ sprintf(xorriso->info_text, "Blanking ( %.1f%% done )", percent);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
+ usleep(1000000);
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text, "Blanking done\n");
+ Xorriso_info(xorriso,0);
+ return(1);
+}
+
+/* @return 0=failure, did not touch media , -1=failure, altered media
+ 1=success, altered media , 2=success, did not touch media
+*/
+int Xorriso_format_media(struct XorrisO *xorriso, int flag)
+{
+ int ret, mode_flag= 0;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+ int current_profile;
+ char current_profile_name[80];
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to -format", 2);
+ if(ret<=0)
+ return(0);
+
+ burn_disc_get_profile(drive, ¤t_profile, current_profile_name);
+ if(current_profile == 0x14) {
+ ; /* ok DVD-RW sequential */
+ } else if(current_profile == 0x1a) {
+ mode_flag= 2;
+ } else {
+ sprintf(xorriso->info_text,
+ "Can only -format DVD+RW and sequential DVD-RW");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ sprintf(xorriso->info_text,"Media current: %s (%4.4xh)",
+ current_profile_name, current_profile);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return 0;
+ }
+
+ if(xorriso->do_dummy) {
+ sprintf(xorriso->info_text, "-dummy mode prevents formatting of media.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return(1);
+ }
+ sprintf(xorriso->info_text, "Beginning to format media.\n");
+ Xorriso_info(xorriso, 0);
+ burn_disc_format(drive, (off_t) 0, mode_flag);
+
+ ret= Xorriso_pacifier_loop(xorriso, drive, 0);
+ if(ret<=0)
+ return(ret);
+
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text, "Formatting done\n");
+ Xorriso_info(xorriso,0);
+ return(1);
+}
+
+
+int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error,int flag)
+{
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_report_iso_error(xorriso, "", iso_error, "Cannot create iter", 0,
+ "FATAL", 1);
+ sprintf(xorriso->info_text, "Cannot create IsoDirIter object");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(1);
+}
+
+
+int Xorriso__node_lba_cmp(const void *node1, const void *node2)
+{
+ uint32_t lba1= 0, lba2= 0;
+ int ret;
+
+ ret = iso_node_get_old_image_lba(*((IsoNode **) node1), &lba1, 0);
+ if(ret!=1)
+ lba1= 0;
+ ret = iso_node_get_old_image_lba(*((IsoNode **) node2), &lba2, 0);
+ if(ret!=1)
+ lba1= 0;
+ return(lba1-lba2);
+}
+
+/* The caller shall make no assumptions about the meaning of iter, node_array,
+ node_count, node_idx ! They are just opaque handles for which the caller
+ provides the memory of proper type.
+ @param flag bit0= initialize iteration
+ bit1= action needs full freedom of object manipulation
+ bit2= action needs LBA sorted iteration
+ bit31= end iteration (mandatory !)
+*/
+int Xorriso_findi_iter(struct XorrisO *xorriso, IsoDir *dir_node, off_t *mem,
+ IsoDirIter **iter,
+ IsoNode ***node_array, int *node_count, int *node_idx,
+ IsoNode **iterated_node, int flag)
+{
+ int ret, i;
+ IsoNode *node;
+ off_t new_mem= 0;
+ char mem_text[80], limit_text[80];
+
+ if(flag&1) {
+ *node_array= NULL;
+ *node_count= -1;
+ *node_idx= 0;
+ *iter= NULL;
+ ret= iso_dir_get_children(dir_node, iter);
+ if(ret<0) {
+cannot_iter:;
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ return(-1);
+ }
+ if((flag&2)|(flag&4)) {
+ /* copy list of nodes and prepare soft iterator */
+ *node_count= 0;
+ while(iso_dir_iter_next(*iter, &node) == 1)
+ (*node_count)++;
+ iso_dir_iter_free(*iter);
+ *iter= NULL;
+
+ new_mem= ((*node_count)+1) * sizeof(IsoNode *);
+ if(new_mem > xorriso->temp_mem_limit) {
+ Sfile_scale((double) new_mem, mem_text, 5,1e4, 0);
+ Sfile_scale((double) xorriso->temp_mem_limit, limit_text, 5,1e4, 0);
+ sprintf(xorriso->info_text,
+ "Stacked directory snapshots exceed -temp_mem_limit (%s > %s)",
+ mem_text, limit_text);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ *node_count= -1;
+ return(-1);
+ }
+ (*node_array)= (IsoNode **) calloc((*node_count)+1, sizeof(IsoNode *));
+ if(*node_array == NULL) {
+ sprintf(xorriso->info_text,
+ "Could not allocate inode list of %.f bytes",
+ ((double) (*node_count)+1) * (double) sizeof(IsoNode *));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ *node_count= -1;
+ return(-1);
+ }
+ *mem= new_mem;
+ ret= iso_dir_get_children(dir_node, iter);
+ if(ret<0)
+ goto cannot_iter;
+ while(iso_dir_iter_next(*iter, &node) == 1 && *node_idx < *node_count) {
+ (*node_array)[*node_idx]= node;
+ iso_node_ref(node);
+ (*node_idx)++;
+ }
+ iso_dir_iter_free(*iter);
+ *iter= NULL;
+ *node_count= *node_idx;
+ *node_idx= 0;
+ if((flag&4) && *node_count>1)
+ qsort(*node_array, *node_count, sizeof(IsoNode *),
+ Xorriso__node_lba_cmp);
+ }
+ }
+
+ if(flag&(1<<31)) {
+ if(*node_count>=0 && *node_array!=NULL) {
+ for(i= 0; i<*node_count; i++)
+ iso_node_unref((*node_array)[i]);
+ free(*node_array);
+ *node_array= NULL;
+ *node_count= -1;
+ *node_idx= 0;
+ } else {
+ if(*iter!=NULL)
+ iso_dir_iter_free(*iter);
+ *iter= NULL;
+ }
+ }
+
+ if(flag&(1|(1<<31)))
+ return(1);
+ if(*node_count>=0) {
+ /* return next node_array element */
+ if(*node_idx>=*node_count)
+ return(0);
+ *iterated_node= (*node_array)[*node_idx];
+ (*node_idx)++;
+ } else {
+ ret= iso_dir_iter_next(*iter, iterated_node);
+ return(ret == 1);
+ }
+ return(1);
+}
+
+
+/*
+*/
+#define Xorriso_rmi_findi_iteR yes
+
+/* @param boss_iter If not NULL then this is an iterator suitable for
+ iso_dir_iter_remove() which is then to be used instead
+ of iso_node_remove().
+ @param flag bit0= remove whole sub tree: rm -r
+ bit1= remove empty directory: rmdir
+ bit2= recursion: do not reassure in mode 2 "tree"
+ bit3= this is for overwriting and not for plain removal
+ bit4= count deleted files in xorriso->pacifier_count
+ bit5= with bit0 only remove directory content, not the directory
+ @return <=0 = error
+ 1 = removed simple node
+ 2 = removed directory or tree
+ 3 = did not remove on user revocation
+*/
+int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
+ char *path, int flag)
+{
+ int ret, is_dir= 0, pl, not_removed= 0, fret;
+ IsoNode *victim_node, *node;
+ IsoDir *boss_node, *root_dir;
+ IsoDirIter *iter= NULL;
+ IsoImage *volume;
+ char *sub_name, *name;
+
+#ifdef Xorriso_fat_local_meM
+ char sfe[5*SfileadrL], sub_path[2*SfileadrL];
+#else
+
+ char *sfe= NULL, *sub_path= NULL;
+ off_t mem;
+
+#ifdef Xorriso_rmi_findi_iteR
+ IsoNode **node_array= NULL;
+ int node_count, node_idx;
+#endif /* ! Xorriso_rmi_findi_iteR */
+
+ /* Avoiding large local memory objects in order to save stack space */
+ sfe= malloc(5*SfileadrL);
+ sub_path= malloc(2*SfileadrL);
+ if(sfe==NULL || sub_path==NULL) {
+ Xorriso_no_malloc_memory(xorriso, &sfe, 0);
+ {ret= -1; goto ex;}
+ }
+#endif /* ! Xorriso_fat_local_meM */
+
+#ifndef Libisofs_iso_dir_iter_sufficienT
+ /* Ticket 127: A80301 - A80302
+ I do not not deem IsoDirIter safe for node list manipulations.
+ The parameter boss_iter once was intended to allow such but
+ has now been downgraded to a mere check for eventual programming bugs.
+ */
+ if(boss_iter!=NULL) {
+ sprintf(xorriso->info_text,
+ "Program error: Xorriso_rmi() was requested to delete iterated node %s",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ ret= -1; goto ex;
+ }
+#endif /* Libisofs_iso_dir_iter_sufficienT */
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ goto ex;
+
+ if(Xorriso_much_too_long(xorriso, strlen(path), 0)<=0)
+ {ret= 0; goto ex;}
+ ret= Xorriso_node_from_path(xorriso, volume, path, &victim_node, 0);
+ if(ret<=0)
+ goto ex;
+ root_dir= iso_image_get_root(volume);
+ if(((void *) root_dir) == ((void *) victim_node)) {
+ sprintf(xorriso->info_text, "May not delete root directory");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ {ret= 0; goto ex;}
+ }
+
+ if(LIBISO_ISDIR(victim_node))
+ is_dir= 1;
+ if(!is_dir) {
+ if(flag&2) { /* rmdir */
+ sprintf(xorriso->info_text, "%s in loaded ISO image is not a directory",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ } else {
+ if(flag&1) { /* rm -r */
+ if((xorriso->do_reassure==1 && !xorriso->request_not_to_ask) ||
+ (flag&32)) {
+ /* Iterate over subordinates and delete them */
+ mem= boss_mem;
+
+#ifdef Xorriso_rmi_findi_iteR
+ ret= Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem,
+ &iter, &node_array, &node_count, &node_idx,
+ &node, 1|2);
+ if(ret<=0) {
+#else
+ ret= iso_dir_get_children((IsoDir *) victim_node, &iter);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<0) {
+#endif /* ! Xorriso_rmi_findi_iteR */
+
+cannot_create_iter:;
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ ret= -1; goto ex;
+ }
+ pl= strlen(path);
+ strcpy(sub_path, path);
+ if(pl==0 || sub_path[pl-1]!='/') {
+ sub_path[pl++]= '/';
+ sub_path[pl]= 0;
+ }
+ sub_name= sub_path+pl;
+
+#ifdef Xorriso_rmi_findi_iteR
+ while(1) {
+ ret= Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter,
+ &node_array, &node_count, &node_idx, &node, 0);
+ if(ret<0)
+ goto ex;
+ if(ret==0 || xorriso->request_to_abort)
+ break;
+#else
+ while(iso_dir_iter_next(iter, &node) == 1
+ && !xorriso->request_to_abort) {
+#endif
+
+ name= (char *) iso_node_get_name(node);
+ if(Xorriso_much_too_long(xorriso, pl+1+strlen(name), 0)<=0)
+ {ret= 0; goto rm_r_problem_handler;}
+ strcpy(sub_name, name);
+ ret= Xorriso_rmi(xorriso, iter, mem, sub_path, (flag&(1|2|8|16))|4);
+ if(ret==3 || ret<=0 || xorriso->request_to_abort) {
+rm_r_problem_handler:;
+ not_removed= 1;
+ fret= Xorriso_eval_problem_status(xorriso, ret, 1|2);
+ if(fret<0)
+ goto dir_not_removed;
+ }
+ }
+ if(flag&32)
+ {ret= 2; goto ex;}
+
+ if(not_removed) {
+dir_not_removed:;
+ sprintf(xorriso->info_text, "Directory not removed: %s",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ if(ret>0)
+ ret= 3;
+ goto ex;
+ }
+ }
+ } else {
+ if(!(flag&2)) { /* not rmdir */
+ sprintf(xorriso->info_text, "%s in loaded ISO image is a directory",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+
+ ret= iso_dir_get_children((IsoDir *) victim_node, &iter);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<0)
+ goto cannot_create_iter;
+ if(ret>0) {
+ if(iso_dir_iter_next(iter, &node) == 1) {
+ sprintf(xorriso->info_text,
+ "Directory not empty on attempt to delete: %s",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ }
+ }
+ }
+
+ if(xorriso->request_to_abort)
+ {ret= 3; goto ex;}
+ boss_node= iso_node_get_parent(victim_node);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(boss_node==NULL) {
+ sprintf(xorriso->info_text,
+ "Cannot find parent node of %s in loaded ISO image",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+
+ while((xorriso->do_reassure==1 || (xorriso->do_reassure==2 && !(flag&4)))
+ && !xorriso->request_not_to_ask) {
+ /* ls -ld */
+ Xorriso_ls_filev(xorriso, xorriso->wdi, 1, &path, (off_t) 0, 1|2|8);
+ if(is_dir) /* du -s */
+ Xorriso_ls_filev(xorriso, xorriso->wdi, 1, &path, (off_t) 0, 2|4);
+ if(flag&8)
+ sprintf(xorriso->info_text,
+ "File exists. Remove ? n= keep old, y= remove, x= abort, @= stop asking\n");
+ else
+ sprintf(xorriso->info_text,
+ "Remove above file ? n= keep it, y= remove it, x= abort, @= stop asking\n");
+ Xorriso_info(xorriso, 4);
+ ret= Xorriso_request_confirmation(xorriso, 1|2|4|16);
+ if(ret<=0)
+ goto ex;
+ if(xorriso->request_to_abort) {
+ sprintf(xorriso->info_text,
+ "Removal operation aborted by user before file: %s",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ ret= 3; goto ex;
+ }
+ if(ret==3)
+ continue;
+ if(ret==6) /* yes */
+ break;
+ if(ret==4) { /* yes, do not ask again */
+ xorriso->request_not_to_ask= 1;
+ break;
+ }
+ if(ret==1) { /* no */
+ sprintf(xorriso->info_text, "Kept in existing state: %s",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ ret= 3; goto ex;
+ }
+ }
+
+#ifdef Libisofs_iso_dir_iter_sufficienT
+
+ if(boss_iter!=NULL) {
+ ret= iso_dir_iter_remove((IsoDirIter *) boss_iter);
+ if(ret<0)
+ ret= -1;
+ } else
+ ret= iso_node_remove(victim_node);
+
+#else /* ! Libisofs_iso_dir_iter_sufficienT */
+
+ ret= iso_node_remove(victim_node);
+
+#endif /* Libisofs_iso_dir_iter_sufficienT */
+
+ Xorriso_process_msg_queues(xorriso,0);
+ if(ret<0) {
+ Xorriso_report_iso_error(xorriso, path, ret, "Cannot remove node", 0,
+ "FATAL", 1);
+ sprintf(xorriso->info_text,
+ "Internal failure to remove %s from loaded ISO image",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ ret= -1; goto ex;
+ }
+ if(flag&16)
+ xorriso->pacifier_count++;
+ xorriso->volset_change_pending= 1;
+ ret= 1+!!is_dir;
+ex:;
+
+#ifndef Xorriso_fat_local_meM
+ if(sfe!=NULL)
+ free(sfe);
+ if(sub_path!=NULL)
+ free(sub_path);
+#endif /* ! Xorriso_fat_local_meM */
+
+#ifdef Xorriso_rmi_findi_iteR
+ Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter,
+ &node_array, &node_count, &node_idx, &node, (1<<31));
+#else
+ if(iter!=NULL)
+ iso_dir_iter_free(iter);
+#endif /* ! Xorriso_rmi_findi_iteR */
+
+ return(ret);
+}
+
+
+int Xorriso__node_name_cmp(const void *node1, const void *node2)
+{
+ char *name1, *name2;
+
+ name1= (char *) iso_node_get_name(*((IsoNode **) node1));
+ name2= (char *) iso_node_get_name(*((IsoNode **) node2));
+ return(strcmp(name1,name2));
+}
+
+
+/* @param flag bit0= only accept directory nodes
+ bit1= do not report memory usage as DEBUG
+ bit2= do not apply search pattern but accept any node
+*/
+int Xorriso_sorted_node_array(struct XorrisO *xorriso,
+ IsoDir *dir_node,
+ int *nodec, IsoNode ***node_array,
+ off_t boss_mem, int flag)
+{
+ int i, ret, failed_at;
+ char *npt;
+ IsoDirIter *iter= NULL;
+ IsoNode *node;
+ off_t mem;
+
+ mem= ((*nodec)+1)*sizeof(IsoNode *);
+ ret= Xorriso_check_temp_mem_limit(xorriso, mem+boss_mem, flag&2);
+ if(ret<=0)
+ return(ret);
+
+ *node_array= calloc(sizeof(IsoNode *), (*nodec)+1);
+ if(*node_array==NULL) {
+ sprintf(xorriso->info_text,
+ "Cannot allocate memory for %d directory entries", *nodec);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0) {
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ return(-1);
+ }
+
+ for(i= 0; iso_dir_iter_next(iter, &node) == 1 && i<*nodec; ) {
+ npt= (char *) iso_node_get_name(node);
+ if(!(flag&4)) {
+ ret= Xorriso_regexec(xorriso, npt, &failed_at, 0);
+ if(ret)
+ continue; /* no match */
+ }
+ if(flag&1)
+ if(!LIBISO_ISDIR(node))
+ continue;
+ (*node_array)[i++]= node;
+ }
+ iso_dir_iter_free(iter);
+ *nodec= i;
+ if(*nodec<=0)
+ return(1);
+ qsort(*node_array, *nodec, sizeof(IsoNode *), Xorriso__node_name_cmp);
+ return(1);
+}
+
+
+/* @param flag bit0= do not only sum up sizes but also print subdirs
+*/
+int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node,
+ char *abs_path, char *rel_path, off_t *size,
+ off_t boss_mem, int flag)
+{
+ int i, ret, no_sort= 0, filec= 0, l;
+ IsoDirIter *iter= NULL;
+ IsoNode *node, **node_array= NULL;
+ char *name;
+ off_t sub_size, report_size, mem= 0;
+
+#ifdef Xorriso_fat_local_meM
+ char path[SfileadrL], show_path[SfileadrL], sfe[5*SfileadrL];
+#else /* Xorriso_fat_local_meM */
+ char *path= NULL, *show_path= NULL, *sfe= NULL;
+
+ sfe= malloc(5*SfileadrL);
+ path= malloc(SfileadrL);
+ show_path= malloc(SfileadrL);
+ if(path==NULL || show_path==NULL || sfe==NULL) {
+ Xorriso_no_malloc_memory(xorriso, &sfe, 0);
+ {ret= -1; goto ex;}
+ }
+
+#endif /* ! Xorriso_fat_local_meM */
+
+ *size= 0;
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0) {
+cannot_create_iter:;
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ {ret= -1; goto ex;}
+ }
+ for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) {
+ sub_size= 0;
+ name= (char *) iso_node_get_name(node);
+ strcpy(show_path, rel_path);
+ if(Sfile_add_to_path(show_path, name, 0)<=0)
+ goto much_too_long;
+ if(LIBISO_ISDIR(node)) {
+ strcpy(path, abs_path);
+ if(Sfile_add_to_path(path, name, 0)<=0) {
+much_too_long:;
+ Xorriso_much_too_long(xorriso, strlen(path)+strlen(name)+1, 2);
+ {ret= -1; goto ex;}
+ }
+ filec++;
+ l= strlen(rel_path)+1;
+ mem+= l;
+ if(l % sizeof(char *))
+ mem+= sizeof(char *)-(l % sizeof(char *));
+ if(flag&1) /* diving and counting is done further below */
+ continue;
+ ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node,
+ path, show_path, &sub_size, boss_mem, 0);
+ if(ret<0)
+ goto ex;
+ if(ret==0)
+ continue;
+ }
+
+ if(LIBISO_ISREG(node)) {
+ sub_size+= iso_file_get_size((IsoFile *) node)+2048;
+/*
+ sub_size+= iso_file_get_size((IsoFile *) node)+strlen(name)+1;
+*/
+ }
+
+ if(sub_size>0)
+ (*size)+= sub_size;
+ Xorriso_process_msg_queues(xorriso,0);
+ }
+
+ if(filec<=0 || !(flag&1))
+ {ret= 1; goto ex;}
+
+ /* Reset iteration */
+ iso_dir_iter_free(iter);
+ iter= NULL;
+ Xorriso_process_msg_queues(xorriso,0);
+
+ ret= Xorriso_sorted_node_array(xorriso, dir_node, &filec, &node_array,
+ boss_mem, 1|2|4);
+ if(ret<0)
+ goto ex;
+ if(ret==0) {
+ no_sort= 1;
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0)
+ goto cannot_create_iter;
+ }
+
+ for(i= 0; (no_sort || irequest_to_abort); i++) {
+ if(no_sort) {
+ ret= iso_dir_iter_next(iter, &node);
+ if(ret!=1)
+ break;
+ if(!LIBISO_ISDIR(node))
+ continue;
+ } else
+ node= node_array[i];
+
+ sub_size= 0;
+ name= (char *) iso_node_get_name(node);
+ strcpy(show_path, rel_path);
+ if(Sfile_add_to_path(show_path, name, 0)<=0)
+ goto much_too_long;
+ strcpy(path, abs_path);
+ if(Sfile_add_to_path(path, name, 0)<=0)
+ goto much_too_long;
+ ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node,
+ path, show_path, &sub_size, boss_mem+mem, flag&1);
+ if(ret<0)
+ goto ex;
+
+ if(LIBISO_ISREG(node)) {
+ sub_size+= iso_file_get_size((IsoFile *) node)+2048;
+/*
+ sub_size+= iso_tree_node_get_size((IsoFile *) node)+strlen(name)+1;
+*/
+ }
+ if(sub_size>0)
+ (*size)+= sub_size;
+ report_size= sub_size/1024;
+ if(report_size*1024result_line, "%7.f ",(double) (report_size));
+ sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n",
+ Text_shellsafe(show_path, sfe, 0));
+ Xorriso_result(xorriso, 0);
+ }
+ ret= 1;
+ex:;
+
+#ifndef Xorriso_fat_local_meM
+ if(sfe!=NULL)
+ free(sfe);
+ if(path!=NULL)
+ free(path);
+ if(show_path!=NULL)
+ free(show_path);
+#endif /* ! Xorriso_fat_local_meM */
+
+ if(iter!=NULL)
+ iso_dir_iter_free(iter);
+ if(node_array!=NULL)
+ free((char *) node_array);
+ Xorriso_process_msg_queues(xorriso,0);
+ return(ret);
+}
+
+
+/* @param flag bit0= *node is already valid
+ bit1= add extra block for size estimation
+*/
+int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
+ IsoNode **node, int flag)
+{
+ int ret;
+ IsoImage *volume;
+
+ memset((char *) stbuf, 0, sizeof(struct stat));
+ if(!(flag&1)) {
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(-1);
+ ret= Xorriso_node_from_path(xorriso, volume, path, node, 1);
+ if(ret<=0)
+ *node= NULL;
+ }
+ if(*node==NULL)
+ return(0);
+
+ /* >>> stbuf->st_dev */
+ /* >>> stbuf->st_ino */
+
+ stbuf->st_mode= iso_node_get_permissions(*node) & 07777;
+ if(LIBISO_ISDIR(*node))
+ stbuf->st_mode|= S_IFDIR;
+ else if(LIBISO_ISREG(*node))
+ stbuf->st_mode|= S_IFREG;
+ else if(LIBISO_ISLNK(*node))
+ stbuf->st_mode|= S_IFLNK;
+ else if(LIBISO_ISLNK(*node))
+ stbuf->st_mode|= S_IFCHR;
+ else if(LIBISO_ISBLK(*node))
+ stbuf->st_mode|= S_IFBLK;
+ else if(LIBISO_ISFIFO(*node))
+ stbuf->st_mode|= S_IFIFO;
+ else if(LIBISO_ISSOCK(*node))
+ stbuf->st_mode|= S_IFSOCK;
+
+ /* >>> NG How to represent LIBISO_BOOT ? */
+
+
+ /* >>> With directories this should be : number of subdirs + 2 */
+ /* >>> ??? How to obtain RR hardlink number for other types ? */
+ stbuf->st_nlink= 1;
+
+ stbuf->st_uid= iso_node_get_uid(*node);
+ stbuf->st_gid= iso_node_get_gid(*node);
+
+ /* >>> stbuf->st_rdev */
+
+ if(LIBISO_ISREG(*node))
+ stbuf->st_size= iso_file_get_size((IsoFile *) *node)+ (2048 * !!(flag&2));
+ else
+ stbuf->st_size= 0;
+
+ stbuf->st_blksize= 2048;
+ stbuf->st_blocks= stbuf->st_size / (off_t) 2048;
+ if(stbuf->st_blocks * (off_t) 2048 != stbuf->st_size)
+ stbuf->st_blocks++;
+
+ stbuf->st_atime= iso_node_get_atime(*node);
+ stbuf->st_mtime= iso_node_get_mtime(*node);
+ stbuf->st_ctime= iso_node_get_ctime(*node);
+ return(1);
+}
+
+
+int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf,
+ int flag)
+{
+ int ret;
+ IsoNode *node;
+
+ ret= Xorriso_fake_stbuf(xorriso, path, stbuf, &node, 0);
+ if(ret>0)
+ return(0);
+ return(-1);
+}
+
+
+int Xorriso_sorted_dir_i(struct XorrisO *xorriso, IsoDir *dir_node,
+ int *filec, char ***filev, off_t boss_mem, int flag)
+{
+ int i,j,ret;
+ IsoDirIter *iter= NULL;
+ IsoNode *node;
+ char *name;
+ off_t mem;
+
+ (*filec)= 0;
+ (*filev)= NULL;
+
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0) {
+cannot_iter:;
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ {ret= -1; goto ex;}
+ }
+ mem= 0;
+ for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) {
+ name= (char *) iso_node_get_name(node);
+ mem+= sizeof(char *)+strlen(name)+8;
+ (*filec)++;
+ }
+ iso_dir_iter_free(iter);
+ iter= NULL;
+ if(*filec==0)
+ {ret= 1; goto ex;}
+
+ ret= Xorriso_check_temp_mem_limit(xorriso, mem+boss_mem, 2);
+ if(ret<=0)
+ goto ex;
+ (*filev)= (char **) calloc(*filec, sizeof(char *));
+ if(*filev==NULL)
+ {ret= -1; goto ex; }
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0)
+ goto cannot_iter;
+ for(i= 0; i<*filec; i++) {
+ ret= iso_dir_iter_next(iter, &node);
+ if(ret!=1)
+ break;
+ name= (char *) iso_node_get_name(node);
+ (*filev)[i]= strdup(name);
+ if((*filev)[i]==NULL) {
+ for(j= 0; jresult_line;
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+
+ Sort_argv(filec, filev, 0);
+
+ /* Count valid nodes, warn of invalid ones */
+ for(i= 0; iinfo_text, "Not found in ISO image: %s",
+ Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
+ was_error++;
+ continue;
+ }
+ }
+
+ if((flag&8) && !(flag&(2|4))) {
+ sprintf(xorriso->info_text, "Valid ISO nodes found: %d\n", filec-was_error);
+ Xorriso_info(xorriso,1);
+ if(filec-was_error<=0)
+ return(!was_error);
+ }
+
+ passes= 1+!(flag&(4|8));
+ for(pass= 0; passrequest_to_abort); i++) {
+ rpt[0]= 0;
+ ret= Xorriso_make_abs_adr(xorriso, wd, filev[i], path, 1|2|4);
+ if(ret<=0)
+ continue;
+ ret= Xorriso_fake_stbuf(xorriso, path, &stbuf, &node, (flag&4)>>1);
+ if(ret<=0)
+ continue;
+ if(LIBISO_ISDIR(node) && !(flag&(4|8))) {
+ if(pass==0)
+ continue;
+ if(filec>1) {
+ strcpy(xorriso->result_line, "\n");
+ Xorriso_result(xorriso,0);
+ sprintf(xorriso->result_line, "%s:\n", Text_shellsafe(filev[i], sfe,0));
+ Xorriso_result(xorriso,0);
+ }
+ ret= Xorriso_sorted_dir_i(xorriso,
+ (IsoDir *) node, &dfilec, &dfilev, boss_mem, 0);
+ if(ret<=0) {
+
+ /* >>> libisofs iterator loop and single item Xorriso_lsx_filev() */;
+
+ } else {
+ if(flag&1) {
+ sprintf(xorriso->result_line, "total %d\n", dfilec);
+ Xorriso_result(xorriso,0);
+ }
+ Xorriso_ls_filev(xorriso, path,
+ dfilec, dfilev, boss_mem, (flag&1)|2|8);
+ }
+ if(dfilec>0)
+ Sfile_destroy_argv(&dfilec, &dfilev, 0);
+ continue;
+ } else
+ if(pass>0)
+ continue;
+ link_target[0]= 0;
+ if((flag&5)==1) { /* -ls_l */
+ ret= Xorriso_format_ls_l(xorriso, &stbuf, 0);
+ if(ret<=0)
+ continue;
+ if(LIBISO_ISLNK(node)) {
+ if(Sfile_str(link_target, (char *) iso_symlink_get_dest(
+ (IsoSymlink *) node), 0)<=0)
+ link_target[0]= 0;
+ }
+ } else if(flag&4) { /* -du or -dus */
+ size= stbuf.st_size;
+ if(S_ISDIR(stbuf.st_mode)) {
+ ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node,
+ path, filev[i], &size, boss_mem, flag&1);
+ if(ret<0)
+ return(-1);
+ if(ret==0)
+ continue;
+ }
+ sprintf(rpt, "%7.f ",(double) (size/1024));
+ }
+ if(link_target[0] && (flag&5)==1)
+ sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s -> %s\n",
+ Text_shellsafe(filev[i], sfe, 0),
+ Text_shellsafe(link_target, sfe2, 0));
+ else
+ sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n",
+ Text_shellsafe(filev[i], sfe, 0));
+ Xorriso_result(xorriso, 0);
+ }
+ return(!was_error);
+}
+
+
+/* This function needs less buffer memory than Xorriso_ls_filev() but cannot
+ perform structured pattern matching as done by Xorriso_expand_pattern()
+ for subsequent Xorriso_ls_filev().
+ @param flag bit0= long format
+ bit1= only check for directory existence
+ bit2= do not apply search pattern but accept any file
+ bit3= just count nodes and return number
+*/
+int Xorriso_ls(struct XorrisO *xorriso, int flag)
+{
+ int ret, is_dir= 0, i, filec= 0, failed_at, no_sort= 0;
+ IsoNode *node, **node_array= NULL;
+ IsoDir *dir_node;
+ IsoImage *volume;
+ IsoDirIter *iter= NULL;
+ char sfe[5*SfileadrL], sfe2[5*SfileadrL], link_target[SfileadrL], *npt, *rpt;
+ struct stat stbuf;
+
+ rpt= xorriso->result_line;
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+
+ ret= Xorriso_node_from_path(xorriso, volume, xorriso->wdi, &node, 0);
+ if(ret<=0)
+ goto wdi_is_not_a_dir;
+ if(LIBISO_ISDIR(node))
+ is_dir= 1;
+ if(!is_dir) {
+wdi_is_not_a_dir:;
+ sprintf(xorriso->info_text,
+ "Working directory path does not lead to a directory in ISO image");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ if(flag&2)
+ {ret= 1; goto ex;}
+
+ dir_node= (IsoDir *) node;
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0) {
+cannot_create_iter:;
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ {ret= -1; goto ex;}
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+
+ for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) {
+ npt= (char *) iso_node_get_name(node);
+ if(!(flag&4)) {
+ ret= Xorriso_regexec(xorriso, npt, &failed_at, 0);
+ if(ret)
+ continue; /* no match */
+ }
+ filec++;
+ }
+ /* Reset iteration */
+ iso_dir_iter_free(iter);
+ iter= NULL;
+ Xorriso_process_msg_queues(xorriso,0);
+ if(flag&8)
+ {ret= filec; goto ex;}
+ sprintf(xorriso->info_text, "Valid ISO nodes found: %d\n", filec);
+ Xorriso_info(xorriso,1);
+
+ ret= Xorriso_sorted_node_array(xorriso, dir_node, &filec, &node_array, 0,
+ flag&4);
+ if(ret<0)
+ goto ex;
+ if(ret==0) {
+ no_sort= 1;
+ ret= iso_dir_get_children(dir_node, &iter);
+ if(ret<0)
+ goto cannot_create_iter;
+ }
+
+ for(i= 0; irequest_to_abort); i++) {
+ if(no_sort) {
+ ret= iso_dir_iter_next(iter, &node);
+ if(ret!=1)
+ break;
+ npt= (char *) iso_node_get_name(node);
+ if(!(flag&4)) {
+ ret= Xorriso_regexec(xorriso, npt, &failed_at, 0);
+ if(ret)
+ continue; /* no match */
+ }
+ } else
+ node= node_array[i];
+
+ npt= (char *) iso_node_get_name(node);
+ link_target[0]= 0;
+ if(LIBISO_ISLNK(node)) {
+ if(Sfile_str(link_target, (char *) iso_symlink_get_dest(
+ (IsoSymlink *) node), 0)<=0)
+ link_target[0]= 0;
+ }
+ rpt[0]= 0;
+ if(flag&1) {
+ ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1);
+ if(ret<=0)
+ continue;
+ ret= Xorriso_format_ls_l(xorriso, &stbuf, 0);
+ if(ret<=0)
+ continue;
+ }
+ if(link_target[0] && (flag&1))
+ sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s -> %s\n",
+ Text_shellsafe(npt, sfe, 0),
+ Text_shellsafe(link_target, sfe2, 0));
+ else
+ sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n",
+ Text_shellsafe(npt, sfe, 0));
+ Xorriso_result(xorriso, 0);
+ }
+
+ ret= 1;
+ex:;
+ if(iter!=NULL)
+ iso_dir_iter_free(iter);
+ Xorriso_process_msg_queues(xorriso,0);
+ if(node_array!=NULL)
+ free((char *) node_array);
+ return(ret);
+}
+
+/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
+ Set to NULL if calling this function from outside ISO world
+*/
+int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
+ char *origin, char *dest, int flag)
+{
+ int ret, ol, dest_ret;
+ char sfe[5*SfileadrL], eff_dest[SfileadrL], dir_adr[SfileadrL], *cpt;
+ char *leafname, eff_origin[SfileadrL], sfe2[5*SfileadrL], *old_leafname;
+ IsoImage *volume;
+ IsoDir *origin_dir, *dest_dir;
+ IsoNode *node, *iso_node;
+
+#ifndef Libisofs_iso_dir_iter_sufficienT
+ /* Ticket 127: A80301 - A80302
+ I do not not deem IsoDirIter safe for node list manipulations.
+ The parameter boss_iter once was intended to allow such but
+ has now been downgraded to a mere check for eventual programming bugs.
+ */
+ if(boss_iter!=NULL) {
+ sprintf(xorriso->info_text,
+ "Program error: Xorriso_rename() was requested to delete iterated node %s",
+ Text_shellsafe(origin, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+#endif /* Libisofs_iso_dir_iter_sufficienT */
+
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0);
+ if(ret<=0)
+ return(ret);
+ dest_ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest,1);
+ if(dest_ret<0)
+ return(dest_ret);
+ if(dest_ret==0) { /* obtain eff_dest address despite it does not exist */
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2);
+ if(ret<=0)
+ return(ret);
+ }
+
+ /* Prevent that destination is a subordinate of origin
+ (that would be a black hole plopping out of the universe) */
+ ol= strlen(eff_origin);
+ if(ol==0) {
+ sprintf(xorriso->info_text, "May not rename root directory");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ } else if(strcmp(eff_origin, eff_dest)==0) {
+ sprintf(xorriso->info_text, "Ignored attempt to rename %s to itself",
+ Text_shellsafe(eff_origin,sfe,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
+ return(0);
+ } else if(strncmp(eff_origin, eff_dest, ol)==0 &&
+ (eff_dest[ol]==0 || eff_dest[ol]=='/')) {
+ sprintf(xorriso->info_text,
+ "May not rename %s to its own sub address %s",
+ Text_shellsafe(eff_origin,sfe,0), Text_shellsafe(eff_dest,sfe2,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+
+ /* Check whether destination exists and may be not overwriteable */
+ if(dest_ret==2 && xorriso->do_overwrite!=1) {
+ sprintf(xorriso->info_text, "Renaming may not overwrite directory: %s",
+ Text_shellsafe(eff_dest, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ } else if (dest_ret==1 && !xorriso->do_overwrite) {
+ sprintf(xorriso->info_text, "Renaming may not overwite: %s",
+ Text_shellsafe(eff_dest, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ } else if(dest_ret>0) {
+ ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, eff_dest, 1|8);
+ if(ret<=0)
+ return(0);
+ if(ret==3) {
+ sprintf(xorriso->info_text, "User revoked renaming of: %s",
+ Text_shellsafe(eff_origin, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
+ return(0);
+ }
+ }
+
+ /* Ensure existence of destination directory */
+ strcpy(dir_adr, eff_dest);
+ cpt= strrchr(dir_adr, '/');
+ if(cpt==NULL)
+ cpt= dir_adr+strlen(dir_adr);
+ *cpt= 0;
+ if(dir_adr[0]!=0) {
+ ret= Xorriso_graft_in(xorriso, boss_iter, NULL, dir_adr, 1);
+ if(ret<=0)
+ return(ret);
+ }
+
+ /* Move node */
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ Xorriso_node_from_path(xorriso, volume, dir_adr, &iso_node, 0);
+ dest_dir= (IsoDir *) iso_node;
+ strcpy(dir_adr, eff_origin);
+ cpt= strrchr(dir_adr, '/');
+ if(cpt==NULL)
+ cpt= dir_adr+strlen(dir_adr);
+ *cpt= 0;
+ Xorriso_node_from_path(xorriso, volume, dir_adr, &iso_node, 0);
+ origin_dir= (IsoDir *) iso_node;
+ Xorriso_node_from_path(xorriso, volume, eff_origin, &node, 0);
+ if(dest_dir==NULL || origin_dir==NULL || node==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "Internal error on rename: confirmed node turns out as NULL");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+ ret= iso_node_take(node);
+ if(ret<0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_report_iso_error(xorriso, eff_dest, 0, "Cannot take", 0, "FATAL",1);
+ sprintf(xorriso->info_text,
+ "Internal error on rename: failed to take node");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+ leafname= strrchr(eff_dest, '/');
+ if(leafname==NULL)
+ leafname= eff_dest;
+ else
+ leafname++;
+
+ old_leafname= (char *) iso_node_get_name(node);
+ if(strcmp(leafname, old_leafname)!=0)
+ ret= iso_node_set_name(node, leafname);
+ else
+ ret= 1;
+ if(ret<0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_report_iso_error(xorriso, eff_dest, 0, "Cannot set name", 0,
+ "FAILURE", 1);
+ return(-1);
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ ret= iso_dir_add_node(dest_dir, node, 0);
+ if(ret<0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ Xorriso_report_iso_error(xorriso, eff_dest, 0, "Cannot add", 0, "FATAL", 1);
+ sprintf(xorriso->info_text,
+ "Internal error on rename: failed to insert node");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ return(-1);
+ }
+ return(1);
+}
+
+
+/* @param flag bit0= do not produce info message on success
+ @return 1=success,
+ 0=was already directory, -1=was other type, -2=other error
+*/
+int Xorriso_mkdir(struct XorrisO *xorriso, char *path, int flag)
+{
+ int ret;
+ char eff_path[SfileadrL], sfe[5*SfileadrL];
+
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1);
+ if(ret<0)
+ return(-2);
+ if(ret>0) {
+ sprintf(xorriso->info_text,"-mkdir: Address already existing %s",
+ Text_shellsafe(eff_path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0,
+ (ret==2 ? "WARNING" : "FAILURE"), 0);
+ return(-1+(ret==2));
+ }
+ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2);
+ if(ret<0)
+ return(-2);
+ ret= Xorriso_graft_in(xorriso, NULL, NULL, eff_path, 1);
+ if(ret<=0)
+ return(-2);
+ if(!(flag&1)) {
+ sprintf(xorriso->info_text, "Created directory in ISO image: %s\n",
+ Text_shellsafe(eff_path,sfe,0));
+ Xorriso_info(xorriso, 0);
+ }
+ return(1);
+}
+
+
+/* @param flag bit0= count results rather than storing them
+ bit1= this is a recursion
+ bit2= prepend wd (automatically done if wd[0]!=0)
+*/
+int Xorriso_obtain_pattern_files_i(
+ struct XorrisO *xorriso, char *wd, IsoDir *dir,
+ int *filec, char **filev, int count_limit, off_t *mem,
+ int *dive_count, int flag)
+{
+ int ret, failed_at;
+ IsoDirIter *iter= NULL;
+ IsoNode *node;
+ char *name;
+
+#ifdef Xorriso_fat_local_meM
+ char adr[SfileadrL];
+#else /* Xorriso_fat_local_meM */
+ char *adr= NULL;
+
+ adr= malloc(SfileadrL);
+ if(adr==NULL) {
+ Xorriso_no_malloc_memory(xorriso, &adr, 0);
+ {ret= -1; goto ex;}
+ }
+#endif /* ! Xorriso_fat_local_meM */
+
+
+ if(!(flag&2))
+ *dive_count= 0;
+ else
+ (*dive_count)++;
+ ret= Xorriso_check_for_root_pattern(xorriso, filec, filev, count_limit,
+ mem, (flag&1)|2);
+ if(ret!=2)
+ goto ex;
+
+ ret= iso_dir_get_children(dir, &iter);
+ if(ret<0) {
+ Xorriso_cannot_create_iter(xorriso, ret, 0);
+ {ret= -1; goto ex;}
+ }
+ while(iso_dir_iter_next(iter, &node) == 1) {
+ name= (char *) iso_node_get_name(node);
+ ret= Xorriso_make_abs_adr(xorriso, wd, name, adr, flag&4);
+ if(ret<=0)
+ goto ex;
+ ret= Xorriso_regexec(xorriso, adr, &failed_at, 1);
+ if(ret) { /* no match */
+ if(failed_at <= *dive_count) /* no hope for a match */
+ continue;
+
+ if(!LIBISO_ISDIR(node)) {
+
+ /* >>> How to deal with softlinks ? */
+
+ continue;
+ }
+ /* dive deeper */
+ ret= Xorriso_obtain_pattern_files_i(
+ xorriso, adr, (IsoDir *) node,
+ filec, filev, count_limit, mem, dive_count, flag|2);
+ if(ret<=0)
+ goto ex;
+ } else {
+ ret= Xorriso_register_matched_adr(xorriso, adr, count_limit,
+ filec, filev, mem, (flag&1)|2);
+ if(ret<=0)
+ goto ex;
+ }
+ }
+ ret= 1;
+ex:;
+
+#ifndef Xorriso_fat_local_meM
+ if(adr!=NULL)
+ free(adr);
+#endif /* ! Xorriso_fat_local_meM */
+
+ if(flag&2)
+ (*dive_count)--;
+ return(ret);
+}
+
+
+/* @param flag bit0= a match count !=1 is a FAILURE event
+ bit1= with bit0 tolerate 0 matches if pattern is a constant
+*/
+int Xorriso_expand_pattern(struct XorrisO *xorriso,
+ int num_patterns, char **patterns, int extra_filec,
+ int *filec, char ***filev, off_t *mem, int flag)
+{
+ int ret, count= 0, abs_adr= 0, i, was_count, was_filec;
+ int nonconst_mismatches= 0, dive_count= 0;
+ char sfe[5*SfileadrL];
+ IsoImage *volume;
+ IsoDir *dir= NULL, *root_dir;
+ IsoNode *iso_node;
+
+ *filec= 0;
+ *filev= NULL;
+
+ xorriso->search_mode= 3;
+ xorriso->structured_search= 1;
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ root_dir= iso_image_get_root(volume);
+ if(root_dir==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "While expanding pattern : Cannot obtain root node of ISO image");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ ret= -1; goto ex;
+ }
+
+ for(i= 0; iwdi does not exist yet, but one may
+ not use it as base for relative address searches.
+ */
+ ret= Xorriso_node_from_path(xorriso, volume, xorriso->wdi, &iso_node, 1);
+ dir= (IsoDir *) iso_node;
+ if(ret<=0) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "While expanding pattern %s : Working directory does not exist in ISO image",
+ Text_shellsafe(patterns[i], sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ if(!LIBISO_ISDIR((IsoNode *) dir)) {
+ sprintf(xorriso->info_text,
+ "Working directory path does not lead to a directory in ISO image");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ }
+
+ /* count the matches */
+ was_count= count;
+ ret= Xorriso_obtain_pattern_files_i(xorriso, "", dir, &count, NULL, 0,
+ mem, &dive_count, 1 | abs_adr);
+ if(ret<=0)
+ goto ex;
+ if(was_count==count && strcmp(patterns[i],"*")!=0 && (flag&3)!=1) {
+ count++;
+ Xorriso_eval_nonmatch(xorriso, patterns[i], &nonconst_mismatches, mem, 0);
+ }
+ }
+
+ ret= Xorriso_check_matchcount(xorriso, count, nonconst_mismatches,
+ num_patterns, patterns, (flag&1)|2);
+ if(ret<=0)
+ goto ex;
+ count+= extra_filec;
+ mem+= extra_filec*sizeof(char *);
+ if(count<=0)
+ {ret= 0; goto ex;}
+ ret= Xorriso_alloc_pattern_mem(xorriso, *mem, count, filev, 0);
+ if(ret<=0)
+ goto ex;
+ /* now store addresses */
+ for(i= 0; iinfo_text,"Permissions now: %-5.5o %s",
+ mode, Text_shellsafe(path, sfe, 0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+ xorriso->volset_change_pending= 1;
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid,
+ int flag)
+{
+ int ret;
+ IsoNode *node;
+
+ ret= Xorriso_get_node_by_path(xorriso, in_path, NULL, &node, 0);
+ if(ret<=0)
+ return(ret);
+ iso_node_set_uid(node, uid);
+ iso_node_set_ctime(node, time(NULL));
+ xorriso->volset_change_pending= 1;
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid,
+ int flag)
+{
+ int ret;
+ IsoNode *node;
+
+ ret= Xorriso_get_node_by_path(xorriso, in_path, NULL, &node, 0);
+ if(ret<=0)
+ return(ret);
+ iso_node_set_gid(node, gid);
+ iso_node_set_ctime(node, time(NULL));
+ xorriso->volset_change_pending= 1;
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+/* @parm flag bit0= atime, bit1= ctime, bit2= mtime, bit8=no auto ctime */
+int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
+ int flag)
+{
+ int ret;
+ IsoNode *node;
+
+ ret= Xorriso_get_node_by_path(xorriso, in_path, NULL, &node, 0);
+ if(ret<=0)
+ return(ret);
+ if(flag&1)
+ iso_node_set_atime(node, t);
+ if(flag&2)
+ iso_node_set_ctime(node, t);
+ if(flag&4)
+ iso_node_set_mtime(node, t);
+ if(!(flag&(2|256)))
+ iso_node_set_ctime(node, time(NULL));
+ xorriso->volset_change_pending= 1;
+ Xorriso_process_msg_queues(xorriso,0);
+ return(1);
+}
+
+
+/* @param flag bit0= not a command parameter (directory iteration or recursion)
+ bit1= do not count deleted files with rm and rm_r
+ @return <=0 error, 1=ok, 2=ok, node has been deleted
+*/
+int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
+ IsoDirIter *boss_iter, off_t boss_mem,
+ char *abs_path, char *show_path,
+ IsoNode *node, int depth, int flag)
+{
+ int ret= 0, type, action= 0, hflag, deleted= 0;
+ uid_t user= 0;
+ gid_t group= 0;
+ time_t date= 0;
+ mode_t mode_or= 0, mode_and= ~1;
+ char *target, sfe[5*SfileadrL], *iso_prefix;
+ struct FindjoB *subjob;
+ struct stat dir_stbuf;
+
+ action= Findjob_get_action_parms(job, &target, &user, &group,
+ &mode_and, &mode_or, &type, &date, &subjob, 0);
+ if(action<0)
+ action= 0;
+
+ hflag= 16*!(flag&2);
+ if(action==1) { /* rm (including rmdir) */
+ ret= Xorriso_fake_stbuf(xorriso, abs_path, &dir_stbuf, &node, 1);
+ if(ret>0) {
+ if(S_ISDIR(dir_stbuf.st_mode))
+ hflag= 2;
+ ret= Xorriso_rmi(xorriso, boss_iter, boss_mem, abs_path, hflag);
+ deleted= 1;
+ }
+ } else if(action==2) { /* rm_r */
+ ret= Xorriso_rmi(xorriso, boss_iter, boss_mem, abs_path, 1|hflag);
+ deleted= 1;
+ } else if(action==3) {
+
+ /* >>> mv target */;
+
+ } else if(action==4) { /* chown */
+ ret= Xorriso_set_uid(xorriso, abs_path, user, 0);
+ } else if(action==5) { /* chgrp */
+ ret= Xorriso_set_gid(xorriso, abs_path, group, 0);
+ } else if(action==6) { /* chmod */
+ ret= Xorriso_set_st_mode(xorriso, abs_path, mode_and, mode_or, 0);
+ } else if(action==7) { /* alter_date */
+ ret= Xorriso_set_time(xorriso, abs_path, date, type&7);
+ } else if(action==8) { /* lsdl */
+ ret= Xorriso_ls_filev(xorriso, "", 1, &abs_path, (off_t) 0, 1|2|8);
+ } else if(action>=9 && action<=13) { /* actions which have own findjobs */
+ Findjob_set_start_path(subjob, abs_path, 0);
+ ret= Xorriso_findi(xorriso, subjob, boss_iter, boss_mem, NULL,
+ abs_path, &dir_stbuf, depth, 1);
+ } else if(action==14 || action==17) { /* compare , update */
+ Findjob_get_start_path(job, &iso_prefix, 0);
+ ret= Xorriso_find_compare(xorriso, (void *) boss_iter, abs_path,
+ iso_prefix, target, (action==17)|((flag&1)<<1));
+ if(ret==2)
+ deleted= 1;
+ if(ret>=0)
+ ret= 1;
+ } else if(action==16 || action==18) { /* not_in_iso , add_missing */
+ ;
+ } else { /* includes : 15 in_iso */
+ sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
+ Xorriso_result(xorriso, 0);
+ ret= 1;
+ }
+ if(ret<=0)
+ return(ret);
+ if(deleted)
+ return(2);
+ return(1);
+}
+
+
+/* @param flag bit0= recursion
+ bit1= do not count deleted files with rm and rm_r
+ @return <=0 error, 1= ok , 2= dir node and path has been deleted
+*/
+int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
+ void *boss_iter, off_t boss_mem,
+ void *dir_node_generic, char *dir_path,
+ struct stat *dir_stbuf, int depth, int flag)
+{
+ int ret, action= 0, hflag, deleted= 0;
+ IsoDirIter *iter= NULL;
+ IsoDir *dir_node= NULL;
+ IsoNode *node, *iso_node;
+ IsoImage *volume;
+ struct stat stbuf;
+ char *name;
+ off_t mem;
+ IsoNode **node_array= NULL;
+ int node_count, node_idx;
+#ifdef Xorriso_fat_local_meM
+ char path[SfileadrL], abs_path[SfileadrL];
+#else /* Xorriso_fat_local_meM */
+ char *path= NULL, *abs_path= NULL;
+
+ path= malloc(SfileadrL);
+ abs_path= malloc(SfileadrL);
+ if(path==NULL || abs_path==NULL) {
+ Xorriso_no_malloc_memory(xorriso, &path, 0);
+ {ret= -1; goto ex;}
+ }
+#endif /* ! Xorriso_fat_local_meM */
+
+ action= Findjob_get_action(job, 0);
+ if(action<0)
+ action= 0;
+
+ dir_node= (IsoDir *) dir_node_generic;
+ if(dir_node==NULL) {
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ {ret= -1; goto ex;}
+ ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, dir_path, path, 1|2|4);
+ if(ret<=0)
+ goto ex;
+ ret= Xorriso_node_from_path(xorriso, volume, path, &iso_node, 0);
+ dir_node= (IsoDir *) iso_node;
+ if(ret<=0)
+ {ret= 0; goto ex;}
+ ret= Xorriso_fake_stbuf(xorriso, "", dir_stbuf, &iso_node, 1);
+ dir_node= (IsoDir *) iso_node;
+ if(ret<=0)
+ goto ex;
+
+ name= strrchr(dir_path, '/');
+ if(name==NULL)
+ name= dir_path;
+ else
+ name++;
+ ret= Findjob_test(job, name, NULL, dir_stbuf, depth, 0);
+ if(ret<0)
+ goto ex;
+ if(ret>0) {
+ ret= Xorriso_findi_action(xorriso, job,
+ (IsoDirIter *) boss_iter, boss_mem,
+ path, dir_path, (IsoNode *) dir_node, depth,
+ flag&(1|2));
+ if(ret<=0)
+ goto ex;
+ if(ret==2) {
+ deleted= 1;
+ goto ex;
+ }
+ }
+ }
+ if(!LIBISO_ISDIR((IsoNode *) dir_node))
+ {ret= 1; goto ex;}
+
+ mem= boss_mem;
+ hflag= 1;
+ if(action==1 || action==2 || action==3 || action==14)
+ hflag|= 2; /* need freedom to manipulate image */
+ if(action==14 || action==17)
+ hflag|= 4; /* need LBA sorted iteration for good data reading performance */
+ ret= Xorriso_findi_iter(xorriso, dir_node, &mem,
+ &iter, &node_array, &node_count, &node_idx,
+ &node, hflag);
+ if(ret<=0)
+ goto ex;
+ while(1) {
+ ret= Xorriso_findi_iter(xorriso, dir_node, &mem, &iter,
+ &node_array, &node_count, &node_idx, &node, 0);
+ if(ret<0)
+ goto ex;
+ if(ret==0 || xorriso->request_to_abort)
+ break;
+ name= (char *) iso_node_get_name(node);
+ ret= Xorriso_make_abs_adr(xorriso, dir_path, name, path, 4);
+ if(ret<=0)
+ goto ex;
+ ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1);
+ if(ret<0)
+ goto ex;
+ if(ret==0)
+ continue;
+
+/* ??? This seems to be redundant with the single test above
+ ??? Should i dive in unconditionally and leave out test and action here ?
+ ??? Then do above test unconditionally ?
+ --- Seems that the current configuration represents the special
+ handling of the find start path with mount points. Dangerous to change.
+*/
+ ret= Findjob_test(job, name, dir_stbuf, &stbuf, depth, 0);
+ if(ret<0)
+ goto ex;
+ if(ret>0) {
+ ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, path, abs_path, 1|2|4);
+ if(ret<=0)
+ goto ex;
+ ret= Xorriso_findi_action(xorriso, job, iter, mem,
+ abs_path, path, node, depth, 1|(flag&2));
+ if(ret==2) /* node has been deleted */
+ continue;
+ if(ret<=0) {
+ if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0)
+ goto ex;
+ }
+ }
+
+ if(S_ISDIR(stbuf.st_mode)) {
+ ret= Xorriso_findi(xorriso, job, (void *) iter, mem,
+ (void *) node, path, &stbuf, depth+1, flag|1);
+ if(ret<0)
+ goto ex;
+ }
+ }
+
+ ret= 1;
+ex:;
+
+#ifndef Xorriso_fat_local_meM
+ if(path!=NULL)
+ free(path);
+ if(abs_path!=NULL)
+ free(abs_path);
+#endif /* ! Xorriso_fat_local_meM */
+
+ Xorriso_process_msg_queues(xorriso,0);
+
+ Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count,
+ &node_idx, &node, (1<<31));
+ if(ret<=0)
+ return(ret);
+ if(deleted)
+ return(2);
+ return(1);
+}
+
+
+/* @param flag bit0= do not mark image as changed */
+int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag)
+{
+ int ret;
+ IsoImage *volume;
+
+ if(xorriso->in_volset_handle == NULL)
+ return(2);
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ iso_image_set_volume_id(volume, volid);
+ if(!(flag&1))
+ xorriso->volset_change_pending= 1;
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Volume ID: '%s'",iso_image_get_volume_id(volume));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+ return(1);
+}
+
+
+int Xorriso_get_volid(struct XorrisO *xorriso, char volid[33], int flag)
+{
+ int ret;
+ IsoImage *volume;
+
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ strncpy(volid, iso_image_get_volume_id(volume), 32);
+ volid[32]= 0;
+ return(1);
+}
+
+
+/* @param flag bit0= do not mark image as changed */
+int Xorriso_set_publisher(struct XorrisO *xorriso, char *name, int flag)
+{
+ int ret;
+ IsoImage *volume;
+
+ if(xorriso->in_volset_handle == NULL)
+ return(2);
+ ret= Xorriso_get_volume(xorriso, &volume, 0);
+ if(ret<=0)
+ return(ret);
+ iso_image_set_publisher_id(volume, name);
+ if(!(flag&1))
+ xorriso->volset_change_pending= 1;
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,"Publisher: '%s'",
+ iso_image_get_publisher_id(volume));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+ return(1);
+}
+
+
+/* @param flag bit0=prepare for a burn run */
+int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag)
+{
+ int ret;
+
+ /* ??? <<< On MISHAP use FAILURE as abort severity known to libisofs.
+ On ERRFILE use NEVER.
+ The pacifier loop will care for canceling libburn on MISHAP
+ and thus also cancel the image generation.
+ with libisofs-0.6.4 this should not be necessary
+ Shall it be uphold anyway ?
+ */
+ if((flag&1) && strcmp(xorriso->abort_on_text, "MISHAP")==0)
+ ret= iso_set_abort_severity("FAILURE");
+ else if((flag&1) && strcmp(xorriso->abort_on_text, "ERRFILE")==0)
+ ret= iso_set_abort_severity("NEVER");
+ else
+ ret= iso_set_abort_severity(xorriso->abort_on_text);
+ return(ret>=0);
+}
+
+
+int Xorriso_report_lib_versions(struct XorrisO *xorriso, int flag)
+{
+ int major, minor, micro;
+ int req_major, req_minor, req_micro;
+
+ iso_lib_version(&major, &minor, µ);
+ isoburn_libisofs_req(&req_major, &req_minor, &req_micro);
+ sprintf(xorriso->result_line,
+ "libisofs in use : %d.%d.%d (min. %d.%d.%d)\n",
+ major, minor, micro, req_major, req_minor, req_micro);
+ Xorriso_result(xorriso, 0);
+ burn_version(&major, &minor, µ);
+ isoburn_libburn_req(&req_major, &req_minor, &req_micro);
+ sprintf(xorriso->result_line,
+ "libburn in use : %d.%d.%d (min. %d.%d.%d)\n",
+ major, minor, micro, req_major, req_minor, req_micro);
+ Xorriso_result(xorriso, 0);
+ isoburn_version(&major, &minor, µ);
+ sprintf(xorriso->result_line,
+ "libisoburn in use : %d.%d.%d (min. %d.%d.%d)\n",
+ major, minor, micro,
+ isoburn_header_version_major, isoburn_header_version_minor,
+ isoburn_header_version_micro);
+ Xorriso_result(xorriso, 0);
+ return(1);
+}
+
+
+/* @param flag bit0= -inq
+ bit1= -checkdrive
+*/
+int Xorriso_atip(struct XorrisO *xorriso, int flag)
+{
+ int ret, profile_number= 0;
+ char *respt, profile_name[80];
+ double x_speed_max, x_speed_min= -1.0;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+ enum burn_disc_status s;
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to print drive and media info", 2);
+ if(ret<=0)
+ return(0);
+ respt= xorriso->result_line;
+ sprintf(respt, "Device type :");
+ ret= burn_drive_get_drive_role(drive);
+ if(ret==0)
+ sprintf(respt+strlen(respt), "%s\n", "Emulated (null-drive)");
+ else if(ret==2)
+ sprintf(respt+strlen(respt), "%s\n",
+ "Emulated (stdio-drive, 2k random read-write)");
+ else if(ret==3)
+ sprintf(respt+strlen(respt), "%s\n",
+ "Emulated (stdio-drive, sequential write-only)");
+ else if(ret!=1)
+ sprintf(respt+strlen(respt), "%s\n","Emulated (stdio-drive)");
+ else
+ sprintf(respt+strlen(respt), "%s\n","Removable CD-ROM");
+ sprintf(respt+strlen(respt), "Vendor_info : '%s'\n",dinfo->vendor);
+ sprintf(respt+strlen(respt), "Identifikation : '%s'\n",dinfo->product);
+ sprintf(respt+strlen(respt), "Revision : '%s'\n",dinfo->revision);
+ Xorriso_result(xorriso,1);
+ if(flag&1)
+ return(1);
+ sprintf(respt, "Driver flags : BURNFREE\n");
+ sprintf(respt+strlen(respt), "Supported modes: SAO TAO\n");
+ Xorriso_result(xorriso,1);
+ if(flag&2)
+ return(1);
+
+ s= burn_disc_get_status(drive);
+ ret= burn_disc_get_profile(drive,&profile_number,profile_name);
+ if(ret<=0) {
+ profile_number= 0;
+ strcpy(profile_name, "-unidentified-");
+ }
+ if(s != BURN_DISC_UNSUITABLE) {
+ ret= burn_disc_read_atip(drive);
+ if(ret>0) {
+ ret= burn_drive_get_min_write_speed(drive);
+ x_speed_min= ((double) ret)/176.4;
+ }
+ }
+ if(s==BURN_DISC_EMPTY) {
+ sprintf(respt, "Current: none\n");
+ Xorriso_result(xorriso,1);
+ return(1);
+ } else
+ sprintf(respt, "Current: %s\n",profile_name);
+ Xorriso_result(xorriso,1);
+ if(strstr(profile_name,"DVD")==profile_name) {
+ sprintf(respt, "book type: %s (emulated booktype)\n", profile_name);
+ Xorriso_result(xorriso,1);
+ sprintf(respt, "xorriso: message for sdvdbackup: \"(growisofs mode Restricted Overwrite)\"\n");
+ Xorriso_result(xorriso,1);
+ } else {
+ sprintf(respt, "ATIP info from disk:\n");
+ Xorriso_result(xorriso,1);
+ if(burn_disc_erasable(drive))
+ sprintf(respt, " Is erasable\n");
+ else
+ sprintf(respt, " Is not erasable\n");
+ Xorriso_result(xorriso,1);
+ { int start_lba,end_lba,min,sec,fr;
+ ret= burn_drive_get_start_end_lba(drive,&start_lba,&end_lba,0);
+ if(ret>0) {
+ burn_lba_to_msf(start_lba,&min,&sec,&fr);
+ sprintf(respt, " ATIP start of lead in: %d (%-2.2d:%-2.2d/%-2.2d)\n",
+ start_lba,min,sec,fr);
+ Xorriso_result(xorriso,1);
+ burn_lba_to_msf(end_lba,&min,&sec,&fr);
+ sprintf(respt, " ATIP start of lead out: %d (%-2.2d:%-2.2d/%-2.2d)\n",
+ end_lba,min,sec,fr);
+ Xorriso_result(xorriso,1);
+ }
+ }
+ ret= burn_drive_get_write_speed(drive);
+ x_speed_max= ((double) ret)/176.4;
+ if(x_speed_min<0)
+ x_speed_min= x_speed_max;
+ sprintf(respt,
+ " 1T speed low: %.f 1T speed high: %.f\n",x_speed_min,x_speed_max);
+ Xorriso_result(xorriso,1);
+ }
+ return(1);
+}
+
+
+int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag)
+{
+ int ret, fd, unpredicted_size, profile_number, is_cd= 0;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+ struct burn_write_opts *burn_options;
+ struct burn_disc *disc= NULL;
+ struct burn_session *session;
+ struct burn_track *track;
+ struct stat stbuf;
+ off_t fixed_size= 0;
+ struct burn_source *data_src, *fifo_src;
+ enum burn_disc_status disc_state;
+ char reasons[BURN_REASONS_LEN], sfe[5*SfileadrL], profile_name[80];
+
+
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to burn track", 2);
+ if(ret<=0)
+ return(0);
+ ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0);
+ if(ret<=0)
+ goto ex;
+
+ disc= burn_disc_create();
+ session= burn_session_create();
+ ret= burn_disc_add_session(disc,session,BURN_POS_END);
+ if(ret==0) {
+ /* >>> */;
+ goto ex;
+ }
+ track= burn_track_create();
+ if(track_source[0] == '-' && track_source[1] == 0) {
+ fd= 0;
+ } else {
+ fd= open(track_source, O_RDONLY);
+ if(fd>=0)
+ if(fstat(fd,&stbuf)!=-1)
+ if((stbuf.st_mode&S_IFMT)==S_IFREG)
+ fixed_size= stbuf.st_size;
+ }
+ if(fixed_size==0)
+ unpredicted_size= 1;
+
+ data_src= NULL;
+ if(fd>=0)
+ data_src= burn_fd_source_new(fd, -1, fixed_size);
+ if(data_src==NULL) {
+ sprintf(xorriso->info_text, "Could not open data source %s",
+ Text_shellsafe(track_source,sfe,0));
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ fifo_src= burn_fifo_source_new(data_src, 2048, xorriso->fs, 0);
+ if(fifo_src == NULL) {
+ sprintf(xorriso->info_text, "Could not create fifo object of 4 MB");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ ret= 0; goto ex;
+ }
+ xorriso->pacifier_fifo= fifo_src;
+ if(burn_track_set_source(track, fifo_src)!=BURN_SOURCE_OK) {
+ sprintf(xorriso->info_text,
+ "Cannot attach source object to track object");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
+ ret= 0; goto ex;
+ }
+ burn_session_add_track(session, track, BURN_POS_END);
+ burn_source_free(data_src);
+
+ disc_state = burn_disc_get_status(drive);
+ if(disc_state == BURN_DISC_BLANK) {
+ /* ok */;
+ } else if(disc_state == BURN_DISC_APPENDABLE) {
+ if(!isoburn_needs_emulation(drive)) {
+ sprintf(xorriso->info_text,
+ "Appendable media with data detected. Need blank media.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+ } else {
+ if(disc_state == BURN_DISC_FULL) {
+ sprintf(xorriso->info_text,
+ "Closed media with data detected. Need blank media.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ if(burn_disc_erasable(drive)) {
+ sprintf(xorriso->info_text, "Try --blank_fast\n");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
+ }
+ } else if(disc_state == BURN_DISC_EMPTY) {
+ sprintf(xorriso->info_text, "No media detected in drive");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ } else {
+ sprintf(xorriso->info_text,
+ "Cannot recognize state of drive and media");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ }
+ ret= 0; goto ex;
+ }
+ if(burn_write_opts_auto_write_type(burn_options, disc, reasons, 0) ==
+ BURN_WRITE_NONE) {
+ sprintf(xorriso->info_text,
+ "Failed to find a suitable write mode with this media.\n");
+ sprintf(xorriso->info_text+strlen(xorriso->info_text),
+ "Reasons given:\n%s", reasons);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+
+ ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2);
+ is_cd= (ret==2);
+ if(isoburn_needs_emulation(drive))
+ burn_write_opts_set_start_byte(burn_options, (off_t) 0);
+ ret= Xorriso_sanitize_image_size(xorriso, drive, disc, burn_options, 2);
+ if(ret<=0)
+ goto ex;
+
+ xorriso->run_state= 1; /* Indicate that burning has started */
+ burn_disc_write(burn_options, disc);
+
+ ret= Xorriso_pacifier_loop(xorriso, drive, 1|(is_cd<<4));
+ if(ret<=0)
+ goto ex;
+ if(!burn_drive_wrote_well(drive)) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "libburn indicates failure with writing.");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ ret= 0; goto ex;
+ }
+
+ sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n");
+ Xorriso_info(xorriso, 0);
+ ret= 1;
+ex:;
+ Xorriso_process_msg_queues(xorriso,0);
+ if(disc!=NULL)
+ burn_disc_free(disc);
+ if(xorriso->pacifier_fifo!=NULL)
+ burn_source_free(xorriso->pacifier_fifo);
+ xorriso->pacifier_fifo= NULL;
+ xorriso->run_state= 0; /* Indicate that burning has ended */
+ return(ret);
+}
+
+
+
+/* @param flag bit1= outdev rather than indev
+ @return <0 error, 0 = no profile to see , 1= ok , 2= ok, is CD profile
+*/
+int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number,
+ char profile_name[80], int flag)
+{
+ int ret;
+ struct burn_drive_info *dinfo;
+ struct burn_drive *drive;
+
+ *profile_number= 0;
+ profile_name[0]= 0;
+ if(xorriso->out_drive_handle==NULL)
+ return(0);
+ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
+ "on attempt to determine media type", flag&2);
+ if(ret<=0)
+ return(0);
+ ret=burn_disc_get_profile(drive, profile_number, profile_name);
+ if(ret<=0)
+ return(ret);
+ if(*profile_number==0x08 || *profile_number==0x09 || *profile_number==0x0a)
+ return(2);
+ return(0);
+}
+
+
+int Xorriso_iso_file_open(struct XorrisO *xorriso, char *pathname,
+ void **stream, int flag)
+{
+ int ret;
+ char eff_path[SfileadrL];
+ IsoNode *node= NULL;
+ IsoFile *filenode= NULL;
+ IsoStream *iso_stream= NULL;
+
+#ifdef Libisofs_lba_tesT
+ uint32_t lba;
+#endif
+
+ *stream= NULL;
+ ret= Xorriso_get_node_by_path(xorriso, pathname, eff_path, &node, 0);
+ if(ret<=0)
+ return(ret);
+ if(!LIBISO_ISREG(node)) {
+ sprintf(xorriso->info_text,
+ "Given path does not lead to a regular data file in the image");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+
+#ifdef Libisofs_lba_tesT
+ ret = iso_node_get_old_image_lba(node, &lba, 0);
+ sprintf(xorriso->info_text, "%s : ret= %d , LBA= %lx",
+ pathname, ret, (unsigned long) lba);
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
+#endif
+
+ filenode= (IsoFile *) node;
+ iso_stream= iso_file_get_stream(filenode);
+ if(iso_stream==NULL) {
+ Xorriso_process_msg_queues(xorriso,0);
+ sprintf(xorriso->info_text,
+ "Could not obtain source stream of file in the image for reading");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ ret= iso_stream_open(iso_stream);
+ if(ret<0) {
+ sprintf(xorriso->info_text,
+ "Could not open data file in the image for reading");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ return(0);
+ }
+ if(!iso_stream_is_repeatable(iso_stream)) {
+ sprintf(xorriso->info_text,
+ "The data production of the file in the image is one-time only");
+ Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
+ iso_stream_close(iso_stream);
+ return(0);
+ }
+ Xorriso_process_msg_queues(xorriso,0);
+ *stream= iso_stream;
+ return(1);
+}
+
+
+int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf,
+ int count, int flag)
+{
+ int ret, rcnt= 0;
+ IsoStream *stream_pt;
+
+ stream_pt= (IsoStream *) stream;
+
+ while(rcnt
+
+ Provided under GPL version 2.
+
+ This file contains the inner isofs- and burn-library interface of xorriso.
+*/
+
+#ifndef Xorrisoburn_includeD
+#define Xorrisoburn_includeD yes
+
+struct XorrisO;
+struct FindjoB;
+
+/* The minimum version of libisoburn to be used with this version of xorriso
+*/
+#define xorriso_libisoburn_req_major 0
+#define xorriso_libisoburn_req_minor 1
+#define xorriso_libisoburn_req_micro 0
+
+int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag);
+
+/* @param flag bit0= global shutdown of libraries */
+int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag);
+
+int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag);
+
+/* @param flag bit0=aquire as isoburn input drive
+ bit1=aquire as libburn output drive (as isoburn drive if bit0)
+ @return <=0 failure , 1=success , 2=neither readable or writeable
+*/
+int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag);
+
+int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag);
+
+int Xorriso_write_session(struct XorrisO *xorriso, int flag);
+
+/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
+ Set to NULL if calling this function from outside ISO world
+ @param flag bit0= mkdir: graft in as empty directory, not as copy from disk
+ bit1= do not report added files
+ @return <=0 = error , 1 = added simple node , 2 = added directory
+*/
+int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter,
+ char *disk_path, char *img_path, int flag);
+
+int Xorriso__text_to_sev(char *severity_name, int *severity_number,int flag);
+
+/* @param flag bit0=report about output drive
+ bit1=short report form
+*/
+int Xorriso_toc(struct XorrisO *xorriso, int flag);
+
+int Xorriso_show_devices(struct XorrisO *xorriso, int flag);
+
+int Xorriso_tell_media_space(struct XorrisO *xorriso,
+ int *media_space, int *free_space, int flag);
+
+int Xorriso_blank_media(struct XorrisO *xorriso, int flag);
+
+int Xorriso_format_media(struct XorrisO *xorriso, int flag);
+
+/* @param boss_iter Opaque internal handle. Use NULL outside xorrisoburn.c :
+ If not NULL then this is an iterator suitable for
+ iso_dir_iter_remove() which is then to be used instead
+ of iso_node_remove().
+ @param flag bit0= remove whole sub tree: rm -r
+ bit1= remove empty directory: rmdir
+ bit2= recursion: do not reassure in mode 2 "tree"
+ bit3= this is for overwriting and not for plain removal
+ @return <=0 = error
+ 1 = removed simple node
+ 2 = removed directory or tree
+ 3 = did not remove on user revocation
+*/
+int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
+ char *path, int flag);
+
+/* @param flag bit0= long format
+ bit1= do not print count of nodes
+ bit2= du format
+ bit3= print directories as themselves (ls -d)
+*/
+int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
+ int filec, char **filev, off_t boss_mem, int flag);
+
+/* This function needs less buffer memory than Xorriso_ls_filev() but cannot
+ perform structured pattern matching.
+ @param flag bit0= long format
+ bit1= only check for directory existence
+ bit2= do not apply search pattern but accept any file
+ bit3= just count nodes and return number
+*/
+int Xorriso_ls(struct XorrisO *xorriso, int flag);
+
+/* @param wd Path to prepend in case img_path is not absolute
+ @param img_path Absolute or relative path to be normalized
+ @param eff_path returns resulting effective path.
+ Must provide at least SfileadrL bytes of storage.
+ @param flag bit0= do not produce problem events (unless faulty path format)
+ bit1= work purely literally, do not use libisofs
+ bit2= (with bit1) this is an address in the disk world
+ @return -1 = faulty path format, 0 = not found ,
+ 1 = found simple node , 2 = found directory
+*/
+int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd,
+ char *img_path, char eff_path[], int flag);
+
+/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
+ Set to NULL if calling this function from outside ISO world
+*/
+int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
+ char *origin, char *dest, int flag);
+
+/* @param flag bit0= do not produce info message on success
+ @return 1=success, 0=was already directory, -1=was other type, -2=bad path
+*/
+int Xorriso_mkdir(struct XorrisO *xorriso, char *img_path, int flag);
+
+/* @param flag bit0= a match count !=1 is a SORRY event */
+int Xorriso_expand_pattern(struct XorrisO *xorriso,
+ int num_patterns, char **patterns, int extra_filec,
+ int *filec, char ***filev, off_t *mem, int flag);
+
+int Xorriso_set_st_mode(struct XorrisO *xorriso, char *path,
+ mode_t mode_and, mode_t mode_or, int flag);
+
+int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid,
+ int flag);
+
+int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid,
+ int flag);
+
+/* @parm flag bit0= atime, bit1= ctime, bit2= mtime, bit8=no auto ctime */
+int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
+ int flag);
+
+/* @param flag bit0= recursion
+ bit1= do not count deleted files with rm and rm_r
+*/
+int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
+ void *boss_iter, off_t boss_mem,
+ void *dir_node_generic, char *dir_path,
+ struct stat *dir_stbuf, int depth, int flag);
+
+/* @param flag bit0= do not mark image as changed */
+int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag);
+
+int Xorriso_get_volid(struct XorrisO *xorriso, char volid[33], int flag);
+
+int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag);
+
+int Xorriso_report_lib_versions(struct XorrisO *xorriso, int flag);
+
+/* @return 0= stbuf content is valid , -1 = path not found */
+int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf,
+ int flag);
+
+/* @param flag bit0= -inq
+ bit1= -checkdrive
+*/
+int Xorriso_atip(struct XorrisO *xorriso, int flag);
+
+int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag);
+
+/* @param flag bit1= outdev rather than indev
+ @return <=0 = failure , 1= ok , 2= ok, is CD profile
+*/
+int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number,
+ char profile_name[80], int flag);
+
+/* @param flag bit0= do not mark image as changed */
+int Xorriso_set_publisher(struct XorrisO *xorriso, char *name, int flag);
+
+
+int Xorriso_iso_file_open(struct XorrisO *xorriso, char *pathname,
+ void **stream, int flag);
+
+int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf,
+ int count, int flag);
+
+int Xorriso_iso_file_close(struct XorrisO *xorriso, void **stream, int flag);
+
+/* @param bit0= copy link target properties rather than link properties
+*/
+int Xorriso_copy_properties(struct XorrisO *xorriso,
+ char *disk_path, char *img_path, int flag);
+
+#endif /* Xorrisoburn_includeD */
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/AUTHORS b/libisofs/tags/ForXorrisoZeroOneTwo/AUTHORS
new file mode 100644
index 00000000..4b186770
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/AUTHORS
@@ -0,0 +1,3 @@
+Vreixo Formoso
+Mario Danic
+Thomas Schmitt
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/COPYING b/libisofs/tags/ForXorrisoZeroOneTwo/COPYING
new file mode 100644
index 00000000..5a965fbc
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/COPYING
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/COPYRIGHT b/libisofs/tags/ForXorrisoZeroOneTwo/COPYRIGHT
new file mode 100644
index 00000000..8d562a3d
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/COPYRIGHT
@@ -0,0 +1,19 @@
+Vreixo Formoso ,
+Mario Danic ,
+Thomas Schmitt
+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
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/ChangeLog b/libisofs/tags/ForXorrisoZeroOneTwo/ChangeLog
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/ChangeLog
@@ -0,0 +1 @@
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/INSTALL b/libisofs/tags/ForXorrisoZeroOneTwo/INSTALL
new file mode 100644
index 00000000..5458714e
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/INSTALL
@@ -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.
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/Makefile.am b/libisofs/tags/ForXorrisoZeroOneTwo/Makefile.am
new file mode 100644
index 00000000..6101ec9c
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/Makefile.am
@@ -0,0 +1,191 @@
+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/find.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/filter.h \
+ libisofs/filter.c \
+ libisofs/filters/xor_encrypt.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
+libisofs_libisofs_la_LIBADD= \
+ $(THREAD_LIBS)
+libinclude_HEADERS = \
+ libisofs/libisofs.h
+
+## ========================================================================= ##
+
+## Build demo applications
+noinst_PROGRAMS = \
+ demo/lsl \
+ demo/cat \
+ demo/catbuffer \
+ demo/tree \
+ demo/find \
+ 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_find_CPPFLAGS = -Ilibisofs
+demo_find_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
+demo_find_SOURCES = demo/find.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
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/NEWS b/libisofs/tags/ForXorrisoZeroOneTwo/NEWS
new file mode 100644
index 00000000..8acff7bc
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/NEWS
@@ -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
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/README b/libisofs/tags/ForXorrisoZeroOneTwo/README
new file mode 100644
index 00000000..1ead917f
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/README
@@ -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
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/Roadmap b/libisofs/tags/ForXorrisoZeroOneTwo/Roadmap
new file mode 100644
index 00000000..926ecef6
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/Roadmap
@@ -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
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/TODO b/libisofs/tags/ForXorrisoZeroOneTwo/TODO
new file mode 100644
index 00000000..bad313fc
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/TODO
@@ -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
+=====
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/acinclude.m4 b/libisofs/tags/ForXorrisoZeroOneTwo/acinclude.m4
new file mode 100644
index 00000000..861847bb
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/acinclude.m4
@@ -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])
+])
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/bootstrap b/libisofs/tags/ForXorrisoZeroOneTwo/bootstrap
new file mode 100755
index 00000000..86709bfc
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/bootstrap
@@ -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
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/configure.ac b/libisofs/tags/ForXorrisoZeroOneTwo/configure.ac
new file mode 100644
index 00000000..69b7dc5e
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/configure.ac
@@ -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 ])
+
+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 ])
+
+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 ])
+
+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
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/cat.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/cat.c
new file mode 100644
index 00000000..a95eebc3
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/cat.c
@@ -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
+#include
+
+/*
+ * 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;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/cat_buffer.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/cat_buffer.c
new file mode 100644
index 00000000..74657ee2
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/cat_buffer.c
@@ -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
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * 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;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/ecma119_tree.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/ecma119_tree.c
new file mode 100644
index 00000000..e1c4dbec
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/ecma119_tree.c
@@ -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
+#include
+#include
+#include
+#include
+#include
+
+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->iso_level = 1;
+ ecma119->rockridge = 1;
+ ecma119->image = image;
+ ecma119->input_charset = strdup("UTF-8");
+
+ /* create low level tree */
+ result = ecma119_tree_create(ecma119);
+ if (result < 0) {
+ printf ("Error creating ecma-119 tree: %d\n", result);
+ return 1;
+ }
+
+ printf("================= ECMA-119 TREE =================\n");
+ print_dir(ecma119->root, 0);
+ printf("\n\n");
+
+ ecma119_node_free(ecma119->root);
+ iso_rbtree_destroy(ecma119->files, iso_file_src_free);
+ free(ecma119->input_charset);
+ free(ecma119);
+ iso_image_unref(image);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso.c
new file mode 100644
index 00000000..f3783b08
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso.c
@@ -0,0 +1,176 @@
+/*
+ * Little program to show how to create an iso image from a local
+ * directory.
+ */
+
+#include "libisofs.h"
+#include "libburn/libburn.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+const char * const optstring = "JRIL:b:hV:";
+extern char *optarg;
+extern int optind;
+
+void usage(char **argv)
+{
+ printf("%s [OPTIONS] DIRECTORY OUTPUT\n", argv[0]);
+}
+
+void help()
+{
+ printf(
+ "Options:\n"
+ " -J Add Joliet support\n"
+ " -R Add Rock Ridge support\n"
+ " -I Add ISO 9660:1999 support\n"
+ " -V label Volume Label\n"
+ " -L Set the ISO level (1 or 2)\n"
+ " -b file Specifies a boot image to add to image\n"
+ " -h Print this message\n"
+ );
+}
+
+int callback(IsoFileSource *src)
+{
+ char *path = iso_file_source_get_path(src);
+ printf("CALLBACK: %s\n", path);
+ free(path);
+ return 1;
+}
+
+int main(int argc, char **argv)
+{
+ int result;
+ int c;
+ IsoImage *image;
+ struct burn_source *burn_src;
+ unsigned char buf[2048];
+ FILE *fd;
+ IsoWriteOpts *opts;
+ char *volid = "VOLID";
+ char *boot_img = NULL;
+ int rr = 0, j = 0, iso1999 = 0, level = 1;
+
+ while ((c = getopt(argc, argv, optstring)) != -1) {
+ switch(c) {
+ case 'h':
+ usage(argv);
+ help();
+ exit(0);
+ break;
+ case 'J':
+ j = 1;
+ break;
+ case 'R':
+ rr = 1;
+ break;
+ case 'I':
+ iso1999 = 1;
+ break;
+ case 'L':
+ level = atoi(optarg);
+ break;
+ case 'b':
+ boot_img = optarg;
+ break;
+ case 'V':
+ volid = optarg;
+ break;
+ case '?':
+ usage(argv);
+ exit(1);
+ break;
+ }
+ }
+
+ if (argc < 2) {
+ printf ("Please pass directory from which to build ISO\n");
+ usage(argv);
+ return 1;
+ }
+ if (argc < 3) {
+ printf ("Please supply output file\n");
+ usage(argv);
+ return 1;
+ }
+
+ fd = fopen(argv[optind+1], "w");
+ if (!fd) {
+ err(1, "error opening output file");
+ }
+
+ result = iso_init();
+ if (result < 0) {
+ printf ("Can't initialize libisofs\n");
+ return 1;
+ }
+ iso_set_msgs_severities("NEVER", "ALL", "");
+
+ result = iso_image_new(volid, &image);
+ if (result < 0) {
+ printf ("Error creating image\n");
+ return 1;
+ }
+ iso_tree_set_follow_symlinks(image, 0);
+ iso_tree_set_ignore_hidden(image, 0);
+ iso_tree_set_ignore_special(image, 0);
+ iso_set_abort_severity("SORRY");
+ /*iso_tree_set_report_callback(image, callback);*/
+
+ result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[optind]);
+ if (result < 0) {
+ printf ("Error adding directory %d\n", result);
+ return 1;
+ }
+
+ if (boot_img) {
+ /* adds El-Torito boot info. Tunned for isolinux */
+ ElToritoBootImage *bootimg;
+ result = iso_image_set_boot_image(image, boot_img, ELTORITO_NO_EMUL,
+ "/isolinux/boot.cat", &bootimg);
+ if (result < 0) {
+ printf ("Error adding boot image %d\n", result);
+ return 1;
+ }
+ el_torito_set_load_size(bootimg, 4);
+ el_torito_patch_isolinux_image(bootimg);
+ }
+
+ result = iso_write_opts_new(&opts, 0);
+ if (result < 0) {
+ printf ("Cant create write opts, error %d\n", result);
+ return 1;
+ }
+ iso_write_opts_set_iso_level(opts, level);
+ iso_write_opts_set_rockridge(opts, rr);
+ iso_write_opts_set_joliet(opts, j);
+ iso_write_opts_set_iso1999(opts, iso1999);
+
+ result = iso_image_create_burn_source(image, opts, &burn_src);
+ if (result < 0) {
+ printf ("Cant create image, error %d\n", result);
+ return 1;
+ }
+
+ iso_write_opts_free(opts);
+
+ while (burn_src->read_xt(burn_src, buf, 2048) == 2048) {
+ fwrite(buf, 1, 2048, fd);
+ }
+ fclose(fd);
+ burn_src->free_data(burn_src);
+ free(burn_src);
+
+ iso_image_unref(image);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_cat.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_cat.c
new file mode 100644
index 00000000..452d1b12
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_cat.c
@@ -0,0 +1,95 @@
+/*
+ * 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
+#include
+
+#include "libisofs.h"
+
+/*
+ * Little test program that extracts a file form a given ISO image.
+ * Outputs file contents to stdout!
+ */
+
+int main(int argc, char **argv)
+{
+ int res;
+ IsoFilesystem *fs;
+ IsoFileSource *file;
+ struct stat info;
+ IsoDataSource *src;
+ IsoReadOpts *opts;
+
+ if (argc != 3) {
+ fprintf(stderr, "Usage: isocat /path/to/image /path/to/file\n");
+ return 1;
+ }
+
+ res = iso_init();
+ if (res < 0) {
+ fprintf(stderr, "Can't init libisofs\n");
+ return 1;
+ }
+
+ res = iso_data_source_new_from_file(argv[1], &src);
+ if (res < 0) {
+ fprintf(stderr, "Error creating data source\n");
+ return 1;
+ }
+
+ res = iso_read_opts_new(&opts, 0);
+ if (res < 0) {
+ fprintf(stderr, "Error creating read options\n");
+ return 1;
+ }
+ res = iso_image_filesystem_new(src, opts, 1, &fs);
+ if (res < 0) {
+ fprintf(stderr, "Error creating filesystem\n");
+ return 1;
+ }
+ iso_read_opts_free(opts);
+
+ res = fs->get_by_path(fs, argv[2], &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);
+ iso_data_source_unref(src);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_grow.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_grow.c
new file mode 100644
index 00000000..951aec1b
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_grow.c
@@ -0,0 +1,257 @@
+/*
+ * Very simple program to show how to grow an iso image.
+ */
+
+#include "libisofs.h"
+#include "libburn/libburn.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+static IsoDataSource *libburn_data_source_new(struct burn_drive *d);
+
+void usage(char **argv)
+{
+ printf("%s DISC DIRECTORY\n", argv[0]);
+}
+
+int main(int argc, char **argv)
+{
+ int result;
+ IsoImage *image;
+ IsoDataSource *src;
+ struct burn_source *burn_src;
+ struct burn_drive_info *drives;
+ struct burn_drive *drive;
+ unsigned char buf[32 * 2048];
+ IsoWriteOpts *opts;
+ int ret = 0;
+ IsoReadImageFeatures *features;
+ uint32_t ms_block;
+ IsoReadOpts *ropts;
+
+ if (argc < 3) {
+ usage(argv);
+ return 1;
+ }
+
+ iso_init();
+ iso_set_msgs_severities("NEVER", "ALL", "");
+
+ /* create the image context */
+ result = iso_image_new("volume_id", &image);
+ if (result < 0) {
+ printf ("Error creating image\n");
+ return 1;
+ }
+ iso_tree_set_follow_symlinks(image, 0);
+ iso_tree_set_ignore_hidden(image, 0);
+
+ if (!burn_initialize()) {
+ err(1, "Can't init libburn");
+ }
+ burn_msgs_set_severities("NEVER", "SORRY", "libburner : ");
+
+ if (burn_drive_scan_and_grab(&drives, argv[1], 0) != 1) {
+ err(1, "Can't open device. Are you sure it is a valid drive?\n");
+ }
+
+ drive = drives[0].drive;
+
+#ifdef ISO_GROW_CHECK_MEDIA
+ {
+ /* some check before going on */
+ enum burn_disc_status state;
+ int pno;
+ char name[80];
+
+ state = burn_disc_get_status(drive);
+ burn_disc_get_profile(drive, &pno, name);
+
+ /*
+ * my drives report BURN_DISC_BLANK on a DVD+RW with data.
+ * is that correct?
+ */
+ if ( (pno != 0x1a) /*|| (state != BURN_DISC_FULL)*/ ) {
+ printf("You need to insert a DVD+RW with some data.\n");
+ printf("Profile: %x, state: %d.\n", pno, state);
+ ret = 1;
+ goto exit_cleanup;
+ }
+ }
+#endif
+
+ /* create the data source to accesss previous image */
+ src = libburn_data_source_new(drive);
+ if (src == NULL) {
+ printf("Can't create data source.\n");
+ ret = 1;
+ goto exit_cleanup;
+ }
+
+ /* import previous image */
+ ret = iso_read_opts_new(&ropts, 0);
+ if (ret < 0) {
+ fprintf(stderr, "Error creating read options\n");
+ return 1;
+ }
+ result = iso_image_import(image, src, ropts, &features);
+ iso_data_source_unref(src);
+ if (result < 0) {
+ printf ("Error importing previous session %d\n", result);
+ return 1;
+ }
+ iso_read_opts_free(ropts);
+
+ iso_tree_set_replace_mode(image, ISO_REPLACE_IF_NEWER);
+
+ /* add new dir */
+ result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[2]);
+ if (result < 0) {
+ printf ("Error adding directory %d\n", result);
+ return 1;
+ }
+
+ /* generate a multisession image with new contents */
+ result = iso_write_opts_new(&opts, 1);
+ if (result < 0) {
+ printf("Cant create write opts, error %d\n", result);
+ return 1;
+ }
+
+ /* round up to 32kb aligment = 16 block */
+ ms_block = ((iso_read_image_features_get_size(features) + 15) / 16 ) * 16;
+ iso_write_opts_set_ms_block(opts, ms_block);
+ iso_write_opts_set_appendable(opts, 1);
+ iso_write_opts_set_overwrite_buf(opts, buf);
+
+ iso_read_image_features_destroy(features);
+
+ result = iso_image_create_burn_source(image, opts, &burn_src);
+ if (result < 0) {
+ printf("Cant create image, error %d\n", result);
+ return 1;
+ }
+
+ iso_write_opts_free(opts);
+
+ /* a. write the new image */
+ printf("Adding new data...\n");
+ {
+ struct burn_disc *target_disc;
+ struct burn_session *session;
+ struct burn_write_opts *burn_options;
+ struct burn_track *track;
+ struct burn_progress progress;
+ char reasons[BURN_REASONS_LEN];
+
+ target_disc = burn_disc_create();
+ session = burn_session_create();
+ burn_disc_add_session(target_disc, session, BURN_POS_END);
+
+ track = burn_track_create();
+ burn_track_set_source(track, burn_src);
+ burn_session_add_track(session, track, BURN_POS_END);
+
+ burn_options = burn_write_opts_new(drive);
+ burn_drive_set_speed(drive, 0, 0);
+ burn_write_opts_set_underrun_proof(burn_options, 1);
+
+ /* mmm, check for 32K alignment? */
+ burn_write_opts_set_start_byte(burn_options, ms_block * 2048);
+
+ if (burn_write_opts_auto_write_type(burn_options, target_disc,
+ reasons, 0) == BURN_WRITE_NONE) {
+ printf("Failed to find a suitable write mode:\n%s\n", reasons);
+ ret = 1;
+ goto exit_cleanup;
+ }
+
+ /* ok, write the new track */
+ burn_disc_write(burn_options, target_disc);
+ burn_write_opts_free(burn_options);
+
+ while (burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
+ usleep(1002);
+
+ while (burn_drive_get_status(drive, &progress) != BURN_DRIVE_IDLE) {
+ printf("Writing: sector %d of %d\n", progress.sector, progress.sectors);
+ sleep(1);
+ }
+
+ }
+
+ /* b. write the new vol desc */
+ printf("Writing the new vol desc...\n");
+ ret = burn_random_access_write(drive, 0, (char*)buf, 32*2048, 0);
+ if (ret != 1) {
+ printf("Ups, new vol desc write failed\n");
+ }
+
+ iso_image_unref(image);
+
+exit_cleanup:;
+ burn_drive_release(drives[0].drive, 0);
+ burn_finish();
+ iso_finish();
+
+ exit(ret);
+}
+
+static int
+libburn_ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
+{
+ struct burn_drive *d;
+ off_t data_count;
+
+ d = (struct burn_drive*)src->data;
+
+ if ( burn_read_data(d, (off_t) lba * (off_t) 2048, (char*)buffer,
+ 2048, &data_count, 0) < 0 ) {
+ return -1; /* error */
+ }
+
+ return 1;
+}
+
+static
+int libburn_ds_open(IsoDataSource *src)
+{
+ /* nothing to do, device is always opened */
+ return 1;
+}
+
+static
+int libburn_ds_close(IsoDataSource *src)
+{
+ /* nothing to do, device is always opened */
+ return 1;
+}
+
+static void
+libburn_ds_free_data(IsoDataSource *src)
+{
+ /* nothing to do */
+}
+
+static IsoDataSource *
+libburn_data_source_new(struct burn_drive *d)
+{
+ IsoDataSource *ret;
+
+ ret = malloc(sizeof(IsoDataSource));
+ ret->version = 0;
+ ret->refcount = 1;
+ ret->read_block = libburn_ds_read_block;
+ ret->open = libburn_ds_open;
+ ret->close = libburn_ds_close;
+ ret->free_data = libburn_ds_free_data;
+ ret->data = d;
+ return ret;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_modify.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_modify.c
new file mode 100644
index 00000000..85404ce4
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_modify.c
@@ -0,0 +1,109 @@
+/*
+ * Little program to show how to modify an iso image.
+ */
+
+#include "libisofs.h"
+#include "libburn/libburn.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+void usage(char **argv)
+{
+ printf("%s [OPTIONS] IMAGE DIRECTORY OUTPUT\n", argv[0]);
+}
+
+int main(int argc, char **argv)
+{
+ int result;
+ IsoImage *image;
+ IsoDataSource *src;
+ struct burn_source *burn_src;
+ unsigned char buf[2048];
+ FILE *fd;
+ IsoWriteOpts *opts;
+ IsoReadOpts *ropts;
+
+ if (argc < 4) {
+ usage(argv);
+ return 1;
+ }
+
+ fd = fopen(argv[3], "w");
+ if (!fd) {
+ err(1, "error opening output file");
+ }
+
+ iso_init();
+ iso_set_msgs_severities("NEVER", "ALL", "");
+
+ /* create the data source to accesss previous image */
+ result = iso_data_source_new_from_file(argv[1], &src);
+ if (result < 0) {
+ printf ("Error creating data source\n");
+ return 1;
+ }
+
+ /* create the image context */
+ result = iso_image_new("volume_id", &image);
+ if (result < 0) {
+ printf ("Error creating image\n");
+ return 1;
+ }
+ iso_tree_set_follow_symlinks(image, 0);
+ iso_tree_set_ignore_hidden(image, 0);
+
+ /* import previous image */
+ result = iso_read_opts_new(&ropts, 0);
+ if (result < 0) {
+ fprintf(stderr, "Error creating read options\n");
+ return 1;
+ }
+ result = iso_image_import(image, src, ropts, NULL);
+ iso_read_opts_free(ropts);
+ iso_data_source_unref(src);
+ if (result < 0) {
+ printf ("Error importing previous session %d\n", result);
+ return 1;
+ }
+
+ /* add new dir */
+ result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[2]);
+ if (result < 0) {
+ printf ("Error adding directory %d\n", result);
+ return 1;
+ }
+
+ /* generate a new image with both previous and added contents */
+ result = iso_write_opts_new(&opts, 1);
+ if (result < 0) {
+ printf("Cant create write opts, error %d\n", result);
+ return 1;
+ }
+ /* for isolinux: iso_write_opts_set_allow_full_ascii(opts, 1); */
+
+ result = iso_image_create_burn_source(image, opts, &burn_src);
+ if (result < 0) {
+ printf ("Cant create image, error %d\n", result);
+ return 1;
+ }
+
+ iso_write_opts_free(opts);
+
+ while (burn_src->read_xt(burn_src, buf, 2048) == 2048) {
+ fwrite(buf, 1, 2048, fd);
+ }
+ fclose(fd);
+ burn_src->free_data(burn_src);
+ free(burn_src);
+
+ iso_image_unref(image);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_ms.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_ms.c
new file mode 100644
index 00000000..563c9d4d
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_ms.c
@@ -0,0 +1,114 @@
+/*
+ * Little program to show how to create a multisession iso image.
+ */
+
+#include "libisofs.h"
+#include "libburn/libburn.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+void usage(char **argv)
+{
+ printf("%s LSS NWA DISC DIRECTORY OUTPUT\n", argv[0]);
+}
+
+int main(int argc, char **argv)
+{
+ int result;
+ IsoImage *image;
+ IsoDataSource *src;
+ struct burn_source *burn_src;
+ unsigned char buf[2048];
+ FILE *fd;
+ IsoWriteOpts *opts;
+ IsoReadOpts *ropts;
+ uint32_t ms_block;
+
+ if (argc < 6) {
+ usage(argv);
+ return 1;
+ }
+
+ fd = fopen(argv[5], "w");
+ if (!fd) {
+ err(1, "error opening output file");
+ }
+
+ iso_init();
+ iso_set_msgs_severities("NEVER", "ALL", "");
+
+ /* create the data source to accesss previous image */
+ result = iso_data_source_new_from_file(argv[3], &src);
+ if (result < 0) {
+ printf ("Error creating data source\n");
+ return 1;
+ }
+
+ /* create the image context */
+ result = iso_image_new("volume_id", &image);
+ if (result < 0) {
+ printf ("Error creating image\n");
+ return 1;
+ }
+ iso_tree_set_follow_symlinks(image, 0);
+ iso_tree_set_ignore_hidden(image, 0);
+
+ /* import previous image */
+ result = iso_read_opts_new(&ropts, 0);
+ if (result < 0) {
+ fprintf(stderr, "Error creating read options\n");
+ return 1;
+ }
+ iso_read_opts_set_start_block(ropts, atoi(argv[1]));
+ result = iso_image_import(image, src, ropts, NULL);
+ iso_read_opts_free(ropts);
+ iso_data_source_unref(src);
+ if (result < 0) {
+ printf ("Error importing previous session %d\n", result);
+ return 1;
+ }
+
+ /* add new dir */
+ result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[4]);
+ if (result < 0) {
+ printf ("Error adding directory %d\n", result);
+ return 1;
+ }
+
+ /* generate a multisession image with new contents */
+ result = iso_write_opts_new(&opts, 1);
+ if (result < 0) {
+ printf("Cant create write opts, error %d\n", result);
+ return 1;
+ }
+
+ /* round up to 32kb aligment = 16 block */
+ ms_block = atoi(argv[2]);
+ iso_write_opts_set_ms_block(opts, ms_block);
+ iso_write_opts_set_appendable(opts, 1);
+
+ result = iso_image_create_burn_source(image, opts, &burn_src);
+ if (result < 0) {
+ printf ("Cant create image, error %d\n", result);
+ return 1;
+ }
+ iso_write_opts_free(opts);
+
+ while (burn_src->read_xt(burn_src, buf, 2048) == 2048) {
+ fwrite(buf, 1, 2048, fd);
+ }
+ fclose(fd);
+ burn_src->free_data(burn_src);
+ free(burn_src);
+
+ iso_image_unref(image);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_read.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_read.c
new file mode 100644
index 00000000..de30717a
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/iso_read.c
@@ -0,0 +1,167 @@
+/*
+ * Little program to output the contents of an iso image.
+ */
+
+
+#include
+#include
+#include
+#include
+
+#include "libisofs.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_type(mode_t mode)
+{
+ switch(mode & S_IFMT) {
+ case S_IFSOCK: printf("[S] "); break;
+ case S_IFLNK: printf("[L] "); break;
+ case S_IFREG: printf("[R] "); break;
+ case S_IFBLK: printf("[B] "); break;
+ case S_IFDIR: printf("[D] "); break;
+ case S_IFIFO: printf("[F] "); break;
+ }
+}
+
+static void
+print_file_src(IsoFileSource *file)
+{
+ struct stat info;
+ char *name;
+ iso_file_source_lstat(file, &info);
+ print_type(info.st_mode);
+ print_permissions(info.st_mode);
+ //printf(" {%ld,%ld} ", (long)info.st_dev, (long)info.st_ino);
+ name = iso_file_source_get_name(file);
+ printf(" %s", name);
+ free(name);
+ if (S_ISLNK(info.st_mode)) {
+ char buf[PATH_MAX];
+ iso_file_source_readlink(file, buf, PATH_MAX);
+ printf(" -> %s\n", buf);
+ }
+ printf("\n");
+}
+
+static void
+print_dir(IsoFileSource *dir, int level)
+{
+ int ret, i;
+ IsoFileSource *file;
+ struct stat info;
+ 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';
+
+ ret = iso_file_source_open(dir);
+ if (ret < 0) {
+ printf ("Can't open dir %d\n", ret);
+ }
+ while ((ret = iso_file_source_readdir(dir, &file)) == 1) {
+ printf("%s", sp);
+ print_file_src(file);
+ ret = iso_file_source_lstat(file, &info);
+ if (ret < 0) {
+ break;
+ }
+ if (S_ISDIR(info.st_mode)) {
+ print_dir(file, level + 1);
+ }
+ iso_file_source_unref(file);
+ }
+ iso_file_source_close(dir);
+ if (ret < 0) {
+ printf ("Can't print dir\n");
+ }
+}
+
+int main(int argc, char **argv)
+{
+ int result;
+ IsoImageFilesystem *fs;
+ IsoDataSource *src;
+ IsoFileSource *root;
+ IsoReadOpts *ropts;
+
+ if (argc != 2) {
+ printf ("You need to specify a valid path\n");
+ return 1;
+ }
+
+ iso_init();
+ iso_set_msgs_severities("NEVER", "ALL", "");
+
+ result = iso_data_source_new_from_file(argv[1], &src);
+ if (result < 0) {
+ printf ("Error creating data source\n");
+ return 1;
+ }
+
+ result = iso_read_opts_new(&ropts, 0);
+ if (result < 0) {
+ fprintf(stderr, "Error creating read options\n");
+ return 1;
+ }
+ result = iso_image_filesystem_new(src, ropts, 1, &fs);
+ iso_read_opts_free(ropts);
+ if (result < 0) {
+ printf ("Error creating filesystem\n");
+ return 1;
+ }
+
+ printf("\nVOLUME INFORMATION\n");
+ printf("==================\n\n");
+
+ printf("Vol. id: %s\n", iso_image_fs_get_volume_id(fs));
+ printf("Publisher: %s\n", iso_image_fs_get_publisher_id(fs));
+ printf("Data preparer: %s\n", iso_image_fs_get_data_preparer_id(fs));
+ printf("System: %s\n", iso_image_fs_get_system_id(fs));
+ printf("Application: %s\n", iso_image_fs_get_application_id(fs));
+ printf("Copyright: %s\n", iso_image_fs_get_copyright_file_id(fs));
+ printf("Abstract: %s\n", iso_image_fs_get_abstract_file_id(fs));
+ printf("Biblio: %s\n", iso_image_fs_get_biblio_file_id(fs));
+
+ printf("\nDIRECTORY TREE\n");
+ printf("==============\n");
+
+ result = fs->get_root(fs, &root);
+ if (result < 0) {
+ printf ("Can't get root %d\n", result);
+ return 1;
+ }
+ //print_file_src(root);
+ print_dir(root, 0);
+ iso_file_source_unref(root);
+
+ fs->close(fs);
+ iso_filesystem_unref((IsoFilesystem*)fs);
+ iso_data_source_unref(src);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/lsl.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/lsl.c
new file mode 100644
index 00000000..17659f75
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/lsl.c
@@ -0,0 +1,130 @@
+/*
+ * 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
+#include
+#include
+
+/*
+ * Little test program to test filesystem implementations.
+ *
+ */
+
+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_type(mode_t mode)
+{
+ switch(mode & S_IFMT) {
+ case S_IFSOCK: printf("[S] "); break;
+ case S_IFLNK: printf("[L] "); break;
+ case S_IFREG: printf("[R] "); break;
+ case S_IFBLK: printf("[B] "); break;
+ case S_IFDIR: printf("[D] "); break;
+ case S_IFIFO: printf("[F] "); break;
+ }
+}
+
+static void
+print_file_src(IsoFileSource *file)
+{
+ struct stat info;
+ char *name;
+ iso_file_source_lstat(file, &info);
+ print_type(info.st_mode);
+ print_permissions(info.st_mode);
+ printf(" {%ld,%ld} ", (long)info.st_dev, (long)info.st_ino);
+ name = iso_file_source_get_name(file);
+ printf(" %s", name);
+ free(name);
+ if (S_ISLNK(info.st_mode)) {
+ char buf[PATH_MAX];
+ iso_file_source_readlink(file, buf, PATH_MAX);
+ printf(" -> %s\n", buf);
+ }
+ printf("\n");
+}
+
+int main(int argc, char **argv)
+{
+ int res;
+ IsoFilesystem *fs;
+ IsoFileSource *dir;
+ IsoFileSource *file;
+ struct stat info;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: lsl /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], &dir);
+ if (res < 0) {
+ fprintf(stderr, "Can't get file, err = %d\n", res);
+ return 1;
+ }
+
+ res = iso_file_source_lstat(dir, &info);
+ if (res < 0) {
+ fprintf(stderr, "Can't stat file, err = %d\n", res);
+ return 1;
+ }
+
+ if (S_ISDIR(info.st_mode)) {
+ res = iso_file_source_open(dir);
+ if (res < 0) {
+ fprintf(stderr, "Can't open file, err = %d\n", res);
+ return 1;
+ }
+
+ while (iso_file_source_readdir(dir, &file) == 1) {
+ print_file_src(file);
+ iso_file_source_unref(file);
+ }
+
+ res = iso_file_source_close(dir);
+ if (res < 0) {
+ fprintf(stderr, "Can't close file, err = %d\n", res);
+ return 1;
+ }
+ } else {
+ print_file_src(dir);
+ }
+
+ iso_file_source_unref(dir);
+ iso_filesystem_unref(fs);
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/demo/tree.c b/libisofs/tags/ForXorrisoZeroOneTwo/demo/tree.c
new file mode 100644
index 00000000..6dddbb99
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/demo/tree.c
@@ -0,0 +1,107 @@
+/*
+ * Little program that import a directory and prints the resulting iso tree.
+ */
+
+#include "libisofs.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+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(IsoDir *dir, int level)
+{
+ int i;
+ IsoDirIter *iter;
+ IsoNode *node;
+ 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';
+
+ iso_dir_get_children(dir, &iter);
+ while (iso_dir_iter_next(iter, &node) == 1) {
+
+ if (ISO_NODE_IS_DIR(node)) {
+ printf("%s+[D] ", sp);
+ print_permissions(iso_node_get_permissions(node));
+ printf(" %s\n", iso_node_get_name(node));
+ print_dir(ISO_DIR(node), level+1);
+ } else if (ISO_NODE_IS_FILE(node)) {
+ printf("%s-[F] ", sp);
+ print_permissions(iso_node_get_permissions(node));
+ printf(" %s\n", iso_node_get_name(node) );
+ } else if (ISO_NODE_IS_SYMLINK(node)) {
+ printf("%s-[L] ", sp);
+ print_permissions(iso_node_get_permissions(node));
+ printf(" %s -> %s \n", iso_node_get_name(node),
+ iso_symlink_get_dest(ISO_SYMLINK(node)) );
+ } else {
+ printf("%s-[C] ", sp);
+ print_permissions(iso_node_get_permissions(node));
+ printf(" %s\n", iso_node_get_name(node) );
+ }
+ }
+ iso_dir_iter_free(iter);
+}
+
+int main(int argc, char **argv)
+{
+ int result;
+ IsoImage *image;
+
+ 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;
+ }
+
+ printf("================= IMAGE =================\n");
+ print_dir(iso_image_get_root(image), 0);
+ printf("\n\n");
+
+ iso_image_unref(image);
+ iso_finish();
+ return 0;
+}
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/Tutorial b/libisofs/tags/ForXorrisoZeroOneTwo/doc/Tutorial
new file mode 100755
index 00000000..6de705bd
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/doc/Tutorial
@@ -0,0 +1,506 @@
+===============================================================================
+ LIBISOFS DEVELOPMENT TUTORIAL
+===============================================================================
+
+Creation date: 2008-Jan-27
+Author: Vreixo Formoso
+_______________________________________________________________________________
+
+This is a little tutorial of how to use libisofs library for application
+development.
+
+Contents:
+---------
+
+1. Introduction
+ 1.1 Library initialization
+ 1.2 Image context
+ 1.3 Error reporting
+2. Creating an image
+ 2.1 Image tree manipulation
+ 2.2 Set the write options
+ 2.3 Obtaining a burn_source
+3. Image growing and modification
+ 3.1 Growing vs Modification
+ 3.2 Image import
+ 3.3 Generating a new image
+4. Bootable images
+5. Advanced features
+
+
+-------------------------------------------------------------------------------
+1. Introduction
+-------------------------------------------------------------------------------
+
+[TODO some lines about refcounts]
+
+-------------------------------------------------------------------------------
+1.1. Library initialization
+
+Before any usage of the library, you have to call
+
+ iso_init()
+
+in the same way, when you have finished using the library, you should call
+
+ iso_finish()
+
+to free all resources reserved by the library.
+
+-------------------------------------------------------------------------------
+1.2. Image context
+
+Libisofs is image-oriented, the core of libisofs usage is the IsoImage object.
+Thus, the first you need to do is to get your own IsoImage object:
+
+ IsoImage *my_image;
+ iso_image_new("NEW DISC", &my_image);
+
+An IsoImage is a context for image creation. It holds the files that will be
+added to image, other related information and several options to customize
+the behavior of libisofs when working with such Image. i.e., an IsoImage is
+a context for libisofs operations. As such, you can work with several image
+contexts at a time.
+
+-------------------------------------------------------------------------------
+1.3. Error reporting
+
+In libisofs error reporting is done in two ways: with the return value of
+the functions and with the message queue.
+
+Error codes are negative numbers, defined in "libisofs.h" header. An
+error code is associated with a given severity, either "DEBUG", "UPDATE",
+"NOTE", "HINT", "WARNING", "SORRY", "FAILURE" and "FATAL". For the meaning
+of each severity take a look at private header "libiso_msgs.h". Errors
+reported by function return value are always "FAILURE" or "FATAL". Other kind
+of errors are only reported with the message queue. You can get the severity
+of any error message with iso_error_get_severity() function.
+
+First of all, most libisofs functions return an integer. If such integer is
+a negative number, it means the function has returned an error. The error code
+and its severity is encoded in the return value (take a look at error codes in
+libisofs.h header).
+
+Additionally, libisofs reports most of its errors in a message queue. Error
+messages on that queue can be printed directly to stderr or programmatically
+retrieved. First of all, you should set the severity threshold over which an
+error is printed or enqueued, with function:
+
+ iso_set_msgs_severities()
+
+Errors enqueued can be retrieved with function:
+
+ iso_obtain_msgs()
+
+Together with the code error, a text message and its severity, this function
+also returns the image id. This is an identifier that uniquely identifies a
+given image context. You can get the identifier of each IsoImage with the
+
+ iso_image_get_msg_id()
+
+and that way distinguish what image has issued the message.
+
+
+-------------------------------------------------------------------------------
+2. Creating an Image
+-------------------------------------------------------------------------------
+
+An image is built from a set of files that you want to store together in an
+ISO-9660 volume. We call the "iso tree" to the file hierarchy that will be
+written to image. The image context, IsoImage, holds that tree, together with
+configuration options and other properties of the image, that provide info
+about the volume (such as the identifier, author, etc...).
+
+All configuration options and volume properties are set by its corresponding
+setters (iso_image_set_volset_id(), iso_image_set_publisher_id()...)
+
+To create an image, you have to follow the following steps:
+
+* Obtain the image context.
+ See "1.2 Image context" for details of how to obtain the IsoImage.
+* Set the desired properties
+* Prepare the iso tree with the files you want to add to image.
+ See "2.1 Image tree manipulation" for details
+* Select the options for image generation.
+ See "2.2 Set the write options"
+* Get the burn_source used to actually write the image.
+
+
+-------------------------------------------------------------------------------
+2.1 Image tree manipulation
+
+libisofs maintains in memory a file tree (usually called the iso tree), that
+represents the files and directories that will be written later to image. You
+are allowed to make whatever changes you want to that tree, just like you do
+to any "real" filesystem, before actually write it to image.
+
+Unlike other ISO-9660 mastering tools, you have full control over the file
+hierarchy that will be written to image, via the libisofs API. You can add
+new files, create any file in image, change its name, attributes, etc The iso
+tree behaves just like any other POSIX filesystem.
+
+The root of the iso tree is created automatically when the IsoImage is
+allocated, and you can't replace it. To get a reference to it you can use the
+function:
+
+ iso_image_get_root()
+
+* Iso tree objects
+
+Each file in the image or iso tree is represented by an IsoNode instance. In
+the same way a POSIX filesystem has several file types (regular files,
+directories, symlinks...), the IsoNode has several subtypes:
+
+ IsoNode
+ |
+ ---------------------------------
+ | | | |
+ IsoDir IsoFile IsoSymlink IsoSpecial
+
+where
+
+ - IsoDir represents a directory
+ - IsoFile represents a regular file
+ - IsoSymlink represents a symbolic linke
+ - IsoSpecial represents any other POSIX file, i.e. block and character
+ devices, FIFOs, sockets.
+
+You can obtain the concrete type of an IsoNode with the iso_node_get_type()
+function.
+
+Many libisofs functions take or return an IsoNode. Many others, however,
+require an specific type. You can safety cast any subtype to an IsoNode
+object. In the same way, after ensuring you are dealing with the correct
+subtype, you can downcast a given IsoNode to the specific subtype.
+
+ IsoDir *dir;
+ IsoNode *node;
+
+ node = (IsoNode*) dir;
+
+ if (iso_node_get_type(node) == LIBISO_DIR) {
+ dir = (IsoDir*) node;
+ ...
+ }
+
+or with the provided macros:
+
+ IsoDir *dir;
+ IsoNode *node;
+
+ node = ISO_NODE(dir);
+
+ if (ISO_NODE_IS_DIR(node)) {
+ dir = ISO_DIR(node);
+ ...
+ }
+
+* Adding files to the image
+
+Files can be added to the image or iso tree either as new files or as files
+from the filesystem.
+
+In the first case, files are created directly on the image. They do not
+correspond to any file in the filesystem. Provided functions are:
+
+ - iso_tree_add_new_dir()
+ - iso_tree_add_new_symlink()
+ - iso_tree_add_new_special()
+
+On the other side, you can add local files to the image, either with the
+
+ iso_tree_add_node()
+
+or with
+
+ iso_tree_add_dir_rec().
+
+The first is intended to add a single file, while the last can be used to add,
+recursively, a full directory (see below for details).
+
+It is important to note that libisofs doesn't store any kind of link between
+the IsoNode and the filesystem file it was created from. The above functions
+just initialize a newly created IsoNode with the attributes of a given file in
+the filesystem. After that, you can move the original file, change its
+attributes or even delete it. The IsoNode in the image tree remains with the
+original attributes. One exception to this rule are the contents of a regular
+file. Libisofs does not make any copy of those contents until they're actually
+written to image. Thus, you shouldn't modify, move or delete regular files
+after adding them to the IsoImage.
+
+
+* Recursive directory addition.
+
+One common use case is to add a local directory to the image. While this can
+be done with iso_tree_add_node(), handling the addition of directory children
+in the application, libisofs provides a function suitable for this case:
+
+ iso_tree_add_dir_rec()
+
+that takes care of adding all files inside a directory, recursing on directory
+children. By default, this function adds all children. However, it is usual
+that you don't want really this. For example, you may want to exclude some
+kind of files (backup files, application sockets,...). Libisofs provides
+several functions to customize the behavior of that function:
+
+ - iso_tree_set_follow_symlinks()
+ - iso_tree_set_ignore_hidden()
+ - iso_tree_set_ignore_special()
+ - iso_tree_add_exclude()
+
+* Operations on iso tree
+
+[TODO briefly explain how to add node, change attributes, ...]
+
+* Replace mode
+
+[TODO]
+
+-------------------------------------------------------------------------------
+2.2 Set the write options
+
+Once you have prepared the iso tree, it is time to select the options for the
+image writing.
+
+These options affect the characteristics of the filesystem to create in the
+image, but also can control how libisofs generates the image.
+
+First of all you have to get an instance of IsoWriteOpts, with the function
+
+ iso_write_opts_new()
+
+The several options available can be classified in:
+
+- Extensions to add to the ISO-9660 image:
+
+ iso_write_opts_set_rockridge()
+ iso_write_opts_set_joliet()
+ iso_write_opts_set_iso1999()
+
+RockRidge is highly recommended, in fact you should use it in all image. Joliet
+is needed if you want to use your images in Windows system. Nowadays,
+ISO-9660:1999 is no much useful, so in most cases you don't want such
+extension.
+
+- ISO-9660 options:
+
+ iso_write_opts_set_iso_level()
+ iso_write_opts_set_omit_version_numbers()
+ iso_write_opts_set_allow_deep_paths()
+ iso_write_opts_set_allow_longer_paths()
+ iso_write_opts_set_max_37_char_filenames()
+ iso_write_opts_set_no_force_dots()
+ iso_write_opts_set_allow_lowercase()
+ iso_write_opts_set_allow_full_ascii()
+
+These control the options for the ISO-9660 filesystem. In most cases you won't
+care about them, as it is the RockRidge or Joliet extensions what determine the
+properties of the files once the image is mounted.
+
+- File attributes options
+
+ iso_write_opts_set_replace_mode()
+ iso_write_opts_set_default_dir_mode()
+ iso_write_opts_set_default_file_mode()
+ iso_write_opts_set_default_uid()
+ iso_write_opts_set_default_gid()
+ iso_write_opts_set_replace_timestamps()
+ iso_write_opts_set_default_timestamp()
+ iso_write_opts_set_always_gmt()
+
+They allow to set default attributes for files in image, despite of the real
+attributes of the file on the local filesystem.
+
+-------------------------------------------------------------------------------
+2.3 Obtaining a burn_source
+
+Finally, you get the burn_source used to write the image with the function:
+
+ iso_image_create_burn_source()
+
+The returned burn_source is suitable for using with libburn, to directly burn
+the image to a disc. Alternatively, you can use burn_source read() to get
+the image contents (for example, to write them to a file, pipe...).
+
+Before creating the burn_source, libisofs computes the size of the image, so
+the get_size() function of the burn_source always returns the final image
+size. It also starts a writing thread. All the operations needed to generate
+the image are done by this thread, including read the original files contents.
+The image is writing to a FIFO buffer, from which the burn_source will read.
+The size of the buffer can be set in advanced with a property of the
+IsoWriteOpts struct:
+
+ iso_write_opts_set_fifo_size()
+
+You can get the state of the buffer in any moment, with the function:
+
+ iso_ring_buffer_get_status()
+
+You can also cancel the writer thread at any time, with the cancel() function
+of the burn_source.
+
+
+-------------------------------------------------------------------------------
+3. Image growing and modification
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+3.1 Growing vs Modification
+
+Libisofs is not restricted only to create new images. It can also be used to
+modify existing images. It supports two kind of image modifications, that we
+have called image growing and image modification:
+
+Image modification consists in generating a new image, based on the contents
+of an existing image. In this mode, libisofs takes an image, the users modifies
+its contents (adding new files, removing files, changing their names...), and
+finally libisofs generates a completely new image.
+
+On the other side, image growing is similar, with the difference that the new
+image is dependent on the other, i.e., it refers to files of the other image.
+Thus, it can't be mounted without the old image. The purpose of this kind of
+images is to increment or add files to a multisession disc. The new image only
+contains the new files. Old files are just references to the old image blocks.
+
+The advantage of the growing approach is that the generated image is smaller,
+as only the new files are written. This mode is suitable when you just want to
+add some files to a very big image, or when dealing with write-once media, such
+as CD-R. Both the time and space needed for the modification is much less than
+with normal image modify.
+
+The main problem of growing is that the new image needs to be recorded together
+with the old image, in order to be mountable. The total size of the image
+(old + new) is bigger (even much bigger) than a completely new image. So, if
+you plan to distribute an image on Internet, or burn it to a disc, generate a
+completely new image is usually a better alternative.
+
+To be able to mount a grown image, the OS needs to now you have appended new
+data to the original image. In multisession media (such as CD-R), the new data
+is appended as a new session, so the OS can identify this and mount the image
+propertly. However, when dealing with non-multisession media (such as DVD+RW)
+or plain .iso files, the new data is just appended at the end of the old image,
+and the OS has no way to know that the appended data is in fact a "new
+session". The method introduced by Andy Polyakov in growisofs can be used in
+those cases. It consists in overwrite the volume descriptors of the old image
+with a new ones that refer to the newly appended contents.
+
+-------------------------------------------------------------------------------
+3.2 Image import
+
+The first thing you need to do in order to modify or grow an image is to import
+it, with the function:
+
+ iso_image_import()
+
+It takes several arguments.
+
+First, the image context, an IsoImage previously obtained with iso_image_new().
+In most cases you will want to use an empty image. However, if you have already
+added files to the image, they will be removed and replaced with the contents
+of the image being imported.
+
+The second parameter is an IsoDataSource instance. It abstracts the original
+image, and it is used by libisofs to access its contents. You are free to
+implement your own data source to access image contents. However, libisofs has
+a simple implementation suitable for reading images on the local filesystem,
+that can be used for import both .iso files and inserted media, via the block
+device and POSIX functions. You can get it with
+
+ iso_data_source_new_from_file()
+
+The third parameter of iso_image_import() is a pointer to an IsoReadOpts
+struct. It holds the options for image reading. You get it with:
+
+ iso_read_opts_new()
+
+and after calling iso_image_import() you should free it with
+
+ iso_read_opts_free()
+
+Some options are related to select what extensions to read. Default options
+are suitable for most users.
+
+ iso_read_opts_set_no_rockridge()
+ iso_read_opts_set_no_joliet()
+ iso_read_opts_set_no_iso1999()
+ iso_read_opts_set_preferjoliet()
+
+If RockRidge extensions are not present, many files attributes can't be
+obtained. In those cases libisofs uses default values. You have options to
+configure what default values to use.
+
+ iso_read_opts_set_default_uid()
+ iso_read_opts_set_default_gid()
+ iso_read_opts_set_default_permissions()
+
+If the original image has been created in another system with a different
+charset, you may want to use:
+
+ iso_read_opts_set_input_charset()
+
+to specify the encoding of the file names on image.
+
+Finally, to import multisession images, you should tell libisofs that it must
+read the last session. For that, you must set the block where the last session
+starts:
+
+ iso_read_opts_set_start_block()
+
+The last parameter for iso_image_import(), optional, is a pointer that will
+be filled with a library-allocated IsoReadImageFeatures, that lets you access
+some information about the image: size, extensions used,...
+
+[TODO: explain that iso_image_import uses dir rec options]
+
+-------------------------------------------------------------------------------
+3.3 Generating a new image
+
+After importing the image, the old image tree gets loaded. You are free to
+make any changes to it: add new files, remove files, change names or
+attributes... Refer to "2.1 Image tree manipulation" for details.
+
+When it is ready, you can now create the new image. The process is the same as
+explained in "2.2 Set the write options" and "2.3 Obtaining a burn_source".
+However, there are some write options that should be taken into account.
+
+First of all, you must select whether you want to grow or modify the image
+(read "3.1 Growing vs Modification" for details). You must call
+
+ iso_write_opts_set_appendable()
+
+An appendable image leads to image growing, and a non-appendable image leads
+to a completelly new image (modification). An appendable image will be appended
+after the old image (in a new session, for example). Thus, in those cases, the
+first block of the image is not 0. You should set the correct lba of the first
+block with:
+
+ iso_write_opts_set_ms_block()
+
+That is usually the "Next Writable Address" on a multisession media, and a
+value slightly greater than the old image size on .iso files or DVD+RW media.
+You can obtain the old image size with the iso_read_image_features_get_size()
+function.
+
+In this last case (i.e., on a non multisession media), you will need to
+overwrite the volume descriptors of the old image with the new ones. To do
+this you need:
+
+- Allocate a buffer of at least 64 KiBs.
+- Initialize it with the first 64 KiBs of the original image.
+- Pass the buffer to libisofs with the iso_write_opts_set_overwrite_buf()
+ option.
+- After appending the new image, you have to overwrite the first 64 KiBs of
+ the original image with the new content of the buffer.
+
+
+-------------------------------------------------------------------------------
+4. Bootable images
+-------------------------------------------------------------------------------
+
+
+
+-------------------------------------------------------------------------------
+5. Advanced features
+-------------------------------------------------------------------------------
+
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/Wiki b/libisofs/tags/ForXorrisoZeroOneTwo/doc/Wiki
new file mode 100755
index 00000000..c9f6f8e1
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/doc/Wiki
@@ -0,0 +1,32 @@
+= libisofs =
+
+libisofs is a library to create an ISO-9660 filesystem, and supports extensions like RockRidge and Joliet. It is also a full featured ISO-9660 editor, allowing you to modify an ISO image or multisession disc, including file addition/removal, change of file names and attributes, and similar.
+
+The old libisofs.so.5 has been declarated deprecated and frozen, leaving it unmaintained. A full refactoring of the design has been done during the last months, and the next generation libisofs.so.6 of the library will be released in the following days.
+
+== Source Code ==
+
+The code is maintained in a [http://bazaar-vcs.org/ Bazaar] repository at Launchpad (https://launchpad.net/libisofs/). You can download it with:
+
+{{{
+$ bzr branch lp:libisofs
+}}}
+
+
+To report any bug or suggest enchantments, [http://libburnia-project.org/register register] yourself and submit a new ticket. Bug and enchantments reports for nglibisofs can be found at http://libburnia-project.org/report/9.
+
+== Usage tutorial ==
+
+Coming soon... For now check [http://codebrowse.launchpad.net/~mario-danic/libisofs/mainline/annotate/metalpain2002%40yahoo.es-20080201154704-xqyzc57vki97iv3y?file_id=tutorial-20080127170757-cwmomu7oz9eh7fcz-1 "doc/Tutorial"] in the source tree.
+
+
+=== Applications ===
+
+Comming soon:
+
+[http://libburnia-project.org/browser/libisoburn/trunk libisoburn]:
+ emulates ISO 9660 multi-session on overwriteable media, coordinates libisofs and libburn.
+
+[http://libburnia-project.org/browser/libisoburn/trunk/xorriso/xorriso_eng.html?format=raw xorriso]:
+ creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions.
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/1. Overview b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/1. Overview
new file mode 100644
index 00000000..e69de29b
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/2. Features b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/2. Features
new file mode 100644
index 00000000..89501e38
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/2. Features
@@ -0,0 +1,193 @@
+FEATURES
+========
+
+Contents:
+
+2.0 Operations on image tree
+2.1 ECMA-119
+2.2 Rock Ridge
+2.3 Joliet
+2.4 El-Torito
+2.5 UDF
+2.6 HFS/HFS+
+2.7 Others
+
+
+===============================================================================
+
+2.0 Operations on image tree
+-----------------------------
+
+Basic:
+ - We HAVE TO Support addition of directories
+ - From filesystem
+ - From filesystem recursively
+ - New on image
+ - We HAVE TO support addition of files
+ - From local filesystem
+ - From previous/ms images
+ - We HAVE TO support addition of other POSIX file types
+ - From filesystem
+ - New on image
+ - Types: symlinks, block/char devices, fifos, sockets...
+ - We HAVE TO support modification of file names on image
+ - We HAVE TO support modification of POSIX attributes:
+ - Uid/Gid
+ - Permissions (we DON'T HAVE TO support full mode modification,
+ as we don't want a dir to be changed to a reg file!!)
+ - Timestamps
+ - We HAVE TO support deletion of nodes.
+ - We HAVE TO support iteration of directory tree.
+ - We WANT TO support direct getting (without iteration) of the number of
+ nodes in a directory.
+
+Extras:
+ - We WANT TO support on-the-fly modification of file contents, to
+ allow things like compression and encryption.
+
+Notes: many operations will need RR extensions to be actually reflected on
+the image.
+
+===============================================================================
+
+2.1 ECMA-119
+------------
+
+Support for ECMA-119 (ISO-9660) specification.
+
+2.1.1 Creation
+--------------
+
+We HAVE TO support creation of new images.
+
+ General:
+ - We HAVE TO support single volume images
+ - We DON'T NEED TO support multiple volume images.
+ It seems multiple volume images are not used.
+ - We HAVE TO support bootable volumes (see 2.4 in this doc)
+ Conformance:
+ - We HAVE TO support Level 1 restrictions (ECMA-119 10.1)
+ - We HAVE TO support Level 2 restrictions (ECMA-119 10.2)
+ Single Section files have a theoric size limit of 4GB (data length
+ is a 32-bit number, see ECMA-119 9.1.4). However I think I have
+ read that only files up to 2GB are supported.
+ - We MAY support full Level 3 (ECMA-119 10.3)
+ Multiple file sections are useful to support files higher than
+ level 2 limit. However, it seems it's a feature not supported in
+ most O.S. nowadays, so it's not very useful.
+ - We DON'T WANT TO support files recording in interleaved mode
+ (ECMA-119 6.4.3)
+ It seems a feature that it's not used.
+ - We DON'T WANT TO support associated files (ECMA-119 6.5.4)
+ What is that? Is it used?
+ - We DON'T WANT TO support Volume Partitions (ECMA-119 8.6)
+ What is that? Is it used?
+ - We DON'T WANT TO support extended attribute records (ECMA-119 9.5)
+ It seems an unused feature. RR is a better alternative.
+ - We DON'T NEED TO support file versions other than 1.
+ Restrictions:
+ - We HAVE TO provide a way to relax iso restrictions related to
+ filenames, allowing:
+ - Higher filename length, up to 37 chars (ECMA-119 7.5.1/7.6.3)
+ - Omit version number (ECMA-119 7.5.1)
+ - Directory hierarchy deeper than 8 levels / 255 path length
+ (ECMA-119 6.8.2.1)
+ - More characters in filenames, not only d-characters
+
+
+2.2.2 Reading
+-------------
+
+ General
+ - We HAVE TO support the reading of iso images
+ - We DON'T NEED TO support reading of features we don't support in
+ creation (see 2.2.1 above)
+ - We HAVE TO support reading arbitray file contents inside image
+
+2.2.3 Modification/growing
+--------------------------
+
+ General
+ - We HAVE TO support creation of new images from the contents of
+ an existing image
+ - We HAVE TO support multissession images
+ - We HAVE TO support growing of images
+
+===============================================================================
+
+2.2 Rock Ridge
+--------------
+
+- We HAVE TO support ALL Rock Ridge features, with these exceptions:
+ - We DON'T NEED TO support SF System User Entry (RRIP 4.1.7), used to
+ encode sparse files.
+ - We MIGHT support BACKUP timestamp (RRIP 4.1.6)
+- We HAVE TO support any charset in RR filenames, and not only POSIX portable
+ filename character set (RRIP 3.4.1). Namely, UTF-8 SHOULD BE the default for
+ RR filenames.
+- We MIGHT support Linux specific ZF extension, to allow transparent
+ compression.
+
+===============================================================================
+
+2.3 Joliet
+----------
+
+- We HAVE TO support ALL Joliet features, with these exceptions:
+ - We DON'T KNOW what to do with UCS-2 conformance level 1 and 2 (scape
+ sequences '%\@' and '%\C'). What's this???????
+ - We DON'T KNOW what to do with CD-XA extensions.
+
+
+===============================================================================
+
+2.4 El-Torito
+-------------
+
+- We HAVE TO El-Torito standard with a single boot image.
+- We MAY support multiple boot images and boot entry selection.
+ - El Torito standard is not very clear about how to do that.
+- We HAVE TO support both emulation and not emulation mode.
+- We HAVE TO support 80x86 platform. We MAY support Power PC and Mac platforms.
+- We HAVE TO provide improved support for isolinux boot images, namely patching
+ features.
+- We HAVE TO support El-Torito in ms images.
+
+
+===============================================================================
+
+2.5 UDF
+-------
+
+
+
+===============================================================================
+
+2.6 HFS/HFS+
+------------
+
+
+
+
+
+===============================================================================
+
+2.7 Others
+----------
+
+- We HAVE TO support sorting of file contents on image
+- We HAVE TO support inode caching to prevent the same file to be written
+ several times into the image
+- We DON'T NEED TO support TRANS.TBL files
+- We DON'T NEED TO support padding of images
+ - Padding should be part of the burning process
+
+
+
+
+
+
+
+
+
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/3. Use Cases b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/3. Use Cases
new file mode 100644
index 00000000..e6e17f0f
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/3. Use Cases
@@ -0,0 +1,193 @@
+USE CASES FOR NG LIBISOFS
+=========================
+
+3.1 General Operations
+======================
+
+3.1.1 Creation of a new image
+-----------------------------
+
+Desc: Creation of a new ISO image from files on the local filesystem
+Phases:
+ - User creates a new image context
+ - User get the root (empty) of the image
+ - User adds files to the image root (see 3.2.)
+ - User sets the options for the the new image (extension to use...)
+ - User gets a burn_source to write the image.
+ - The burn_source can be used by libburn to write the new image.
+
+3.1.2 Image growing (multisession)
+----------------------------------
+
+Desc: An existing image can be grown with new files. New content is added
+ incrementally. Suitable for multisession. Growing support for
+ overwritteable media.
+Phases:
+ - Uses reads an existing image to get the image context.
+ - User get the root of the image
+ - User modifies the image tree (see 3.2.)
+ - User sets the options for the the new image (extension to use...)
+ A required option will be the nwa for the image.
+ Optionally it can pass a pointer to a 64K buffer, that will be filled
+ with suitable volume descriptors to be used with overwrieable media.
+ - User gets a burn_source to write the image.
+ - The burn_source can be used by libburn to write an image that should be
+ appended to the previous image.
+
+
+3.1.3 Image modification
+------------------------
+
+Desc: Creation of a new image from the contents of a previous image.
+Phases:
+ - Uses reads an existing image to get the image context.
+ - User get the root of the image
+ - User modifies the image tree (see 3.2.)
+ - User sets the options for the the new image (extension to use...)
+ - User gets a burn_source to write the image.
+ - The burn_source can be used by libburn to write the image to another
+ device or file.
+
+3.2 Tree operations
+===================
+
+3.2.1 Addition of contents
+--------------------------
+
+ All addition operations take a parent dir. The functions check that the
+ node name is unique among all children. Image context options determine
+ what to do if a file with such name already exist.
+
+ 3.2.1.1 Directories
+ --------------------
+ - Creation of new directories in image, given a parent dir. and a name.
+ Attributes are initialized to default values
+ - Addition of a dir from the filesystem, given a parent.
+ Dir contents are not added. Name and other attributes taken from
+ the dir on filesystem
+ - Recursive addition of a dir, given a parent. Directory contents are
+ recursivelly added to image.
+
+ 3.2.1.2 Regular files
+ ----------------------
+ - Addition of a local filesystem file. Name, attributes and contents to
+ be written taken from the filesystem file.
+ - Addition of files from the previous image. Files are automatically
+ added to the tree when the image is read. Name and attrbs taken from
+ previous image. When the image has no RR extensions, unavailable atts
+ are initialized to default values. The contents are only written to
+ img if we choose image modification.
+ - Addition of filtered files. Name and atts taken from the local
+ filesystem. A filter (see 3.3) is applied to the file contents before
+ written to image.
+ - Addition of splitted files. Like local filesystem files, but the file
+ is splitted in several files on a given size. Suitable for big (> 2GB)
+ files. Name of the splitted files automatically generated.
+
+ 3.2.1.3 Symbolic links
+ ----------------------
+
+ Simbolic links are only written to image if RR extensions are enabled.
+
+ - Addition of a simbolic link from local filesystem. Name, atts and
+ dest of a path are taken from the simbolic link.
+ - Addition of new link on image to a path. Name and dest specified,
+ the destination is specified as a path. Attributes initialized to
+ default values.
+ - Addition of new link on image to another node. Name and dest
+ specified, the dest is set to a node previously added to image.
+ When written, the destination path is computed as the relative path
+ from the link to the destination node. Attributes initialized to
+ default values.
+
+ 3.2.1.4 Special files (block devices, fifos...)
+ -----------------------------------------------
+
+ Special files are only written to image if RR extensions are enabled.
+
+ - Addition of special files from filesystem.
+ - Creation of new special files on image.
+
+
+3.2.2 Modification of contents
+------------------------------
+
+ 3.2.2.1 Deletion of nodes
+ -------------------------
+
+ - Any node can be deleted. When a dir is remove, all its contents
+ are also removed.
+
+ 3.2.2.2 Move
+ ------------
+
+ - Any node can be move to another dir..
+
+ 3.2.2.3 Rename
+ --------------
+
+ - You can change the name of any node
+
+ 3.2.2.4 Change of POSIX attributes
+ ----------------------------------
+
+ - Following POSIX atts can be changed: owner (uid/gid), permissions,
+ timestamps.
+
+3.2.3 Bootable information
+--------------------------
+
+ - Addition of a boot image to a volume.
+ - In most cases, the catalog and the boot image itself is added to the
+ iso tree.
+ - Alternatively, user can select to add a hidden images, i.e., images
+ that don't appear in the iso tree.
+ - Modification of boot image attributes:
+ - bootable flag
+ - load segment
+ - load size
+ - Automatic patching of isolinux images. User needs to set whether to apply
+ this.
+ - Reading of El-Torito info from multisession images. Modification of its
+ attributes.
+ - Removing of El-Torito images
+
+
+3.2.4 Other operations
+----------------------
+
+ 3.2.4.1 Set file sort weight
+ -----------------------------
+
+ - Any file can have a sort weight, that will determine the order in
+ which the files are written to image
+
+ 3.2.4.2 Hidding of nodes
+ ------------------------
+
+ - Files can be hidden in the RR or Joliet tree
+
+
+3.3 Filters
+===========
+
+ [TODO]
+
+ Support for:
+ - compression filter
+ - encryption filter
+ - external process filter
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/4. Design b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/4. Design
new file mode 100644
index 00000000..e69de29b
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/5. Implementation b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/5. Implementation
new file mode 100644
index 00000000..e69de29b
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/README b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/README
new file mode 100644
index 00000000..75face44
--- /dev/null
+++ b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/README
@@ -0,0 +1,7 @@
+Index
+=====
+
+1. Overview
+2. Features
+3. Design
+4. Implementation
diff --git a/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/BuilderSec.png b/libisofs/tags/ForXorrisoZeroOneTwo/doc/devel/UML/BuilderSec.png
new file mode 100644
index 0000000000000000000000000000000000000000..a89203ee903b9abd36879bfe0d099c7f7d5f48eb
GIT binary patch
literal 25202
zcmagG2|Uzo+dn)~xk^!5M3$0Lgi1s9in8x(mKmkc5M?mNHkBkP3X#Fs*Rf>FP9>=r
zTQf#>VeISJ#`>PW(RJU?^Z&o^=e@4a$o!UbJ(lnBJ&se5zOLH-y}Wy2FxY+#byY(c
zjI|dA+tKyU4sgZ4xY-*9yCbWidd=9gbE-!#x2v=~!&mRzA@iz1KRNroGI2#eOI11o
zVm2S}v5NF?s>@gKBwMgW*I8$f73LXvsv5#KeiVpX*06o;mAH{~R?~~|KKP6oad_@H
z>~X$>3`@84m-ACkd)#4k7%a=8
z*BK?pg3=|iz{s(9R_Ft}O3IXlKCs7lBQ*4Z!7^mwY|sa$k4AAo9~catPGf#x(96sQ
z5@=*T=)-IP_J2L2kDlB0zuRVZ`M=wKjPFw=nZc$5Z1(?ccP)voycH=t)*ck+|93nn
z2@SLXeb?%Nzr#wWgTR?9_UtvnTv1I;bNf&NP73O-4kN=4M&FU<
zys89xgpAPr!<5SD!xJ}8g?mhslefhTMf7%xOSQK(na|S%9_n)|@6^pxc1JK0`e+S{j|GQzDWnW^
z%OFgo+?|S6y-0&Ow~MNR1v)y!+uhPSf7Pa6Z92Z?@pIm0;o6y=i6q)5VitB~Rn7lu
zTYqMmu*Ny~$lg+1Eze~{P4Mm_VTw=7ljt<5KEky02(A$`Tceg2jAzZuqSX+UBiz|a
zcg8?3)skZ+`kVIKf7Z*AJMK7BWk@p8vHz&3*nmZl21zn-HiS6|C*$3G{8WFz#SpND
z5k}~5kE4m$*}%aGZ&HQYVoAE1Y&z`|7p0QnimAPEApTDNGw_@$>EgumLi$MmHK`)2
zOxmz>uflB0gBpZ=Jzg!ZA$Ye!6`rl;kjsX#!o1^bf9S*AMe5+4xt;s%I~r5%9W+S#
zemVGhd{ffWg8AtBKJm8`^GPg{K$NR(fH;u(N_9!xoz7mZk4KE?6tY4Tz6QtmVBy=n
zvD#~Uq-L}GSw-WXfmAd~~NP
z+|Rl9w>WM-tD>=$nCH~^^j1E`M@8Ashv^Y%t;qtO?wIcijY~n*^9JZqIMtEkFVO5aDIrud*@&va__v_S=fV+**vJ0G#cwQeq709Ro8+C8ug@g|T1p#iOxK
z6;esGA(i?>IB}f*yNsy9F>f3<7iMB>d#iaO@1q9QUinCIF}ehHEm|_Sy|7BAmLM@?
zW1HffUR^%gbKlA!*=DYbw=aD(?38>I!hN!R+3fn{tJdU8%Zg?SsBP8KCC#ML0yn=D
zM!Cs<(Yh%z<2&jgStiGEza~ABC_em-d;EnPr`xG{nT%YTfCt*?Y
z3t??*JFdy@?6~Q-Ulh$SQ6qdau%8kCmhi^_{nzODiNHBG7jULYUcy(MoNitkncnh1
ziy6_K-{!uh`mlKY)Q=p1!9yuiMP@RidZ)o6B%1Yj@unNnwIAFKRwG^8wrh+Ha-~4A
zmAeqf+DY4rnsp=izB8jc`BQXqgkDEddw1+Jp*uXU^&$n!*VJ40@KJoeo0PDXT<0iGxGL0$vcUaPPSS=)d80`nWR
zTHwL|JOmyzLTe<^m|g;O5+?kg&DABH4g&tCn-y{~|LF}p!))j(smcLr`Tu?abd52i
zr(R6Nv%dc^(ReIjU?GVm@4)RZTPqVGMTo_~3lB^-cl8JKI@maW#&JxgaqnmL{@;ND
zp9O<2C$VrE&?^X@x0RDwU{@>l*rY)Y47fm6@Dunn@E>r0kS7E`9^c9;L*fVD^@-VF
zJ?DyJz|{-XqYLpktu|LKd8+dcsL805vW&7%xjj3tlH#v?S+$h`SGbMP`PLPC9^->Q
zwl$9s9I*UT;zZbN!WP^4Bmug}y$!tJYo(=kD?^}i21-yb67PvX46NSgeqk?5J2)U`Yecu#r$_!%
z?d#V})Js*vJp3xAcTiyS)y?DLba9EhXWsqtu97)BGS$Lgq@=lO9v#lAB(8UpDY
zYf^rz^h&+r+U8(=X}yEWqPDgVY^x&%?8UR+Dy&r#C-bI-1J-O$)j5#$2D7>-mqsV^
zQIeT&+BKE~*Xy?!eHU4$b4G$!rX6Rd1_fQBnp-80%vti}ZT)3M-&PO8|wwU{sgVIt*lOB0i3&*Xm
zxyjyAev3Mn8|d&c;E3ymvEZ}uTYu*Ieh0s_^B#5Nl(q}*!HL;MU2waq#n3r#iuTAI
z02_S69Hqnwm&D-rkQLSk?z<(Z+aFf@Y;f?}Oi8&aA^*wgk@a+AdUfG)2KIiyq>^=G
zaSuD8JVW-u=qL&grDkc!3yM
zJxit0&FJN3?jP{=oUdNPUA`MBUMXeJzoMP@-^-qc%Nw$;W&4z3}X1g
zJ+--g;&FmTADhi}#OIf=mbWbEho_RCeyJbMmQxUqcpLUrG`*=tUPY_wk>uO48qu$3
zxW?qY_4LrU1Nf?MT;5qysE1SJvPVl`Sm~-6#Xr3J8F0GoxBjG6KUjk$gM8B<^F8
zhl4_R6>7I$!zgyLRL_+aw=_|lvaWC6F0s(+P&T}F<$cYW??F0<
zC3L&uh>