Compare commits

...

49 Commits

Author SHA1 Message Date
Stéphane Lesimple
cbcac368dc chore: add auto Windows CLI tests 2020-08-30 18:40:34 +02:00
Stéphane Lesimple
bd70bcef1b chore: add auto Windows CLI tests 2020-08-30 17:58:31 +02:00
Stéphane Lesimple
71b32a30a1 feat: BD-R: add --no-defect-management
Enable bigger augmented images for BD-R (around +3%).
If you know you will use a BD-R medium and want to maximize the free space
for parity data, you can skip the defect management formatting before burning,
at the expense of potential coasters. Specify this option to tell dvdisaster
to produce bigger images that will only fit on BD-R media burnt without defect
management. Some burning softwares call it "formatting" the BD-R before burning.
Note that should you need to repair such an augmented image, you'll then need to
specify this option on the command-line too.
2020-08-30 17:54:36 +02:00
Stéphane Lesimple
2d68cfb0b1 feat: add --no-bdr-defect-management to produce bigger augmented images with RS03 2020-08-30 17:06:41 +02:00
Stéphane Lesimple
c0c6747bd9 fix: reimport some missed locales 2020-08-29 22:11:30 +02:00
Stéphane Lesimple
3eecbcbdcc chore: autotest windows & linux on PR + remove 2 warnings under Linux 2020-08-29 21:44:15 +02:00
Stéphane Lesimple
49eecc0a6f chore: add a static make target 2020-08-27 19:11:12 +02:00
Stéphane Lesimple
4d2e0ba32c chore: fix make parallelism 2020-08-27 19:11:12 +02:00
Stéphane Lesimple
495a851356 fix: adjust BDXL_QL_SIZE and rollback BD_SL_SIZE to upstream version
BD_SL_SIZE was mistakenly modified in 0.79.6-pl1, we restore the
previous upstream version to avoid having several dvdisaster versions
in the field with different values set for it.

If you created an RS03 augmented image with 0.79.6-pl1, you'll still
be able to conduct a repair of the image, should it be damaged,
by using any 0.79.6 version (with or without patchlevel), using
the following additional command-line parameters:
dvdisaster -f --debug -n 12219392

BDXL_QL_SIZE (introduced in pl1) was also adjusted in this version,
To repair a damaged BD-R quadruple layer image created by pl1:
dvdisaster -f --debug -n 62500864

The values that were present in pl1 were corresponding to a BD-R
burnt without formatting it for defect management first, which enabled
more space for parity data. You can still do it if you want (read
the comment in the code introduced by this commit), but to follow
upstream design, the default number of sectors for all BD-R implies
that defect management is enabled.
2020-08-27 19:11:12 +02:00
Stéphane Lesimple
5b95870f39 chore: update README.md 2020-08-27 18:37:06 +02:00
Stéphane Lesimple
d76551ce39 chore: automatically run regression tests on pull request 2020-08-26 09:35:35 +02:00
Stéphane Lesimple
0c5995bd72 chore: use tags to describe the build 2020-08-25 21:15:08 +02:00
Stéphane Lesimple
7c74ca8f84 chore: fix a typo in makefile, update po files 2020-08-25 21:12:55 +02:00
Stéphane Lesimple
7966d41c01 update README.md 2020-08-25 21:06:29 +02:00
Stéphane Lesimple
87d61d4eb0 fix config-win.txt location 2020-08-25 20:35:20 +02:00
Stéphane Lesimple
ab0427f2f0 update CHANGELOG, create README.md 2020-08-25 20:27:40 +02:00
Stéphane Lesimple
4b982057f7 adjust the welcome window message 2020-08-25 20:22:49 +02:00
Stéphane Lesimple
d22fac49a3 add regtest/runtests.sh 2020-08-25 20:15:36 +02:00
Stéphane Lesimple
8e0664462e icon for Windows, make windist 2020-08-25 20:15:00 +02:00
Stéphane Lesimple
8298d78e04 regtests: more fixes for Windows 2020-08-25 14:28:15 +02:00
Stéphane Lesimple
d8e0dab436 regtests: enhancements for Windows 2020-08-25 13:22:10 +02:00
Stéphane Lesimple
196506c3dd win32: add device name for simulated device 2020-08-25 13:05:22 +02:00
Stéphane Lesimple
6362a68355 enh: regtests: add config-win.txt to override tests config 2020-08-25 13:04:42 +02:00
Stéphane Lesimple
5553ed332f fix: isprint => canprint
add a canprint() func that return true iif
char is ascii (< 0x80) and not a control char
(> 0x1F), as isprint() seems to be different
under Linux and Windows
2020-08-25 13:03:05 +02:00
Stéphane Lesimple
5ab5f9b0cb enable all regtests, fixes after regests run 2020-08-24 21:02:44 +02:00
Stéphane Lesimple
9ef0b374e5 chore: remove exit status check, sometimes non-zero is legit 2020-08-23 20:01:19 +02:00
Stéphane Lesimple
a886d60417 fix: remove debug print 2020-08-23 20:00:26 +02:00
Stéphane Lesimple
d29db408a3 fix: configure: remove -Werror, silently breaks conftest.c tests 2020-08-23 19:58:37 +02:00
Stéphane Lesimple
f8dbe54a8c feat: First working Windows build 2020-08-23 16:52:06 +02:00
Stéphane Lesimple
f9e8ce83bc chore: regtest: if exit status != 0, log it 2020-08-23 16:38:07 +02:00
Stéphane Lesimple
4ba33a2c89 chore: add notion of patchlevel to avoid changing version scheme 2020-08-23 16:38:07 +02:00
Stéphane Lesimple
41887bb25e debian: adust patches/series 2020-08-20 14:20:10 +02:00
Stéphane Lesimple
0a90d1b22a chore: Adjust changelog, about box and welcome message 2020-08-20 14:17:58 +02:00
Stéphane Lesimple
d314a6bcef enh: CLI: better description for -m 2020-08-20 14:17:58 +02:00
Stéphane Lesimple
b4aed53e23 feat: add support for BDXL QL (128GB) 2020-08-20 14:17:58 +02:00
Stéphane Lesimple
a4efe71abf chore: adjustments to the auto build numbering 2020-08-20 14:17:58 +02:00
Stéphane Lesimple
38defdf7aa Apply (most) debian patches
Apply debian patch 02-encryption
Apply debian patch 03-dvdrom
Apply a modified version of patch 05-help-dialog
Apply debian patch 08-fix-gnu-make-detection
Apply debian patch 10-use-non-size-specific-icon-and-add-keywords-to-desktop-file
Apply debian patch 12-fix-spelling-of-up-to
Apply debian patch 13-fix-missing-language-field-in-po-files
Apply a modified version of debian patch 14-make-builds-reproducible
Apply debian patch 17-fix-all-but-deprecated-api-warnings
Apply a modified version of debian patch 18-update-copyright-in-about-dialog
Apply debian patch 19-show-text-files-with-abs-path
Apply debian patch 22-fix-hurd-i386-ftbfs
Apply debian patch 23-add-bdrom-support
Apply debian patch 25-fix-man-pages
Apply debian patch 27-allow-opening-in-browser-again
Apply debian patch 28-pdftex-reproducibility
Apply debian patch 29-fix-more-typos
Apply debian patch 30-hurd-kfreebsd-ftbfs
Apply debian patch 31-improve-hurd-and-kfreebsd-support
Apply debian patch 33-honour-LDFLAGS
Apply debian patch 34-gcc8-format-security.patch
Apply debian patch 35-archived-homepage
Apply debian patch 36-fix-parallelism
2020-08-20 14:17:35 +02:00
Stéphane Lesimple
99b27b982a feat: CLI-only version (without GTK)
Modify the build system and the source
files to support building a CLI-only
version with only glib2 as a dependency.
Use CLI_ONLY=1 ./configure, then make clean all.
2020-08-19 21:21:11 +02:00
Stéphane Lesimple
4f480905dc fix: adjust BD_SL_SIZE to the most commonly found size in the field
This is also the size reported by Wikipedia.
TODO: add a CLI option to specify a medium
of arbitrary size, especially important for RS03.
2020-08-19 21:21:11 +02:00
Stéphane Lesimple
32c8455017 chore: build system adjustments
Remove build.h and version.tex from versioning, they're autogenerated
Make 'Makefile' the dummy makefile to instruct user to launch configure if no GNUmakefile is found
Make GNUmakefile the generated makefile and exclude it from the versioning
Update .gitignore accordingly
2020-08-19 21:21:11 +02:00
Debian Janitor
0c038b8171 Fix day-of-week for changelog entries 0.71~devel23-4.
Fixes lintian: debian-changelog-has-wrong-day-of-week
See https://lintian.debian.org/tags/debian-changelog-has-wrong-day-of-week.html for more details.
2020-08-19 21:21:11 +02:00
Debian Janitor
fc3f2605f6 Remove obsolete fields Name, Contact from debian/upstream/metadata. 2020-08-19 21:21:11 +02:00
Debian Janitor
4ecd698a6b Update standards version to 4.4.1, no changes needed.
Fixes lintian: out-of-date-standards-version
See https://lintian.debian.org/tags/out-of-date-standards-version.html for more details.
2020-08-19 21:21:11 +02:00
Debian Janitor
a5bf80c657 Set debhelper-compat version in Build-Depends. 2020-08-19 21:21:11 +02:00
Debian Janitor
5bc91d01b1 Update standards version, no changes needed.
Fixes lintian: out-of-date-standards-version
See https://lintian.debian.org/tags/out-of-date-standards-version.html for more details.
2020-08-19 21:21:11 +02:00
Debian Janitor
3c60b1a959 Use secure URI in debian/watch.
Fixes lintian: debian-watch-uses-insecure-uri
See https://lintian.debian.org/tags/debian-watch-uses-insecure-uri.html for more details.
2020-08-19 21:21:11 +02:00
Carlos Maddela
181c40e1fb Release version 0.79.5-9 2020-08-19 21:21:11 +02:00
Carlos Maddela
6f7cb57317 Make sure that the upstream changelog remains uncompressed
Make sure that the upstream changelog remains uncompressed,
so that the application can display it.
2020-08-19 21:21:11 +02:00
Carlos Maddela
d169e4f289 debian/gbp.conf: Switch debian branch to debian/master. 2020-08-19 21:21:11 +02:00
143 changed files with 10928 additions and 7697 deletions

View File

@@ -1,4 +0,0 @@
PRIVATE
test-cases
regtest
st

145
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,145 @@
name: C/C++ CI
on: [pull_request]
jobs:
linux64-gui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install prerequisites
run: sudo apt update && sudo apt install -y libgtk2.0-dev libglib2.0-dev
- name: configure
run: ./configure
- name: make
run: nproc && make -j$(nproc)
- name: check executability
run: ./dvdisaster --version
- name: check executable
run: file dvdisaster && file dvdisaster | grep -q 'ELF 64'
- name: regression tests
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
linux64-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install prerequisites
run: sudo apt update && sudo apt install -y libglib2.0-dev
- name: configure
run: env CLI_ONLY=1 ./configure
- name: make
run: nproc && make -j$(nproc)
- name: check executability
run: ./dvdisaster --version
- name: check executable
run: file dvdisaster && file dvdisaster | grep -q 'ELF 64'
- name: regression tests
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
win64-gui:
runs-on: windows-2016
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: git diffutils make pkg-config mingw-w64-x86_64-gtk2 mingw-w64-x86_64-glib2 mingw-w64-x86_64-gcc
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: configure
run: ./configure
- name: make
run: nproc && make -j$(nproc)
- name: check executability
run: ./dvdisaster.exe --version
- name: check executable
run: file dvdisaster.exe && file dvdisaster.exe | grep -q 'x86-64, for MS Windows'
- name: regression tests
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
win32-gui:
runs-on: windows-2016
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: false
install: git diffutils make pkg-config mingw-w64-i686-gtk2 mingw-w64-i686-glib2 mingw-w64-i686-gcc
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: configure
run: ./configure
- name: make
run: nproc && make -j$(nproc)
- name: check executability
run: ./dvdisaster.exe --version
- name: check executable
run: file dvdisaster.exe && file dvdisaster.exe | grep -q '386, for MS Windows'
- name: regression tests
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
win64-cli:
runs-on: windows-2016
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: git diffutils make pkg-config mingw-w64-x86_64-glib2 mingw-w64-x86_64-gcc
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: configure
run: env CLI_ONLY=1 ./configure
- name: make
run: nproc && make -j$(nproc)
- name: check executability
run: ./dvdisaster.exe --version
- name: check executable
run: file dvdisaster.exe && file dvdisaster.exe | grep -q 'x86-64, for MS Windows'
- name: regression tests
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
win32-cli:
runs-on: windows-2016
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: false
install: git diffutils make pkg-config mingw-w64-i686-glib2 mingw-w64-i686-gcc
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: configure
run: env CLI_ONLY=1 ./configure
- name: make
run: nproc && make -j$(nproc)
- name: check executability
run: ./dvdisaster.exe --version
- name: check executable
run: file dvdisaster.exe && file dvdisaster.exe | grep -q '386, for MS Windows'
- name: regression tests
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh

15
.gitignore vendored
View File

@@ -1,3 +1,18 @@
.pc
*.o
*~
*.gcno
*.gcda
*.gcov
Makefile.config
configure.log
locale/Makefile
GNUmakefile
.gitignore
simple-md5sum
inlined-icons.h
help-dialogs.h
dvdisaster
build.h
dvdisaster.mo
locale/messages.pot

View File

@@ -1,5 +1,63 @@
# dvdisaster changelog -*-text-*-
0.79.6.patchlevel-2 30-08-2020 *UNOFFICIAL*
- fix: Adjust BDXL_QL_SIZE and rollback BD_SL_SIZE to upstream version*
- feat: add --no-bdr-defect-management to produce bigger augmented images with RS03
- chore: remove 2 compiler warnings under Linux
- chore: automatically run regtests under Win32, Win64, Linux64 (regular and CLI-only) on pull requests
- chore: add a Linux CLI-only static make target
- chore: fix make parallelism
- chore: use tags to describe the build
*:BD_SL_SIZE was mistakenly modified in 0.79.6-pl1, we restore the
previous upstream value to avoid having several dvdisaster versions
in the field with different values set for it.
If you created an RS03 augmented image with 0.79.6-pl1, you'll still
be able to conduct a repair of the image, should it be damaged,
by using any 0.79.6 version (with or without patchlevel), using
the following additional command-line parameters:
dvdisaster -f --debug -n 12219392
On the patchlevel versions, this is equivalent to saying:
dvdisaster -f --no-bdr-defect-management
BDXL_QL_SIZE (introduced in pl1) was also adjusted in this version,
To repair a damaged BD-R quadruple layer image created by pl1:
dvdisaster -f --debug -n 62500864
On the patchlevel versions, this is equivalent to saying:
dvdisaster -f --no-bdr-defect-management
The values that were present in pl1 were corresponding to a BD-R
burnt without formatting it for defect management first, which enabled
more space for parity data. You can still do it if you want, with
--no-bdr-defect-management (see manpage), but to follow upstream,
the default number of sectors for all BD-R implies that defect
management is enabled.
0.79.6.patchlevel-1 20-08-2020 *UNOFFICIAL*
- This is an UNOFFICIAL version, not from the original author,
based on the latest available pre-release, 0.79.6.
Changes will be kept minimal (this is not a hard fork),
to be able to merge in any new upstream version should it arise.
- Most patches from the Debian maintainer have been applied,
up to Debian version 0.79.6-5. Patches that are purely Debian
specific have been omitted.
- This release keeps the debian/ folder untouched, with only
the patches/series file adjusted. Building the package has
not been tested.
- Added support for BDXL-QL (quadruple layer, 128GB)
- Added support to compile a CLI-only version, without
the GTK dependency (only glib2), compile with:
$ CLI_ONLY=1 ./configure && make clean && make -j4
- Added support to compile a Windows version under MingW (tested
with MSYS2)
- All regression tests are passing on Linux 64, Win 32 and Win 64.
- A few tweaks and fixes around have been done while massively
amending the source files to make the CLI-only version possible.
This hopefully removes a few quirks without adding too many.
THE ORIGINAL UPSTREAM CHANGELOG IS KEPT BELOW:
0.79.6 20-11-2017
- The Verify/Test option will now output dvdisaster version
numbers always in x.yy.zz format, as the old scheme

View File

@@ -1,4 +0,0 @@
all:
@echo
@echo "Please create a Makefile by entering \"bash configure\" first"
@echo

View File

@@ -39,9 +39,9 @@ INTL_LIBS = $(CFG_INTL_LIBS)
CAM_LFLAGS = $(CFG_CAM_LFLAGS)
CAM_LIBS = $(CFG_CAM_LIBS)
GTK_CFLAGS = $(CFG_GTK2_CFLAGS)
GTK_LIBS = $(CFG_GTK2_LIBS)
GTK_BINDIR = $(CFG_GTK2_BINDIR)
GTK_CFLAGS = $(CFG_GTK2_CFLAGS) $(CFG_GLIB2_CFLAGS)
GTK_LIBS = $(CFG_GTK2_LIBS) $(CFG_GLIB2_LIBS)
GTK_BINDIR = $(CFG_GTK2_BINDIR) $(CFG_GLIB2_BINDIR)
EFENCE_LFLAGS = $(CFG_EFENCE_LFLAGS)
EFENCE_LIBS = $(CFG_EFENCE_LIBS)
@@ -67,22 +67,31 @@ OFILES = $(CFG_OFILES)
# Compilation related
######################################################################
.PHONY : all help show locale time-stamp
.PHONY : all help show locale build.h
${BUILDTMP}/%.o : %.c
@echo "Compiling:" $?
@$(CC) $(COPTS) -c $? -o $@
all: time-stamp dvdisaster
all: dvdisaster
${BUILDTMP}/build.o : build.c build.h
@echo "Compiling:" build.o
@$(CC) $(COPTS) -c build.c -o $@
# Building the dvdisaster binary
time-stamp:
build.h:
@echo "Updating:" build.h
@$(SRCDIR)/scripts/time-stamper.bash $(SRCDIR)/build.h
dvdisaster: inlined-icons.h $(OFILES)
dvdisaster: $(ICONS) $(OFILES) build.h
@echo "Linking : dvdisaster"
@$(CC) $(LOPTS) $(OFILES) $(LIBS) -o dvdisaster
@if test $(CFG_SYS_OPTIONS) == -DSYS_MINGW; \
then windres -v winres.rc -O coff -o winres.o >/dev/null ; \
$(CC) $(LOPTS) $(OFILES) $(LIBS) winres.o -o dvdisaster ; \
else $(CC) $(LOPTS) $(OFILES) $(LIBS) -o dvdisaster ; \
fi
@if test -e locale/de/LC_MESSAGES/dvdisaster.mo \
|| echo $(WITH_OPTIONS) | grep "NLS_NO" >/dev/null; \
then echo "not touching locale"; \
@@ -138,9 +147,10 @@ untranslated:
@$(MAKE) --no-print-directory -C locale check-untranslated
simple-md5sum: md5.c
@$(CC) $(COPTS) $(MUDFLAP_CFLAGS) -DSIMPLE_MD5SUM md5.c $(MUDFLAP_LFLAGS) $(MUDFLAP_LIBS) -o simple-md5sum
@$(CC) $(COPTS) $(MUDFLAP_CFLAGS) -DSIMPLE_MD5SUM md5.c $(LDFLAGS) $(MUDFLAP_LFLAGS) $(MUDFLAP_LIBS) -o simple-md5sum
version.tex:
@test -d $(SRCDIR)/documentation/config || mkdir $(SRCDIR)/documentation/config
@echo "\\newcommand{\\projectversion}{$(VERSION)}" >$(SRCDIR)/documentation/config/version.tex
manual: version.tex
@@ -221,7 +231,7 @@ show:
######################################################################
.PHONY : install uninstall clean distclean arch
.PHONY : srcdist
.PHONY : srcdist dist
install: dvdisaster manual
@echo "Installing package..."
@@ -239,9 +249,9 @@ install: dvdisaster manual
install -d $(BUILDROOT)$(MANDIR)/de/man1
cd documentation; \
ESCAPED_DOCSUBDIR=`echo $(DOCSUBDIR) | sed -e 's/\//\\\\\//g'`; \
sed "s/%docdir%/$$ESCAPED_DOCSUBDIR\/html/" <dvdisaster.en.1 >dvdisaster.updated; \
sed "s/%docdir%/$$ESCAPED_DOCSUBDIR/" <dvdisaster.en.1 >dvdisaster.updated; \
install -m 644 dvdisaster.updated $(BUILDROOT)$(MANDIR)/man1/dvdisaster.1; \
sed "s/%docdir%/$$ESCAPED_DOCSUBDIR\/html/" <dvdisaster.de.1 >dvdisaster.updated; \
sed "s/%docdir%/$$ESCAPED_DOCSUBDIR/" <dvdisaster.de.1 >dvdisaster.updated; \
install -m 644 dvdisaster.updated $(BUILDROOT)$(MANDIR)/de/man1/dvdisaster.1; \
rm dvdisaster.updated
if echo $(WITH_OPTIONS) | grep "NLS_YES" >/dev/null; then \
@@ -286,10 +296,6 @@ distclean: clean
@echo "Removing configuration files"
@rm -f configure.log Makefile.config GNUmakefile locale/Makefile
@for i in locale/?? locale/??_??; do rm -rf $$i; done
@echo "all:" >>GNUmakefile
@echo -e "\t@echo" >>GNUmakefile
@echo -e "\t@echo \"Please create a Makefile by entering \\\"bash configure\\\" first\"" >>GNUmakefile
@echo -e "\t@echo" >>GNUmakefile
# There might be a not executable simple-md5sum from a compiler run
# under a different architecture, so make sure we have a working binary
@@ -317,9 +323,10 @@ clean:
@rm -f simple-md5sum
@$(MAKE) --no-print-directory -C $(SRCDIR)/documentation/codec-specs clean;
@$(MAKE) --no-print-directory -C $(SRCDIR)/documentation/user-manual clean;
@$(MAKE) --no-print-directory -C $(SRCDIR)/locale clean;
BUILD=`grep BUILD $(SRCDIR)/build.h | cut -d ' ' -f 3`
arch: archclean time-stamp
arch: archclean build.h
@cd .. ; tar -c -z -f $(TAR_PREFIX)/$(PKGNAME)-$(BUILD).tgz $(PKGNAME)
INSTALL: documentation/install.template
@@ -329,5 +336,26 @@ srcdist: INSTALL distclean manual manualclean
@cd .. ; tar -c -j -X $(PKGNAME)/NODIST -f $(TAR_PREFIX)/$(PKGNAME).tar.bz2 $(PKGNAME)
@cd .. ; gpg --homedir .gnupg --default-key 758BCC23 --detach-sign --output $(TAR_PREFIX)/$(PKGNAME).tar.bz2.gpg --armor $(TAR_PREFIX)/$(PKGNAME).tar.bz2
MINGWROOT = $(shell dirname $(CC))/..
windist:
rm -rf dist
mkdir -p dist/lib dist/locale dist/share/themes
for i in libatk-1.0-*.dll libbrotlicommon.dll libbrotlidec.dll libbz2-*.dll libcairo-*.dll libdatrie-*.dll libexpat-*.dll libffi-*.dll libfontconfig-*.dll libfreetype-*.dll libfribidi-*.dll libgcc_s_*.dll libgdk_pixbuf-2.0-*.dll libgdk-win32-2.0-*.dll libgio-2.0-*.dll libglib-2.0-*.dll libgmodule-2.0-*.dll libgobject-2.0-*.dll libgraphite2.dll libgtk-win32-2.0-*.dll libharfbuzz-*.dll libiconv-*.dll libintl-*.dll libpango-1.0-*.dll libpangocairo-1.0-*.dll libpangoft2-1.0-*.dll libpangowin32-1.0-*.dll libpcre-*.dll libpixman-1-*.dll libpng16-*.dll libssp-*.dll libstdc++-*.dll libthai-*.dll libwinpthread-*.dll zlib1.dll; \
do cp -v $(MINGWROOT)/bin/$$i dist/ ; done
cp -v dvdisaster.exe dist/
cp -vr locale/*/ dist/locale/
cp -vr $(MINGWROOT)/share/themes/MS-Windows dist/share/themes/
cp -vr $(MINGWROOT)/lib/gtk-2.0 dist/lib/
find dist -type f -name "*.a" -delete
windistcli:
rm -rf dist
mkdir -p dist/locale
for i in libglib-2.0-*.dll libiconv-*.dll libintl-*.dll libpcre-*.dll libwinpthread-*.dll; \
do cp -v $(MINGWROOT)/bin/$$i dist/ ; done
cp -v dvdisaster.exe dist/
cp -vr locale/*/ dist/locale/
find dist -type f -name "*.a" -delete
static: dvdisaster
$(CC) $(LOPTS) $(OFILES) $(LIBS) -pthread -static -o dvdisaster-static

View File

@@ -127,6 +127,11 @@ Call the configuration script in the usual way:
user@host> ./configure
If you want to build a CLI-only version, which doesn't depend
on the gtk2 libraries, you can run instead:
user@host> CLI_ONLY=1 ./configure
The script will possibly print some errors about missing libraries.
Type "configure --help" to learn about pointing configure
to the correct path of already installed libraries.

View File

@@ -4,8 +4,11 @@
all:
@echo
@echo "dvdisaster requires GNU make to build."
@echo "Please try your command again using gmake."
@echo "Please run \`./configure' first."
@echo "To build a CLI-only version,"
@echo "run \`CLI_ONLY=1 ./configure' instead."
@echo "Note that dvdisaster requires GNU make to build."
@echo "Under non-Linux systems, it might be known as \`gmake'."
@echo
show: all

5
README
View File

@@ -65,8 +65,3 @@ locale
scripts
Scripts needed for configuring and building dvdisaster are
located in the "scripts" directory.
tools
Auxiliary programs for the build and packaging process reside
in "tools".

78
README.md Normal file
View File

@@ -0,0 +1,78 @@
# dvdisaster provides additional ECC protection for optical media
It can loosely be compared to *par2* files, but the protection works at the *iso* level instead of working at the file level. This way, even if metadata from the optical media filesystem is damaged, dvdisaster can still work flawlessly.
This version of dvdisaster supports the following platforms:
Linux, FreeBSD, NetBSD on x86, PowerPC, Sparc, and Windows.
Three protection codecs are supported, they're quickly detailed below. Please see the documentation/manual.pdf for more information about these, and everything else.
# The codecs
## RS01
RS01 creates error correction files which are stored separately from the image they
belong to. The artefact is an **ecc** file, which must be stored on another media than the one we're protecting.
## RS02
RS02 creates error correction data which is added to the medium to protect, we call this *augmenting* the image we're protecting. Damaged sectors in the error correction information reduce the data recovering capacity, but do not make recovery impossible - a second medium for keeping or protecting the error correction
information is not required.
## RS03
RS03 is a further development of RS01 and RS02. It can create both error correction files and
augmented images, with the following added features:
- RS03 can distribute work over multiple processor cores and is therefore much faster than
RS01/RS02 on modern hardware.
- RS03 error correction files are - contrary to RS01 - robust against damage. This should
not delude you into careless handling of your error correction files though - the disadvantages
of reading at the filesystem level are still valid.
- RS03 augmented images do not require so-called master blocks holding important in-
formation. This makes RS03 a bit more robust, but also more restrictive: The augmented
image must completely fill the medium now while the size of augmented images can be
freely chosen in RS02.
The changes for parallel computation and higher robustness make RS03 a bit less space efficient,
e.g. RS03 error correction data has slighly less error correction capacity than its RS01/RS02
counterparts on images with equal size.
# Unofficial version
The last upstream version by Carsten Gnörlich is dated 2017, and could be found on the [official](https://web.archive.org/web/20180428070843/http://dvdisaster.net/en/index.html) [website](https://web.archive.org/web/20180509154525/http://dvdisaster.org/en/index.html) which is [now](http://www.dvdisaster.net) [down](http://www.dvdisaster.org). The original source code [repository](https://sourceforge.net/projects/dvdisaster/files/dvdisaster) doesn't have it, but [Debian sources](https://sources.debian.org/src/dvdisaster/) does, thanks to the maintainer there.
The original README has been left untouched in this repository.
This version is built on top of the latest upstream version, with the following notable enhancements:
- Most Debian patches have been applied, those specific to Debian have been omitted
- Windows build supported again, it was dropped upstream a few versions back
- A CLI-only version is now supported, without depending on gtk (`CLI_ONLY=1 ./configure && make clean && make -j4`)
- Regression tests confirmed working on Linux64, Windows32 and Windows64, for normal and CLI-only builds
- Added pre-defined sizes for BD-R Triple Layer (100GB), BD-R Quadruple Layer (128GB)
# Rationale
Even if the optical media era is sunsetting now, and has been for a few years, it's still of some value for off-site backups. In any case, we still have media in our hands that we want to be able to repair, should it be damaged, during the next years/decades. Repairing is actually pretty much the very reason of dvdisaster existence (as long as parity data has been added, of course).
The idea of this unofficial version is to ensure dvdisaster doesn't get hard to find, use or compile, should upstream development never resume (we hope it does!).
This is also why precompiled Windows binaries and a precompiled static CLI-only Linux version are available here.
# Compiling
See the INSTALL file
# Screenshots
### Scanning a damaged CD under Windows
![dvdisaster_damaged_cd](https://user-images.githubusercontent.com/218502/91434313-edaaf880-e864-11ea-8e41-7b58a1e97a70.PNG)
### Scanning a healthy BD-R (single layer) with Linux GUI
![dvdisaster_bdr_read](https://user-images.githubusercontent.com/218502/91436728-fbfb1380-e868-11ea-8444-04ebc60809d8.PNG)
### Creating an RS03 error correction file with Linux GUI
![dvdisaster_bdr_create](https://user-images.githubusercontent.com/218502/91436740-00273100-e869-11ea-837a-af0d0733fe87.PNG)
### Verifying a BD-R image with Linux GUI
![dvdisaster_bdr_verify](https://user-images.githubusercontent.com/218502/91436731-fc93aa00-e868-11ea-93e6-b8c277620df7.PNG)

View File

@@ -25,4 +25,4 @@
/* build is incremented at each make;
make recompile of dependent file as fast as possible */
int buildCount = BUILD;
const char *const buildCount = BUILD;

View File

@@ -1,2 +0,0 @@
#define BUILD 272
#define BDATE "17.11.17 (Freitag, 09:57)"

View File

@@ -22,7 +22,8 @@
#include "dvdisaster.h"
#ifdef SYS_LINUX
#if defined(SYS_LINUX)
int ProbeCacheLineSize()
{ int cl_size = 0;
@@ -36,9 +37,9 @@ int ProbeCacheLineSize()
return cl_size;
}
#endif
#ifdef SYS_FREEBSD
#elif defined(SYS_FREEBSD) || defined(SYS_KFREEBSD)
#include <sys/param.h>
int ProbeCacheLineSize()
@@ -52,9 +53,9 @@ int ProbeCacheLineSize()
return cl_size;
}
#endif
#ifdef SYS_NETBSD
#elif defined(SYS_NETBSD)
#include <sys/param.h>
int ProbeCacheLineSize()
@@ -68,13 +69,14 @@ int ProbeCacheLineSize()
return cl_size;
}
#endif
#ifdef SYS_UNKNOWN
#else /* SYS_UNKNOWN and others. */
int ProbeCacheLineSize()
{
return 64;
}
#endif
/* TODO MINGW: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-cache_descriptor */

View File

@@ -50,7 +50,8 @@ static void get_base_dirs()
/*** Otherwise try the installation directory.
On Unices this is a hardcoded directory. */
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_UNKNOWN)
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_KFREEBSD) || \
defined(SYS_NETBSD) || defined(SYS_HURD) || defined(SYS_UNKNOWN)
if(DirStat(BINDIR))
Closure->binDir = g_strdup(BINDIR);
@@ -89,6 +90,7 @@ find_dotfile:
* Update color string for the <span color="#f00baa">...</span> string
*/
#ifndef CLI
void UpdateMarkup(char **string, GdkColor *color)
{ int hexval;
@@ -173,6 +175,7 @@ static void get_color(GdkColor *color, char *value)
color->green = hex&0xff00;
color->blue = (hex<<8)&0xff00;
}
#endif
/***
*** Save and restore user settings to/from the .dvdisaster file
@@ -196,7 +199,7 @@ void ReadDotfile()
/* Get first MAX_LINE_LEN bytes of line, discard the rest */
line[MAX_LINE_LEN-1] = 1;
fgets(line, MAX_LINE_LEN, dotfile);
if (!fgets(line, MAX_LINE_LEN, dotfile)) break;
if(!line[MAX_LINE_LEN-1]) /* line longer than buffer */
while(!feof(dotfile) && fgetc(dotfile) != '\n')
;
@@ -239,6 +242,7 @@ void ReadDotfile()
if(!strcmp(symbol, "bd-size1")) { Closure->bdSize1 = Closure->savedBDSize1 = atoll(value); continue; }
if(!strcmp(symbol, "bd-size2")) { Closure->bdSize2 = Closure->savedBDSize2 = atoll(value); continue; }
if(!strcmp(symbol, "bd-size3")) { Closure->bdSize3 = Closure->savedBDSize3 = atoll(value); continue; }
if(!strcmp(symbol, "bd-size4")) { Closure->bdSize4 = Closure->savedBDSize4 = atoll(value); continue; }
if(!strcmp(symbol, "cache-size")) { Closure->cacheMiB = atoi(value); continue; }
if(!strcmp(symbol, "cd-size")) { Closure->cdSize = Closure->savedCDSize = atoll(value); continue; }
if(!strcmp(symbol, "codec-threads")) { Closure->codecThreads = atoi(value); continue; }
@@ -288,6 +292,7 @@ void ReadDotfile()
if(!strcmp(symbol, "verbose")) { Closure->verbose = atoi(value); continue; }
if(!strcmp(symbol, "welcome-msg")) { Closure->welcomeMessage = atoi(value); continue; }
#ifndef CLI
if(!strcmp(symbol, "positive-text")) { get_color(Closure->greenText, value);
UpdateMarkup(&Closure->greenMarkup, Closure->greenText);
continue;
@@ -305,6 +310,7 @@ void ReadDotfile()
if(!strcmp(symbol, "ignored-sector")) { get_color(Closure->blueSector, value); continue; }
if(!strcmp(symbol, "highlit-sector")) { get_color(Closure->whiteSector, value); continue; }
if(!strcmp(symbol, "present-sector")) { get_color(Closure->darkSector, value); continue; }
#endif
}
if(fclose(dotfile))
@@ -348,6 +354,7 @@ static void update_dotfile()
g_fprintf(dotfile, "bd-size1: %lld\n", (long long int)Closure->bdSize1);
g_fprintf(dotfile, "bd-size2: %lld\n", (long long int)Closure->bdSize2);
g_fprintf(dotfile, "bd-size3: %lld\n", (long long int)Closure->bdSize3);
g_fprintf(dotfile, "bd-size4: %lld\n", (long long int)Closure->bdSize4);
g_fprintf(dotfile, "cache-size: %d\n", Closure->cacheMiB);
g_fprintf(dotfile, "cd-size: %lld\n", (long long int)Closure->cdSize);
g_fprintf(dotfile, "codec-threads: %d\n", Closure->codecThreads);
@@ -391,6 +398,7 @@ static void update_dotfile()
g_fprintf(dotfile, "verbose: %d\n", Closure->verbose);
g_fprintf(dotfile, "welcome-msg: %d\n\n", Closure->welcomeMessage);
#ifndef CLI
save_colors(dotfile, "positive-text", Closure->greenText);
save_colors(dotfile, "negative-text", Closure->redText);
save_colors(dotfile, "bar-color", Closure->barColor);
@@ -402,6 +410,7 @@ static void update_dotfile()
save_colors(dotfile, "ignored-sector", Closure->blueSector);
save_colors(dotfile, "highlit-sector", Closure->whiteSector);
save_colors(dotfile, "present-sector", Closure->darkSector);
#endif
if(fclose(dotfile))
g_printf("Error closing configuration file %s: %s\n",
@@ -423,7 +432,10 @@ void InitClosure()
/* Extract the version string */
#ifdef HAVE_UNSTABLE_RELEASE
#if defined(HAVE_UNSTABLE_RELEASE) && defined(PATCHLEVEL)
Closure->cookedVersion = g_strdup_printf("%s (unstable-unofficial patchlevel %d)", VERSION, PATCHLEVEL);
Closure->releaseFlags = MFLAG_DEVEL;
#elif defined(HAVE_UNSTABLE_RELEASE)
Closure->cookedVersion = g_strdup_printf("%s (unstable)", VERSION);
Closure->releaseFlags = MFLAG_DEVEL;
#else
@@ -432,7 +444,8 @@ void InitClosure()
/* Generate a more comprehensive version string */
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_NETBSD)
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_KFREEBSD) || \
defined(SYS_NETBSD) || defined(SYS_HURD)
#ifdef HAVE_64BIT
#define BITNESS_STRING " 64bit"
#else
@@ -442,7 +455,7 @@ void InitClosure()
#define BITNESS_STRING ""
#endif
Closure->versionString = g_strdup_printf("dvdisaster %s build %d, %s%s",
Closure->versionString = g_strdup_printf("dvdisaster %s build %s, %s%s",
Closure->cookedVersion, buildCount, SYS_NAME, BITNESS_STRING);
/* Replace the dot with a locale-resistant separator */
@@ -474,6 +487,7 @@ void InitClosure()
Closure->deviceNames = g_ptr_array_new();
Closure->deviceNodes = g_ptr_array_new();
Closure->viewer = g_strdup("xdg-open");
Closure->browser = g_strdup("xdg-open");
Closure->methodList = g_ptr_array_new();
Closure->methodName = g_strdup("RS01");
Closure->dDumpDir = g_strdup(Closure->homeDir);
@@ -492,6 +506,8 @@ void InitClosure()
Closure->welcomeMessage = 1;
Closure->useSCSIDriver = DRIVER_SG;
Closure->dsmVersion = 1;
Closure->noBdrDefectManagement = FALSE;
Closure->ignoreRS03header = FALSE;
/* default sizes for typical CD and DVD media */
@@ -501,7 +517,9 @@ void InitClosure()
Closure->bdSize1 = Closure->savedBDSize1 = BD_SL_SIZE;
Closure->bdSize2 = Closure->savedBDSize2 = BD_DL_SIZE;
Closure->bdSize3 = Closure->savedBDSize3 = BDXL_TL_SIZE;
Closure->bdSize4 = Closure->savedBDSize4 = BDXL_QL_SIZE;
#ifndef CLI
Closure->logString = g_string_sized_new(1024);
Closure->logLock = g_malloc0(sizeof(GMutex));
g_mutex_init(Closure->logLock);
@@ -523,6 +541,7 @@ void InitClosure()
Closure->darkSector = g_malloc0(sizeof(GdkColor));
DefaultColors();
#endif
memset(Closure->bs, '\b', 255);
memset(Closure->sp, ' ', 255);
@@ -567,7 +586,10 @@ void cond_free_ptr_array(GPtrArray *a)
void FreeClosure()
{
#ifndef CLI
if(Closure->guiMode)
#endif
/* in CLI-only mode, always update dotfile */
update_dotfile();
cond_free(Closure->cookedVersion);
@@ -589,11 +611,13 @@ void FreeClosure()
cond_free(Closure->binDir);
cond_free(Closure->docDir);
cond_free(Closure->viewer);
cond_free(Closure->browser);
cond_free(Closure->errorTitle);
cond_free(Closure->simulateCD);
cond_free(Closure->dDumpDir);
cond_free(Closure->dDumpPrefix);
#ifndef CLI
if(Closure->prefsContext)
FreePreferences(Closure->prefsContext);
@@ -644,6 +668,7 @@ void FreeClosure()
if(Closure->readAdaptiveErrorMsg)
g_free(Closure->readAdaptiveErrorMsg);
#endif
g_free(Closure);
}

29
configure vendored
View File

@@ -4,9 +4,16 @@
BASH_BASED_CONFIGURE=./scripts/bash-based-configure
REQUIRED_CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I."
RECOMMENDED_CFLAGS="-O2 -fomit-frame-pointer -Wall"
RECOMMENDED_CFLAGS="-DPATCHLEVEL=2 -O2 -fomit-frame-pointer -Wall -Wno-deprecated-declarations -Wno-stringop-truncation"
DEBUG_CFLAGS="-ggdb -Wall"
if [ "$CLI_ONLY" = 1 ]; then
REQUIRED_CFLAGS="-DCLI $REQUIRED_CFLAGS"
echo '#define FLAVOR CLI' > build.h
else
echo '#define FLAVOR GUI' > build.h
fi
CFG_USE_CYGWIN="no" # do not change
if test -e $BASH_BASED_CONFIGURE; then
@@ -48,7 +55,9 @@ GET_BUILDTMP
PRINT_MESSAGE "\nLooking for includes and libraries:"
REQUIRE_GLIB2 2 32 0
REQUIRE_GTK2 2 6 0 WITH_THREADS
if [ "$CLI_ONLY" != 1 ]; then
REQUIRE_GTK2 2 6 0 WITH_THREADS
fi
echo
if ! CHECK_INCLUDE locale.h locale || ! CHECK_INCLUDE libintl.h intl ; then
@@ -110,10 +119,12 @@ if ! EXECUTE_PROGRAM "xgettext --help" xgettext \
cfg_force_with_nls=no
fi
if ! EXECUTE_PROGRAM "gdk-pixbuf-csource --help" gdk_pixbuf_csource ; then
echo "* gdk-pixbuf not installed"
echo "* or path to gdk-pixbuf-csource is missing."
exit 1
if [ "$CLI_ONLY" != 1 ]; then
if ! EXECUTE_PROGRAM "gdk-pixbuf-csource --help" gdk_pixbuf_csource ; then
echo "* gdk-pixbuf not installed"
echo "* or path to gdk-pixbuf-csource is missing."
exit 1
fi
fi
# Evaluate the --with* customization options
@@ -151,6 +162,9 @@ cfiles="method-link.c"
ofiles="$BUILDTMP/method-link.o"
for cfile in *.c; do
if [ "$CLI_ONLY" = 1 ]; then
grep -q 'DVDISASTER_GUI_FILE' "$cfile" && continue
fi
cfile_prefix=`echo $cfile | sed -e 's/\.c//'`
cfiles="$cfiles $cfile"
ofiles="$ofiles $BUILDTMP/$cfile_prefix.o"
@@ -160,6 +174,9 @@ done
echo
echo -e "\nCFG_CFILES = $cfiles" >> Makefile.config
echo "CFG_OFILES = $ofiles" >> Makefile.config
if [ "$CLI_ONLY" != 1 ]; then
echo "ICONS = inlined-icons.h" >> Makefile.config
fi
# Create the method wrapper

View File

@@ -6,7 +6,8 @@ Comment=Additional error protection for CD/DVD media
Comment[cs]=Přídavná ochrana pro média CD/DVD
Comment[de]=Zusätzliche Fehlerkorrektur für CD/DVD
Exec=dvdisaster
Icon=dvdisaster48.png
Icon=dvdisaster
Terminal=false
Type=Application
Categories=Application;System;
Keywords=CD;DVD;media;data loss;scratch;aging;error;protection;recovery;

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"

19
debian/changelog vendored
View File

@@ -1,3 +1,14 @@
dvdisaster (0.79.6-6) UNRELEASED; urgency=medium
* Use secure URI in debian/watch.
* Update standards version, no changes needed.
* Set debhelper-compat version in Build-Depends.
* Update standards version to 4.4.1, no changes needed.
* Remove obsolete fields Name, Contact from debian/upstream/metadata.
* Fix day-of-week for changelog entries 0.71~devel23-4.
-- Debian Janitor <janitor@jelmer.uk> Tue, 06 Aug 2019 16:08:20 +0000
dvdisaster (0.79.6-5) experimental; urgency=medium
* Merge changes from 0.79.5-9.
@@ -38,6 +49,12 @@ dvdisaster (0.79.6-1) experimental; urgency=medium
* Rebase patches.
-- Carlos Maddela <e7appew@gmail.com> Thu, 21 Dec 2017 05:51:54 +1100
dvdisaster (0.79.5-9) unstable; urgency=medium
* Make sure that the upstream changelog remains uncompressed so
that the application can display it.
-- Carlos Maddela <e7appew@gmail.com> Sat, 02 Feb 2019 13:32:34 +1100
dvdisaster (0.79.5-9) unstable; urgency=medium
@@ -394,7 +411,7 @@ dvdisaster (0.71~devel23-4) unstable; urgency=low
* Fixed clean target in rules (Closes: #442559).
-- Daniel Baumann <daniel@debian.org> Sun, 17 Sep 2007 00:37:00 +0200
-- Daniel Baumann <daniel@debian.org> Mon, 17 Sep 2007 00:37:00 +0200
dvdisaster (0.71~devel23-3) unstable; urgency=medium

1
debian/compat vendored
View File

@@ -1 +0,0 @@
12

5
debian/control vendored
View File

@@ -11,11 +11,12 @@ Build-Depends: debhelper (>= 12),
libcam-dev [kfreebsd-any],
libgtk2.0-dev,
libpng-dev,
pkg-config
pkg-config,
debhelper-compat (= 12)
Build-Depends-Indep: texlive-fonts-recommended <!nodoc>,
texlive-latex-base <!nodoc>,
texlive-latex-extra <!nodoc>
Standards-Version: 4.3.0
Standards-Version: 4.4.1
Vcs-Browser: https://salsa.debian.org/optical-media-team/dvdisaster
Vcs-Git: https://salsa.debian.org/optical-media-team/dvdisaster.git
Homepage: https://web.archive.org/web/20180428070843/http://dvdisaster.net/

2
debian/gbp.conf vendored
View File

@@ -1,5 +1,5 @@
[DEFAULT]
debian-branch = debian/experimental
debian-branch = debian/master
upstream-branch = upstream/latest
sign-tags = True
pristine-tar = True

22
debian/patches/series vendored
View File

@@ -1,31 +1,9 @@
02-encryption.patch
03-dvdrom.patch
05-help-dialog.patch
08-fix-gnu-make-detection.patch
10-use-non-size-specific-icon-and-add-keywords-to-desktop-file.patch
11-no-cruft.patch
12-fix-spelling-of-up-to.patch
13-fix-missing-language-field-in-po-files.patch
14-make-builds-reproducible.patch
15-show-new-pkg-tracker.patch
16-remove-auto-build-of-doco-from-install-rule.patch
17-fix-all-but-deprecated-api-warnings.patch
18-update-copyright-in-about-dialog.patch
19-show-text-files-with-abs-path.patch
20-display-changelog-credits-and-todo.patch
22-fix-hurd-i386-ftbfs.patch
23-add-bdrom-support.patch
24-show-gpl3-license.patch
25-fix-man-pages.patch
26-fix-display-of-manual.pdf.patch
27-allow-opening-in-browser-again.patch
28-pdftex-reproducibility.patch
29-fix-more-typos.patch
30-hurd-kfreebsd-ftbfs.patch
31-improve-hurd-and-kfreebsd-support.patch
32-display-compilation-commands.patch
33-honour-LDFLAGS.patch
34-gcc8-format-security.patch
35-archived-homepage.patch
36-fix-parallelism.patch
37-suggest-dvdisaster-doc.patch

View File

@@ -1,8 +1,4 @@
%YAML 1.1
---
# https://wiki.debian.org/UpstreamMetadata
Contact: Carsten Gnörlich <carsten@dvdisaster.org>
Documentation: https://web.archive.org/web/20180428070843/http://dvdisaster.net/en/misc.html#manual
Homepage: https://web.archive.org/web/20180428070843/http://dvdisaster.net/
Name: dvdisaster
Security-Contact: Carsten Gnörlich <carsten@dvdisaster.org>

2
debian/watch vendored
View File

@@ -1,4 +1,4 @@
version=3
opts="pgpsigurlmangle=s/$/.gpg/" \
https://web.archive.org/web/20180428070843/http://dvdisaster.net/en/index.html \
https://web.archive.org/web/20180428070843/https://dvdisaster.net/en/index.html \
(?:.*?/)?dvdisaster-(.*)\.tar\.bz2 debian uupdate

View File

@@ -747,8 +747,8 @@ void HexDump(unsigned char *buf, int len, int step)
for(j=0; j<step; j++)
{ if(i+j >= len) break;
if((j&0x07) == 0x07)
PrintLog("%c ", isprint(buf[i+j]) ? buf[i+j] : '.');
else PrintLog("%c", isprint(buf[i+j]) ? buf[i+j] : '.');
PrintLog("%c ", canprint(buf[i+j]) ? buf[i+j] : '.');
else PrintLog("%c", canprint(buf[i+j]) ? buf[i+j] : '.');
}
PrintLog("\n");
@@ -1023,7 +1023,7 @@ void RawSector(char *arg)
*
* ./dvdisaster --debug --send-cdb 12,00,00,00,24,00:24
*
* The first six bytes make up the cdb; cdbs with upto 12 bytes are possible.
* The first six bytes make up the cdb; cdbs with up to 12 bytes are possible.
* The :24 arg is the allocation length.
* Note that the allocation length must match those specified in the cdb;
* differing values may crash the system.

View File

@@ -44,7 +44,7 @@ correction files must be protected with an image level
error correction layer (by using RS01,RS02 or RS03 on the medium),
since only image level error correction avoids meta
data sectors to become a single point of failure. See the
discussion at \url{http://dvdisaster.net/en/qa32.html} for
discussion at \url{https://web.archive.org/web/20180428070843/http://dvdisaster.net/en/qa32.html} for
more information on the advantages of image level data protection
over file level approaches.
@@ -172,7 +172,7 @@ The $d_{i,j}$ denote the $i-th$ byte in the $j-th$ layer.
In order to create the first ecc block, bytes $d_{1,1}$ to $d_{1,n}$ are taken from the
$n$ layers. Then the RS(255,k) code is calculated (see appendix \ref{rs} for its parameters)
and the
resulting $k$ parity bytes $e_{1,1}$ upto $e_{k,1}$ are stored
resulting $k$ parity bytes $e_{1,1}$ up to $e_{k,1}$ are stored
in the ecc file. The resulting ecc block is marked grey in the
figure. The next ecc blocks are calculated and stored accordingly.
In total, the ecc section contains $k*ls$ bytes of parity information,

View File

@@ -74,7 +74,7 @@ the parity data portion of the image might not be written to the medium.
Most current writing programs do however measure the .iso image by examining
its file size, and will transfer the parity data correctly. To be sure you
should follow the steps described under ``Testing image compatibility''
at the dvdisaster site (\url{http://dvdisaster.net/en/howtos92.html}) once
at the dvdisaster site (\url{https://web.archive.org/web/20180428070843/http://dvdisaster.net/en/howtos92.html}) once
before using each version of your optical media authoring software.
Like the other dvdisaster codecs, RS02 is based on a RS(255,k) Reed-Solomon code
@@ -133,7 +133,7 @@ Its format is described in appendix \ref{eh}. For RS02, only the data fields
marked with ``all'' or ``RS02'' are relevant; all other fields should be set to zero.
Data layer $n$ does also contain the CRC32 checksums of each data sector
upto the ecc header. If the .iso image contains $s$ sectors,
up to the ecc header. If the .iso image contains $s$ sectors,
then the CRC field contains $4s$ bytes, rounded up
to the nearest multiple of 2048.
CRC32 checksums are calculated over a whole CD sector comprising 2048 bytes.

View File

@@ -1 +0,0 @@
\newcommand{\projectversion}{0.79.6}

View File

@@ -1,4 +1,4 @@
.TH DVDISASTER 1 "2010-02-06" "0.80" "protection for optical media"
.TH DVDISASTER 1 "2020-08-30" "0.80" "protection for optical media"
.SH NAME
DVDISASTER \- data loss/scratch/aging protection for optical media
@@ -50,6 +50,7 @@ DVDISASTER \- data loss/scratch/aging protection for optical media
.RB [\| \-\-medium-info \|]
.RB [\| \-\-no-progress \|]
.RB [\| \-\-old-ds-marker \|]
.RB [\| \-\-no-bdr-defect-management \|]
.RB [\| \-\-prefetch-sectors
.IR n \|]
.RB [\| \-\-raw-mode
@@ -225,6 +226,21 @@ RS02 images:
\-n BDXL3 augments image suitable for three layered BDXL media.
.RE
.RS
\-n BDXL4 augments image suitable for quadruple layered BDXL media.
.RE
.RS
\-n BDNODM\ \ \ \ augments image suitable for BD media burnt without defect management.
.RE
.RS
\-n BD2NODM\ \ augments image suitable for two layered BD media burnt without defect management.
.RE
.RS
\-n BDXL3NODM augments image suitable for three layered BDXL media burnt without defect management.
.RE
.RS
\-n BDXL4NODM augments image suitable for quadruple layered BDXL media burnt without defect management.
.RE
.RS
\-n x\ \ \ \ \ augments image using approx. x sectors in total.
.RE
.RS
@@ -240,9 +256,22 @@ RS03 images:
.RS
Setting the redundancy is not possible due to constraints in the format.
The codec will automatically choose the size of the smallest fitting medium.
However, see --no-bdr-defect-management below.
.RE
.RE
.TP
.B \-\-no-bdr-defect-management
Enable bigger augmented images for BD-R (around +3%).
If you know you will use a BD-R medium and want to maximize the free space
for parity data, you can skip the defect management formatting before burning,
at the expense of potential coasters. Specify this option to tell dvdisaster
to produce bigger images that will only fit on BD-R media burnt without defect
management. Some burning softwares call it "formatting" the BD-R before burning.
Note that should you need to repair such an augmented image, you'll then need to
specify this option on the command-line too.
.RE
.TP
.B \-m, \-\-method n
lists/selects error correction methods (default: RS01).
@@ -279,7 +308,7 @@ Selects between the sg (SG_IO) driver (default setting) and the
older cdrom (CDROM_SEND_PACKET) driver for accessing the optical drives.
Both drivers should work equally well; however the cdrom driver is known
to cause system failures on some ancient SCSI controllers.
The older cdrom driver was the default upto and including dvdisaster 0.72.x;
The older cdrom driver was the default up to and including dvdisaster 0.72.x;
if the now pre-selected sg driver changes something to the worse for you
please switch back to the older driver using \-\-driver=cdrom.
.TP
@@ -384,7 +413,7 @@ the uncorrected sector instead.
.RE
.TP
.B \-\-read-attempts n-m
attempts n upto m reads of a defective sector.
attempts n up to m reads of a defective sector.
.TP
.B \-\-read-medium n
read the whole medium up to n times.

View File

@@ -63,7 +63,7 @@ Carsten Gnörlich (Anschrift wie oben).
Das Impressum gilt für die Internetpräsenz unter den Domänen<br>
<a href="http://dvdisaster.com">dvdisaster.com</a>, &nbsp;
<a href="http://dvdisaster.de">dvdisaster.de</a>, &nbsp;
<a href="http://dvdisaster.net">dvdisaster.net</a>, &nbsp;
<a href="https://web.archive.org/web/20180428070843/http://dvdisaster.net">dvdisaster.net</a>, &nbsp;
<a href="http://dvdisaster.org">dvdisaster.org</a>.
<!-- Page footer -->

View File

@@ -63,7 +63,7 @@ Carsten Gnörlich (see above for address).
This notice covers the web sites under the domains<br>
<a href="http://dvdisaster.com">dvdisaster.com</a>, &nbsp;
<a href="http://dvdisaster.de">dvdisaster.de</a>, &nbsp;
<a href="http://dvdisaster.net">dvdisaster.net</a>, &nbsp;
<a href="https://web.archive.org/web/20180428070843/http://dvdisaster.net">dvdisaster.net</a>, &nbsp;
<a href="http://dvdisaster.org">dvdisaster.org</a>.<br>
<!-- Page footer -->

View File

@@ -272,7 +272,7 @@ media with augmented images may not play correctly on all units \\
\end{tabular}
\paragraph{Further reading.} The specification for the dvdisaster codecs
has been specified in a separate document called \href{http://dvdisaster.net/downloads/codecs.pdf}{codecs.pdf}.
has been specified in a separate document called \href{https://web.archive.org/web/20180428070843/http://dvdisaster.net/downloads/codecs.pdf}{codecs.pdf}.
Good knowledge in coding theory and programming is required.
\subsection{The linear reading strategy}

View File

@@ -15,7 +15,7 @@ the \href{http://www.gnu.org/licenses/gpl-3.0.txt}{GNU General Public License v3
\bigskip
The dvdisaster developer site (\url{http://dvdisaster.net}) contains
The dvdisaster developer site (\url{https://web.archive.org/web/20180428070843/http://dvdisaster.net}) contains
the latest source code releases for the FreeBSD, GNU/Linux and NetBSD
operating systems. These are mostly aimed at maintainers of binary packages for
the beforementioned platforms. As an end user you might find it more convenient
@@ -133,6 +133,6 @@ We cannot accept them for various reasons.
\smallskip
dvdisaster releases are always published with cryptographic signatures
and md5 checksums. See the \href{http://dvdisaster.net}{download site} for examples.
and md5 checksums. See the \href{https://web.archive.org/web/20180428070843/http://dvdisaster.net}{download site} for examples.
Be very cautious if signatures and checksums are missing, invalid or not
matching those published at the sites mentioned above.

View File

@@ -1822,7 +1822,7 @@ process of creating error correction files using these options. The
first option marked green lets dvdisaster create the error correction
file immediately after the medium has been (completely) read.
The second option marked green deletes the image when the error correction
file has been sucessfully created.
file has been successfully created.
\bigskip

Binary file not shown.

View File

@@ -65,6 +65,8 @@
\fancyfoot{}
\fancyfoot[LE,RO]{page \thepage\ of \pageref{LastPage}}
\pdftrailerid{dvdisaster}
\pdfsuppressptexinfo=-1
\begin{document}
\definecolor{lightorange}{RGB}{255,224,150}

View File

@@ -465,6 +465,6 @@ drive for reading images in these cases.}
\qa{``Ecc file has been created with version 0.40.7.''}
{Some developer versions of dvdisaster mark their ecc files with a special bit.
This causes dvdisaster versions upto 0.65 to falsely display the above error
This causes dvdisaster versions up to 0.65 to falsely display the above error
message. Please use the developer versions only together with dvdisaster
0.66 or newer versions. }

View File

@@ -260,15 +260,20 @@ int CheckForMissingSectors(unsigned char *buf, guint64 sector,
*** Dialogue for indicating problem with the missing sector
***/
#ifndef CLI
static void insert_buttons(GtkDialog *dialog)
{
gtk_dialog_add_buttons(dialog,
_utf("Stop reporting these errors"), 1,
_utf("Continue reporting"), 0, NULL);
}
#endif
void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int source_type, int *number)
{ int answer;
{
#ifndef CLI
int answer;
#endif
guint64 recorded_number;
char *vol_label, *label_msg;
@@ -288,7 +293,11 @@ void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int sou
/* In CLI mode, only report the first unrecoverable sector unless verbose is given. */
#ifndef CLI
if(!Closure->guiMode && !Closure->verbose && *number > 0)
#else
if(!Closure->verbose && *number > 0)
#endif
{ if(*number == 1)
PrintLog(_("* ... more unrecoverable sectors found ...\n"
"* further messages are suppressed unless the -v option is given.\n"));
@@ -303,9 +312,13 @@ void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int sou
vol_label = get_volume_label(buf);
if(vol_label)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
label_msg = g_strdup_printf(_("\n\nThe label of the original (defective) medium was:\n%s\n\n"), vol_label);
else label_msg = g_strdup_printf(_("\n* \n* The label of the original (defective) medium was:\n* \n* %s\n* "), vol_label);
else
#endif
label_msg = g_strdup_printf(_("\n* \n* The label of the original (defective) medium was:\n* \n* %s\n* "), vol_label);
g_free(vol_label);
}
else label_msg = g_strdup("\n");
@@ -326,14 +339,18 @@ void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int sou
"repaired by dvdisaster. Also it will not be possible to create\n"
"error correction data for it. Sorry for the bad news.\n");
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintLogWithAsterisks(msg,sector, recorded_number, label_msg);
#ifndef CLI
else
{ answer = ModalDialog(GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, insert_buttons, msg,
sector, recorded_number, label_msg);
if(answer) Closure->noMissingWarnings = TRUE;
}
#endif
}
break;
@@ -349,13 +366,17 @@ void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int sou
"repaired by dvdisaster. Also it will not be possible to create\n"
"error correction data for it. Sorry for the bad news.\n");
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintLogWithAsterisks(msg,sector, label_msg);
#ifndef CLI
else
{ answer = ModalDialog(GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, insert_buttons, msg,
sector, label_msg);
if(answer) Closure->noMissingWarnings = TRUE;
}
#endif
}
break;
}
@@ -374,14 +395,18 @@ void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int sou
"repaired by dvdisaster. Also it will not be possible to create\n"
"error correction data for it. Sorry for the bad news.\n");
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintLogWithAsterisks(msg, sector);
#ifndef CLI
else
{ answer = ModalDialog(GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, insert_buttons, msg,
sector);
if(answer) Closure->noMissingWarnings = TRUE;
}
#endif
}
/* Error was found while reading an ecc file */
@@ -394,14 +419,18 @@ void ExplainMissingSector(unsigned char *buf, guint64 sector, int error, int sou
"in the ecc file are missing and its error correction\n"
"capacity will be reduced.\n");
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintLogWithAsterisks(msg, sector);
#ifndef CLI
else
{ answer = ModalDialog(GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, insert_buttons, msg,
sector);
if(answer) Closure->noMissingWarnings = TRUE;
}
#endif
}
g_free(label_msg);

View File

@@ -22,6 +22,19 @@
#include "dvdisaster.h"
/*
* Those are now declared as extern in dvdisaster.h,
* and as such are accessible from everywhere.
* MinGW didn't link these being declared directly
* in dvdisaster.h (ended up having one copy of each
* struct for every .c including dvdisaster.h)
*/
struct _RawBuffer *rawbuffer_forward;
struct _DefectiveSectorHeader *dsh_forward;
struct _DeviceHandle *dh_forward;
struct _Image *dh_image;
/*
* The all-famous main() loop
*/
@@ -72,7 +85,9 @@ typedef enum
MODIFIER_FIXED_SPEED_VALUES,
MODIFIER_IGNORE_FATAL_SENSE,
MODIFIER_IGNORE_ISO_SIZE,
MODIFIER_IGNORE_RS03_HEADER,
MODIFIER_INTERNAL_REREADS,
MODIFIER_NO_BDR_DEFECT_MANAGEMENT,
MODIFIER_NO_PROGRESS,
MODIFIER_OLD_DS_MARKER,
MODIFIER_PREFETCH_SECTORS,
@@ -96,7 +111,9 @@ typedef enum
int main(int argc, char *argv[])
{ int mode = MODE_NONE;
int sequence = MODE_NONE;
#ifndef CLI
int devices_queried = FALSE;
#endif
char *debug_arg = NULL;
char *read_range = NULL;
#ifdef WITH_NLS_YES
@@ -224,6 +241,7 @@ int main(int argc, char *argv[])
{"help", 0, 0, 'h'},
{"ignore-fatal-sense", 0, 0, MODIFIER_IGNORE_FATAL_SENSE },
{"ignore-iso-size", 0, 0, MODIFIER_IGNORE_ISO_SIZE },
{"ignore-rs03-header", 0, 0, MODIFIER_IGNORE_RS03_HEADER },
{"internal-rereads", 1, 0, MODIFIER_INTERNAL_REREADS },
{"image", 1, 0, 'i'},
{"jump", 1, 0, 'j'},
@@ -231,6 +249,7 @@ int main(int argc, char *argv[])
{"medium-info", 0, 0, MODE_MEDIUM_INFO },
{"merge-images", 1, 0, MODE_MERGE_IMAGES },
{"method", 2, 0, 'm' },
{"no-bdr-defect-management", 0, 0, MODIFIER_NO_BDR_DEFECT_MANAGEMENT },
{"no-progress", 0, 0, MODIFIER_NO_PROGRESS },
{"old-ds-marker", 0, 0, MODIFIER_OLD_DS_MARKER },
{"prefetch-sectors", 1, 0, MODIFIER_PREFETCH_SECTORS },
@@ -324,6 +343,16 @@ int main(int argc, char *argv[])
Closure->mediumSize = BD_DL_SIZE;
else if(!strcmp(optarg, "BDXL3") || !strcmp(optarg, "bdxl3"))
Closure->mediumSize = BDXL_TL_SIZE;
else if(!strcmp(optarg, "BDXL4") || !strcmp(optarg, "bdxl4"))
Closure->mediumSize = BDXL_QL_SIZE;
else if(!strcmp(optarg, "BDNODM") || !strcmp(optarg, "bdnodm"))
Closure->mediumSize = BD_SL_SIZE_NODM;
else if(!strcmp(optarg, "BD2NODM") || !strcmp(optarg, "bd2nodm"))
Closure->mediumSize = BD_DL_SIZE_NODM;
else if(!strcmp(optarg, "BDXL3NODM") || !strcmp(optarg, "bdxl3nodm"))
Closure->mediumSize = BDXL_TL_SIZE_NODM;
else if(!strcmp(optarg, "BDXL4NODM") || !strcmp(optarg, "bdxl4nodm"))
Closure->mediumSize = BDXL_QL_SIZE_NODM;
else
{ int len = strlen(optarg);
if(strchr("0123456789", optarg[len-1]))
@@ -461,6 +490,10 @@ int main(int argc, char *argv[])
case MODIFIER_IGNORE_ISO_SIZE:
Closure->ignoreIsoSize = TRUE;
break;
case MODIFIER_IGNORE_RS03_HEADER:
Closure->ignoreRS03header = TRUE;
debug_mode_required = TRUE;
break;
case MODIFIER_INTERNAL_REREADS:
if(optarg)
Closure->internalAttempts = atoi(optarg);
@@ -485,6 +518,9 @@ int main(int argc, char *argv[])
}
}
break;
case MODIFIER_NO_BDR_DEFECT_MANAGEMENT:
Closure->noBdrDefectManagement = TRUE;
break;
case MODIFIER_NO_PROGRESS:
Closure->noProgress = 1;
break;
@@ -724,7 +760,9 @@ int main(int argc, char *argv[])
if(!Closure->device && mode == MODE_SEQUENCE
&& (sequence & (1<<MODE_READ | 1<<MODE_SCAN)))
{ Closure->device = DefaultDevice();
#ifndef CLI
devices_queried = TRUE;
#endif
}
/*** Dispatch action depending on mode.
@@ -879,7 +917,11 @@ int main(int argc, char *argv[])
/*** If no mode was selected, print the help screen. */
#ifndef CLI
if(mode == MODE_HELP)
#else
if(mode == MODE_HELP || mode == MODE_NONE)
#endif
{
/* TRANSLATORS: Program options like -r and --read are not to be translated
to avoid confusion when discussing the program in international forums. */
@@ -926,11 +968,12 @@ int main(int argc, char *argv[])
PrintCLI(_(" --ignore-iso-size - ignore image size from ISO/UDF data (dangerous - see man page!)\n"));
PrintCLI(_(" --internal-rereads n - drive may attempt n rereads before reporting an error\n"));
PrintCLI(_(" --medium-info - print info about medium in drive\n"));
PrintCLI(_(" --no-bdr-defect-management - use bigger RS03 images for BD-R (see man page!)\n"));
PrintCLI(_(" --no-progress - do not print progress information\n"));
PrintCLI(_(" --old-ds-marker - mark missing sectors compatible with dvdisaster <= 0.70\n"));
PrintCLI(_(" --prefetch-sectors n - prefetch n sectors for RS03 encoding (uses ~nMiB)\n"));
PrintCLI(_(" --raw-mode n - mode for raw reading CD media (20 or 21)\n"));
PrintCLI(_(" --read-attempts n-m - attempts n upto m reads of a defective sector\n"));
PrintCLI(_(" --read-attempts n-m - attempts n up to m reads of a defective sector\n"));
PrintCLI(_(" --read-medium n - read the whole medium up to n times\n"));
PrintCLI(_(" --read-raw - performs read in raw mode if possible\n"));
PrintCLI(_(" --regtest - tweaks output for compatibility with regtests\n"));
@@ -949,6 +992,7 @@ int main(int argc, char *argv[])
PrintCLI(_(" --erase sector - erase the given sector\n"));
PrintCLI(_(" --erase n-m - erase sectors n - m, inclusively\n"));
PrintCLI(_(" --fixed-speed-values - output fixed speed values for better output diffing\n"));
PrintCLI(_(" --ignore-rs03-header - ignore RS03 header when repairing (forcing a full search)\n"));
PrintCLI(_(" --marked-image n - create image with n marked random sectors\n"));
PrintCLI(_(" --merge-images a,b merge image a with b (a receives sectors from b)\n"));
PrintCLI(_(" --random-errors e - seed image with (correctable) random errors\n"));
@@ -971,6 +1015,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
#ifndef CLI
/* If no mode was selected at the command line,
start the graphical user interface. */
@@ -1001,6 +1046,7 @@ int main(int argc, char *argv[])
ReadDotfile();
CreateMainWindow(&argc, &argv);
}
#endif
FreeClosure();
exit(exitCode);

View File

@@ -40,7 +40,9 @@
#include <glib.h>
#include <glib/gprintf.h>
#ifndef CLI
#include <gtk/gtk.h>
#endif
#include <ctype.h>
#include <errno.h>
@@ -75,7 +77,11 @@
/* File permissions for images */
#ifdef SYS_MINGW
#define IMG_PERMS (S_IRUSR | S_IWUSR)
#else
#define IMG_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
#endif
/* Using round() is preferred over rint() on systems which have it */
@@ -83,6 +89,12 @@
#define round(x) rint(x)
#endif
#ifdef CLI
#define STATUS_LABEL_OR_NULL NULL
#else
#define STATUS_LABEL_OR_NULL Closure->status
#endif
/* Some standard media sizes */
/* WARNING: These values affect RS03 in non-obvious ways.
@@ -93,14 +105,42 @@
* scan and verify such images correctly as long as they
* are not damaged. But recovery WILL BREAK when
* processing a damaged image. YOU HAVE BEEN WARNED.
*
* NOTE: If you compile a custom version with modified values,
* you may then use `-n X --debug' (also works on an unmodified
* version) to ensure a proper recovery. 'X' being the number
* of sectors considered when augmenting the image, which is
* the immediately higher #define close to the unaugmented image size.
* HOWEVER you MUST to remember this 'X'! It's probably a good idea
* to write it down directly on the media you're protecting.
* This way you'll have it at hand when attempting repair.
* You might be tempted to do it for BD-Rs, using more space
* for parity data by disabling defect management.
* Do it at your own risk.
*
* WARNING! (read above)
*/
#define CDR_SIZE (351*1024)
#define DVD_SL_SIZE 2295104 /* DVD+R/RW size used as least common denominator */
#define DVD_DL_SIZE 4171712 /* also seen: 4148992 4173824 */
#define BD_SL_SIZE 11826176
#define BD_DL_SIZE 23652352
#define BD_DL_SIZE 23652352
#define BDXL_TL_SIZE 47305728
#define BDXL_QL_SIZE 60403712
/*
* Below are the BD-R sizes when defect management is disabled when burning.
* This is a tradeoff between risking a coaster vs having more space for parity.
* These values are NEVER used by default, we default on the values above, which
* are smaller and will work with or without defect management.
* We use these values for RS03 when --no-defect-management is explicitly specified,
* don't forget to specify it again when attempting a repair!
* NODM = No Defect Management
*/
#define BD_SL_SIZE_NODM 12219392
#define BD_DL_SIZE_NODM 24438784
#define BDXL_TL_SIZE_NODM 48878592
#define BDXL_QL_SIZE_NODM 62500864
/* Maximum accepted media sizes (in 2K sectors) */
@@ -112,7 +152,7 @@
#define MAX_CODEC_THREADS 1024 /* not including IO and GUI */
#define MAX_OLD_CACHE_SIZE 8096 /* old cache for RS01/RS02 */
#define MAX_PREFETCH_CACHE_SIZE (512*1024) /* upto 0.5TB RS03 */
#define MAX_PREFETCH_CACHE_SIZE (512*1024) /* up to 0.5TB RS03 */
/* Choices for I/O strategy */
@@ -159,12 +199,14 @@ typedef struct _GlobalClosure
gint64 bdSize1; /* Maximum 1-layer bd size (for augmented images) */
gint64 bdSize2; /* Maximum 2-layer bd size (for augmented images) */
gint64 bdSize3; /* Maximum 3-layer bdxl size (for augmented images) */
gint64 bdSize4; /* Maximum 4-layer bdxl size (for augmented images) */
gint64 savedCDSize; /* Undo values for above */
gint64 savedDVDSize1;
gint64 savedDVDSize2;
gint64 savedBDSize1;
gint64 savedBDSize2;
gint64 savedBDSize3;
gint64 savedBDSize4;
gint64 mediumSize; /* Maximum medium size (for augmented images) */
int cacheMiB; /* Cache setting for the parity codec, in megabytes */
int prefetchSectors; /* Prefetch setting per encoder thread */
@@ -221,6 +263,8 @@ typedef struct _GlobalClosure
int clSize; /* Bytesize of cache line */
int useSCSIDriver; /* Whether to use generic or sg driver on Linux */
int fixedSpeedValues;/* output fixed speed reading to make comparing debugging output easier */
int noBdrDefectManagement;/* if true, enable use of the BD*_NODM sizes, default: false */
int ignoreRS03header; /* if true, ignore the RS03 header when repairing, forcing a full search (debug only) */
char *homeDir; /* path to users home dir */
char *dotFile; /* path to .dvdisaster file */
char *logFile; /* path to logfile */
@@ -229,6 +273,7 @@ typedef struct _GlobalClosure
char *binDir; /* place where the binary resides */
char *docDir; /* place where our documentation resides */
char *viewer; /* Name of preferred PDF viewer */
char *browser; /* Name of preferred browser */
GMutex progressLock; /* A mutex protected the stuff below */
char bs[256]; /* A string of 255 backspace characters */
@@ -244,12 +289,15 @@ typedef struct _GlobalClosure
struct _CrcBuf *crcBuf; /* crcBuf of last image read */
#ifndef CLI
/*** GUI-related things */
int guiMode; /* TRUE if GUI is active */
int stopActions; /* crude method to stop ongoing action(s) */
#endif
int noMissingWarnings; /* suppress warnings about inconsistent missing sectors */
#ifndef CLI
GtkWidget *logWidget; /* Dialog for the log display */
GtkScrolledWindow *logScroll; /* and its scrolled window */
GtkTextBuffer *logBuffer; /* Text buffer for the log output */
@@ -330,7 +378,9 @@ typedef struct _GlobalClosure
GtkWidget *readLinearErrors;
GtkWidget *readLinearFootline;
GtkWidget *readLinearFootlineBox;
#endif
gint64 crcErrors, readErrors; /* these are passed between threads and must therefore be global */
#ifndef CLI
/*** Widgets for the adaptive reading action */
@@ -340,6 +390,7 @@ typedef struct _GlobalClosure
char *readAdaptiveSubtitle;
char *readAdaptiveErrorMsg;
int additionalSpiralColor;
#endif
} GlobalClosure;
@@ -376,7 +427,7 @@ typedef struct _LargeFile
#define FINGERPRINT_SECTOR 16 /* Sector currently used to calculate the fingerprint. */
/* This is the ISO filesystem root sector which contains */
/* the volume label and creation time stamps. */
/* Versions upto 0.64 used sector 257, */
/* Versions up to 0.64 used sector 257, */
/* but that was not a wise choice for CD media.*/
#define MFLAG_DEVEL (1<<0) /* for methodFlags[3] */
@@ -434,13 +485,13 @@ typedef struct _CrcBlock
} CrcBlock;
/***
*** forward declarations
*** dvdisaster.c
***/
struct _RawBuffer *rawbuffer_forward;
struct _DefectiveSectorHeader *dsh_forward;
struct _DeviceHandle *dh_forward;
struct _Image *dh_image;
extern struct _RawBuffer *rawbuffer_forward;
extern struct _DefectiveSectorHeader *dsh_forward;
extern struct _DeviceHandle *dh_forward;
extern struct _Image *dh_image;
/***
*** bitmap.c
@@ -463,7 +514,7 @@ void FreeBitmap(Bitmap*);
*** build.h
***/
int buildCount;
extern const char *const buildCount;
/***
*** cacheprobe.h
@@ -477,8 +528,10 @@ int ProbeCacheLineSize();
void InitClosure(void);
void LocalizedFileDefaults(void);
#ifndef CLI
void UpdateMarkup(char**, GdkColor*);
void DefaultColors(void);
#endif
void FreeClosure(void);
void ReadDotfile(void);
void WriteSignature(void);
@@ -550,6 +603,7 @@ int CrcBufValid(CrcBuf*, struct _Image*, EccHeader*);
void PrintCrcBuf(CrcBuf*);
#ifndef CLI
/***
*** curve.c
***/
@@ -593,6 +647,7 @@ int CurveY(Curve*, gdouble);
int CurveLogY(Curve*, gdouble);
void RedrawAxes(Curve*);
void RedrawCurve(Curve*, int);
#endif
/***
*** debug.c
@@ -659,7 +714,9 @@ void PrintEccHeader(EccHeader*);
*** fix-window.c
***/
#ifndef CLI
void CreateFixWindow(GtkWidget*);
#endif
/***
*** galois.c
@@ -717,6 +774,7 @@ void FreeGaloisTables(GaloisTables*);
ReedSolomonTables *CreateReedSolomonTables(GaloisTables*, gint32, gint32, int);
void FreeReedSolomonTables(ReedSolomonTables*);
#ifndef CLI
/***
*** help-dialogs.c
***/
@@ -757,6 +815,7 @@ void AboutDialog();
void AboutText(GtkWidget*, char*, ...);
void AboutLink(GtkWidget*, char*, char*);
void AboutTextWithLink(GtkWidget*, char*, char*);
#endif
/***
*** heuristic-lec.c
@@ -993,6 +1052,7 @@ int forget(void*);
void check_memleaks(void);
#ifndef CLI
/***
*** menubar.c
***/
@@ -1000,6 +1060,7 @@ void check_memleaks(void);
void AttachTooltip(GtkWidget*, char*, char*);
GtkWidget* CreateMenuBar(GtkWidget*);
GtkWidget* CreateToolBar(GtkWidget*);
#endif
/***
*** method.c / method-link.c
@@ -1012,7 +1073,7 @@ GtkWidget* CreateToolBar(GtkWidget*);
#define ECC_MD5_BAD (1<<2)
typedef struct _Method
{ char name[4]; /* Method name tag */
{ char name[5]; /* Method name tag */
guint32 properties; /* see definition above */
char *description; /* Fulltext description */
char *menuEntry; /* Text for use in preferences menu */
@@ -1027,6 +1088,7 @@ typedef struct _Method
void (*updateCksums)(Image*, gint64, unsigned char*);/* checksum while reading an image */
int (*finalizeCksums)(Image*);
void *ckSumClosure; /* working closure for above */
#ifndef CLI
void (*createVerifyWindow)(struct _Method*, GtkWidget*);
void (*createCreateWindow)(struct _Method*, GtkWidget*);
void (*createFixWindow)(struct _Method*, GtkWidget*);
@@ -1036,9 +1098,12 @@ typedef struct _Method
void (*resetFixWindow)(struct _Method*);
void (*resetPrefsPage)(struct _Method*);
void (*readPreferences)(struct _Method*);
#endif
void (*destroy)(struct _Method*);
#ifndef CLI
int tabWindowIndex; /* our position in the (invisible) notebook */
void *widgetList; /* linkage to window system */
#endif
} Method;
void BindMethods(void); /* created by configure in method-link.c */
@@ -1053,6 +1118,7 @@ void CallMethodDestructors(void);
*** misc.c
***/
int canprint(char);
char* sgettext(char*);
char* sgettext_utf8(char*);
@@ -1068,7 +1134,11 @@ void Verbose(char*, ...);
void PrintTimeToLog(GTimer*, char*, ...);
void PrintProgress(char*, ...);
void ClearProgress(void);
#ifndef CLI
void PrintCLIorLabel(GtkLabel*, char*, ...);
#else
void PrintCLIorLabel(void*, char*, ...);
#endif
int GetLongestTranslation(char*, ...);
void LogWarning(char*, ...);
@@ -1078,6 +1148,7 @@ void UnregisterCleanup(void);
GThread* CreateGThread(GThreadFunc, gpointer);
#ifndef CLI
void ShowWidget(GtkWidget*);
void AllowActions(gboolean);
@@ -1088,7 +1159,13 @@ void SetProgress(GtkWidget*, int, int);
int ModalDialog(GtkMessageType, GtkButtonsType, void (*)(GtkDialog*), char*, ...);
int ModalWarning(GtkMessageType, GtkButtonsType, void (*)(GtkDialog*), char*, ...);
#define ModalWarningOrCLI(a,b,c,d,...) ModalWarning(a,b,c,d,__VA_ARGS__)
#else
int ModalWarning(char*, ...);
#define ModalWarningOrCLI(a,b,c,d,...) ModalWarning(d,__VA_ARGS__)
#endif
#ifndef CLI
void SetText(PangoLayout*, char*, int*, int*);
void SwitchAndSetFootline(GtkWidget*, int, GtkWidget*, char*, ...);
@@ -1097,10 +1174,12 @@ void TimedInsensitive(GtkWidget*, int);
int GetLabelWidth(GtkLabel*, char*, ...);
void LockLabelSize(GtkLabel*, char*, ...);
#endif
int ConfirmImageDeletion(char *);
int ConfirmEccDeletion(char *);
#ifndef CLI
/***
*** preferences.c
***/
@@ -1113,6 +1192,7 @@ void FreePreferences(void*);
void UpdatePrefsExhaustiveSearch(void);
void UpdatePrefsConfirmDeletion(void);
void RegisterPreferencesHelpWindow(LabelWithOnlineHelp*);
#endif
/***
*** print-sense.c
@@ -1125,7 +1205,7 @@ void GetLastSense(int*, int*, int*);
/***
*** random.c
***/
**/
#define MY_RAND_MAX 2147483647
@@ -1169,6 +1249,7 @@ void ReadDefectiveSectorFile(DefectiveSectorHeader *, struct _RawBuffer*, char*)
void ReadMediumLinear(gpointer);
#ifndef CLI
/***
*** read-linear-window.c
***/
@@ -1180,6 +1261,7 @@ void InitializeCurve(void*, int, int);
void AddCurveValues(void*, int, int, int);
void MarkExistingSectors(void);
void RedrawReadLinearWindow(void);
#endif
/***
*** read-adaptive.c
@@ -1189,6 +1271,7 @@ void GetReadingRange(gint64, gint64*, gint64*);
void ReadMediumAdaptive(gpointer);
#ifndef CLI
/***
*** read-adaptive-window.c
***/
@@ -1205,6 +1288,7 @@ void SetAdaptiveReadFootline(char*, GdkColor*);
void UpdateAdaptiveResults(gint64, gint64, gint64, int);
void ChangeSegmentColor(GdkColor*, int);
void RemoveFillMarkers();
#endif
/***
*** recover-raw.c
@@ -1348,6 +1432,12 @@ int ProbeAltiVec(void);
void ShowPDF(char*);
/***
*** show-html.c
***/
void ShowHTML(char*);
/***
*** smart-lec.c
***/
@@ -1362,6 +1452,7 @@ void *PrepareIterativeSmartLEC(RawBuffer*);
void SmartLECIteration(void*, char*);
void EndIterativeSmartLEC(void*);
#ifndef CLI
/***
*** spiral.c
***/
@@ -1397,5 +1488,6 @@ void MoveSpiralCursor(Spiral*, int);
***/
void CreateWelcomePage(GtkNotebook*);
#endif
#endif /* DVDISASTER_H */

View File

@@ -53,6 +53,7 @@ void register_rs01(void)
method->finalizeCksums = RS01FinalizeCksums;
method->expectedImageSize = RS01ExpectedImageSize;
#ifndef CLI
/*** Linkage to rs01-window.c */
method->createCreateWindow = CreateRS01EWindow;
@@ -68,6 +69,7 @@ void register_rs01(void)
method->createVerifyWindow = CreateRS01VerifyWindow;
method->resetVerifyWindow = ResetRS01VerifyWindow;
#endif
/*** Register ourself */
@@ -77,10 +79,14 @@ void register_rs01(void)
}
static void destroy(Method *method)
{ RS01Widgets *wl = (RS01Widgets*)method->widgetList;
{
#ifndef CLI
RS01Widgets *wl = (RS01Widgets*)method->widgetList;
#endif
g_free(method->ckSumClosure);
#ifndef CLI
if(wl)
{ if(wl->fixCurve) FreeCurve(wl->fixCurve);
@@ -92,6 +98,7 @@ static void destroy(Method *method)
g_free(wl);
}
#endif
}

View File

@@ -54,6 +54,7 @@ void register_rs02(void)
method->finalizeCksums = RS02FinalizeCksums;
method->expectedImageSize = RS02ExpectedImageSize;
#ifndef CLI
/*** Linkage to rs02-window.c */
method->createCreateWindow = CreateRS02EncWindow;
@@ -70,6 +71,7 @@ void register_rs02(void)
method->createVerifyWindow = CreateRS02VerifyWindow;
method->resetVerifyWindow = ResetRS02VerifyWindow;
#endif
/*** Register ourself */
@@ -79,13 +81,17 @@ void register_rs02(void)
}
static void destroy(Method *method)
{ RS02Widgets *wl = (RS02Widgets*)method->widgetList;
{
#ifndef CLI
RS02Widgets *wl = (RS02Widgets*)method->widgetList;
#endif
RS02CksumClosure *csc = (RS02CksumClosure*)method->ckSumClosure;
if(csc->lay)
g_free(csc->lay);
g_free(method->ckSumClosure);
#ifndef CLI
if(wl)
{ if(wl->fixCurve) FreeCurve(wl->fixCurve);
@@ -97,5 +103,6 @@ static void destroy(Method *method)
g_free(wl);
}
#endif
}

View File

@@ -55,6 +55,7 @@ void register_rs03(void)
method->recognizeEccFile = RS03RecognizeFile;
method->recognizeEccImage = RS03RecognizeImage;
#ifndef CLI
/*** Linkage to rs03-window.c */
method->createCreateWindow = CreateRS03EncWindow;
@@ -71,6 +72,7 @@ void register_rs03(void)
method->createVerifyWindow = CreateRS03VerifyWindow;
method->resetVerifyWindow = ResetRS03VerifyWindow;
#endif
/*** Register ourself */
@@ -80,13 +82,17 @@ void register_rs03(void)
}
static void destroy(Method *method)
{ RS03Widgets *wl = (RS03Widgets*)method->widgetList;
{
#ifndef CLI
RS03Widgets *wl = (RS03Widgets*)method->widgetList;
#endif
RS03CksumClosure *csc = (RS03CksumClosure*)method->ckSumClosure;
if(csc->lay)
g_free(csc->lay);
g_free(method->ckSumClosure);
#ifndef CLI
if(wl)
{ if(wl->fixCurve) FreeCurve(wl->fixCurve);
@@ -98,5 +104,6 @@ static void destroy(Method *method)
g_free(wl);
}
#endif
}

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"
@@ -423,6 +424,24 @@ char *find_file(char *file, size_t *size, char *lang)
lang_suffix[1] = lang[1];
}
/* Test for absolute path first. */
if(*file == '/')
{
if(lang)
path = g_strdup_printf("%s.%s", file, lang_suffix);
else
path = g_strdup(file);
if(LargeStat(path, &stat_size))
{
*size = stat_size;
return path;
}
g_free(path);
return NULL;
}
/* Try file in bin dir */
if(Closure->binDir)
@@ -581,7 +600,8 @@ static gint about_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
{ case GDK_BUTTON_PRESS:
if(!inside) return FALSE; /* Defect in certain Gtk versions? */
if(!strcmp(label,"GPL")) ShowGPL();
else if(!strcmp(label,"MODIFYING")) show_modifying();
else if(!strcmp(label,"MODIFYING")) show_modifying();
else if(strlen(label) > 4 && !strncmp(label, "http", 4)) ShowHTML(g_strdup(label));
else ShowPDF(g_strdup(label));
break;
case GDK_ENTER_NOTIFY:
@@ -723,8 +743,10 @@ void AboutDialog()
g_free(text);
#ifdef MODIFIED_SOURCE
AboutTextWithLink(vbox,
_("Modified version Copyright 2017 (please fill in - [directions])\n"
AboutTextWithLink(vbox,
_("[Modified version]\n"
"Copyright 2019-2020 Stephane Lesimple\n"
"Copyright 2005-2017 Debian Optical Media Tools Team\n"
"Copyright 2004-2017 Carsten Gnoerlich"),
"MODIFYING");
#else
@@ -746,11 +768,12 @@ void AboutDialog()
"GPL");
#ifdef MODIFIED_SOURCE
AboutTextWithLink(vbox, _("\nThis program is <b>not the original</b>. It is based on the\n"
"source code of dvdisaster, but contains third-party changes.\n\n"
"Please do not bother the original authors of dvdisaster\n"
"([www.dvdisaster.org]) about issues with this version.\n"),
"http://www.dvdisaster.org");
AboutTextWithLink(vbox, _("\nThis version is <b>not the original</b>. It has been patched\n"
"for Debian to support DVD-ROMs (with and without encryption),\n"
"and subsequently patched again to support a CLI-only build, among other things.\n\n"
"Please do not bother the original authors of dvdisaster nor the Debian maintainer\n"
"but submit bugreports against [GitHub] instead.\n"),
"https://github.com/speed47/dvdisaster");
#else
lang = g_getenv("LANG");

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"

BIN
icons/win.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -148,11 +148,13 @@ int ReportImageEccInconsistencies(Image *image)
if(!image || image->type == IMAGE_NONE)
{ if(image) CloseImage(image);
#ifndef CLI
if(Closure->guiMode)
{ CreateMessage(_("Image file %s not present or permission denied.\n"), GTK_MESSAGE_ERROR, Closure->imageName);
return TRUE;
}
else
#endif
{ Stop(_("Image file %s not present or permission denied.\n"), Closure->imageName);
}
}
@@ -161,11 +163,13 @@ int ReportImageEccInconsistencies(Image *image)
if(image->eccFile && !image->eccFileMethod)
{ CloseImage(image);
#ifndef CLI
if(Closure->guiMode)
{ CreateMessage(_("\nError correction file type unknown.\n"), GTK_MESSAGE_ERROR);
return TRUE;
}
else
#endif
{ Stop(_("\nError correction file type unknown.\n"));
}
}
@@ -174,12 +178,14 @@ int ReportImageEccInconsistencies(Image *image)
if(!image->eccFile && image->eccFileState == ECCFILE_NOPERM)
{ CloseImage(image);
#ifndef CLI
if(Closure->guiMode)
{ CreateMessage(_("\nPermission denied on ecc file (perhaps not writeable?).\n"),
GTK_MESSAGE_ERROR);
return TRUE;
}
else
#endif
{ Stop(_("\nPermission denied on ecc file (perhaps not writeable?).\n"));
}
}
@@ -189,12 +195,14 @@ int ReportImageEccInconsistencies(Image *image)
if(!image->eccFile && !image->eccMethod)
{ CloseImage(image);
#ifndef CLI
if(Closure->guiMode)
{ CreateMessage(_("\nNo error correction file present.\n"
"No error correction data recognized in image.\n"), GTK_MESSAGE_ERROR);
return TRUE;
}
else
#endif
{ Stop(_("\nNo error correction file present.\n"
"No error correction data recognized in image.\n"));
}

View File

@@ -36,6 +36,36 @@
* Also, individual behaviour may deviate from standard functions.
*/
#ifdef SYS_MINGW
#include <windows.h>
#define large_stat _stati64
#define large_lseek _lseeki64
/* The original windows ftruncate has off_size (32bit) */
int large_ftruncate(int fd, gint64 size)
{ gint32 handle;
if((handle=_get_osfhandle(fd)) == -1)
return -1;
if(_lseeki64(fd, size, SEEK_SET) == -1)
return -1;
if(SetEndOfFile((HANDLE)handle) == 0)
return -1;
return 0;
}
#else
#define large_ftruncate ftruncate
#define large_stat stat
#define large_lseek lseek
#endif /* SYS_MINGW */
/*
* convert special chars in file names to correct OS encoding
*/
@@ -62,7 +92,7 @@ int LargeStat(char *path, guint64 *length_return)
if(!cp_path) return FALSE;
if(stat(cp_path, &mystat) == -1)
if(large_stat(cp_path, &mystat) == -1)
{ g_free(cp_path);
return FALSE;
}
@@ -85,7 +115,7 @@ int DirStat(char *path)
if(!cp_path) return FALSE;
if(stat(cp_path, &mystat) == -1)
if(large_stat(cp_path, &mystat) == -1)
{ g_free(cp_path);
return FALSE;
}
@@ -109,6 +139,9 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
#ifdef HAVE_O_LARGEFILE
flags |= O_LARGEFILE;
#endif
#ifdef SYS_MINGW
flags |= O_BINARY;
#endif
cp_path = os_path(name);
if(!cp_path)
@@ -117,7 +150,7 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
/* Do not try to open directories etc. */
if( (stat(cp_path, &mystat) == 0)
if( (large_stat(cp_path, &mystat) == 0)
&& !S_ISREG(mystat.st_mode))
{ g_free(cp_path), g_free(lf); return NULL;
}
@@ -144,7 +177,7 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
int LargeSeek(LargeFile *lf, off_t pos)
{
lf->offset = pos;
if(lseek(lf->fileHandle, pos, SEEK_SET) != pos)
if(large_lseek(lf->fileHandle, pos, SEEK_SET) != pos)
return FALSE;
return TRUE;
@@ -178,12 +211,14 @@ ssize_t LargeRead(LargeFile *lf, void *buf, size_t count)
* Writing large files
*/
#ifndef CLI
static void insert_buttons(GtkDialog *dialog)
{
gtk_dialog_add_buttons(dialog,
GTK_STOCK_REDO , 1,
GTK_STOCK_CANCEL, 0, NULL);
}
#endif
static ssize_t xwrite(int fdes, void *buf_base, size_t count)
{ unsigned char *buf = (unsigned char*)buf_base;
@@ -191,7 +226,9 @@ static ssize_t xwrite(int fdes, void *buf_base, size_t count)
/* Simply fail when going out of space in command line mode */
#ifndef CLI
if(!Closure->guiMode)
#endif
{ while(count)
{ ssize_t n = write(fdes, buf, count);
@@ -206,6 +243,7 @@ static ssize_t xwrite(int fdes, void *buf_base, size_t count)
return total;
}
#ifndef CLI
/* Give the user a chance to free more space in GUI mode.
When running out of space, the last write() may complete
with n<count but no error condition, so we try writing
@@ -235,6 +273,7 @@ static ssize_t xwrite(int fdes, void *buf_base, size_t count)
}
return total;
#endif
}
ssize_t LargeWrite(LargeFile *lf, void *buf, size_t count)
@@ -270,7 +309,7 @@ int LargeClose(LargeFile *lf)
int LargeTruncate(LargeFile *lf, off_t length)
{ int result;
result = (ftruncate(lf->fileHandle, length) == 0);
result = (large_ftruncate(lf->fileHandle, length) == 0);
if(result)
lf->size = length;
@@ -310,6 +349,19 @@ FILE *portable_fopen(char *path, char *modes)
return file;
}
#ifdef SYS_MINGW
int portable_mkdir(char *path)
{ int status;
char *cp_path;
cp_path = os_path(path);
status = mkdir(cp_path);
g_free(cp_path);
return status;
}
#endif
/***
*** Convenience functions
***/

View File

@@ -30,15 +30,19 @@ locale: \$(LOCALEFILES)
# Create the locale files.
messages.pot: \$(CFILES)
@cd ..; xgettext --no-wrap -cTRANSLATORS: -o locale/messages.pot -k_ -k_utf \$(CFILES_NP)
clean:
rm -f messages.pot
EOF
for i in $prefixes; do
cat >> Makefile <<EOF
$i.po: \$(CFILES)
$i.po: messages.pot
@echo "Updating $i.po"
@cd ..; xgettext --no-wrap -cTRANSLATORS: -o locale/messages.pot -k_ -k_utf \$(CFILES_NP)
@msgmerge -q -U --no-wrap --no-fuzzy-matching $i.po messages.pot
@rm -f messages.pot
$i/LC_MESSAGES/dvdisaster.mo: $i.po
@echo "Updating $i.mo"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"
@@ -60,7 +61,6 @@ static void action_cb(GtkWidget *widget, gpointer data)
if(action != ACTION_STOP)
{
/* Clear the log buffer, request new log file time stamp */
if(action != ACTION_CREATE_CONT)
{ g_mutex_lock(Closure->logLock);
g_string_truncate(Closure->logString, 0);
@@ -68,7 +68,6 @@ static void action_cb(GtkWidget *widget, gpointer data)
g_mutex_unlock(Closure->logLock);
Closure->logFileStamped = FALSE;
}
/* Make sure we're using the current file selections */
g_free(Closure->imageName);

View File

@@ -25,6 +25,7 @@
#include "scsi-layer.h"
#include "udf.h"
#ifndef CLI
/*
* Local data
*/
@@ -65,6 +66,7 @@ static void print_defaults(medium_info *mi)
SetLabelText(mi->eccSize, "-");
SetLabelText(mi->eccVersion, "-");
}
#endif
static void print_tab(char *label, int tab_width)
{ char *translation=_(label);
@@ -83,18 +85,24 @@ static void print_tab(char *label, int tab_width)
void PrintMediumInfo(void *mi_ptr)
{ Image *image;
DeviceHandle *dh;
#ifndef CLI
medium_info *mi=(medium_info*)mi_ptr;
#endif
char *disc_status;
char *sess_status;
int tab_width=30;
#ifndef CLI
if(!mi) /* create dummy medium_info in CLI mode so that PrintCLIorLabel() won't crash */
{ mi=alloca(sizeof(medium_info));
memset(mi, 0, sizeof(medium_info));
}
#endif
#ifndef CLI
if(Closure->guiMode)
print_defaults(mi);
#endif
image = OpenImageFromDevice(Closure->device);
if(!image) return;
@@ -116,13 +124,37 @@ void PrintMediumInfo(void *mi_ptr)
NULL)+1;
print_tab("Medium type:",tab_width);
PrintCLIorLabel(mi->physicalType, "%s\n", dh->typeDescr);
PrintCLIorLabel(
#ifndef CLI
mi->physicalType,
#else
NULL,
#endif
"%s\n", dh->typeDescr);
print_tab("Book type:",tab_width);
PrintCLIorLabel(mi->bookType, "%s\n", dh->bookDescr);
PrintCLIorLabel(
#ifndef CLI
mi->bookType,
#else
NULL,
#endif
"%s\n", dh->bookDescr);
print_tab("Manuf.-ID:",tab_width);
PrintCLIorLabel(mi->manufID, "%s\n", dh->manuID);
PrintCLIorLabel(
#ifndef CLI
mi->manufID,
#else
NULL,
#endif
"%s\n", dh->manuID);
print_tab("Drive profile:",tab_width);
PrintCLIorLabel(mi->profileDescr, "%s\n", dh->profileDescr);
PrintCLIorLabel(
#ifndef CLI
mi->profileDescr,
#else
NULL,
#endif
"%s\n", dh->profileDescr);
switch(dh->discStatus&3)
{ case 0: disc_status = g_strdup(_("empty")); break;
@@ -139,20 +171,44 @@ void PrintMediumInfo(void *mi_ptr)
print_tab("Disc status:",tab_width);
PrintCLIorLabel(mi->discStatus, _("%s (%d sessions; last session %s)\n"),
PrintCLIorLabel(
#ifndef CLI
mi->discStatus,
#else
NULL,
#endif
_("%s (%d sessions; last session %s)\n"),
disc_status, dh->sessions, sess_status);
g_free(disc_status);
g_free(sess_status);
print_tab("Used sectors:",tab_width);
PrintCLIorLabel(mi->usedCapacity1, _("%lld sectors (%lld MiB), from READ CAPACITY\n"),
PrintCLIorLabel(
#ifndef CLI
mi->usedCapacity1,
#else
NULL,
#endif
_("%lld sectors (%lld MiB), from READ CAPACITY\n"),
dh->readCapacity+1, (dh->readCapacity+1)>>9);
print_tab(" ",tab_width);
PrintCLIorLabel(mi->usedCapacity2, _("%lld sectors (%lld MiB), from DVD structure\n"),
PrintCLIorLabel(
#ifndef CLI
mi->usedCapacity2,
#else
NULL,
#endif
_("%lld sectors (%lld MiB), from DVD structure\n"),
dh->userAreaSize, dh->userAreaSize>>9);
print_tab("Blank capacity:",tab_width);
PrintCLIorLabel(mi->blankCapacity, _("%lld sectors (%lld MiB)\n"),
PrintCLIorLabel(
#ifndef CLI
mi->blankCapacity,
#else
NULL,
#endif
_("%lld sectors (%lld MiB)\n"),
dh->blankCapacity, (dh->blankCapacity)>>9);
/* Filesystem properties */
@@ -168,12 +224,30 @@ void PrintMediumInfo(void *mi_ptr)
PrintCLI("\n\n");
print_tab("Medium label:",tab_width);
PrintCLIorLabel(mi->isoLabel, "%s\n", image->isoInfo->volumeLabel);
PrintCLIorLabel(
#ifndef CLI
mi->isoLabel,
#else
NULL,
#endif
"%s\n", image->isoInfo->volumeLabel);
print_tab("File system size:",tab_width);
PrintCLIorLabel(mi->isoSize, _("%d sectors (%lld MiB)\n"),
PrintCLIorLabel(
#ifndef CLI
mi->isoSize,
#else
NULL,
#endif
_("%d sectors (%lld MiB)\n"),
image->isoInfo->volumeSize, (gint64)image->isoInfo->volumeSize>>9);
print_tab("Creation time:",tab_width);
PrintCLIorLabel(mi->isoTime, "%s\n", image->isoInfo->creationDate);
PrintCLIorLabel(
#ifndef CLI
mi->isoTime,
#else
NULL,
#endif
"%s\n", image->isoInfo->creationDate);
}
/* Augmented image properties
@@ -197,18 +271,35 @@ void PrintMediumInfo(void *mi_ptr)
memcpy(method, eh->method, 4);
method[4] = 0;
print_tab("Error correction data:",tab_width);
#ifndef CLI
PrintCLIorLabel(mi->eccState, _("%s, %d roots, %4.1f%% redundancy.\n"),
#else
PrintCLIorLabel(NULL, _("%s, %d roots, %4.1f%% redundancy.\n"),
#endif
method, eh->eccBytes,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
print_tab("Augmented image size:",tab_width);
#ifndef CLI
PrintCLIorLabel(mi->eccSize, _("%lld sectors (%lld MiB)\n"),
#else
PrintCLIorLabel(NULL, _("%lld sectors (%lld MiB)\n"),
#endif
image->expectedSectors, image->expectedSectors>>9);
print_tab("dvdisaster version:", tab_width);
if(micro)
#ifndef CLI
PrintCLIorLabel(mi->eccVersion, "%d.%d.%d", major, minor, micro);
else PrintCLIorLabel(mi->eccVersion, "%d.%d", major, minor);
#else
PrintCLIorLabel(NULL, "%d.%d.%d", major, minor, micro);
#endif
else
#ifndef CLI
PrintCLIorLabel(mi->eccVersion, "%d.%d", major, minor);
#else
PrintCLIorLabel(NULL, "%d.%d", major, minor);
#endif
}
/* Clean up */
@@ -219,6 +310,7 @@ void PrintMediumInfo(void *mi_ptr)
/***
*** GUI callbacks
***/
#ifndef CLI
/*
* Callback for drive selection
@@ -496,3 +588,4 @@ void CreateMediumInfoWindow()
PrintMediumInfo(mi);
}
#endif

View File

@@ -20,6 +20,8 @@
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef WITH_MEMDEBUG_YES
#define _GNU_SOURCE
#if !defined(SYS_FREEBSD) /* FreeBSD declares malloc() in stdlib.h */
@@ -85,7 +87,7 @@ void remember(void *ptr, int size, char *file, int line)
g_mutex_lock(&phMutex);
hash_idx = (((long)ptr)>>3)&63;
hash_idx = (((long long)ptr)>>3)&63;
if(phCnt[hash_idx] >= phMax[hash_idx])
{ if(!phMax[hash_idx]) phMax[hash_idx] = 16;
else phMax[hash_idx] *= 2;
@@ -348,3 +350,4 @@ void check_memleaks(void)
else g_printf("dvdisaster: No memory leaks found.\n");
}
#endif

View File

@@ -19,11 +19,16 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"
#include <limits.h>
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
/***
*** Forward declarations
***/
@@ -414,7 +419,7 @@ void set_path(GtkWidget *entry, char *path)
else
{ char buf[PATH_MAX + strlen(path) + 2];
getcwd(buf, PATH_MAX);
if (!getcwd(buf, PATH_MAX)) return;
strcat(buf,"/");
strcat(buf,path);

View File

@@ -59,7 +59,7 @@ void ListMethods(void)
{ Method *method = g_ptr_array_index(Closure->methodList, i);
strncpy(name, method->name, 4);
PrintCLI("%s -- %s\n",name,method->description);
PrintCLI("%s, enable with -m%s: %s\n",name,name,method->description);
}
}

73
misc.c
View File

@@ -22,6 +22,11 @@
#include "dvdisaster.h"
int canprint(char c)
{
return ((isascii(c) && !iscntrl(c)) ? 1 : 0);
}
/***
*** gettext() convenience
***/
@@ -52,8 +57,11 @@ char *sgettext(char *msgid)
}
char *sgettext_utf8(char *msgid)
{ static gchar ringbuf[20][1024];
{
#ifndef CLI
static gchar ringbuf[20][1024];
static int ringptr;
#endif
char *msgval;
#ifdef WITH_NLS_YES
@@ -72,6 +80,7 @@ char *sgettext_utf8(char *msgid)
/*** If we are running the GUI, convert to UTF8 for Gtk+ */
#ifndef CLI
if(Closure->guiMode)
{ char *msg_utf8 = g_locale_to_utf8(msgval, -1, NULL, NULL, NULL);
@@ -81,6 +90,7 @@ char *sgettext_utf8(char *msgid)
return ringbuf[ringptr];
}
#endif
return msgval;
}
@@ -138,6 +148,8 @@ void CalcSectors(guint64 size, guint64 *sectors, int *in_last)
* Append message to the log window.
*/
#ifndef CLI
#define MAX_LOG_WIN_SIZE 10240
static void clamp_gstring(GString *string)
@@ -191,6 +203,7 @@ static void log_window_append(char *text)
g_free(utf_tmp);
}
#endif
/*
* Output of the greetings is delayed until the first message is printed.
@@ -228,6 +241,7 @@ void PrintCLI(char *format, ...)
va_end(argp);
}
#ifndef CLI
if(Closure->guiMode)
{ if(Closure->verbose)
{ va_start(argp, format);
@@ -236,6 +250,7 @@ void PrintCLI(char *format, ...)
}
return;
}
#endif
va_start(argp, format);
g_vprintf(format, argp);
@@ -256,8 +271,10 @@ void PrintProgress(char *format, ...)
va_list argp;
int n;
#ifndef CLI
if(Closure->guiMode)
return;
#endif
print_greetings(stdout);
@@ -321,9 +338,11 @@ void PrintLog(char *format, ...)
va_start(argp, format);
#ifndef CLI
if(Closure->guiMode)
log_window_vprintf(format, argp);
else
#endif
{
print_greetings(stdout);
g_vprintf(format, argp);
@@ -370,9 +389,11 @@ void PrintLogWithAsterisks(char *format, ...)
va_start(argp, format);
#ifndef CLI
if(Closure->guiMode)
log_window_vprintf(new_format, argp);
else
#endif
{
print_greetings(stdout);
g_vprintf(new_format, argp);
@@ -402,9 +423,11 @@ void Verbose(char *format, ...)
va_start(argp, format);
#ifndef CLI
if(Closure->guiMode)
log_window_vprintf(format, argp);
else
#endif
{
print_greetings(stdout);
g_vprintf(format, argp);
@@ -436,11 +459,13 @@ void PrintTimeToLog(GTimer *timer, char *format, ...)
tmp2 = g_strdup_printf("%02d:%02d:%04.1f %s", hours, minutes, seconds, tmp1);
va_end(argp);
#ifndef CLI
if(Closure->guiMode)
{
log_window_append(tmp2);
}
else
#endif
{ g_printf("%s", tmp2);
fflush(stdout);
@@ -455,7 +480,11 @@ void PrintTimeToLog(GTimer *timer, char *format, ...)
* or show it in the given label
*/
#ifndef CLI
void PrintCLIorLabel(GtkLabel *label, char *format, ...)
#else
void PrintCLIorLabel(void *unused, char *format, ...)
#endif
{ va_list argp;
if(Closure->logFileEnabled)
@@ -466,6 +495,7 @@ void PrintCLIorLabel(GtkLabel *label, char *format, ...)
va_start(argp, format);
#ifndef CLI
if(Closure->guiMode)
{ char *c,*tmp;
@@ -483,6 +513,7 @@ void PrintCLIorLabel(GtkLabel *label, char *format, ...)
g_free(tmp);
}
else
#endif
{ g_vprintf(format, argp);
fflush(stdout);
@@ -531,12 +562,18 @@ static void vlog_warning(char *format, va_list argp)
prefix[len] = 0;
str = g_string_sized_new(256);
#ifndef CLI
g_string_append_printf(str,"* %s:%c", warn, Closure->guiMode ? '\n' : ' ');
#else
g_string_append_printf(str,"* %s: ", warn);
#endif
do
{ c = strchr(line,'\n');
if(c) *c=0;
#ifndef CLI
if(Closure->guiMode) g_string_append_printf(str,"* %s\n",line);
else
#endif
{ if(line != body)
g_string_append_printf(str,"%s%s\n",prefix,line);
else g_string_append_printf(str,"%s\n",line);
@@ -547,10 +584,12 @@ static void vlog_warning(char *format, va_list argp)
if(Closure->logFileEnabled)
PrintLogFile("%s", str->str);
#ifndef CLI
if(Closure->guiMode)
{ log_window_append(str->str);
}
else
#endif
{ print_greetings(stdout);
g_printf("%s", str->str);
fflush(stdout);
@@ -598,7 +637,9 @@ void Stop(char *format, ...)
/*** CLI mode */
#ifndef CLI
if(!Closure->guiMode)
#endif
{ g_printf("%s", _("\n*\n* dvdisaster - can not continue:\n*\n"));
va_start(argp, format);
g_vprintf(format, argp);
@@ -609,6 +650,7 @@ void Stop(char *format, ...)
/*** GUI mode */
#ifndef CLI
else
{ char *titled,*msg,*utf_msg;
int idx;
@@ -634,6 +676,7 @@ void Stop(char *format, ...)
g_free(msg);
g_free(utf_msg);
}
#endif
/* The cleanup procedure is supposed to terminate any running
threads except for the main thread.
@@ -667,7 +710,9 @@ void Stop(char *format, ...)
/* see above: possibly unreachable in GUI mode! */
#ifndef CLI
if(!Closure->guiMode)
#endif
{ FreeClosure();
exit(EXIT_FAILURE);
}
@@ -737,6 +782,7 @@ void CallIdleFunc(gboolean (*idle_func)(gpointer), gpointer data)
/***
*** Graphical user interface convenience
***/
#ifndef CLI
/*
* Show the given widget
@@ -1055,6 +1101,9 @@ int ModalDialog(GtkMessageType mt, GtkButtonsType bt,
int ModalWarning(GtkMessageType mt, GtkButtonsType bt,
void(*button_fn)(GtkDialog*), char *msg, ...)
#else
int ModalWarning(char *msg, ...)
#endif
{ va_list argp;
int result = 1;
@@ -1062,11 +1111,13 @@ int ModalWarning(GtkMessageType mt, GtkButtonsType bt,
vlog_warning(msg, argp);
va_end(argp);
#ifndef CLI
if(Closure->guiMode)
{ va_start(argp, msg);
result = vmodal_dialog(mt, bt, button_fn, msg, argp);
va_end(argp);
}
#endif
return result;
}
@@ -1075,6 +1126,7 @@ int ModalWarning(GtkMessageType mt, GtkButtonsType bt,
* Set the text in the pango layout and retrieve its extents.
*/
#ifndef CLI
void SetText(PangoLayout *layout, char *text, int *w, int *h)
{ PangoRectangle rect;
char *t = g_locale_to_utf8(text, -1, NULL, NULL, NULL);
@@ -1261,16 +1313,19 @@ static void insert_button(GtkDialog *dialog)
ReverseCancelOK(GTK_DIALOG(dialog));
}
#endif
int ConfirmImageDeletion(char *file)
{ int answer;
{
#ifndef CLI
if(!Closure->guiMode) /* Always delete it in command line mode */
#endif
return TRUE;
#ifndef CLI
if(!Closure->confirmDeletion) /* I told you so... */
return TRUE;
answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
insert_button,
_("Image file already exists and does not match the medium:\n\n"
"%s\n\n"
@@ -1278,18 +1333,21 @@ int ConfirmImageDeletion(char *file)
file);
return answer == GTK_RESPONSE_OK;
#endif
}
int ConfirmEccDeletion(char *file)
{ int answer;
{
#ifndef CLI
if(!Closure->guiMode) /* Always delete it in command line mode */
#endif
return TRUE;
#ifndef CLI
if(!Closure->confirmDeletion) /* I told you so... */
return TRUE;
answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
insert_button,
_("The error correction file is already present:\n\n"
"%s\n\n"
@@ -1297,5 +1355,6 @@ int ConfirmEccDeletion(char *file)
file);
return answer == GTK_RESPONSE_OK;
#endif
}

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"
@@ -2061,8 +2062,8 @@ void CreatePreferencesWindow(void)
frame = gtk_frame_new(_utf("Media ejection"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
lwoh = CreateLabelWithOnlineHelp(_("Eject medium after sucessful read"),
_("Eject medium after sucessful read"));
lwoh = CreateLabelWithOnlineHelp(_("Eject medium after successful read"),
_("Eject medium after successful read"));
RegisterPreferencesHelpWindow(lwoh);
for(i=0; i<2; i++)
@@ -2221,7 +2222,7 @@ void CreatePreferencesWindow(void)
_("<b>Maximum number of reading attempts</b>\n\n"
"When the minimum number of reading attempts is reached "
"without success, dvdisaster might choose to perform additional "
"reading attempts upto this number.\n\n"
"reading attempts up to this number.\n\n"
"The decision to do more attempts depends on the quality of "
"data gathered so far, which in turn is influenced by the "
@@ -2336,7 +2337,7 @@ void CreatePreferencesWindow(void)
AddHelpParagraph(lwoh,
_("<b>Media read attempts</b> for the linear reading strategy\n\n"
"If unreadable sectors remain after reading the medium from start to end, "
"the medium is read again upto he given number of times.\n\n"
"the medium is read again up to he given number of times.\n\n"
"Only the missing sectors will be tried in the additional reading passes."));
/** Defective sector caching */

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"
@@ -622,7 +623,7 @@ static void render_sector(raw_editor_context *rec)
gdk_gc_set_rgb_fg_color(Closure->drawGC,Closure->foreground);
sprintf(byte, "%c", isprint(buf[idx]) ? buf[idx] : '.');
sprintf(byte, "%c", canprint(buf[idx]) ? buf[idx] : '.');
idx++;
SetText(rec->layout, byte, &w, &h);
gdk_draw_layout(d, Closure->drawGC, x, y, rec->layout);

View File

@@ -193,7 +193,14 @@ int SaveDefectiveSector(RawBuffer *rb, int can_c2_scan)
(long long)rb->lba);
if(!LargeStat(filename, &length))
{ PrintCLIorLabel(Closure->status,_(" [Creating new cache file %s]\n"), filename);
{
PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
_(" [Creating new cache file %s]\n"), filename);
init_defective_sector_file(filename, rb, &file, dsh);
}
else
@@ -264,7 +271,12 @@ int SaveDefectiveSector(RawBuffer *rb, int can_c2_scan)
LargeClose(file);
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
_(" [Appended %d/%d sectors to cache file %s; LBA=%lld, ssize=%d, %d sectors]\n"),
count, rb->samplesRead, filename, dsh->lba, dsh->sectorSize, dsh->nSectors);
@@ -313,7 +325,13 @@ int TryDefectiveSectorCache(RawBuffer *rb, unsigned char *outbuf)
status = TryCDFrameRecovery(rb, outbuf);
if(!status)
{ PrintCLIorLabel(Closure->status,
{
PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
" [Success after processing cached sector %d]\n", i+1);
return status;
}

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"

View File

@@ -368,12 +368,14 @@ static void cleanup(gpointer data)
}
bail_out:
#ifndef CLI
if(Closure->guiMode)
{ if(rc->earlyTermination)
SetAdaptiveReadFootline(_("Aborted by unrecoverable error."), Closure->redText);
AllowActions(TRUE);
}
#endif
if(rc->image)
if(!LargeClose(rc->image))
@@ -399,8 +401,10 @@ bail_out:
g_free(rc);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/***
@@ -486,8 +490,10 @@ static void print_progress(read_closure *rc, int immediate)
int total = rc->readable+rc->correctable;
int percent = (int)((1000LL*(long long)total)/rc->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
return;
#endif
if( rc->lastPercent >= percent
&& rc->lastCorrectable == rc->correctable
@@ -535,7 +541,12 @@ static void print_progress(read_closure *rc, int immediate)
static void clear_progress(read_closure *rc)
{
if(!rc->progressMsgLen || Closure->guiMode)
if(!rc->progressMsgLen ||
#ifndef CLI
Closure->guiMode)
#else
0)
#endif
return;
rc->progressSp[rc->progressMsgLen] = 0;
@@ -553,6 +564,7 @@ static void clear_progress(read_closure *rc)
* Sector markup in the spiral
*/
#ifndef CLI
static void mark_sector(read_closure *rc, gint64 sector, GdkColor *color)
{ int segment;
int changed = FALSE;
@@ -598,6 +610,7 @@ static void mark_sector(read_closure *rc, gint64 sector, GdkColor *color)
rc->expectedSectors-rc->readable-rc->correctable,
(int)((1000LL*(rc->readable+rc->correctable))/rc->expectedSectors));
}
#endif
/***
*** Basic device and image handling and sanity checks.
@@ -639,7 +652,9 @@ static void open_and_determine_mode(read_closure *rc)
rc->rs01LayerSectors = (rc->ei->sectors+rc->eh->dataBytes-1)/rc->eh->dataBytes;
#ifndef CLI
SetAdaptiveReadMinimumPercentage((1000*(rc->eh->dataBytes-rc->eh->eccBytes))/rc->eh->dataBytes);
#endif
}
else /* see if we have RS02 type ecc */
if(rc->medium->eccHeader && !strncmp((char*)rc->medium->eccHeader->method,"RS02",4))
@@ -647,7 +662,9 @@ static void open_and_determine_mode(read_closure *rc)
rc->eh = rc->medium->eccHeader;
rc->lay = RS02LayoutFromImage(rc->medium);
#ifndef CLI
SetAdaptiveReadMinimumPercentage((1000*rc->lay->ndata)/255);
#endif
if(Closure->version < rc->eh->neededVersion)
PrintCLI(_("* Warning: This image requires dvdisaster-%d.%d!\n"
@@ -718,9 +735,10 @@ static void check_size(read_closure *rc)
/* Compare size with answer from drive */
if(rc->sectors < rc->dh->sectors)
{ int answer;
{
int answer;
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Medium contains %lld sectors more as recorded in the .ecc file\n"
"(Medium: %lld sectors; expected from .ecc file: %lld sectors).\n"
"Only the first %lld medium sectors will be processed.\n"),
@@ -728,23 +746,30 @@ static void check_size(read_closure *rc)
rc->sectors);
if(!answer)
{ SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
{
#ifndef CLI
SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
#endif
rc->earlyTermination = FALSE;
cleanup((gpointer)rc);
}
}
if(rc->sectors > rc->dh->sectors)
{ int answer;
{
int answer;
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Medium contains %lld sectors less as recorded in the .ecc file\n"
"(Medium: %lld sectors; expected from .ecc file: %lld sectors).\n"),
rc->sectors-rc->dh->sectors, rc->dh->sectors, rc->sectors,
rc->sectors);
if(!answer)
{ SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
{
#ifndef CLI
SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
#endif
rc->earlyTermination = FALSE;
cleanup((gpointer)rc);
}
@@ -761,10 +786,14 @@ void GetReadingRange(gint64 sectors, gint64 *firstSector, gint64 *lastSector)
{ gint64 first, last;
if(Closure->readStart || Closure->readEnd)
{ if(!Closure->guiMode) /* more range checks are made below */
{
#ifndef CLI
if(!Closure->guiMode) /* more range checks are made below */
#endif
{ first = Closure->readStart;
last = Closure->readEnd < 0 ? sectors-1 : Closure->readEnd;
}
#ifndef CLI
else /* be more permissive in GUI mode */
{ first = 0;
last = sectors-1;
@@ -774,6 +803,7 @@ void GetReadingRange(gint64 sectors, gint64 *firstSector, gint64 *lastSector)
last = Closure->readEnd < sectors ? Closure->readEnd : sectors-1;
}
}
#endif
if(first > last || first < 0 || last >= sectors)
Stop(_("Sectors must be in range [0..%lld].\n"), sectors-1);
@@ -800,15 +830,19 @@ static void check_ecc_fingerprint(read_closure *rc)
fp_read = GetImageFingerprint(rc->medium, digest, rc->eh->fpSector);
if(!fp_read) /* Not readable. Bad luck. */
{ int answer;
{
int answer;
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Sector %d is missing. Can not compare medium and ecc fingerprints.\n"
"Double check that the medium and the ecc file belong together.\n"),
rc->eh->fpSector);
if(!answer)
{ SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
{
#ifndef CLI
SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
#endif
rc->earlyTermination = FALSE;
cleanup((gpointer)rc);
}
@@ -856,8 +890,11 @@ int check_image_fingerprint(read_closure *rc)
if(memcmp(image_fp, medium_fp, 16))
{
#ifndef CLI
if(!Closure->guiMode)
#endif
Stop(_("Image file does not match the optical disc."));
#ifndef CLI
else
{ int answer = ConfirmImageDeletion(Closure->imageName);
@@ -873,6 +910,7 @@ int check_image_fingerprint(read_closure *rc)
return TRUE; /* causes reopen of image in caller */
}
}
#endif
}
return 0; /* okay */
@@ -886,16 +924,20 @@ int check_image_fingerprint(read_closure *rc)
void check_image_size(read_closure *rc, gint64 image_file_sectors)
{
if(image_file_sectors > rc->expectedSectors)
{ int answer;
{
int answer;
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than inserted medium\n"
"(Image file: %lld sectors; medium: %lld sectors).\n"),
image_file_sectors-rc->expectedSectors,
image_file_sectors, rc->expectedSectors);
if(!answer)
{ SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
{
#ifndef CLI
SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
#endif
rc->earlyTermination = FALSE;
cleanup((gpointer)rc);
}
@@ -913,11 +955,15 @@ static void load_crc_buf(read_closure *rc)
{
switch(rc->readMode)
{ case ECC_IN_FILE:
#ifndef CLI
SetAdaptiveReadSubtitle(_utf("Loading CRC data."));
#endif
rc->crcBuf = GetCRCFromRS01_obsolete(rc->ei);
break;
case ECC_IN_IMAGE:
#ifndef CLI
SetAdaptiveReadSubtitle(_utf("Loading CRC data."));
#endif
rc->crcBuf = GetCRCFromRS02_obsolete(rc->lay, rc->dh, rc->image);
break;
default:
@@ -948,19 +994,23 @@ static void build_interval_from_image(read_closure *rc)
Check them for "dead sector markers"
and for checksum failures if ecc data is present. */
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadSubtitle(_("Analysing existing image file"));
#endif
for(s=0; s<=rc->highestWrittenSector; s++)
{ int n,percent;
/* Check for user interruption. */
#ifndef CLI
if(Closure->stopActions)
{ SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
rc->earlyTermination = FALSE;
cleanup((gpointer)rc);
}
#endif
/* Read the next sector */
@@ -974,7 +1024,9 @@ static void build_interval_from_image(read_closure *rc)
if(current_missing)
{ int fixme=0;
#ifndef CLI
mark_sector(rc, s, Closure->redSector);
#endif
ExplainMissingSector(rc->buf, s, current_missing, SOURCE_IMAGE, &fixme);
}
@@ -994,7 +1046,9 @@ static void build_interval_from_image(read_closure *rc)
make it missing due to the CRC failure. */
if(!current_missing)
{ current_missing = 1;
#ifndef CLI
mark_sector(rc, s, Closure->yellowSector);
#endif
}
}
@@ -1009,7 +1063,9 @@ static void build_interval_from_image(read_closure *rc)
if(rc->map)
SetBit(rc->map, s);
#ifndef CLI
mark_sector(rc, s, Closure->greenSector);
#endif
#ifdef CHECK_VISITED
rc->count[s]++;
@@ -1043,7 +1099,10 @@ static void build_interval_from_image(read_closure *rc)
percent = (100*s)/(rc->highestWrittenSector+1);
if(last_percent != percent)
{ if(!Closure->guiMode)
{
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintProgress(_("Analysing existing image file: %2d%%"),percent);
last_percent = percent;
@@ -1071,8 +1130,10 @@ static void build_interval_from_image(read_closure *rc)
/*** Now that all readable sectors are known,
determine those which can already be corrected. */
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadSubtitle(_("Determining correctable sectors"));
#endif
/* RS01 type error correction. */
@@ -1104,7 +1165,9 @@ static void build_interval_from_image(read_closure *rc)
#ifdef CHECK_VISITED
rc->count[layer_idx]++;
#endif
#ifndef CLI
mark_sector(rc, layer_idx, Closure->greenSector);
#endif
}
layer_idx += rc->rs01LayerSectors;
@@ -1137,7 +1200,9 @@ static void build_interval_from_image(read_closure *rc)
&& !GetBit(rc->map, sector))
{ SetBit(rc->map, sector);
rc->correctable++;
#ifndef CLI
mark_sector(rc, sector, Closure->greenSector);
#endif
}
}
}
@@ -1152,10 +1217,12 @@ static void build_interval_from_image(read_closure *rc)
else PrintLog(_("Analysing existing image file: %lld readable, %lld still missing.\n"),
rc->readable, rc->expectedSectors-rc->readable-rc->correctable);
#ifndef CLI
if(Closure->guiMode)
UpdateAdaptiveResults(rc->readable, rc->correctable,
rc->expectedSectors-rc->readable-rc->correctable,
(int)((1000LL*(rc->readable+rc->correctable))/rc->expectedSectors));
#endif
// print_intervals(rc);
}
@@ -1179,12 +1246,16 @@ static void mark_rs02_headers(read_closure *rc)
while(hpos < end)
{ if(!GetBit(rc->map, hpos))
{ SetBit(rc->map, hpos);
#ifndef CLI
mark_sector(rc, hpos, Closure->greenSector);
#endif
rc->correctable++;
}
if(!GetBit(rc->map, hpos+1))
{ SetBit(rc->map, hpos+1);
#ifndef CLI
mark_sector(rc, hpos+1, Closure->greenSector);
#endif
rc->correctable++;
}
@@ -1196,6 +1267,7 @@ static void mark_rs02_headers(read_closure *rc)
*** Main routine for adaptive reading
***/
#ifndef CLI
static void insert_buttons(GtkDialog *dialog)
{
gtk_dialog_add_buttons(dialog,
@@ -1203,6 +1275,7 @@ static void insert_buttons(GtkDialog *dialog)
_utf("Ignore always"), 2,
_utf("Abort"), 0, NULL);
}
#endif
/*
* Fill the gap between rc->intervalStart and rc->highestWrittenSector
@@ -1239,10 +1312,12 @@ void fill_gap(read_closure *rc)
t = g_strdup_printf(_("Filling image area [%lld..%lld]"),
firstUnwritten, rc->intervalStart-1);
clear_progress(rc);
#ifndef CLI
if(Closure->guiMode)
{ SetAdaptiveReadSubtitle(t);
ChangeSpiralCursor(Closure->readAdaptiveSpiral, -1);
}
#endif
PrintCLI(t);
g_free(t);
@@ -1268,20 +1343,25 @@ void fill_gap(read_closure *rc)
/* Check whether user hit the Stop button */
#ifndef CLI
if(Closure->stopActions)
{ if(Closure->guiMode)
{
if(Closure->guiMode)
SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
rc->earlyTermination = FALSE; /* suppress respective error message */
cleanup((gpointer)rc);
}
#endif
/* Cycle the progress animation */
if(j++ % 2000)
{ int seq = (j/2000)%10;
#ifndef CLI
if(!Closure->guiMode)
#endif
{ g_printf("%s", anim[seq]);
fflush(stdout);
}
@@ -1289,21 +1369,25 @@ void fill_gap(read_closure *rc)
/* Show progress in the spiral */
#ifndef CLI
if(Closure->guiMode)
{ int segment = i / rc->sectorsPerSegment;
if(Closure->readAdaptiveSpiral->segmentColor[segment] == Closure->background)
ChangeSegmentColor(Closure->whiteSector, segment);
}
#endif
}
PrintCLI(" \n");
rc->highestWrittenSector = rc->intervalStart-1;
#ifndef CLI
if(Closure->guiMode) /* remove temporary fill markers */
{ RemoveFillMarkers();
SetAdaptiveReadSubtitle(rc->subtitle);
}
#endif
}
@@ -1358,10 +1442,12 @@ void ReadMediumAdaptive(gpointer data)
rc->earlyTermination = TRUE;
RegisterCleanup(_("Reading aborted"), cleanup, rc);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readAdaptiveHeadline), "<big>%s</big>\n<i>%s</i>",
_("Preparing for reading the medium image."),
_("Medium: not yet determined"));
#endif
/* Please note: Commenting the follwing Stop() out will provide
adaptive reading for RS01 and RS02, but behaviour with RS03
@@ -1418,6 +1504,7 @@ void ReadMediumAdaptive(gpointer data)
/*** Initialize segment state counters (only in GUI mode) */
#ifndef CLI
if(Closure->guiMode)
{ //rc->sectorsPerSegment = 1 + (rc->sectors / ADAPTIVE_READ_SPIRAL_SIZE);
rc->sectorsPerSegment = ((rc->expectedSectors+ADAPTIVE_READ_SPIRAL_SIZE-1) / ADAPTIVE_READ_SPIRAL_SIZE);
@@ -1425,6 +1512,7 @@ void ReadMediumAdaptive(gpointer data)
// ClipReadAdaptiveSpiral(rc->sectors/rc->sectorsPerSegment);
ClipReadAdaptiveSpiral((rc->expectedSectors+rc->sectorsPerSegment-1)/rc->sectorsPerSegment);
}
#endif
/*** Initialize the interval list */
@@ -1440,11 +1528,13 @@ reopen_image:
Stop(_("Can't open %s:\n%s"),Closure->imageName,strerror(errno));
PrintLog(_("Creating new %s image.\n"),Closure->imageName);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readAdaptiveHeadline),
"<big>%s</big>\n<i>%s</i>",
_("Reading new medium image."),
rc->dh->mediumDescr);
#endif
/* Mark RS02 header sectors as correctable. */
@@ -1460,11 +1550,13 @@ reopen_image:
else
{ int reopen;
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readAdaptiveHeadline),
"<big>%s</big>\n<i>%s</i>",
_("Completing existing medium image."),
rc->dh->mediumDescr);
#endif
/* Open the existing image file. */
@@ -1500,8 +1592,10 @@ reopen_image:
if(rc->readMode != IMAGE_ONLY)
{ PrintLog(t);
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadFootline(t, Closure->greenText);
#endif
}
goto finished;
}
@@ -1519,8 +1613,10 @@ reopen_image:
/*** Read the medium image. */
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadSubtitle(rc->subtitle);
#endif
for(;;)
{ int cluster_mask = rc->dh->clusterSize-1;
@@ -1545,6 +1641,7 @@ reopen_image:
for(s=rc->intervalStart; s<=rc->intervalEnd; ) /* s is incremented elsewhere */
{ int nsectors,cnt;
#ifndef CLI
if(Closure->stopActions) /* somebody hit the Stop button */
{ if(Closure->guiMode)
SetAdaptiveReadFootline(_("Aborted by user request!"), Closure->redText);
@@ -1555,6 +1652,7 @@ reopen_image:
if(Closure->guiMode)
ChangeSpiralCursor(Closure->readAdaptiveSpiral, s / rc->sectorsPerSegment);
#endif
/* Determine number of sectors to read. Read the next dh->clusterSize sectors
unless we're at the end of the interval or at a position which is
@@ -1600,13 +1698,17 @@ reread:
if(status && !Closure->ignoreFatalSense
&& rc->dh->sense.sense_key
&& rc->dh->sense.sense_key != 3 && rc->dh->sense.sense_key != 5)
{ int answer;
{
#ifndef CLI
int answer;
if(!Closure->guiMode)
#endif
Stop(_("Sector %lld: %s\nCan not recover from above error.\n"
"Use the --ignore-fatal-sense option to override."),
s, GetLastSenseString(FALSE));
#ifndef CLI
answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, insert_buttons,
_("Sector %lld: %s\n\n"
"It may not be possible to recover from this error.\n"
@@ -1617,11 +1719,12 @@ reread:
Closure->ignoreFatalSense = 2;
if(!answer)
{ SetAdaptiveReadFootline(_("Aborted by unrecoverable error."), Closure->redText);
{
SetAdaptiveReadFootline(_("Aborted by unrecoverable error."), Closure->redText);
rc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
#endif
}
/* When encountering an error during cluster size reads,
@@ -1675,7 +1778,9 @@ reread:
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
b, "unv", strerror(errno));
#ifndef CLI
mark_sector(rc, b, Closure->yellowSector);
#endif
if(rc->highestWrittenSector < b)
rc->highestWrittenSector = b;
@@ -1692,7 +1797,9 @@ reread:
SetBit(rc->map, b);
rc->readable++;
#ifndef CLI
mark_sector(rc, b, Closure->greenSector);
#endif
if(rc->highestWrittenSector < b)
rc->highestWrittenSector = b;
@@ -1745,7 +1852,9 @@ reread:
&& !GetBit(rc->map, layer_idx))
{ SetBit(rc->map, layer_idx);
rc->correctable++;
#ifndef CLI
mark_sector(rc, layer_idx, Closure->greenSector);
#endif
#ifdef CHECK_VISITED
rc->count[layer_idx]++;
@@ -1788,7 +1897,9 @@ reread:
&& !GetBit(rc->map, sector))
{ SetBit(rc->map, sector);
rc->correctable++;
#ifndef CLI
mark_sector(rc, sector, Closure->greenSector);
#endif
fill_correctable_gap(rc, sector);
}
}
@@ -1813,8 +1924,10 @@ reread:
print_progress(rc, TRUE);
if(rc->readMode != IMAGE_ONLY)
{ PrintLog(t);
#ifndef CLI
if(Closure->guiMode && rc->ei)
SetAdaptiveReadFootline(t, Closure->foreground);
#endif
}
if(Closure->eject)
LoadMedium(rc->dh, FALSE);
@@ -1826,10 +1939,20 @@ reread:
{ unsigned char buf[2048];
PrintCLI("\n");
if(nsectors>1) PrintCLIorLabel(Closure->status,
if(nsectors>1) PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
_("Sectors %lld-%lld: %s\n"),
s, s+nsectors-1, GetLastSenseString(FALSE));
else PrintCLIorLabel(Closure->status,
else PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
_("Sector %lld: %s\n"),
s, GetLastSenseString(FALSE));
@@ -1849,7 +1972,9 @@ reread:
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
s, "nds", strerror(errno));
#ifndef CLI
mark_sector(rc, s+i, Closure->redSector);
#endif
}
if(rc->highestWrittenSector < s+nsectors)
@@ -1944,10 +2069,12 @@ finished:
/* Force output of final results */
#ifndef CLI
if(Closure->guiMode)
{ ChangeSpiralCursor(Closure->readAdaptiveSpiral, -1);
mark_sector(rc, 0, NULL);
}
#endif
/*** Summarize results. */
@@ -1963,8 +2090,10 @@ finished:
PrintLog(_("\n%s\n"
"(%lld readable, %lld correctable, %lld still missing).\n"),
t, rc->readable, rc->correctable, rc->expectedSectors-total);
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadFootline(t, Closure->foreground);
#endif
g_free(t);
exitCode = EXIT_FAILURE;
@@ -1976,8 +2105,10 @@ finished:
{ if(rc->readable == rc->expectedSectors)
{ char *t = _("\nGood! All sectors have been read.\n");
PrintLog(t);
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadFootline(t, Closure->foreground);
#endif
if(Closure->eject)
LoadMedium(rc->dh, FALSE);
}
@@ -1990,8 +2121,10 @@ finished:
"%2d.%1d%% of the image have been read (%lld sectors).\n"),
t, percent/10, percent%10, rc->readable);
#ifndef CLI
if(Closure->guiMode)
SetAdaptiveReadFootline(t, Closure->foreground);
#endif
g_free(t);
exitCode = EXIT_FAILURE;
}
@@ -2009,7 +2142,9 @@ finished:
rc->earlyTermination = FALSE;
#ifndef CLI
terminate:
#endif
cleanup((gpointer)rc);
}

View File

@@ -19,6 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
*/
// DVDISASTER_GUI_FILE
#include "dvdisaster.h"

View File

@@ -57,9 +57,11 @@ static void send_eof(read_closure *rc)
static void cleanup(gpointer data)
{ read_closure *rc = (read_closure*)data;
#ifndef CLI
int full_read = FALSE;
int aborted = rc->earlyTermination;
int scan_mode = rc->scanMode;
#endif
int i;
int renderers_left = TRUE;
@@ -70,7 +72,11 @@ static void cleanup(gpointer data)
idle functions. Executing the while loop would create a deadlock
in that case. */
while(renderers_left && Closure->stopActions != STOP_SHUTDOWN_ALL)
while(renderers_left
#ifndef CLI
&& Closure->stopActions != STOP_SHUTDOWN_ALL
#endif
)
{ g_mutex_lock(rc->rendererMutex);
if(rc->activeRenderers<=0)
renderers_left=FALSE;
@@ -106,17 +112,21 @@ static void cleanup(gpointer data)
/* Clean up reader thread */
#ifndef CLI
if(rc->image)
full_read = (rc->readOK == rc->image->dh->sectors && !Closure->crcErrors);
#endif
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
{ if(rc->unreportedError)
SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by unrecoverable error.</span> %lld sectors read, %lld sectors unreadable/skipped so far."),
Closure->redMarkup, rc->readOK, Closure->readErrors);
}
#endif
if(rc->readerImage)
if(!LargeClose(rc->readerImage))
@@ -163,6 +173,7 @@ static void cleanup(gpointer data)
/* Continue with ecc file creation after read.
NOTE: Images are NOT automatically augmented after a read. */
#ifndef CLI
if(Closure->readAndCreate && Closure->guiMode && !scan_mode && !aborted) /* General prerequisites */
{ if( !strncmp(Closure->methodName, "RS01", 4) /* codec prerequisites */
|| (!strncmp(Closure->methodName, "RS03", 4) && Closure->eccTarget == ECC_FILE) )
@@ -185,6 +196,7 @@ static void cleanup(gpointer data)
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/***
@@ -199,19 +211,23 @@ static void register_reader(read_closure *rc)
{
if(rc->scanMode) /* Output messages differ in read and scan mode */
{ RegisterCleanup(_("Scanning aborted"), cleanup, rc);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>",
_("Scanning medium for read errors."),
_("Medium: not yet determined"));
#endif
}
else
{ RegisterCleanup(_("Reading aborted"), cleanup, rc);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>",
_("Preparing for reading the medium image."),
_("Medium: not yet determined"));
#endif
}
}
@@ -236,6 +252,7 @@ static void determine_mode(read_closure *rc)
rc->msg = g_strdup(_("Scanning medium for read errors."));
PrintLog("%s\n", rc->msg);
#ifndef CLI
if(Closure->guiMode)
{ if(rc->eccMethod)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
@@ -246,18 +263,23 @@ static void determine_mode(read_closure *rc)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>", rc->msg, rc->image->dh->mediumDescr);
}
#endif
rc->readMarker = 0;
#ifndef CLI
if(Closure->guiMode)
InitializeCurve(rc, rc->image->dh->maxRate, rc->image->dh->canC2Scan);
#endif
return;
}
/*** If no image file exists, open a new one. */
#ifndef CLI
reopen_image:
#endif
if(!LargeStat(Closure->imageName, &image_size))
{
if(rc->msg) g_free(rc->msg);
@@ -269,6 +291,7 @@ reopen_image:
Stop(_("Can't open %s:\n%s"),Closure->imageName,strerror(errno));
PrintLog(_("Creating new %s image.\n"),Closure->imageName);
#ifndef CLI
if(Closure->guiMode)
{ if(rc->eccMethod)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
@@ -278,11 +301,14 @@ reopen_image:
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>", rc->msg, rc->image->dh->mediumDescr);
}
#endif
rc->rereading = FALSE;
rc->readMarker = 0;
#ifndef CLI
if(Closure->guiMode)
InitializeCurve(rc, rc->image->dh->maxRate, rc->image->dh->canC2Scan);
#endif
return;
}
@@ -328,8 +354,11 @@ reopen_image:
if(!unknown_fingerprint && memcmp(image_fp, medium_fp, 16))
{
#ifndef CLI
if(!Closure->guiMode)
#endif
Stop(_("Image file does not match the optical disc."));
#ifndef CLI
else
{ int answer = ConfirmImageDeletion(Closure->imageName);
@@ -347,6 +376,7 @@ reopen_image:
goto reopen_image;
}
}
#endif
}
/*** If the image is not complete yet, first aim to read the
@@ -358,19 +388,25 @@ reopen_image:
{ PrintLog(_("Completing image %s. Continuing with sector %lld.\n"),
Closure->imageName, rc->readMarker);
rc->firstSector = rc->readMarker;
#ifndef CLI
Closure->additionalSpiralColor = 0; /* blue */
#endif
}
else
{ PrintLog(_("Completing image %s. Only missing sectors will be read.\n"), Closure->imageName);
#ifndef CLI
Closure->additionalSpiralColor = 3; /* dark green*/
#endif
}
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>",rc->msg,rc->image->dh->mediumDescr);
if(Closure->guiMode)
InitializeCurve(rc, rc->image->dh->maxRate, rc->image->dh->canC2Scan);
#endif
}
/*
@@ -427,17 +463,21 @@ static void prepare_crc_cache(read_closure *rc)
// FIXME: reuse CrcBuf and write respective message
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>",
_("Reading CRC information from ecc data"),
rc->image->dh->mediumDescr);
#endif
if(rc->eccMethod->getCrcBuf)
{ Closure->crcBuf = rc->eccMethod->getCrcBuf(rc->image);
Closure->crcBuf->crcCached = TRUE;
#ifndef CLI
if(Closure->guiMode)
RedrawReadLinearWindow();
#endif
/* Augmented image codecs provide the CRCs and md5sums for
the data portion, but not for the full image.
@@ -453,9 +493,11 @@ static void prepare_crc_cache(read_closure *rc)
rc->eccMethod->resetCksums(rc->image);
}
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
"<big>%s</big>\n<i>%s</i>", rc->msg, rc->image->dh->mediumDescr);
#endif
PrintCLI(_("done.\n"));
return;
}
@@ -474,14 +516,18 @@ static void prepare_crc_cache(read_closure *rc)
static void prepare_timer(read_closure *rc)
{
#ifndef CLI
if(Closure->guiMode && Closure->spinupDelay)
SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("Waiting %d seconds for drive to spin up...\n"), Closure->spinupDelay);
#endif
SpinupDevice(rc->image->dh);
#ifndef CLI
if(Closure->guiMode && Closure->spinupDelay)
SwitchAndSetFootline(Closure->readLinearNotebook, 0, Closure->readLinearFootline, "ignore");
#endif
if(Closure->spinupDelay) /* eliminate initial seek time from timing */
ReadSectors(rc->image->dh, rc->alignedBuf[0]->buf, rc->firstSector, 1);
@@ -496,24 +542,29 @@ static void prepare_timer(read_closure *rc)
static void show_progress(read_closure *rc)
{ int percent;
#ifndef CLI
if(Closure->guiMode && rc->lastErrorsPrinted != Closure->readErrors)
{ SetLabelText(GTK_LABEL(Closure->readLinearErrors),
_("Unreadable / skipped sectors: %lld"), Closure->readErrors);
rc->lastErrorsPrinted = Closure->readErrors;
}
#endif
if(rc->readPos>rc->readMarker) rc->readMarker=rc->readPos;
percent = (1000*rc->readPos)/rc->image->dh->sectors;
if(rc->lastPercent != percent)
{ gulong ignore;
#ifndef CLI
int color;
if(Closure->guiMode)
ChangeSpiralCursor(Closure->readLinearSpiral, percent);
#endif
if(rc->readOK <= rc->lastReadOK) /* nothing read since last sample? */
{ rc->speed = 0.0;
#ifndef CLI
if(Closure->readErrors - rc->previousReadErrors > 0)
color = 2;
else if(Closure->crcErrors - rc->previousCRCErrors > 0)
@@ -522,6 +573,7 @@ static void show_progress(read_closure *rc)
if(Closure->guiMode)
AddCurveValues(rc, percent, color, rc->maxC2);
#endif
rc->lastPercent = percent;
rc->lastSpeed = rc->speed;
rc->previousReadErrors = Closure->readErrors;
@@ -533,19 +585,23 @@ static void show_progress(read_closure *rc)
double elapsed = g_timer_elapsed(rc->speedTimer, &ignore);
double kb_sec = kb_read / elapsed;
#ifndef CLI
if(Closure->readErrors - rc->previousReadErrors > 0)
color = 2;
else if(Closure->crcErrors - rc->previousCRCErrors > 0)
color = 4;
else color = 1;
#endif
if(rc->firstSpeedValue)
{ rc->speed = kb_sec / rc->image->dh->singleRate;
#ifndef CLI
if(Closure->guiMode)
{ AddCurveValues(rc, rc->lastPercent, color, rc->maxC2);
AddCurveValues(rc, percent, color, rc->maxC2);
}
#endif
rc->firstSpeedValue = FALSE;
rc->lastPercent = percent;
@@ -568,8 +624,10 @@ static void show_progress(read_closure *rc)
cut_peaks=3;
}
#ifndef CLI
if(Closure->guiMode)
AddCurveValues(rc, percent, color, rc->maxC2);
#endif
if(Closure->speedWarning && rc->lastSpeed > 0.5)
{ double delta = rc->speed - rc->lastSpeed;
@@ -719,6 +777,7 @@ update_mutex:
*** The reader part
***/
#ifndef CLI
static void insert_buttons(GtkDialog *dialog)
{
gtk_dialog_add_buttons(dialog,
@@ -726,6 +785,7 @@ static void insert_buttons(GtkDialog *dialog)
_utf("Ignore always"), 2,
_utf("Abort"), 0, NULL);
}
#endif
void ReadMediumLinear(gpointer data)
{ read_closure *rc = g_malloc0(sizeof(read_closure));
@@ -806,11 +866,11 @@ void ReadMediumLinear(gpointer data)
/*** Make sure we are compatible with the ecc data */
if(rc->eccHeader && (Closure->version < rc->eccHeader->neededVersion))
{ if(Closure->guiMode)
{ int answer;
{
int answer;
if(rc->image->eccFileState == ECCFILE_PRESENT)
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("This ecc file requires dvdisaster-%d.%d!\n\n"
"Proceeding could trigger incorrect behaviour.\n"
"Please read the image without using this ecc file\n"
@@ -818,43 +878,33 @@ void ReadMediumLinear(gpointer data)
rc->eccHeader->neededVersion/10000,
(rc->eccHeader->neededVersion%10000)/100);
else
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("This image requires dvdisaster-%d.%d!\n\n"
"Proceeding could trigger incorrect behaviour.\n"
"Please visit http://www.dvdisaster.org for an upgrade.\n\n"),
rc->eccHeader->neededVersion/10000,
(rc->eccHeader->neededVersion%10000)/100);
PrintCLI("\n");
if(!answer)
{ SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
{
#ifndef CLI
SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup, rc->readOK,Closure->readErrors);
#endif
rc->unreportedError = FALSE; /* suppress respective error message */
goto terminate;
}
}
else
{ if(rc->image->eccFileState == ECCFILE_PRESENT)
PrintCLI(_("* Warning: This ecc file requires dvdisaster-%d.%d!\n"
"* Proceeding could trigger incorrect behaviour.\n"
"* Please read the image without using this ecc file\n"
"* or visit http://www.dvdisaster.org for an upgrade.\n\n"),
rc->eccHeader->neededVersion/10000,
(rc->eccHeader->neededVersion%10000)/100);
else
PrintCLI(_("* Warning: This image requires dvdisaster-%d.%d!\n"
"* Proceeding could trigger incorrect behaviour.\n"
"* Please visit http://www.dvdisaster.org for an upgrade.\n\n"),
rc->eccHeader->neededVersion/10000,
(rc->eccHeader->neededVersion%10000)/100);
}
}
/*** See if user wants to limit the read range. */
GetReadingRange(rc->image->dh->sectors, &rc->firstSector, &rc->lastSector);
#ifndef CLI
if(rc->firstSector > 0) /* Mark skipped sectors */
Closure->additionalSpiralColor = 0; /* blue */
#endif
/*** Determine the reading mode. There are three possibilities:
1. scanning (rc->scanMode == TRUE)
@@ -919,8 +969,10 @@ next_reading_pass:
break;
}
Closure->sectorSkip = 0;
#ifndef CLI
if(Closure->guiMode)
MarkExistingSectors();
#endif
rc->lastCopied = 0; /* Start rendering the spiral from the beginning */
}
@@ -937,6 +989,7 @@ next_reading_pass:
while(rc->readPos<=rc->lastSector)
{ int cluster_mask = rc->image->dh->clusterSize-1;
#ifndef CLI
if(Closure->stopActions) /* somebody hit the Stop button */
{
if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
@@ -947,6 +1000,7 @@ next_reading_pass:
rc->unreportedError = FALSE; /* suppress respective error message */
goto terminate;
}
#endif
/*** Decide between reading in fast mode (dh->clusterSize sectors at once)
or reading one sector at a time.
@@ -1047,13 +1101,17 @@ reread:
if(status && !Closure->ignoreFatalSense
&& rc->image->dh->sense.sense_key && rc->image->dh->sense.sense_key != 3 && rc->image->dh->sense.sense_key != 5)
{ int answer;
{
#ifndef CLI
int answer;
if(!Closure->guiMode)
#endif
Stop(_("Sector %lld: %s\nCan not recover from above error.\n"
"Use the --ignore-fatal-sense option to override."),
rc->readPos, GetLastSenseString(FALSE));
#ifndef CLI
answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, insert_buttons,
_("Sector %lld: %s\n\n"
"It may not be possible to recover from this error.\n"
@@ -1064,12 +1122,14 @@ reread:
Closure->ignoreFatalSense = 2;
if(!answer)
{ SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
{
SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by user request!</span> %lld sectors read, %lld sectors unreadable/skipped so far."),
Closure->redMarkup, rc->readOK,Closure->readErrors);
rc->unreportedError = FALSE; /* suppress respective error message */
goto terminate;
}
#endif
}
/*** Evaluate C2 scan results */
@@ -1211,7 +1271,12 @@ reread:
if(Closure->sectorSkip && nsectors > 1)
{ int i;
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
_("Sector %lld: %s Skipping %d sectors.\n"),
rc->readPos, GetLastSenseString(FALSE), nfill-1);
for(i=0; i<nfill; i++) /* workaround: large values for nfill */
@@ -1239,7 +1304,12 @@ reread:
goto reread;
}
else
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(
#ifndef CLI
Closure->status,
#else
NULL,
#endif
_("Sector %lld: %s\n"),
rc->readPos, GetLastSenseString(FALSE));
if(rc->readPos >= rc->image->dh->sectors - 2) tao_tail++;
@@ -1262,8 +1332,10 @@ step_counter:
to checksum means we have ecc data - we can fix the image using ecc
rather than by re-reading it. */
#ifndef CLI
if(Closure->guiMode)
ChangeSpiralCursor(Closure->readLinearSpiral, -1); /* switch cursor off */
#endif
rc->pass++;
rc->image->dh->pass = rc->pass;
@@ -1273,11 +1345,14 @@ step_counter:
&& rc->pass < Closure->readingPasses)
{ int renderers_left = TRUE;
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(Closure->readLinearHeadline),
_("<big>Trying to complete image, reading pass %d of %d.</big>\n%s"),
rc->pass+1, Closure->readingPasses, rc->image->dh->mediumDescr);
else PrintCLI(_("\nTrying to complete image, reading pass %d of %d.\n"),
else
#endif
PrintCLI(_("\nTrying to complete image, reading pass %d of %d.\n"),
rc->pass+1, Closure->readingPasses);
@@ -1360,12 +1435,14 @@ step_counter:
}
PrintLog("\n%s\n",t);
#ifndef CLI
if(Closure->guiMode)
{ if(rc->scanMode) SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
"%s%s",_("Scanning finished: "),t);
else SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
"%s%s",_("Reading finished: "),t);
}
#endif
if(t) g_free(t);
if(!Closure->fixedSpeedValues)
@@ -1374,14 +1451,16 @@ step_counter:
if(rc->image->dh->mainType == CD && tao_tail && tao_tail == Closure->readErrors && !Closure->noTruncate)
{ int answer;
#ifndef CLI
if(Closure->guiMode)
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("%d sectors missing at the end of the disc.\n"
"This is okay if the CD was written in TAO (track at once) mode.\n"
"The Image will be truncated accordingly. See the manual for details.\n"),
tao_tail);
else
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
else
#endif
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("%d sectors missing at the end of the disc.\n"
"This is okay if the CD was written in TAO (track at once) mode.\n"
"The Image will be truncated accordingly. See the manual for details.\n"

View File

@@ -476,7 +476,7 @@ static int simple_lec(RawBuffer *rb, unsigned char *frame, char *msg)
if(q_failures || p_failures || q_corrected || p_corrected)
{
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld L-EC P/Q results: %d/%d failures, %d/%d corrected (%s).\n",
rb->lba, p_failures, q_failures, p_corrected, q_corrected, msg);
return 1;
@@ -558,7 +558,7 @@ int ValidateRawSector(RawBuffer *rb, unsigned char *frame, char *msg)
/* Tell user that L-EC succeeded */
if(lec_did_sth)
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by L-EC.\n",
rb->lba);
@@ -891,7 +891,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Good. Data section passes EDC test.\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -907,7 +907,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader after correcting sync pattern.\n",
rb->lba);
@@ -924,7 +924,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{
PrintCLIorLabel(Closure->status,
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by iterative L-EC.\n",
rb->lba);
@@ -947,7 +947,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by smart L-EC.\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -959,7 +959,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by plausible sector search (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -970,7 +970,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by brute force plausible sector search (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -981,7 +981,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by mutual ack heuristic (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -992,7 +992,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by heuristic L-EC (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -1003,7 +1003,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by plausible sector search (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -1014,7 +1014,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by brute force plausible sector search (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -1025,7 +1025,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by mutual ack heuristic (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -1036,7 +1036,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(Closure->status,
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by heuristic L-EC (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);

81
regtest/common.bash Executable file → Normal file
View File

@@ -1,15 +1,17 @@
CONFIGFILE="./config.txt"
CONFIGFILE_WIN="./config-win.txt"
NEWVER=../dvdisaster
SETVERSION="0.80"
DATABASE=./database
RNDSEQ="./fixed-random-sequence"
NON_EXISTENT_DEVICE=/dev/sdz
ISODIR=/var/tmp/regtest
if ! test -d $ISODIR; then
echo "$ISODIR does not exist."
echo "Please create it manually, or edit common.bash"
exit 0
exit 1
fi
LOGDIR="/dev/shm"
@@ -28,14 +30,22 @@ fi
# Assemble sed expressions for removal of variable output contents
SED_REMOVE_ISO_DIR=$(echo "${ISODIR}/" | sed -e "s/\//\\\\\//g")
SED_REMOVE_DEV_SHM=$(echo "/dev/shm/" | sed -e "s/\//\\\\\//g")
SED_REMOVE_ISO_DIR="([a-zA-Z]:/[a-zA-Z0-9/]+)?${ISODIR}/"
# For MSYS2
if [ -n "$ORIGINAL_TEMP" ]; then
ISODIR="$ORIGINAL_TEMP"
# /c/ => C:/
SED_REMOVE_ISO_DIR="$(echo "$ISODIR" | cut -c2 | tr a-z A-Z):$(echo "$ISODIR" | cut -c3-)/"
NON_EXISTENT_DEVICE=V:
fi
# Usage
if test "$1" == "--help" || test "$1" == "-h"; then
echo "Usage: $0 [gui] [all|cont <test case>]"
exit 0;
exit 1;
fi
doall="no"
@@ -57,7 +67,6 @@ case "${param[0]}" in
doall="yes"
;;
cont)
doall="yes"
cont_at="${param[1]}"
;;
esac
@@ -69,7 +78,7 @@ if test -x $NEWVER; then
echo "OK"
else
echo "missing."
exit 0
exit 1
fi
### Helper functions
@@ -94,6 +103,9 @@ function file_exists()
function try()
{ local doit=$(grep "${CODEC_PREFIX}_$2 " $CONFIGFILE)
if echo "$OS" | grep -q Windows && test -e "$CONFIGFILE_WIN" && grep -q "${CODEC_PREFIX}_$2 " "$CONFIGFILE_WIN"; then
doit=$(grep "${CODEC_PREFIX}_$2 " "$CONFIGFILE_WIN")
fi
if test -z "$doit"; then
echo "Config for ${CODEC_PREFIX}_$2 missing"
@@ -120,10 +132,20 @@ function try()
rm -f $SIMISO
fi
echo -n "Test case: $1 - "
if test -z "$REGTEST_SECTION"; then
REGTEST_SECTION="Test"
fi
if [ "$REGTEST_NO_UTF8" != 1 ]; then
echo -n "[ ] "
fi
echo -n "${CODEC_PREFIX} - ${REGTEST_SECTION} - $1 - "
return 0
else
# echo "Skipping: $1 ($doit, ${CODEC_PREFIX}_$2)"
if [ "$REGTEST_NO_UTF8" != 1 ]; then
echo -n "[-] "
fi
echo "${CODEC_PREFIX} - ${REGTEST_SECTION} - $1 - SKIPPED ($doit, ${CODEC_PREFIX}_$2)"
return 1
fi
}
@@ -153,6 +175,7 @@ function run_regtest()
local testparms="$2"
local testiso="$3"
local testecc="$4"
local options="$5"
local testeccopt=""
local image_md5=""
local ecc_md5=""
@@ -187,27 +210,39 @@ function run_regtest()
# ignore the memory tracker line when no memory leaks
# have been found
grep -v "dvdisaster: No memory leaks found." $NEWLOG >$TMPLOG
grep -va "dvdisaster: No memory leaks found." $NEWLOG >$TMPLOG
mv $TMPLOG $NEWLOG
# ignore log lines specified by user
if test -n "$IGNORE_LOG_LINE"; then
egrep -v "$IGNORE_LOG_LINE" $NEWLOG >$TMPLOG
grep -Eva "$IGNORE_LOG_LINE" $NEWLOG >$TMPLOG
mv $TMPLOG $NEWLOG
fi
filter=cat
echo "$options" | grep -qw SORTED && filter=sort
if [ "${CODEC_PREFIX}_${testsymbol}" = RS01_scan_no_device ] || [ "${CODEC_PREFIX}_${testsymbol}" = RS01_read_no_device ]; then
# for Windows
sed -i -re "s=device $NON_EXISTENT_DEVICE\.=/dev/sdz: No such file or directory=" $NEWLOG
fi
if ! diff <(tail -n +3 $REFLOG) <(sed -e "s/${SED_REMOVE_ISO_DIR}//g" $NEWLOG) >${DIFFLOG}; then
echo "BAD; diffs found (<expected; >created):"
if ! diff <(tail -n +3 $REFLOG | $filter) <(sed -re "s=${SED_REMOVE_ISO_DIR}==g" $NEWLOG | $filter) >${DIFFLOG}; then
if [ "$REGTEST_NO_UTF8" = 1 ]; then
echo "BAD; diffs found (<expected; >created):"
else
printf "%b\r%b\n" "BAD; diffs found (<expected; >created):" "[\e[31m✘\e[0m]"
fi
cat ${DIFFLOG}
if test "$interactive_diff" == "yes"; then
echo
echo ">> The diff can also be seen with: vimdiff $REFLOG $NEWLOG"
read -n 1 -p ">> Press 'a' to accept this diff; any other key to fail this test:" -e answer
if test "$answer" == "a"; then
cp $REFLOG $LOGDIR
head -n 2 $LOGDIR/${CODEC_PREFIX}_${testsymbol} >$REFLOG
sed -e "s/${SED_REMOVE_ISO_DIR}//g" $NEWLOG >>$REFLOG
sed -e "s=${SED_REMOVE_ISO_DIR}==g" $NEWLOG >>$REFLOG
pass="skip"
else
pass="false"
@@ -228,7 +263,7 @@ function run_regtest()
xterm_pid=$!
fi
LANG=en_EN.UTF-8 $NEWVER --regtest $extra_args --resource-file $LOGDIR/.dvdisaster-regtest >>$NEWLOG 2>&1
LANG=en_EN.UTF-8 timeout 15 $NEWVER --regtest $extra_args --resource-file $LOGDIR/.dvdisaster-regtest >>$NEWLOG 2>&1
rm -f $LOGDIR/.dvdisaster-regtest
fi
@@ -240,7 +275,11 @@ function run_regtest()
if test ${image_md5} != "ignore"; then
md5=$($MD5SUM ${testiso} | cut -d\ -f 1)
if test "$image_md5" != "$md5"; then
echo "BAD; md5 sum mismatch in image file:"
if [ "$REGTEST_NO_UTF8" = 1 ]; then
echo "BAD; md5 sum mismatch in image file:"
else
printf "%b\r%b\n" "BAD; md5 sum mismatch in image file:" "[\e[31m✘\e[0m]"
fi
echo "... expected image: $image_md5"
echo "... generated image: $md5"
pass="false"
@@ -250,7 +289,11 @@ function run_regtest()
if test ${ecc_md5} != "ignore"; then
md5=$($MD5SUM ${testecc} | cut -d\ -f 1)
if test "$ecc_md5" != "$md5"; then
echo "BAD; md5 sum mismatch in ecc file:"
if [ "$pass" = false ] || [ "$REGTEST_NO_UTF8" = 1 ]; then
echo "BAD; md5 sum mismatch in ecc file:"
else
printf "%b\r%b\n" "BAD; md5 sum mismatch in ecc file:" "[\e[31m✘\e[0m]"
fi
echo "... expected ecc: $ecc_md5"
echo "... generated ecc: $md5"
pass="false"
@@ -259,7 +302,11 @@ function run_regtest()
case "${pass}" in
true)
echo "GOOD"
if [ "$REGTEST_NO_UTF8" = 1 ]; then
echo GOOD
else
printf "%b\r%b\n" "GOOD" "[\e[32m✓\e[0m]"
fi
;;
skip)

26
regtest/config-win.txt Normal file
View File

@@ -0,0 +1,26 @@
RS01_ecc_no_read_perm no
RS01_ecc_no_write_perm no
RS01_fix_no_read_perm no
RS01_fix_no_read_perm_ecc no
RS01_fix_no_write_perm no
RS01_scan_with_no_permission_for_ecc no
RS01_read_with_no_permission_for_ecc no
RS01_adaptive_with_no_permission_for_ecc no
RS02_ecc_no_read_perm no
RS02_ecc_no_write_perm no
RS02_fix_no_read_perm no
RS02_fix_no_write_perm no
RS03i_ecc_no_read_perm no
RS03i_ecc_no_write_perm no
RS03i_fix_no_read_perm no
RS03i_fix_no_write_perm no
RS03f_ecc_no_read_perm no
RS03f_ecc_no_write_perm no
RS03f_fix_no_read_perm no
RS03f_fix_no_read_perm_ecc no
RS03f_fix_no_write_perm no
RS03f_fix_no_write_perm_ecc no
RS01_scan_no_device_access no
RS01_read_no_device_access no
RS01_adaptive_no_device_access no

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ See the file "COPYING" for further information.
Opening rs02-tmp.iso: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -16,7 +16,7 @@ Completing image rs02-tmp.iso. Only missing sectors will be read.
Opening rs02-tmp.iso: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -16,7 +16,7 @@ All sectors successfully read.
Opening rs02-tmp.iso: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -11,7 +11,7 @@ Opening rs02-tmp.iso: 39809 medium sectors.
Image size is now: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -11,7 +11,7 @@ Opening rs02-tmp.iso: 39810 medium sectors.
Image size is now: 30000 medium sectors and 56 bytes.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34933 sectors).

View File

@@ -11,7 +11,7 @@ Opening rs02-tmp.iso: 34932 medium sectors.
Image size is now: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -11,7 +11,7 @@ Opening rs02-tmp.iso: 34933 medium sectors.
Image size is now: 30000 medium sectors and 56 bytes.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34933 sectors).

View File

@@ -11,7 +11,7 @@ Opening rs02-tmp.iso: 34935 medium sectors.
Image size is now: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -11,7 +11,7 @@ Opening rs02-tmp.iso: 34935 medium sectors.
Image size is now: 30000 medium sectors and 137 bytes.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34933 sectors).

View File

@@ -8,7 +8,7 @@ See the file "COPYING" for further information.
Opening rs02-tmp.iso: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
*

View File

@@ -8,7 +8,7 @@ See the file "COPYING" for further information.
Opening rs02-tmp.iso: 30000 medium sectors and 137 bytes.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34933 sectors).

View File

@@ -17,7 +17,7 @@ All sectors successfully read. Checksums match.
Opening rs02-tmp.iso: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -20,7 +20,7 @@ Opening rs02-tmp.iso: 49935 medium sectors.
Image size is now: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -17,7 +17,7 @@ All sectors successfully read. Checksums match.
Opening rs02-tmp.iso: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -20,7 +20,7 @@ Opening rs02-tmp.iso: 36975 medium sectors.
Image size is now: 30000 medium sectors.
Augmenting image with Method RS02:
58 MiB data, 9 MiB ecc (35 roots; 15.9% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 68 MiB (34932 sectors).

View File

@@ -7,7 +7,7 @@ See the file "COPYING" for further information.
Opening rs03i-tmp.iso: 21000 medium sectors.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -249,7 +249,7 @@ ndata = 216
nroots = 39 (18.1%)
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
CrcBufValid: NOT complete
Cache allocation: 110592K+12288K+9984K=129M (data+parity+descrambling)

View File

@@ -250,7 +250,7 @@ ndata = 216
nroots = 39 (18.1%)
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
CrcBufValid: buffer VALID
CrcBuf present, augmented image: using data MD5 sum

View File

@@ -10,7 +10,7 @@ Opening rs03i-tmp.iso: 29835 medium sectors.
* Truncating image to data part (21000 sectors).
Image size is now: 21000 medium sectors.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -10,7 +10,7 @@ Opening rs03i-tmp.iso: 29835 medium sectors.
* Truncating image to data part (21001 sectors).
Image size is now: 21000 medium sectors and 56 bytes.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -10,7 +10,7 @@ Opening rs03i-tmp.iso: 29887 medium sectors.
* Truncating image to data part (21000 sectors).
Image size is now: 21000 medium sectors.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -10,7 +10,7 @@ Opening rs03i-tmp.iso: 24927 medium sectors.
* Truncating image to data part (21001 sectors).
Image size is now: 21000 medium sectors and 56 bytes.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -10,7 +10,7 @@ Opening rs03i-tmp.iso: 24990 medium sectors.
* Truncating image to data part (21000 sectors).
Image size is now: 21000 medium sectors.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -10,7 +10,7 @@ Opening rs03i-tmp.iso: 24990 medium sectors.
* Truncating image to data part (21001 sectors).
Image size is now: 21000 medium sectors and 56 bytes.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -7,7 +7,7 @@ See the file "COPYING" for further information.
Opening rs03i-tmp.iso: 21000 medium sectors.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
*

View File

@@ -7,7 +7,7 @@ See the file "COPYING" for further information.
Opening rs03i-tmp.iso: 21000 medium sectors and 56 bytes.
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
Image has been augmented with error correction data.
New image size is 48 MiB (24990 sectors).

View File

@@ -252,7 +252,7 @@ ndata = 216
nroots = 39 (18.1%)
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
CrcBufValid: buffer VALID
CrcBuf present, augmented image: using data MD5 sum

View File

@@ -209,7 +209,7 @@ ndata = 216
nroots = 39 (18.1%)
41 MiB data, 7 MiB ecc (39 roots; 18.1% redundancy).
* Warning: Using redundancies below 20%% may not give
* Warning: Using redundancies below 20% may not give
* the expected data loss protection.
CrcBufValid: buffer VALID
CrcBuf present, augmented image: using data MD5 sum

Some files were not shown because too many files have changed in this diff Show More