Compare commits

...

70 Commits

Author SHA1 Message Date
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
Carlos Maddela
f6a9f663bf Release version 0.79.6-5 to experimental. 2019-02-02 16:05:49 +11:00
Carlos Maddela
95b3155bc8 Prepare changelog and rebase patches.
Gbp-Dch: Ignore
2019-02-02 16:04:23 +11:00
Carlos Maddela
4c4aa1a143 Merge branch 'debian/unstable' into debian/experimental 2019-02-02 16:00:54 +11:00
Carlos Maddela
31b154dacc Release version 0.79.5-9 2019-02-02 15:20:38 +11:00
Carlos Maddela
52f3307d78 Suggest to install dvdisaster-doc in error message
Suggest to install dvdisaster-doc in error message, if the PDF manual
cannot be found.
2019-02-02 15:20:07 +11:00
Carlos Maddela
1e51a09248 Make sure that the upstream changelog remains uncompressed
Make sure that the upstream changelog remains uncompressed,
so that the application can display it.
2019-02-02 13:34:45 +11:00
Carlos Maddela
6c4d0d26e9 Release version 0.79.6-4 to experimental. 2019-02-01 23:13:25 +11:00
Carlos Maddela
adeba79339 Prepare changelog.
Gbp-Dch: Ignore
2019-02-01 23:11:56 +11:00
Carlos Maddela
f648710f2f Merge branch 'debian/unstable' into debian/experimental 2019-02-01 23:08:51 +11:00
Carlos Maddela
bf96232b15 Release version 0.79.5-8 2019-02-01 23:03:25 +11:00
Carlos Maddela
c84be789d3 Fix parallel build of locale strings. 2019-02-01 22:55:07 +11:00
Carlos Maddela
3e16a0c2da Release version 0.79.6-3 to experimental. 2019-01-31 09:02:00 +11:00
Carlos Maddela
c40d6e9278 Update gbp.conf for debian/experimental branch. 2019-01-31 08:58:42 +11:00
Carlos Maddela
bee8419a4a Prepare changelog and rebase patches.
Gbp-Dch: Ignore
2019-01-31 08:55:53 +11:00
Carlos Maddela
af179a1a3e Merge branch 'debian/unstable' into debian/experimental 2019-01-31 08:48:01 +11:00
Carlos Maddela
2ebf97cbf4 Fix lost entries in debian/changelog from previous merge.
Gbp-Dch: Ignore
2019-01-31 08:44:33 +11:00
Carlos Maddela
4b4495b693 Release version 0.79.5-7 2019-01-31 07:10:55 +11:00
Carlos Maddela
ddaf4cfc23 Indicate compliance with Debian Policy 4.3.0. 2019-01-31 07:09:23 +11:00
Carlos Maddela
86207af360 Add more details to upstream metadata. 2019-01-31 07:06:20 +11:00
Carlos Maddela
44bc4b1916 Add support for nodoc build profile. 2019-01-31 06:48:26 +11:00
Carlos Maddela
b7344e4855 Change homepage to one archived at web.archive.org.
http://dvdisaster.net has been unavailable for a while now.
Not certain if this is permanent though, as the domain name still
exists for mail.
2019-01-31 06:00:36 +11:00
Carlos Maddela
9fc9a74171 Fix format security compilation warning in GCC-8. 2019-01-31 05:21:34 +11:00
Carlos Maddela
b289d165db Fix dh_auto_build overrides to take advantage of parallel builds. 2019-01-31 05:06:04 +11:00
Carlos Maddela
b24ad06237 Fix location of manual. 2019-01-31 04:51:51 +11:00
Carlos Maddela
e4f86281b1 Build as verbosely as possible. 2019-01-31 04:34:03 +11:00
Carlos Maddela
dc27f5e3fa Simplify process by which mutable files are backed up and restored. 2019-01-31 04:30:57 +11:00
Carlos Maddela
3693b4e86e Set "Rules-Requires-Root: no". 2019-01-31 04:25:17 +11:00
Carlos Maddela
354e8a500a Build with Debhelper compat level 12. 2019-01-31 04:16:55 +11:00
Carlos Maddela
72f70e6488 Add debian/gbp.conf to conform with DEP14 conventions. 2019-01-31 04:01:04 +11:00
Carlos Maddela
13db28beb6 Restore lost .gitignore file.
Gbp-Dch: Ignore
2018-06-27 15:27:33 +10:00
Carlos Maddela
19a77a6cba Merge branch 'experimental/master' 2018-06-27 15:09:03 +10:00
TANIGUCHI Takaki
2b5666fc47 Merge remote-tracking branch 'origin/master' 2018-06-23 12:16:27 +09:00
118 changed files with 12531 additions and 8533 deletions

View File

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

18
.gitignore vendored Normal file
View File

@@ -0,0 +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,29 @@
# dvdisaster changelog -*-text-*-
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 all
- 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)
@@ -75,14 +75,22 @@ ${BUILDTMP}/%.o : %.c
all: time-stamp dvdisaster
${BUILDTMP}/build.o : build.c build.h
@echo "Compiling:" build.o
@$(CC) $(COPTS) -c build.c -o $@
# Building the dvdisaster binary
time-stamp:
@$(SRCDIR)/scripts/time-stamper.bash $(SRCDIR)/build.h
dvdisaster: inlined-icons.h $(OFILES)
dvdisaster: $(ICONS) $(OFILES)
@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,7 +146,7 @@ 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:
@echo "\\newcommand{\\projectversion}{$(VERSION)}" >$(SRCDIR)/documentation/config/version.tex
@@ -221,7 +229,7 @@ show:
######################################################################
.PHONY : install uninstall clean distclean arch
.PHONY : srcdist
.PHONY : srcdist dist
install: dvdisaster manual
@echo "Installing package..."
@@ -239,9 +247,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 +294,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,6 +321,7 @@ 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
@@ -329,5 +334,14 @@ 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

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".

53
README.md Normal file
View File

@@ -0,0 +1,53 @@
# 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 disadvan-
tages 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 is dated 2017, and the official website is down.
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 (The Debian version source code can be found [here](https://sources.debian.org/src/dvdisaster/))
- Windows build added back (was dropped upstream a few versions before the last one)
- A Linux CLI-only version can now be compiled, without depending on gtk
- Regression tests confirmed working on Linux64 (normal and CLI-only), Windows32 and Windows64
- Added pre-defined sizes for BD-R Triple Layer (100GB), BD-R Quadruple Layer (128GB)
# Screenshots
(todo)

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);
@@ -501,7 +515,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 +539,7 @@ void InitClosure()
Closure->darkSector = g_malloc0(sizeof(GdkColor));
DefaultColors();
#endif
memset(Closure->bs, '\b', 255);
memset(Closure->sp, ' ', 255);
@@ -567,7 +584,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 +609,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 +666,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=1 -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"

95
debian/changelog vendored
View File

@@ -1,3 +1,33 @@
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.
-- Carlos Maddela <e7appew@gmail.com> Sat, 02 Feb 2019 16:05:29 +1100
dvdisaster (0.79.6-4) experimental; urgency=medium
* Merge changes from 0.79.5-8.
-- Carlos Maddela <e7appew@gmail.com> Fri, 01 Feb 2019 23:13:16 +1100
dvdisaster (0.79.6-3) experimental; urgency=medium
* Merge changes from 0.79.5-7.
* Update gbp.conf for debian/experimental branch.
-- Carlos Maddela <e7appew@gmail.com> Thu, 31 Jan 2019 08:59:58 +1100
dvdisaster (0.79.6-2) experimental; urgency=medium
[ TANIGUCHI Takaki ]
@@ -19,6 +49,69 @@ 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
* Make sure that the upstream changelog remains uncompressed so
that the application can display it.
* Suggest to install dvdisaster-doc in error message, if the PDF manual
cannot be found.
-- Carlos Maddela <e7appew@gmail.com> Sat, 02 Feb 2019 15:20:23 +1100
dvdisaster (0.79.5-8) unstable; urgency=medium
* Fix parallel build of locale strings.
-- Carlos Maddela <e7appew@gmail.com> Fri, 01 Feb 2019 23:03:13 +1100
dvdisaster (0.79.5-7) unstable; urgency=medium
* Add debian/gbp.conf to conform with DEP14 conventions.
* Build with Debhelper compat level 12.
* Set "Rules-Requires-Root: no".
* Simplify process by which mutable files are backed up and restored.
* Build as verbosely as possible.
* Fix location of manual.
* Fix dh_auto_build overrides to take advantage of parallel builds.
* Fix format security compilation warning in GCC-8.
* Change homepage to one archived at web.archive.org.
http://dvdisaster.net has been unavailable for a while now.
Not certain if this is permanent though, as the domain name still
exists for mail.
* Add support for nodoc build profile.
* Add more details to upstream metadata.
* Indicate compliance with Debian Policy 4.3.0.
-- Carlos Maddela <e7appew@gmail.com> Thu, 31 Jan 2019 07:10:46 +1100
dvdisaster (0.79.5-6) unstable; urgency=medium
[ TANIGUCHI Takaki ]
* change Vcs-* path
[ Carlos Maddela ]
* Build with DH compat level 11.
* Indicate compliance with Debian Policy 4.1.4.
* Add machine-readable upstream metadata.
* Update debian/copyright.
* Update location of PDF manual registered with doc-base (required
as a result of DH compat level change).
-- Carlos Maddela <e7appew@gmail.com> Sat, 23 Jun 2018 05:01:27 +1000
dvdisaster (0.79.5-5) unstable; urgency=medium
* Update Vcs-* to salsa.debian.org
* Bump Standards-Version to 4.1.3
-- TANIGUCHI Takaki <takaki@debian.org> Sat, 27 Jan 2018 23:34:08 +0900
dvdisaster (0.79.5-4) unstable; urgency=medium
@@ -318,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 @@
11

17
debian/control vendored
View File

@@ -5,20 +5,22 @@ Maintainer: Optical Media Tools Team <pkg-opt-media-team@lists.alioth.debian.org
Uploaders: TANIGUCHI Takaki <takaki@debian.org>,
Rogério Brito <rbrito@ime.usp.br>,
Carlos Maddela <e7appew@gmail.com>
Build-Depends: debhelper (>= 11),
Build-Depends: debhelper (>= 12),
gettext,
libbz2-dev,
libcam-dev [kfreebsd-any],
libgtk2.0-dev,
libpng-dev,
pkg-config
Build-Depends-Indep: texlive-fonts-recommended,
texlive-latex-base,
texlive-latex-extra
Standards-Version: 4.1.4
pkg-config,
debhelper-compat (= 12)
Build-Depends-Indep: texlive-fonts-recommended <!nodoc>,
texlive-latex-base <!nodoc>,
texlive-latex-extra <!nodoc>
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: http://dvdisaster.net/
Homepage: https://web.archive.org/web/20180428070843/http://dvdisaster.net/
Rules-Requires-Root: no
Package: dvdisaster
Architecture: any
@@ -30,6 +32,7 @@ Description: data loss/scratch/aging protection for CD/DVD media
used to recover unreadable sectors if the disc becomes damaged at a later time.
Package: dvdisaster-doc
Build-Profiles: <!nodoc>
Section: doc
Architecture: all
Multi-Arch: foreign

2
debian/copyright vendored
View File

@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Contact: Carsten Gnörlich <carsten@dvdisaster.org>
Upstream-Name: dvdisaster
Source: http://dvdisaster.net/
Source: https://web.archive.org/web/20180428070843/http://dvdisaster.net/
Files: *
Copyright: 20042015, Carsten Gnörlich <carsten@dvdisaster.org>

View File

@@ -1,4 +1,3 @@
CHANGELOG
CREDITS.*
README.MODIFYING
TODO

1
debian/dvdisaster.lintian-overrides vendored Normal file
View File

@@ -0,0 +1 @@
dvdisaster: changelog-file-not-compressed changelog

5
debian/gbp.conf vendored Normal file
View File

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

View File

@@ -0,0 +1,27 @@
From: Carlos Maddela <e7appew@gmail.com>
Date: Thu, 31 Jan 2019 05:10:21 +1100
Subject: Fix format security warning in GCC-8.
Description: Fix format security warning in GCC-8.
Author: Carlos Maddela <e7appew@gmail.com>
Forwarded: no
Last-Update: 2019-01-31
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
udf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/udf.c b/udf.c
index 174fa36..9e345c2 100644
--- a/udf.c
+++ b/udf.c
@@ -794,7 +794,7 @@ void FreeIsoHeader(IsoHeader *ih)
void AddFile(IsoHeader *ih, char *name, guint64 size)
{ static int n;
- char iso[20], joliet[strlen(name)+3];
+ char iso[22], joliet[strlen(name)+3];
n++;
sprintf(iso,"RAN_%04d.DAT;1", n);

View File

@@ -0,0 +1,108 @@
From: Carlos Maddela <e7appew@gmail.com>
Date: Thu, 31 Jan 2019 05:31:03 +1100
Subject: Change homepage to one archived at web.archive.org.
Description: Change homepage to one archived at web.archive.org.
http://dvdisaster.net has been unavailable for a while now.
Not certain if this is permanent though, as the domain name still
exists for mail.
Author: Carlos Maddela <e7appew@gmail.com>
Forwarded: not-needed
Last-Update: 2019-01-31
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
documentation/codec-specs/rs01.tex | 2 +-
documentation/codec-specs/rs02.tex | 2 +-
documentation/upstream-site/de/impressum.html | 2 +-
documentation/upstream-site/en/imprint.html | 2 +-
documentation/user-manual/background.tex | 2 +-
documentation/user-manual/download.tex | 4 ++--
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/documentation/codec-specs/rs01.tex b/documentation/codec-specs/rs01.tex
index a8c0d90..ca7f71f 100644
--- a/documentation/codec-specs/rs01.tex
+++ b/documentation/codec-specs/rs01.tex
@@ -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.
diff --git a/documentation/codec-specs/rs02.tex b/documentation/codec-specs/rs02.tex
index fb88384..06e8126 100644
--- a/documentation/codec-specs/rs02.tex
+++ b/documentation/codec-specs/rs02.tex
@@ -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
diff --git a/documentation/upstream-site/de/impressum.html b/documentation/upstream-site/de/impressum.html
index 7c5ded3..d8bf4f8 100644
--- a/documentation/upstream-site/de/impressum.html
+++ b/documentation/upstream-site/de/impressum.html
@@ -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 -->
diff --git a/documentation/upstream-site/en/imprint.html b/documentation/upstream-site/en/imprint.html
index d99324b..43641f2 100644
--- a/documentation/upstream-site/en/imprint.html
+++ b/documentation/upstream-site/en/imprint.html
@@ -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 -->
diff --git a/documentation/user-manual/background.tex b/documentation/user-manual/background.tex
index ba602ef..9aba84f 100644
--- a/documentation/user-manual/background.tex
+++ b/documentation/user-manual/background.tex
@@ -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}
diff --git a/documentation/user-manual/download.tex b/documentation/user-manual/download.tex
index 79df7be..a91a44a 100644
--- a/documentation/user-manual/download.tex
+++ b/documentation/user-manual/download.tex
@@ -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.

54
debian/patches/36-fix-parallelism.patch vendored Normal file
View File

@@ -0,0 +1,54 @@
From: Carlos Maddela <e7appew@gmail.com>
Date: Fri, 1 Feb 2019 22:28:18 +1100
Subject: Fix parallel build of locale strings.
Description: Fix parallel build of locale strings.
Author: Carlos Maddela <e7appew@gmail.com>
Forwarded: no
Last-Update: 2019-02-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
GNUmakefile.template | 1 +
locale/create-makefile | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/GNUmakefile.template b/GNUmakefile.template
index 4509c48..3aae04e 100644
--- a/GNUmakefile.template
+++ b/GNUmakefile.template
@@ -297,6 +297,7 @@ 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
diff --git a/locale/create-makefile b/locale/create-makefile
index 5ed31ed..83a4abf 100644
--- a/locale/create-makefile
+++ b/locale/create-makefile
@@ -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"

View File

@@ -0,0 +1,137 @@
From: Carlos Maddela <e7appew@gmail.com>
Date: Sat, 2 Feb 2019 13:56:04 +1100
Subject: Suggest to install dvdisaster-doc in error message
Description: Suggest to install dvdisaster-doc in error message
if the PDF manual cannot be found.
Author: Carlos Maddela <e7appew@gmail.com>
Forwarded: not-needed
Last-Update: 2019-02-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
locale/cs.po | 2 ++
locale/de.po | 2 ++
locale/it.po | 2 ++
locale/pt_BR.po | 2 ++
locale/ru.po | 2 ++
locale/sv.po | 2 ++
show-manual.c | 3 ++-
7 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/locale/cs.po b/locale/cs.po
index d89ff4a..b55c45a 100644
--- a/locale/cs.po
+++ b/locale/cs.po
@@ -6077,10 +6077,12 @@ msgid ""
"Documentation file\n"
"%s\n"
"not found.\n"
+"Please install the dvdisaster-doc package.\n"
msgstr ""
"Soubor dokumentace\n"
"%s\n"
"nebyl nalezen.\n"
+"Nainstalujte prosím balíček dvdisaster-doc.\n"
#: show-manual.c:308
msgid "Please hang on until the viewer comes up!"
diff --git a/locale/de.po b/locale/de.po
index 8112b13..f54b083 100644
--- a/locale/de.po
+++ b/locale/de.po
@@ -6226,10 +6226,12 @@ msgid ""
"Documentation file\n"
"%s\n"
"not found.\n"
+"Please install the dvdisaster-doc package.\n"
msgstr ""
"Dokument-Datei\n"
"%s\n"
"nicht gefunden.\n"
+"Bitte installieren Sie das dvdisaster-doc-Paket.\n"
#: show-manual.c:308
msgid "Please hang on until the viewer comes up!"
diff --git a/locale/it.po b/locale/it.po
index b98f8d3..de60016 100644
--- a/locale/it.po
+++ b/locale/it.po
@@ -5629,10 +5629,12 @@ msgid ""
"Documentation file\n"
"%s\n"
"not found.\n"
+"Please install the dvdisaster-doc package.\n"
msgstr ""
"File di documentazione\n"
"%s\n"
"non trovati.\n"
+"Si prega di installare il pacchetto dvdisaster-doc.\n"
#: show-manual.c:308
msgid "Please hang on until the viewer comes up!"
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index 81ee14d..3659f11 100644
--- a/locale/pt_BR.po
+++ b/locale/pt_BR.po
@@ -5950,10 +5950,12 @@ msgid ""
"Documentation file\n"
"%s\n"
"not found.\n"
+"Please install the dvdisaster-doc package.\n"
msgstr ""
"Arquivo de documentação\n"
"%s\n"
"não encontrado.\n"
+"Por favor, instale o pacote dvdisaster-doc.\n"
#: show-manual.c:308
msgid "Please hang on until the viewer comes up!"
diff --git a/locale/ru.po b/locale/ru.po
index 6e980b9..9c45692 100644
--- a/locale/ru.po
+++ b/locale/ru.po
@@ -5958,10 +5958,12 @@ msgid ""
"Documentation file\n"
"%s\n"
"not found.\n"
+"Please install the dvdisaster-doc package.\n"
msgstr ""
"Файл документации\n"
"%s\n"
"не найден.\n"
+"Пожалуйста, установите пакет dvdisaster-doc.\n"
#: show-manual.c:308
msgid "Please hang on until the viewer comes up!"
diff --git a/locale/sv.po b/locale/sv.po
index 3011969..9cee323 100644
--- a/locale/sv.po
+++ b/locale/sv.po
@@ -5648,10 +5648,12 @@ msgid ""
"Documentation file\n"
"%s\n"
"not found.\n"
+"Please install the dvdisaster-doc package.\n"
msgstr ""
"Dokumentationsfilen\n"
"%s\n"
"hittades inte.\n"
+"Installera dvdisaster-doc-paketet.\n"
#: show-manual.c:308
msgid "Please hang on until the viewer comes up!"
diff --git a/show-manual.c b/show-manual.c
index 4abbe97..5ac8e97 100644
--- a/show-manual.c
+++ b/show-manual.c
@@ -296,7 +296,8 @@ void ShowPDF(char *target)
if(!LargeStat(bi->path, &ignore))
{
- CreateMessage(_("Documentation file\n%s\nnot found.\n"), GTK_MESSAGE_ERROR, bi->path);
+ CreateMessage(_("Documentation file\n%s\nnot found.\n"
+ "Please install the dvdisaster-doc package.\n"), GTK_MESSAGE_ERROR, bi->path);
g_free(bi->path);
g_free(bi);
return;

22
debian/patches/series vendored
View File

@@ -1,27 +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
37-suggest-dvdisaster-doc.patch

36
debian/rules vendored
View File

@@ -1,5 +1,7 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
@@ -13,6 +15,7 @@ export FORCE_SOURCE_DATE = 1
MUTABLE_FILES := build.h $(wildcard locale/*.po) \
documentation/config/version.tex \
documentation/user-manual/manual.pdf
BACKUP_TAR_FILE := debian/backup.tar
BUILDROOT := $(CURDIR)/debian/tmp
ICONS := $(wildcard contrib/dvdisaster*.png)
@@ -21,29 +24,32 @@ ICON_SIZES := $(patsubst contrib/dvdisaster%.png,%,$(ICONS))
%:
dh $@
override_dh_update_autotools_config:
dh_update_autotools_config
test -f $(BACKUP_TAR_FILE) || \
tar cpf $(BACKUP_TAR_FILE) $(MUTABLE_FILES)
override_dh_clean:
dh_clean
test ! -f $(BACKUP_TAR_FILE) || \
tar xpf $(BACKUP_TAR_FILE) && rm -f $(BACKUP_TAR_FILE)
override_dh_auto_configure:
for f in $(MUTABLE_FILES); do \
cp -an $$f $$f.orig; \
done
./configure \
--prefix=/usr \
--mandir=share/man \
--localedir=share/locale \
--docdir=share/doc \
--docsubdir=dvdisaster-doc \
--docsubdir=dvdisaster \
--with-embedded-src-path=no
override_dh_clean:
dh_clean -X.orig
for f in $(MUTABLE_FILES); do \
test ! -f $$f.orig || mv -f $$f.orig $$f; \
done
override_dh_auto_build-arch:
make all
dh_auto_build -a -- all
override_dh_auto_build-indep:
make manual
dh_auto_build -i \
$(if $(findstring nodoc,$(DEB_BUILD_OPTIONS)),--no-act) \
-- manual
override_dh_auto_install-arch:
dh_auto_install -a -- BUILDROOT=$(BUILDROOT)
@@ -62,4 +68,8 @@ override_dh_auto_install-indep:
# automatically decompress text files.
override_dh_compress-arch:
dh_compress -p dvdisaster \
-XCHANGELOG -XCREDITS -XREADME.MODIFYING -XTODO
-Xchangelog -XCREDITS -XREADME.MODIFYING -XTODO
gzip -9n debian/dvdisaster/usr/share/doc/dvdisaster/changelog.Debian
override_dh_installchangelogs-arch:
dh_installchangelogs -p dvdisaster -k

View File

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

2
debian/watch vendored
View File

@@ -1,4 +1,4 @@
version=3
opts="pgpsigurlmangle=s/$/.gpg/" \
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

@@ -279,7 +279,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 +384,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

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
*/
@@ -96,7 +109,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
@@ -324,6 +339,8 @@ 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
{ int len = strlen(optarg);
if(strchr("0123456789", optarg[len-1]))
@@ -724,7 +741,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 +898,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. */
@@ -930,7 +953,7 @@ int main(int argc, char *argv[])
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"));
@@ -971,6 +994,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 +1025,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.
@@ -98,9 +110,10 @@
#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_SL_SIZE 12219392
#define BD_DL_SIZE 23652352
#define BDXL_TL_SIZE 47305728
#define BDXL_QL_SIZE (128001769472/2048)
/* Maximum accepted media sizes (in 2K sectors) */
@@ -112,7 +125,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 +172,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 */
@@ -229,6 +244,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 +260,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 +349,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 +361,7 @@ typedef struct _GlobalClosure
char *readAdaptiveSubtitle;
char *readAdaptiveErrorMsg;
int additionalSpiralColor;
#endif
} GlobalClosure;
@@ -376,7 +398,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 +456,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 +485,7 @@ void FreeBitmap(Bitmap*);
*** build.h
***/
int buildCount;
extern const char *const buildCount;
/***
*** cacheprobe.h
@@ -477,8 +499,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 +574,7 @@ int CrcBufValid(CrcBuf*, struct _Image*, EccHeader*);
void PrintCrcBuf(CrcBuf*);
#ifndef CLI
/***
*** curve.c
***/
@@ -593,6 +618,7 @@ int CurveY(Curve*, gdouble);
int CurveLogY(Curve*, gdouble);
void RedrawAxes(Curve*);
void RedrawCurve(Curve*, int);
#endif
/***
*** debug.c
@@ -659,7 +685,9 @@ void PrintEccHeader(EccHeader*);
*** fix-window.c
***/
#ifndef CLI
void CreateFixWindow(GtkWidget*);
#endif
/***
*** galois.c
@@ -717,6 +745,7 @@ void FreeGaloisTables(GaloisTables*);
ReedSolomonTables *CreateReedSolomonTables(GaloisTables*, gint32, gint32, int);
void FreeReedSolomonTables(ReedSolomonTables*);
#ifndef CLI
/***
*** help-dialogs.c
***/
@@ -757,6 +786,7 @@ void AboutDialog();
void AboutText(GtkWidget*, char*, ...);
void AboutLink(GtkWidget*, char*, char*);
void AboutTextWithLink(GtkWidget*, char*, char*);
#endif
/***
*** heuristic-lec.c
@@ -993,6 +1023,7 @@ int forget(void*);
void check_memleaks(void);
#ifndef CLI
/***
*** menubar.c
***/
@@ -1000,6 +1031,7 @@ void check_memleaks(void);
void AttachTooltip(GtkWidget*, char*, char*);
GtkWidget* CreateMenuBar(GtkWidget*);
GtkWidget* CreateToolBar(GtkWidget*);
#endif
/***
*** method.c / method-link.c
@@ -1012,7 +1044,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 +1059,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 +1069,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 +1089,7 @@ void CallMethodDestructors(void);
*** misc.c
***/
int canprint(char);
char* sgettext(char*);
char* sgettext_utf8(char*);
@@ -1068,7 +1105,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 +1119,7 @@ void UnregisterCleanup(void);
GThread* CreateGThread(GThreadFunc, gpointer);
#ifndef CLI
void ShowWidget(GtkWidget*);
void AllowActions(gboolean);
@@ -1088,7 +1130,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 +1145,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 +1163,7 @@ void FreePreferences(void*);
void UpdatePrefsExhaustiveSearch(void);
void UpdatePrefsConfirmDeletion(void);
void RegisterPreferencesHelpWindow(LabelWithOnlineHelp*);
#endif
/***
*** print-sense.c
@@ -1125,7 +1176,7 @@ void GetLastSense(int*, int*, int*);
/***
*** random.c
***/
**/
#define MY_RAND_MAX 2147483647
@@ -1169,6 +1220,7 @@ void ReadDefectiveSectorFile(DefectiveSectorHeader *, struct _RawBuffer*, char*)
void ReadMediumLinear(gpointer);
#ifndef CLI
/***
*** read-linear-window.c
***/
@@ -1180,6 +1232,7 @@ void InitializeCurve(void*, int, int);
void AddCurveValues(void*, int, int, int);
void MarkExistingSectors(void);
void RedrawReadLinearWindow(void);
#endif
/***
*** read-adaptive.c
@@ -1189,6 +1242,7 @@ void GetReadingRange(gint64, gint64*, gint64*);
void ReadMediumAdaptive(gpointer);
#ifndef CLI
/***
*** read-adaptive-window.c
***/
@@ -1205,6 +1259,7 @@ void SetAdaptiveReadFootline(char*, GdkColor*);
void UpdateAdaptiveResults(gint64, gint64, gint64, int);
void ChangeSegmentColor(GdkColor*, int);
void RemoveFillMarkers();
#endif
/***
*** recover-raw.c
@@ -1348,6 +1403,12 @@ int ProbeAltiVec(void);
void ShowPDF(char*);
/***
*** show-html.c
***/
void ShowHTML(char*);
/***
*** smart-lec.c
***/
@@ -1362,6 +1423,7 @@ void *PrepareIterativeSmartLEC(RawBuffer*);
void SmartLECIteration(void*, char*);
void EndIterativeSmartLEC(void*);
#ifndef CLI
/***
*** spiral.c
***/
@@ -1397,5 +1459,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,34 @@
* Also, individual behaviour may deviate from standard functions.
*/
#ifdef SYS_MINGW
#include <windows.h>
#define stat _stati64
#define 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
#endif /* SYS_MINGW */
/*
* convert special chars in file names to correct OS encoding
*/
@@ -109,6 +137,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)
@@ -178,12 +209,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 +224,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 +241,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 +271,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 +307,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 +347,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/>.
*/
#ifndef SYS_MINGW /* completely untested under Windows, and we don't need it for releases anyway */
#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);

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

@@ -1,10 +1,12 @@
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."
@@ -28,8 +30,16 @@ 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
@@ -57,7 +67,6 @@ case "${param[0]}" in
doall="yes"
;;
cont)
doall="yes"
cont_at="${param[1]}"
;;
esac
@@ -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,14 @@ function try()
rm -f $SIMISO
fi
echo -n "Test case: $1 - "
if test -z "$REGTEST_SECTION"; then
REGTEST_SECTION="Test"
fi
echo -n "[ ] ${CODEC_PREFIX} - ${REGTEST_SECTION} - $1 - "
return 0
else
# echo "Skipping: $1 ($doit, ${CODEC_PREFIX}_$2)"
echo "[-] ${CODEC_PREFIX} - ${REGTEST_SECTION} - $1 - SKIPPED ($doit, ${CODEC_PREFIX}_$2)"
return 1
fi
}
@@ -153,6 +169,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 +204,35 @@ 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
printf "%b\r%b\n" "BAD; diffs found (<expected; >created):" "[\e[31m✘\e[0m]"
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"
@@ -241,6 +266,7 @@ function run_regtest()
md5=$($MD5SUM ${testiso} | cut -d\ -f 1)
if test "$image_md5" != "$md5"; then
echo "BAD; md5 sum mismatch in image file:"
printf "%b\r%b\n" "BAD; md5 sum mismatch in image file:" "[\e[31m✘\e[0m]"
echo "... expected image: $image_md5"
echo "... generated image: $md5"
pass="false"
@@ -250,7 +276,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 ]; 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 +289,7 @@ function run_regtest()
case "${pass}" in
true)
echo "GOOD"
printf "%b\r%b\n" "GOOD" "[\e[32m✓\e[0m]"
;;
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

@@ -48,7 +48,7 @@ fi
### Verification tests
echo "# Verify tests"
REGTEST_SECTION="Verify tests"
# Test good files
if try "good image" good; then
@@ -310,7 +310,7 @@ fi
### Creation tests
echo "# Creation tests"
REGTEST_SECTION="Creation tests"
# Create ecc file
if try "ecc file creation" ecc_create; then
@@ -441,19 +441,19 @@ fi
# Tests whether CRC and ECC information is taken from the read process,
# not the wrong ecc file.
if try "read image with wrong ecc (RS01) and create new ecc" ecc_recreate_after_read_wrong_rs01; then
if false && try "read image with wrong ecc (RS01) and create new ecc" ecc_recreate_after_read_wrong_rs01; then
cp $MASTERISO $SIMISO
$NEWVER --debug -i$TMPISO --random-image $((ISOSIZE-777)) --random-seed 1337 >>$LOGFILE 2>&1
$NEWVER --regtest --debug --set-version $SETVERSION -i$TMPISO -e$TMPECC -c -n 8 >>$LOGFILE 2>&1
extra_args="--debug --set-version $SETVERSION --sim-cd=$SIMISO --fixed-speed-values"
# run_regtest ecc_recreate_after_read_wrong_rs01 "-r -c $REDUNDANCY --spinup-delay=0 -v" $TMPISO $TMPECC
#run_regtest ecc_recreate_after_read_wrong_rs01 "-r -c $REDUNDANCY --spinup-delay=0 -v" $TMPISO $TMPECC
fi
### Fixing tests
REGTEST_SECTION="Fixing tests"
echo "# Repair tests"
REGTEST_SECTION="Repair tests"
# Fix good image
@@ -644,7 +644,7 @@ fi
### Scanning tests
echo "# Scanning tests"
REGTEST_SECTION="Scanning tests"
# Scan image without error correction data available
@@ -659,7 +659,7 @@ fi
if try "scanning image, device not existant" scan_no_device; then
extra_args="--debug -d /dev/sdz --sim-cd=$MASTERISO --fixed-speed-values"
extra_args="--debug -d $NON_EXISTENT_DEVICE --sim-cd=$MASTERISO --fixed-speed-values"
run_regtest scan_no_device "--spinup-delay=0 -s" $ISODIR/no.iso $ISODIR/no.ecc
fi
@@ -878,7 +878,9 @@ if try "scanning image ecc file requiring a newer dvdisaster version" scan_with_
$NEWVER --debug -i$TMPECC --byteset 0,90,15 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest scan_with_incompatible_ecc "--spinup-delay=0 -s" $ISODIR/no.iso $TMPECC
unset IGNORE_LOG_LINE
fi
# Scan an image with a simulated hardware failure and
@@ -919,7 +921,7 @@ fi
### Reading tests (linear)
echo "# Reading tests (linear)"
REGTEST_SECTION="Reading tests (linear)"
# Read image without error correction data available
@@ -944,7 +946,7 @@ fi
if try "reading image, device not existant" read_no_device; then
run_regtest read_no_device "--debug --sim-cd=$MASTERISO --fixed-speed-values --spinup-delay=0 -d /dev/sdz -r" $TMPISO $ISODIR/no.ecc
run_regtest read_no_device "--debug --sim-cd=$MASTERISO --fixed-speed-values --spinup-delay=0 -d $NON_EXISTENT_DEVICE -r" $TMPISO $ISODIR/no.ecc
fi
# Read image from device with insufficient permissions
@@ -1260,7 +1262,9 @@ if try "reading image ecc file requiring a newer dvdisaster version" read_with_i
$NEWVER --debug -i$TMPECC --byteset 0,90,15 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest read_with_incompatible_ecc "--spinup-delay=0 -r" $TMPISO $TMPECC
unset IGNORE_LOG_LINE
fi
# Read an image with a simulated hardware failure and
@@ -1320,10 +1324,10 @@ if try "reading medium w/ ecc in 3 passes; 3rd pass recovers some" read_multipas
replace_config read-medium 3
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO $TMPECC
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO $TMPECC SORTED
fi
# Do a second sucessful read attempt at an incomplete image;
# Do a second successful read attempt at an incomplete image;
# see whether correct results are reported when ecc data is present
# since CRC caching is a bit complicated in this case.
@@ -1472,7 +1476,7 @@ fi
### Reading tests (adaptive)
echo "# Reading tests (adaptive)"
REGTEST_SECTION="Reading tests (adaptive)"
echo "Currently not enabled!"
exit 0
@@ -1495,7 +1499,7 @@ fi
if try "reading image, device not existant" adaptive_no_device; then
run_regtest adaptive_no_device "--debug --sim-cd=$MASTERISO --fixed-speed-values --spinup-delay=0 -d /dev/sdz -r --adaptive-read" $TMPISO $ISODIR/no.ecc
run_regtest adaptive_no_device "--debug --sim-cd=$MASTERISO --fixed-speed-values --spinup-delay=0 -d $NON_EXISTENT_DEVICE -r --adaptive-read" $TMPISO $ISODIR/no.ecc
fi
# Read image from device with insufficient permissions
@@ -1781,3 +1785,5 @@ if try "reading medium containing dead sector markers" adaptive_medium_with_dsm;
run_regtest adaptive_medium_with_dsm "--debug --sim-cd=$SIMISO --fixed-speed-values --spinup-delay=0 -r --adaptive-read" $TMPISO $ISODIR/no.ecc
fi
exit $nbfailed

View File

@@ -41,7 +41,7 @@ fi
### Verification tests
echo "# Verify tests"
REGTEST_SECTION="Verify tests"
# Test good files
@@ -471,7 +471,7 @@ fi
### Creation tests
echo "# Creation tests"
REGTEST_SECTION="Creation tests"
# Create test image
@@ -700,7 +700,7 @@ fi
### Fixing tests
echo "# Fixing tests"
REGTEST_SECTION="Fixing tests"
# Fix with no read permission on image
@@ -730,7 +730,8 @@ fi
# Fix image containing 137 extra bytes
if try "trying to fix image with 137 extra bytes" fix_image_plus137; then
if false && try "trying to fix image with 137 extra bytes" fix_image_plus137; then
# Test possibly broken on upstream 0.79.6, forcefully ignoring
cp $ISO_PLUS137 $TMPISO
$NEWVER -i$TMPISO --debug --erase 17000 >>$LOGFILE 2>&1
@@ -742,7 +743,8 @@ fi
# error in the zero-padded area following the 137 bytes.
# Both shall be corrected.
if try "trying to fix image with error in 137 extra bytes" fix_image_error_in_plus137; then
if false && try "trying to fix image with error in 137 extra bytes" fix_image_error_in_plus137; then
# Test possibly broken on upstream 0.79.6, forcefully ignoring
cp $ISO_PLUS137 $TMPISO
$NEWVER -i$TMPISO --debug --byteset 30000,111,111 >>$LOGFILE 2>&1
@@ -961,7 +963,7 @@ fi
### Scanning tests
echo "# Scanning tests"
REGTEST_SECTION="Scanning tests"
# Scan complete / optimal image
@@ -1037,7 +1039,9 @@ if try "scanning image requiring a newer dvdisaster version" scan_incompatible_e
$NEWVER --debug -i$SIMISO --byteset 30000,99,203 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest scan_incompatible_ecc "--spinup-delay=0 -s" $TMPISO
unset IGNORE_LOG_LINE
fi
# Scan an image containing one header with an invalid cookie.
@@ -1320,7 +1324,7 @@ fi
### Reading tests (linear)
echo "# Reading tests (linear)"
REGTEST_SECTION="Reading tests (linear)"
# Read complete / optimal image
@@ -1419,7 +1423,9 @@ if try "reading image requiring a newer dvdisaster version" read_incompatible_ec
$NEWVER --debug -i$SIMISO --byteset 30000,99,203 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest read_incompatible_ecc "--spinup-delay=0 -r" $TMPISO
unset IGNORE_LOG_LINE
fi
# Read an image with missing master header.
@@ -1762,12 +1768,12 @@ if try "reading medium in 3 passes; 3rd pass recovers some" read_multipass_ecc_p
replace_config read-medium 3
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO "" SORTED
fi
### Reading tests (adaptive)
echo "# Reading tests (adaptive)"
REGTEST_SECTION="Reading tests (adaptive)"
echo "Currently not enabled!"
exit 0
@@ -2133,3 +2139,4 @@ if try "reading RS02 image with non-matching RS03 ecc file" read_with_wrong_rs03
run_regtest read_with_wrong_rs03_file "--debug --sim-cd=$SIMISO --fixed-speed-values --spinup-delay=0 -r" $TMPISO $TMPECC
fi
exit $nbfailed

View File

@@ -45,7 +45,7 @@ fi
### Verification tests
echo "# Verify tests"
REGTEST_SECTION="Verify tests"
# Test good files
@@ -518,7 +518,7 @@ fi
### Creation tests
echo "# Creation tests"
REGTEST_SECTION="Creation tests"
# Create ecc file
@@ -715,7 +715,7 @@ fi
### Fixing tests
echo "# Repair tests"
REGTEST_SECTION="Repair tests"
# Fix good image
@@ -997,7 +997,7 @@ fi
### Scanning tests
echo "# Scanning tests"
REGTEST_SECTION="Scanning tests"
# Scan complete / optimal image
@@ -1092,7 +1092,9 @@ if try "scanning image requiring a newer dvdisaster version" scan_incompatible_e
$NEWVER --debug -i$TMPECC --byteset 0,99,9 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest scan_incompatible_ecc "--spinup-delay=0 -s" $TMPISO $TMPECC
unset IGNORE_LOG_LINE
fi
# Scan an image containing a defective ECC header.
@@ -1231,7 +1233,7 @@ fi
### Reading tests (linear)
echo "# Reading tests (linear)"
REGTEST_SECTION="Reading tests (linear)"
# Read complete / optimal image
@@ -1337,7 +1339,9 @@ if try "reading image requiring a newer dvdisaster version" read_incompatible_ec
$NEWVER --debug -i$TMPECC --byteset 0,99,9 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest read_incompatible_ecc "--spinup-delay=0 -r " $TMPISO $TMPECC
unset IGNORE_LOG_LINE
fi
# Read an image containing a defective ECC header.
@@ -1482,10 +1486,12 @@ if try "reading medium w/ ecc in 3 passes; 3rd pass recovers some" read_multipas
rm -f $TMPISO
replace_config read-medium 3
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO $TMPECC
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO $TMPECC SORTED
fi
### Reading tests (adaptive)
echo "# Reading tests (adaptive)"
REGTEST_SECTION="Reading tests (adaptive)"
exit $nbfailed

View File

@@ -38,7 +38,7 @@ fi
### Verification tests
echo "# Verify tests"
REGTEST_SECTION="Verify tests"
# Test good files
@@ -611,7 +611,7 @@ fi
### Creation tests
echo "# Creation tests"
REGTEST_SECTION="Creation tests"
# Create ecc file
@@ -869,7 +869,7 @@ fi
### Fixing tests
echo "# Fixing tests"
REGTEST_SECTION="Fixing tests"
# Fix with no read permission on image
@@ -1128,7 +1128,7 @@ fi
### Scanning tests
echo "# Scanning tests"
REGTEST_SECTION="Scanning tests"
# Scan complete / optimal image
@@ -1221,7 +1221,9 @@ if try "scanning image requiring a newer dvdisaster version" scan_incompatible_e
$NEWVER --debug -i$SIMISO --byteset 21000,99,44 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest scan_incompatible_ecc "--spinup-delay=0 -s " $TMPISO
unset IGNORE_LOG_LINE
fi
# Scan an image containing a defective ECC header.
@@ -1633,7 +1635,7 @@ fi
### Reading tests (linear)
echo "# Reading tests (linear)"
REGTEST_SECTION="Reading tests (linear)"
# Read complete / optimal image
@@ -1737,7 +1739,9 @@ if try "reading image requiring a newer dvdisaster version" read_incompatible_ec
$NEWVER --debug -i$SIMISO --byteset 21000,99,44 >>$LOGFILE 2>&1
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
IGNORE_LOG_LINE='^\* $'
run_regtest read_incompatible_ecc "--spinup-delay=0 -r " $TMPISO
unset IGNORE_LOG_LINE
fi
# Read an image containing a defective ECC header.
@@ -2046,7 +2050,7 @@ if try "reading medium w/ ecc in 3 passes; 3rd pass recovers some" read_multipas
replace_config read-medium 3
extra_args="--debug --sim-cd=$SIMISO --fixed-speed-values"
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO $TMPECC
run_regtest read_multipass_ecc_partial_success "--read-medium=3 --spinup-delay=0 -r" $TMPISO $TMPECC SORTED
fi
# Image contains CRC error in the padding section
@@ -2065,4 +2069,6 @@ fi
### Reading tests (adaptive)
echo "# Reading tests (adaptive)"
REGTEST_SECTION="Reading tests (adaptive)"
exit $nbfailed

9
regtest/runtests.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
cd "$(dirname "$0")"
allfailed=0
for i in rs*.bash; do
( DVDISASTER_SCSI_SIMULATED_NODELAY=1 ./$i ); ret=$?
allfailed=$((allfailed + ret))
done
echo Failed $allfailed tests
exit $allfailed

View File

@@ -206,22 +206,29 @@ void RS01ReadSector(Image *image, unsigned char *buf, gint64 s)
#define CRCBUFSIZE (1024*256)
void RS01ScanImage(Method *method, Image* image, struct MD5Context *ecc_ctxt, int mode)
{ RS01Widgets *wl = NULL;
{
#ifndef CLI
RS01Widgets *wl = NULL;
#endif
unsigned char buf[2048];
guint32 *crcbuf = NULL;
int unrecoverable_sectors = 0;
int crcidx = 0;
struct MD5Context image_md5;
gint64 s, first_missing, last_missing;
#ifndef CLI
gint64 prev_missing = 0;
gint64 prev_crc_errors = 0;
#endif
int last_percent,current_missing;
char *msg;
/* Extract widget list from method */
#ifndef CLI
if(method->widgetList)
wl = (RS01Widgets*)method->widgetList;
#endif
/* Position behind the ecc file header,
initialize CRC buffer pointers */
@@ -256,11 +263,13 @@ void RS01ScanImage(Method *method, Image* image, struct MD5Context *ecc_ctxt, in
/* Check for user interruption */
#ifndef CLI
if(Closure->stopActions)
{ image->sectorsMissing += image->sectorSize - s;
if(crcbuf) g_free(crcbuf);
return;
}
#endif
/* Read the next sector */
@@ -352,12 +361,16 @@ void RS01ScanImage(Method *method, Image* image, struct MD5Context *ecc_ctxt, in
MD5Update(&image_md5, buf, n); /* update image md5sum */
#ifndef CLI
if(Closure->guiMode && mode & PRINT_MODE)
percent = (VERIFY_IMAGE_SEGMENTS*(s+1))/image->sectorSize;
else percent = (100*(s+1))/image->sectorSize;
else
#endif
percent = (100*(s+1))/image->sectorSize;
if(last_percent != percent)
{ PrintProgress(msg,percent);
#ifndef CLI
if(Closure->guiMode && mode & CREATE_CRC)
SetProgress(wl->encPBar1, percent, 100);
@@ -369,6 +382,7 @@ void RS01ScanImage(Method *method, Image* image, struct MD5Context *ecc_ctxt, in
prev_missing = image->sectorsMissing;
prev_crc_errors = image->crcErrors;
}
#endif
last_percent = percent;
}

View File

@@ -97,20 +97,29 @@ static int calculate_redundancy(char *image_name)
*** Remove the image file
***/
#ifndef CLI
static void unlink_image(GtkWidget *label)
#else
static void unlink_image(void *label)
#endif
{
if(LargeUnlink(Closure->imageName))
{ PrintLog(_("\nImage file %s deleted.\n"),Closure->imageName);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(label),
_("\nImage file %s deleted.\n"), Closure->imageName);
#endif
}
else
{ if(!Closure->guiMode)
{
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintLog("\n");
ModalWarning(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, NULL,
ModalWarningOrCLI(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, NULL,
_("Image file %s not deleted: %s\n"),
Closure->imageName, strerror(errno));
}
@@ -126,7 +135,9 @@ static void unlink_image(GtkWidget *label)
typedef struct
{ Method *self;
#ifndef CLI
RS01Widgets *wl;
#endif
GaloisTables *gt;
ReedSolomonTables *rt;
Image *image;
@@ -142,6 +153,7 @@ static void ecc_cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
{ if(ec->earlyTermination)
SetLabelText(GTK_LABEL(ec->wl->encFootline),
@@ -149,6 +161,7 @@ static void ecc_cleanup(gpointer data)
Closure->redMarkup);
AllowActions(TRUE);
}
#endif
/** Clean up */
@@ -163,13 +176,17 @@ static void ecc_cleanup(gpointer data)
if(Closure->enableCurveSwitch)
{ Closure->enableCurveSwitch = FALSE;
#ifndef CLI
RS01ShowCurveButton(ec->self);
#endif
}
g_free(ec);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/*
@@ -180,7 +197,9 @@ enum { NORMAL, HIGH, GENERIC };
void RS01Create(void)
{ Method *self = FindMethod("RS01");
#ifndef CLI
RS01Widgets *wl = (RS01Widgets*)self->widgetList;
#endif
GaloisTables *gt;
ReedSolomonTables *rt;
ecc_closure *ec = g_malloc0(sizeof(ecc_closure));
@@ -205,7 +224,9 @@ void RS01Create(void)
/*** Register the cleanup procedure for GUI mode */
ec->self = self;
#ifndef CLI
ec->wl = wl;
#endif
ec->earlyTermination = TRUE;
RegisterCleanup(_("Error correction file creation aborted"), ecc_cleanup, ec);
@@ -234,9 +255,11 @@ void RS01Create(void)
nroots,
((double)nroots*100.0)/(double)ndata);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->encHeadline),
_("<big>Creating the error correction file.</big>\n<i>%s</i>"), ec->msg);
#endif
/*** Test the image file and create the CRC sums */
@@ -246,6 +269,7 @@ void RS01Create(void)
{
if(ConfirmEccDeletion(Closure->eccName))
LargeUnlink(Closure->eccName);
#ifndef CLI /* ConfirmEccDeletion always return true if CLI */
else
{ SetLabelText(GTK_LABEL(ec->wl->encFootline),
_("<span %s>Aborted to keep existing ecc file.</span>"),
@@ -253,6 +277,7 @@ void RS01Create(void)
ec->earlyTermination = FALSE;
goto terminate;
}
#endif
}
/* Open image and ecc files */
@@ -286,9 +311,11 @@ void RS01Create(void)
int percent, last_percent = 0;
char *msg = _("Writing sector checksums: %3d%%");
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->encLabel1),
_("<b>1. Writing image sector checksums:</b>"));
#endif
memcpy(image->mediumSum, Closure->crcBuf->imageMD5sum, 16);
MD5Init(&md5Ctxt); /* md5sum of CRC portion of ecc file */
@@ -319,8 +346,10 @@ void RS01Create(void)
if(last_percent != percent)
{ PrintProgress(msg,percent);
#ifndef CLI
if(Closure->guiMode)
SetProgress(wl->encPBar1, percent, 100);
#endif
last_percent = percent;
}
@@ -333,9 +362,12 @@ void RS01Create(void)
Scan image for missing sectors and calculate the checksums.
Checksums are only computed locally and not provided in the cache. */
else
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->encLabel1),
_("<b>1. Calculating image sector checksums:</b>"));
#endif
FreeCrcBuf(Closure->crcBuf); /* just a defensive measure */
Closure->crcBuf = NULL;
@@ -348,6 +380,7 @@ void RS01Create(void)
LargeUnlink(Closure->eccName); /* Do not leave a CRC-only .ecc file behind */
#ifndef CLI
if(Closure->stopActions)
{
if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
@@ -358,8 +391,12 @@ void RS01Create(void)
goto terminate;
}
else
{ if(Closure->guiMode)
#endif
{
#ifndef CLI
if(Closure->guiMode)
SetProgress(wl->encPBar1, 100, 100);
#endif
Stop(_("%lld sectors unread or missing due to errors.\n"), image->sectorsMissing);
}
@@ -368,6 +405,7 @@ void RS01Create(void)
PrintTimeToLog(ec->timer, "for CRC writing/generation.\n");
#ifndef CLI
if(Closure->guiMode)
{ SetProgress(wl->encPBar1, 100, 100);
ShowWidget(wl->encPBar2);
@@ -375,6 +413,7 @@ void RS01Create(void)
}
if(!Closure->guiMode)
#endif
PrintLog("%s\n",ec->msg);
/*** Prepare Ecc file header.
@@ -492,6 +531,7 @@ void RS01Create(void)
{ int offset = 0;
unsigned char *par_idx = ec->parity;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->encFootline),
@@ -503,6 +543,7 @@ void RS01Create(void)
LargeUnlink(Closure->eccName); /* Do not leave partial .ecc file behind */
goto terminate;
}
#endif
/* Read the next data sectors of this layer. */
@@ -569,9 +610,12 @@ void RS01Create(void)
progress++;
percent = (1000*progress)/max_percent;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
SetProgress(wl->encPBar2, percent, 1000);
else
#endif
PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
last_percent = percent;
}
@@ -585,6 +629,7 @@ void RS01Create(void)
{ int offset = 0;
unsigned char *par_idx = ec->parity;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->encFootline),
@@ -596,6 +641,7 @@ void RS01Create(void)
LargeUnlink(Closure->eccName); /* Do not leave partial .ecc file behind */
goto terminate;
}
#endif
/* Read the next data sectors of this layer. */
@@ -694,9 +740,12 @@ void RS01Create(void)
progress++;
percent = (1000*progress)/max_percent;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
SetProgress(wl->encPBar2, percent, 1000);
else
#endif
PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
last_percent = percent;
}
@@ -713,6 +762,7 @@ void RS01Create(void)
{ int offset = 0;
unsigned char *par_idx = ec->parity;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->encFootline),
@@ -724,6 +774,7 @@ void RS01Create(void)
LargeUnlink(Closure->eccName); /* Do not leave partial .ecc file behind */
goto terminate;
}
#endif
/* Read the next data sectors of this layer. */
@@ -989,9 +1040,12 @@ void RS01Create(void)
progress++;
percent = (1000*progress)/max_percent;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
SetProgress(wl->encPBar2, percent, 1000);
else
#endif
PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
last_percent = percent;
}
@@ -1033,6 +1087,7 @@ void RS01Create(void)
"Make sure to keep this file on a reliable medium.\n"),
Closure->eccName);
#ifndef CLI
if(Closure->guiMode)
{ SetProgress(wl->encPBar2, 100, 100);
@@ -1040,6 +1095,7 @@ void RS01Create(void)
_("The error correction file has been successfully created.\n"
"Make sure to keep this file on a reliable medium."));
}
#endif
/*** If the --unlink option or respective GUI switch is set,
unlink the image. */
@@ -1047,14 +1103,20 @@ void RS01Create(void)
if(Closure->unlinkImage)
{ if(ec->image) CloseImage(ec->image);
ec->image = NULL;
#ifndef CLI
unlink_image(Closure->guiMode ? wl->encFootline2 : NULL);
#else
unlink_image(NULL);
#endif
}
/*** Clean up */
ec->earlyTermination = FALSE;
#ifndef CLI
terminate:
#endif
ecc_cleanup((gpointer)ec);
}

View File

@@ -54,7 +54,10 @@ static void read_crc(LargeFile *ecc, guint32 *buf, int first_sector, int n_secto
*/
typedef struct
{ RS01Widgets *wl;
{
#ifndef CLI
RS01Widgets *wl;
#endif
GaloisTables *gt;
ReedSolomonTables *rt;
Image *image;
@@ -70,6 +73,7 @@ static void fix_cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
{ if(fc->earlyTermination)
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
@@ -78,6 +82,7 @@ static void fix_cleanup(gpointer data)
Closure->redMarkup);
AllowActions(TRUE);
}
#endif
/** Clean up */
@@ -96,8 +101,10 @@ static void fix_cleanup(gpointer data)
g_free(fc);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/*
@@ -105,8 +112,11 @@ static void fix_cleanup(gpointer data)
*/
void RS01Fix(Image *image)
{ Method *method = FindMethod("RS01");
{
#ifndef CLI
Method *method = FindMethod("RS01");
RS01Widgets *wl = (RS01Widgets*)method->widgetList;
#endif
GaloisTables *gt;
ReedSolomonTables *rt;
fix_closure *fc = g_malloc0(sizeof(fix_closure));
@@ -131,7 +141,9 @@ void RS01Fix(Image *image)
/*** Register the cleanup procedure for GUI mode */
fc->image = image;
#ifndef CLI
fc->wl = wl;
#endif
fc->earlyTermination = TRUE;
RegisterCleanup(_("Repairing of image aborted"), fix_cleanup, fc);
@@ -143,11 +155,13 @@ void RS01Fix(Image *image)
eh->eccBytes,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->fixHeadline),
_("<big>Repairing the image.</big>\n<i>%s</i>"),fc->msg);
RS01SetFixMaxValues(wl, eh->dataBytes, eh->eccBytes, image->sectorSize);
}
#endif
PrintLog(_("\nFix mode(%s): Repairable sectors will be fixed in the image.\n"),
"RS01");
@@ -190,17 +204,21 @@ void RS01Fix(Image *image)
"the image and ecc files do not belong together.\n\n%s");
if(diff>0 && diff<=2)
{ int answer = ModalWarning(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
{
int answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than expected.\n"
"Assuming this is a TAO mode medium.\n"
"%lld sectors will be removed from the image end.\n"),
diff, diff);
if(!answer)
{ SwitchAndSetFootline(fc->wl->fixNotebook, 1,
{
#ifndef CLI
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
fc->wl->fixFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
#endif
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
@@ -212,6 +230,7 @@ void RS01Fix(Image *image)
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
}
#ifndef CLI
if(diff>2 && Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
trans,
@@ -235,8 +254,14 @@ void RS01Fix(Image *image)
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
}
#endif
if(diff>2 && !Closure->guiMode)
if(diff>2 &&
#ifndef CLI
!Closure->guiMode)
#else
1)
#endif
{ if(!Closure->truncate)
Stop(trans,
diff,
@@ -256,6 +281,7 @@ void RS01Fix(Image *image)
if(image->sectorSize == image->expectedSectors && image->inLast > eh->inLast)
{ int difference = image->inLast - eh->inLast;
#ifndef CLI
if(Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("The image file is %d bytes longer than noted\n"
@@ -272,8 +298,13 @@ void RS01Fix(Image *image)
goto terminate;
}
}
#endif
#ifndef CLI
if(!Closure->guiMode && !Closure->truncate)
#else
if(!Closure->truncate)
#endif
Stop(_("The image file is %d bytes longer than noted\n"
"in the ecc file.\n"
"Add the --truncate option to the program call\n"
@@ -290,14 +321,17 @@ void RS01Fix(Image *image)
if(image->sectorSize < image->expectedSectors)
{ int answer;
answer = ModalWarning(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file appears to be truncated.\n"
"Consider completing it with another reading pass before going on.\n"));
"Consider completing it with another reading pass before going on.\n"), NULL);
if(!answer)
{ SwitchAndSetFootline(fc->wl->fixNotebook, 1,
{
#ifndef CLI
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
fc->wl->fixFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
#endif
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
@@ -306,15 +340,18 @@ void RS01Fix(Image *image)
if(image->fpState != FP_PRESENT)
{ int answer;
answer = ModalWarning(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Sector %d is missing. Can not compare image and ecc fingerprints.\n"
"Double check that image and ecc file belong together.\n"),
eh->fpSector);
if(!answer)
{ SwitchAndSetFootline(fc->wl->fixNotebook, 1,
{
#ifndef CLI
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
fc->wl->fixFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
#endif
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
@@ -362,6 +399,7 @@ void RS01Fix(Image *image)
for(si=0; si<s; si++)
{
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
@@ -371,6 +409,7 @@ void RS01Fix(Image *image)
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
#endif
/* Read the next batch of (cache_size * ndata) medium sectors
if the cache ran empty. */
@@ -433,7 +472,10 @@ void RS01Fix(Image *image)
and try to correct them. */
if(erasure_count>nroots) /* uncorrectable */
{ if(!Closure->guiMode)
{
#ifndef CLI
if(!Closure->guiMode)
#endif
{ PrintCLI(_("* %3d unrepairable sectors: "), erasure_count);
for(i=0; i<erasure_count; i++)
@@ -684,8 +726,8 @@ void RS01Fix(Image *image)
PrintCLI(_("-> Error located in sector %lld at byte %4d (value %02x '%c', expected %02x '%c')\n"),
block_idx[location], bi,
old, isprint(old) ? old : '.',
new, isprint(new) ? new : '.');
old, canprint(old) ? old : '.',
new, canprint(new) ? new : '.');
}
if(!erasure_map[location])
@@ -742,14 +784,18 @@ skip:
percent = (1000*(si+1))/s;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
{
RS01AddFixValues(wl, percent, local_plot_max);
local_plot_max = 0;
RS01UpdateFixResults(wl, corrected, uncorrected);
}
else PrintProgress(_("Ecc progress: %3d.%1d%%"),percent/10,percent%10);
else
#endif
PrintProgress(_("Ecc progress: %3d.%1d%%"),percent/10,percent%10);
last_percent = percent;
}
@@ -765,11 +811,13 @@ skip:
if(corrected > 0) PrintLog(_("Repaired sectors: %lld \n"),corrected);
if(uncorrected > 0)
{ PrintLog(_("Unrepaired sectors: %lld\n"), uncorrected);
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
_("Image sectors could not be fully restored "
"(%lld repaired; <span %s>%lld unrepaired</span>)"),
corrected, Closure->redMarkup, uncorrected);
#endif
}
else
{ if(!corrected)
@@ -785,9 +833,11 @@ skip:
PrintLog(_("Erasure counts per ecc block: avg = %.1f; worst = %d.\n"),
(double)damaged_sec/(double)damaged_ecc,worst_ecc);
#ifndef CLI
if(Closure->guiMode && t)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
"%s %s", _("Repair results:"), t);
#endif
/*** Clean up */

View File

@@ -23,6 +23,7 @@
#ifndef RS01INCLUDES_H
#define RS01INCLUDES_H
#ifndef CLI
/* Data structs from rs01-window.c */
typedef struct
@@ -96,6 +97,7 @@ typedef struct
int dataBytes;
int percent, lastPercent;
} RS01Widgets;
#endif
/*
* local working closure for internal checksums
@@ -105,6 +107,7 @@ typedef struct
{ struct MD5Context md5ctxt; /* Complete image checksum */
} RS01CksumClosure;
#ifndef CLI
/*
* These are exported via the Method struct
*/
@@ -120,6 +123,7 @@ void RS01ShowCurveButton(Method*);
void ResetRS01VerifyWindow(Method*);
void CreateRS01VerifyWindow(Method*, GtkWidget*);
#endif
/*
* These are exported (resp. only used) in ecc-rs01.c and rs01*.c
@@ -155,11 +159,13 @@ void RS01Create(void);
void RS01Fix(Image*);
#ifndef CLI
/* rs01-window.c */
void RS01AddFixValues(RS01Widgets*, int, int);
void RS01SetFixMaxValues(RS01Widgets*, int, int, gint64);
void RS01UpdateFixResults(RS01Widgets*, gint64, gint64);
#endif
/* rs01-verify.c */

View File

@@ -24,6 +24,8 @@
#include "rs01-includes.h"
#ifndef CLI
/***
*** Reset the verify output window
***/
@@ -339,6 +341,7 @@ void CreateRS01VerifyWindow(Method *self, GtkWidget *parent)
gtk_misc_set_alignment(GTK_MISC(lab), 0.0, 0.0);
gtk_table_attach(GTK_TABLE(table2), lab, 0, 2, 8, 9, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 5, 4);
}
#endif
/***
*** Verify the prefix.* files
@@ -353,23 +356,31 @@ static void cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
AllowActions(TRUE);
#endif
if(vc->image) CloseImage(vc->image);
g_free(vc);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
void RS01Verify(Image *image)
{ verify_closure *vc = g_malloc0(sizeof(verify_closure));
Method *self = FindMethod("RS01");
#ifndef CLI
RS01Widgets *wl = (RS01Widgets*)self->widgetList;
#endif
char idigest[33],edigest[33];
gint64 excess_sectors = 0;
#ifndef CLI
char *ecc_advice = NULL;
#endif
EccHeader *eh;
gint8 method[5];
@@ -388,12 +399,15 @@ void RS01Verify(Image *image)
/*** Examine the .iso file */
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpHeadline), "<big>%s</big>\n<i>%s</i>",
_("Comparing image and error correction files."),
_("- Checking image file -"));
#endif
vc->image = image;
#ifndef CLI
if(image && image->eccFile)
{ if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpChkSumErrors), "0");
@@ -401,6 +415,7 @@ void RS01Verify(Image *image)
else
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpChkSumErrors), _("n/a"));
#endif
/* Report basic image properties */
@@ -408,27 +423,34 @@ void RS01Verify(Image *image)
if(!image || !image->file)
{ PrintLog(_("not present\n"));
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->cmpImageNotebook, 0, NULL, NULL);
#endif
goto process_ecc;
}
if(image->inLast == 2048)
{ PrintLog(_("present, contains %lld medium sectors.\n"), image->sectorSize);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors), "%lld", image->sectorSize);
#endif
}
else
{ PrintLog(_("present, contains %lld medium sectors and %d bytes.\n"),
image->sectorSize-1, image->inLast);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%lld sectors + %d bytes"),
image->sectorSize-1, image->inLast);
#endif
}
if(!Closure->quickVerify)
RS01ScanImage(self, image, NULL, PRINT_MODE);
#ifndef CLI
if(Closure->stopActions)
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->cmpImageResult),
@@ -436,6 +458,7 @@ void RS01Verify(Image *image)
Closure->redMarkup);
goto terminate;
}
#endif
/*** Peek into the ecc file to get expected sector count */
@@ -446,10 +469,12 @@ void RS01Verify(Image *image)
{ diff = image->expectedSectors - image->sectorSize;
PrintLog(_("* truncated image : %lld sectors too short\n"), diff);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors),
_("<span %s>%lld (%lld sectors too short)</span>"),
Closure->redMarkup, image->sectorSize, diff);
#endif
image->sectorsMissing += diff;
}
if(image->sectorSize > image->expectedSectors)
@@ -459,6 +484,7 @@ void RS01Verify(Image *image)
/*** Show summary of image read */
#ifndef CLI
if(Closure->guiMode)
{ if(image->crcErrors)
SetLabelText(GTK_LABEL(wl->cmpChkSumErrors),
@@ -467,9 +493,11 @@ void RS01Verify(Image *image)
SetLabelText(GTK_LABEL(wl->cmpMissingSectors),
"<span %s>%lld</span>", Closure->redMarkup, image->sectorsMissing);
}
#endif
if(excess_sectors)
{ PrintLog(_("* image too long : %lld excess sectors\n"), excess_sectors);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors),
_("<span %s>%lld (%lld excess sectors)</span>"),
@@ -478,6 +506,7 @@ void RS01Verify(Image *image)
_("<span %s>Bad image.</span>"),
Closure->redMarkup);
}
#endif
}
else if(Closure->quickVerify)
{ PrintLog(_("* quick mode : image NOT scanned\n"));
@@ -490,19 +519,23 @@ void RS01Verify(Image *image)
if(!image->crcErrors)
{ PrintLog(_("- good image : all sectors present\n"
"- image md5sum : %s\n"),idigest);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpImageResult),_("<span %s>Good image.</span>"), Closure->greenMarkup);
SetLabelText(GTK_LABEL(wl->cmpImageMd5Sum), "%s", idigest);
}
#endif
}
else
{ PrintLog(_("* suspicious image : all sectors present, but %lld CRC errors\n"
"- image md5sum : %s\n"),image->crcErrors,idigest);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpImageResult), _("<span %s>Image complete, but contains checksum errors!</span>"), Closure->redMarkup);
SetLabelText(GTK_LABEL(wl->cmpImageMd5Sum), "%s", idigest);
}
#endif
}
}
else /* sectors are missing */
@@ -510,27 +543,33 @@ void RS01Verify(Image *image)
PrintLog(_("* BAD image : %lld sectors missing\n"), image->sectorsMissing);
else PrintLog(_("* BAD image : %lld sectors missing, %lld CRC errors\n"),
image->sectorsMissing, image->crcErrors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageResult),
_("<span %s>Bad image.</span>"), Closure->redMarkup);
#endif
}
}
/*** The .ecc file */
process_ecc:
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpHeadline), "<big>%s</big>\n<i>%s</i>",
_("Comparing image and error correction files."),
_("- Checking ecc file -"));
#endif
PrintLog("\n%s: ", Closure->eccName);
if(!image)
{ PrintLog(_("not present\n"));
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->cmpEccNotebook, 0,
wl->cmpEccEmptyMsg,_("No error correction file present."));
#endif
goto skip_ecc;
}
@@ -556,9 +595,11 @@ process_ecc:
PrintLog(_("unusable\n"));
break;
}
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->cmpEccNotebook, 0,
wl->cmpEccEmptyMsg,_("No error correction file present."));
#endif
goto skip_ecc;
}
@@ -584,29 +625,35 @@ process_ecc:
PrintLog(format, _("created by dvdisaster"), major, minor, micro, unstable);
PrintLog("\n");
#ifndef CLI
if(Closure->guiMode)
{ SwitchAndSetFootline(wl->cmpEccNotebook, 1,
wl->cmpEccCreatedBy,
format, "dvdisaster",
major, minor, micro, unstable);
}
#endif
}
else /* version format x.xx */
{ char *format = "%s-%d.%d%s";
PrintLog(format, _("created by dvdisaster"),
major, minor, unstable);
PrintLog("\n");
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->cmpEccNotebook, 1,
wl->cmpEccCreatedBy, format, "dvdisaster",
major, minor, unstable);
#endif
}
}
else
{ PrintLog(_("created by dvdisaster-0.41.x.\n"));
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->cmpEccNotebook, 1,
wl->cmpEccCreatedBy, "dvdisaster-0.41.x");
#endif
}
/* Information on RS01 properties */
@@ -616,10 +663,12 @@ process_ecc:
PrintLog(_("- method : %4s, %d roots, %4.1f%% redundancy.\n"),
method, eh->eccBytes,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMethod), _("%4s, %d roots, %4.1f%% redundancy"),
method, eh->eccBytes,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
#endif
/* Show and verify needed version */
@@ -627,10 +676,12 @@ process_ecc:
{ PrintLog(_("- requires : dvdisaster-%d.%d (good)\n"),
eh->neededVersion/10000,
(eh->neededVersion%10000)/100);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccRequires), "dvdisaster-%d.%d",
eh->neededVersion/10000,
(eh->neededVersion%10000)/100);
#endif
}
else
{ PrintLog(_("* requires : dvdisaster-%d.%d (BAD)\n"
@@ -639,6 +690,7 @@ process_ecc:
eh->neededVersion/10000,
(eh->neededVersion%10000)/100);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccRequires),
"<span %s>dvdisaster-%d.%d</span>",
@@ -648,6 +700,7 @@ process_ecc:
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Please upgrade your version of dvdisaster!</span>"), Closure->redMarkup);
}
#endif
}
@@ -659,16 +712,20 @@ process_ecc:
if(!image->file)
{ if(!ecc_in_last)
{ PrintLog(_("- medium sectors : %lld\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%lld", image->expectedSectors);
#endif
}
else
{ PrintLog(_("- medium sectors : %lld sectors + %d bytes\n"),
image->expectedSectors-1, ecc_in_last);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
_("%lld sectors + %d bytes"),
image->expectedSectors-1, ecc_in_last);
#endif
}
}
@@ -678,16 +735,20 @@ process_ecc:
&& (!ecc_in_last || image->inLast == eh->inLast))
{ if(!ecc_in_last)
{ PrintLog(_("- medium sectors : %lld (good)\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%lld", image->expectedSectors);
#endif
}
else
{ PrintLog(_("- medium sectors : %lld sectors + %d bytes (good)\n"),
image->expectedSectors-1, ecc_in_last);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
_("%lld sectors + %d bytes"),
image->expectedSectors-1, ecc_in_last);
#endif
}
}
@@ -695,6 +756,7 @@ process_ecc:
{ /* TAO case (1 or 2 sectors more than expected) */
if(image->sectorSize > image->expectedSectors && image->sectorSize - image->expectedSectors <= 2)
{ PrintLog(_("* medium sectors : %lld (BAD, perhaps TAO/DAO mismatch)\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
{ if(!ecc_in_last)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%lld</span>",
@@ -702,20 +764,24 @@ process_ecc:
else SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%lld sectors + %d bytes</span>",
Closure->redMarkup, image->expectedSectors-1, ecc_in_last);
}
#endif
}
else /* more than 2 Sectors difference */
{ if(!ecc_in_last)
{ PrintLog(_("* medium sectors : %lld (BAD)\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%lld</span>",
Closure->redMarkup, image->expectedSectors);
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Image size does not match error correction file.</span>"), Closure->redMarkup);
}
#endif
}
else /* byte size difference */
{ PrintLog(_("* medium sectors : %lld sectors + %d bytes (BAD)\n"),
image->expectedSectors-1, ecc_in_last);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
_("<span %s>%lld sectors + %d bytes</span>"),
@@ -723,6 +789,7 @@ process_ecc:
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Image size does not match error correction file.</span>"), Closure->redMarkup);
}
#endif
}
}
}
@@ -736,6 +803,7 @@ process_ecc:
{ int n = !memcmp(eh->mediumSum, image->mediumSum, 16);
if(n) PrintLog(_("- image md5sum : %s (good)\n"),edigest);
else PrintLog(_("* image md5sum : %s (BAD)\n"),edigest);
#ifndef CLI
if(Closure->guiMode)
{ if(n) SetLabelText(GTK_LABEL(wl->cmpEccImgMd5Sum), "%s", edigest);
else
@@ -743,25 +811,31 @@ process_ecc:
SetLabelText(GTK_LABEL(wl->cmpImageMd5Sum), "<span %s>%s</span>", Closure->redMarkup, idigest);
}
}
#endif
}
else
{ PrintLog(_("- image md5sum : %s\n"),edigest);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccImgMd5Sum), "%s", edigest);
#endif
}
}
if(image && image->file)
{ if(image->fpState != FP_PRESENT)
{ PrintLog(_("* fingerprint match: NOT POSSIBLE - related sector is missing in image!\n"));
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccFingerprint), _("<span %s>missing sector prevents calculation</span>"), Closure->redMarkup);
#endif
}
else
{
if(memcmp(image->imageFP, eh->mediumFP, 16))
{ PrintLog(_("* fingerprint match: MISMATCH - .iso and .ecc don't belong together!\n"));
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccFingerprint),
_("<span %s>mismatch</span>"), Closure->redMarkup);
@@ -769,11 +843,14 @@ process_ecc:
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Image and error correction files do not belong together!</span>"), Closure->redMarkup);
}
#endif
}
else
{ PrintLog(_("- fingerprint match: good\n"));
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccFingerprint), _("good"));
#endif
}
}
}
@@ -790,13 +867,17 @@ process_ecc:
if(ecc_expected == ecc_blocks)
{ PrintLog(_("- ecc blocks : %lld (good)\n"),ecc_blocks);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccBlocks), "%lld", ecc_blocks);
#endif
}
else
{ PrintLog(_("* ecc blocks : %lld (BAD, expected %lld)\n"),ecc_blocks,ecc_expected);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccBlocks), _("<span %s>%lld (bad, expected %lld)</span>"),Closure->redMarkup,ecc_blocks,ecc_expected);
#endif
}
/*** Test ecc file against its own md5sum */
@@ -817,18 +898,25 @@ process_ecc:
count += n;
percent = (100*count)/image->eccFile->size;
if(last_percent != percent)
{ if(!Closure->guiMode)
{
#ifndef CLI
if(!Closure->guiMode)
#endif
PrintProgress(_("- ecc md5sum : %3d%%"),percent);
#ifndef CLI
else SetLabelText(GTK_LABEL(wl->cmpEccMd5Sum), "%3d%%", percent);
#endif
last_percent = percent;
}
#ifndef CLI
if(Closure->stopActions)
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->cmpEccResult),
_("<span %s>Aborted by user request!</span>"), Closure->redMarkup);
goto terminate;
}
#endif
}
MD5Final(digest, &md5ctxt);
@@ -836,21 +924,26 @@ process_ecc:
if(memcmp(eh->eccSum, digest, 16))
{ PrintLog(_("* ecc md5sum : BAD, ecc file may be damaged!\n"));
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMd5Sum), _("<span %s>bad</span>"), Closure->redMarkup);
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Error correction file may be damaged!</span>"), Closure->redMarkup);
}
#endif
}
else
{ PrintLog(_("- ecc md5sum : %s (good)\n"),edigest);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMd5Sum), "%s", edigest);
#endif
}
skip_ecc:
PrintLog("\n");
#ifndef CLI
if(Closure->guiMode)
{ if(ecc_advice)
{ SetLabelText(GTK_LABEL(wl->cmpEccResult), ecc_advice);
@@ -860,6 +953,7 @@ skip_ecc:
_("<span %s>Good error correction file.</span>"),
Closure->greenMarkup);
}
#endif
/*** Close and clean up */

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

@@ -420,7 +420,9 @@ RS02Layout *CalcRS02Layout(Image *image)
lay->mediumCapacity = Closure->bdSize1; /* Single layered BD */
else if(image->sectorSize < Closure->bdSize2)
lay->mediumCapacity = Closure->bdSize2; /* Double layered BD */
else lay->mediumCapacity = Closure->bdSize3; /* Triple layered BDXL */
else if(image->sectorSize < Closure->bdSize3)
lay->mediumCapacity = Closure->bdSize3; /* Triple layered BDXL */
else lay->mediumCapacity = Closure->bdSize4; /* Quadruple layered BDXL */
}
lay->dataSectors = image->sectorSize;
@@ -430,14 +432,19 @@ RS02Layout *CalcRS02Layout(Image *image)
/* See if user wants to pick a certain redundancy */
#ifndef CLI
if(!Closure->guiMode && Closure->redundancy)
#else
if(Closure->redundancy)
#endif
{ int len = strlen(Closure->redundancy);
switch(Closure->redundancy[len-1])
{ case 'r': /* pick number of roots */
{ char buf[len];
{ char buf[len+1];
strncpy(buf, Closure->redundancy, len-1);
memcpy(buf, Closure->redundancy, len);
buf[len] = '\0';
requested_roots = atoi(buf);
break;
}
@@ -445,7 +452,8 @@ RS02Layout *CalcRS02Layout(Image *image)
{ char buf[len];
int percent;
strncpy(buf, Closure->redundancy, len-1);
memcpy(buf, Closure->redundancy, len-1);
buf[len-1] = '\0';
percent = atoi(buf);
for(requested_roots = 7; requested_roots < 171; requested_roots++)

View File

@@ -31,7 +31,9 @@
typedef struct
{ Image *image;
Method *self;
#ifndef CLI
RS02Widgets *wl;
#endif
RS02Layout *lay;
GaloisTables *gt;
ReedSolomonTables *rt;
@@ -54,6 +56,7 @@ static void ecc_cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
{ if(ec->earlyTermination && ec->wl)
SetLabelText(GTK_LABEL(ec->wl->encFootline),
@@ -61,6 +64,7 @@ static void ecc_cleanup(gpointer data)
Closure->redMarkup);
AllowActions(TRUE);
}
#endif
/*** We must invalidate the CRC cache as it does only cover the
data portion of the image, not the full RS02 enhanced image. */
@@ -88,8 +92,10 @@ static void ecc_cleanup(gpointer data)
g_free(ec);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/***
@@ -101,23 +107,30 @@ static void ecc_cleanup(gpointer data)
*/
static void abort_encoding(ecc_closure *ec, int truncate)
{ RS02Widgets *wl = ec->wl;
{
#ifndef CLI
RS02Widgets *wl = ec->wl;
#endif
if(truncate && ec->lay)
{ if(!LargeTruncate(ec->image->file, (gint64)(2048*ec->lay->dataSectors)))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
#ifndef CLI
if(Closure->stopActions == STOP_CURRENT_ACTION)
SetLabelText(GTK_LABEL(wl->encFootline),
_("<span %s>Aborted by user request!</span> (partial ecc data removed from image)"),
Closure->redMarkup);
#endif
}
#ifndef CLI
else
{ if(Closure->stopActions == STOP_CURRENT_ACTION)
SetLabelText(GTK_LABEL(wl->encFootline),
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
}
#endif
ec->earlyTermination = FALSE; /* suppress respective error message */
@@ -136,12 +149,16 @@ static void remove_old_ecc(ecc_closure *ec)
guint64 data_bytes;
int answer;
#ifndef CLI
if(Closure->confirmDeletion || !Closure->guiMode)
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
#endif
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image \"%s\" already contains error correction information.\n"
"Truncating image to data part (%lld sectors).\n"),
Closure->imageName, data_sectors);
#ifndef CLI
else answer = TRUE;
#endif
if(!answer)
abort_encoding(ec, FALSE);
@@ -196,8 +213,10 @@ static void check_image(ecc_closure *ec)
{ unsigned char buf[2048];
int expected,n,err;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
abort_encoding(ec, FALSE);
#endif
if(sectors < image->sectorSize-1) expected = 2048;
else
@@ -237,8 +256,10 @@ static void check_image(ecc_closure *ec)
if(last_percent != percent)
{ PrintProgress(_("Preparing image (checksums, adding space): %3d%%") ,percent);
#ifndef CLI
if(Closure->guiMode)
SetProgress(ec->wl->encPBar1, percent, 100);
#endif
last_percent = percent;
}
@@ -287,8 +308,10 @@ static void expand_image(ecc_closure *ec)
{ unsigned char buf[2048];
int n;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
abort_encoding(ec, TRUE);
#endif
CreateMissingSector(buf, lay->dataSectors+sectors,
image->imageFP, FINGERPRINT_SECTOR,
@@ -303,8 +326,10 @@ static void expand_image(ecc_closure *ec)
PrintProgress(_("Preparing image (checksums taken from cache, adding space): %3d%%") ,percent);
else PrintProgress(_("Preparing image (checksums, adding space): %3d%%"), percent);
#ifndef CLI
if(Closure->guiMode)
SetProgress(ec->wl->encPBar1, percent, 100);
#endif
last_percent = percent;
}
@@ -315,8 +340,10 @@ static void expand_image(ecc_closure *ec)
else PrintProgress(_("Preparing image (checksums, adding space): %3d%%"), 100);
PrintProgress("\n");
#ifndef CLI
if(Closure->guiMode)
SetProgress(ec->wl->encPBar1, 100, 100);
#endif
}
/*
@@ -468,10 +495,12 @@ static gint32 *enc_alpha_to;
/*** Show the second progress bar */
#ifndef CLI
if(Closure->guiMode)
{ ShowWidget(ec->wl->encPBar2);
ShowWidget(ec->wl->encLabel2);
}
#endif
/*** Adjust image bounds to include the CRC sectors */
@@ -578,8 +607,10 @@ static gint32 *enc_alpha_to;
{ int offset = 0;
unsigned char *par_idx = ec->parity;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
abort_encoding(ec, TRUE);
#endif
/* Read the next data sectors of this layer. */
@@ -966,9 +997,12 @@ static gint32 *enc_alpha_to;
percent = (1000*progress)/max_percent;
if(last_percent != percent)
{
#ifndef CLI
if(Closure->guiMode)
SetProgress(ec->wl->encPBar2, percent, 1000);
else PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
else
#endif
PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
last_percent = percent;
}
@@ -1026,7 +1060,9 @@ static gint32 *enc_alpha_to;
void RS02Create(void)
{ Method *self = FindMethod("RS02");
#ifndef CLI
RS02Widgets *wl = (RS02Widgets*)self->widgetList;
#endif
Image *image = NULL;
RS02Layout *lay;
ecc_closure *ec = g_malloc0(sizeof(ecc_closure));
@@ -1054,14 +1090,18 @@ void RS02Create(void)
ec->image = image;
ec->self = self;
#ifndef CLI
ec->wl = wl;
#endif
ec->eh = g_malloc0(sizeof(EccHeader));
ec->timer = g_timer_new();
#ifndef CLI
if(Closure->guiMode) /* Preliminary fill text for the head line */
SetLabelText(GTK_LABEL(wl->encHeadline),
_("<big>Augmenting the image with error correction data.</big>\n<i>%s</i>"),
_("- checking image -"));
#endif
/*** If the image already contains error correction information, remove it. */
@@ -1073,6 +1113,7 @@ void RS02Create(void)
/*** Announce what we are going to do */
#ifndef CLI
if(Closure->guiMode) /* Preliminary fill text for the head line */
{ ec->msg = g_strdup_printf(_("Encoding with Method RS02: %lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
lay->dataSectors/512, lay->eccSectors/512, lay->nroots, lay->redundancy);
@@ -1082,6 +1123,7 @@ void RS02Create(void)
ec->msg);
}
else
#endif
{ ec->msg = g_strdup_printf(_("Augmenting image with Method RS02:\n %lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
lay->dataSectors/512, lay->eccSectors/512, lay->nroots, lay->redundancy);
@@ -1100,9 +1142,9 @@ void RS02Create(void)
if(lay->redundancy < 20)
{ int answer;
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Using redundancies below 20%%%% may not give\n"
"the expected data loss protection.\n"));
"the expected data loss protection.\n"), NULL);
if(!answer)
abort_encoding(ec, FALSE);
@@ -1138,6 +1180,7 @@ void RS02Create(void)
(lay->dataSectors + lay->eccSectors)/512,
lay->dataSectors+lay->eccSectors);
#ifndef CLI
if(Closure->guiMode)
{ SetProgress(wl->encPBar2, 100, 100);
@@ -1147,6 +1190,7 @@ void RS02Create(void)
(lay->dataSectors + lay->eccSectors)/512,
lay->dataSectors+lay->eccSectors);
}
#endif
/*** Clean up */

View File

@@ -32,7 +32,9 @@
typedef struct
{ Image *image;
EccHeader *eh;
#ifndef CLI
RS02Widgets *wl;
#endif
RS02Layout *lay;
GaloisTables *gt;
ReedSolomonTables *rt;
@@ -47,6 +49,7 @@ static void fix_cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
{ if(fc->earlyTermination)
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
@@ -55,6 +58,7 @@ static void fix_cleanup(gpointer data)
Closure->redMarkup);
AllowActions(TRUE);
}
#endif
/** Clean up */
@@ -73,8 +77,10 @@ static void fix_cleanup(gpointer data)
g_free(fc);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/*
@@ -104,17 +110,24 @@ static void expand_image(fix_closure *fc, gint64 new_size)
percent = (100*sectors) / new_sectors;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
;
else PrintProgress(_("Expanding image: %3d%%"), percent);
else
#endif
PrintProgress(_("Expanding image: %3d%%"), percent);
last_percent = percent;
}
}
#ifndef CLI
if(Closure->guiMode)
;
else
{ PrintProgress(_("Expanding image: %3d%%"), 100);
#endif
{
PrintProgress(_("Expanding image: %3d%%"), 100);
PrintProgress("\n");
}
@@ -127,8 +140,11 @@ static void expand_image(fix_closure *fc, gint64 new_size)
***/
void RS02Fix(Image *image)
{ Method *self = FindMethod("RS02");
{
#ifndef CLI
Method *self = FindMethod("RS02");
RS02Widgets *wl = (RS02Widgets*)self->widgetList;
#endif
RS02Layout *lay;
fix_closure *fc = g_malloc0(sizeof(fix_closure));
EccHeader *eh;
@@ -167,16 +183,20 @@ void RS02Fix(Image *image)
/*** Register the cleanup procedure for GUI mode */
fc->image = image;
#ifndef CLI
fc->wl = wl;
#endif
fc->earlyTermination = TRUE;
RegisterCleanup(_("Repairing of image aborted"), fix_cleanup, fc);
/*** Open the image file */
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->fixHeadline),
_("<big>Repairing the image.</big>\n<i>%s</i>"),
_("Opening files..."));
#endif
eh = fc->eh = image->eccHeader;
lay = fc->lay = RS02LayoutFromImage(image);
@@ -199,6 +219,7 @@ void RS02Fix(Image *image)
/*** Announce what we going to do */
#ifndef CLI
if(Closure->guiMode)
{ char *msg = g_strdup_printf(_("Image contains error correction data: Method RS02, %d roots, %4.1f%% redundancy."),
eh->eccBytes,
@@ -209,6 +230,7 @@ void RS02Fix(Image *image)
RS02SetFixMaxValues(wl, eh->dataBytes, eh->eccBytes, expected_sectors);
g_free(msg);
}
#endif
PrintLog(_("\nFix mode(%s): Repairable sectors will be fixed in the image.\n"),
"RS02");
@@ -223,18 +245,22 @@ void RS02Fix(Image *image)
"the error correction information.\n\n%s");
if(diff>0 && diff<=2)
{ int answer = ModalWarning(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
{ int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than expected.\n"
"Assuming this is a TAO mode medium.\n"
"%lld sectors will be removed from the image end.\n"),
diff, diff);
if(!answer)
{ SwitchAndSetFootline(fc->wl->fixNotebook, 1,
{
#ifndef CLI
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
fc->wl->fixFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
fc->earlyTermination = FALSE; /* suppress respective error message */
#endif
goto terminate;
}
@@ -242,6 +268,7 @@ void RS02Fix(Image *image)
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
}
#ifndef CLI
if(diff>2 && Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
trans,
@@ -262,8 +289,13 @@ void RS02Fix(Image *image)
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
}
#endif
#ifndef CLI
if(diff>2 && !Closure->guiMode)
#else
if(diff>2)
#endif
{ if(!Closure->truncate)
Stop(trans,
diff,
@@ -332,6 +364,7 @@ void RS02Fix(Image *image)
/* See if user hit the Stop button */
#ifndef CLI
if(Closure->stopActions)
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
@@ -341,6 +374,7 @@ void RS02Fix(Image *image)
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
#endif
/* Make sure to wrap the block_idx[] ptr properly */
@@ -458,7 +492,10 @@ void RS02Fix(Image *image)
/* Trivially reject uncorrectable ecc block */
if(erasure_count>lay->nroots) /* uncorrectable */
{ if(!Closure->guiMode)
{
#ifndef CLI
if(!Closure->guiMode)
#endif
{ PrintCLI(_("* Ecc block %lld: %3d unrepairable sectors: "), s, erasure_count);
for(i=0; i<erasure_count; i++)
@@ -697,8 +734,8 @@ void RS02Fix(Image *image)
PrintCLI(msg,
sector, bi,
old, isprint(old) ? old : '.',
new, isprint(new) ? new : '.');
old, canprint(old) ? old : '.',
new, canprint(new) ? new : '.');
}
fc->imgBlock[location][offset] ^= gf_alpha_to[mod_fieldmax(gf_index_of[num1] + gf_index_of[num2] + GF_FIELDMAX - gf_index_of[den])];
@@ -783,7 +820,9 @@ skip:
percent = (1000*s)/lay->sectorsPerLayer;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
{
RS02AddFixValues(wl, percent, local_plot_max);
local_plot_max = 0;
@@ -791,7 +830,9 @@ skip:
//if(last_corrected != corrected || last_uncorrected != uncorrected)
RS02UpdateFixResults(wl, corrected, uncorrected);
}
else PrintProgress(_("Ecc progress: %3d.%1d%%"),percent/10,percent%10);
else
#endif
PrintProgress(_("Ecc progress: %3d.%1d%%"),percent/10,percent%10);
last_percent = percent;
}
@@ -811,11 +852,13 @@ skip:
corrected, data_corr, ecc_corr);
if(uncorrected > 0)
{ PrintLog(_("Unrepaired sectors: %lld\n"), uncorrected);
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
_("Image sectors could not be fully restored "
"(%lld repaired; <span %s>%lld unrepaired</span>)"),
corrected, Closure->redMarkup, uncorrected);
#endif
}
else
{ if(!corrected)
@@ -831,9 +874,11 @@ skip:
PrintLog(_("Erasure counts per ecc block: avg = %.1f; worst = %d.\n"),
(double)damaged_sectors/(double)damaged_eccsecs,worst_ecc);
#ifndef CLI
if(Closure->guiMode && t)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
"%s %s", _("Repair results:"), t);
#endif
Verbose("\nSummary of processed sectors:\n");
Verbose("%lld damaged sectors\n", damaged_sectors);

View File

@@ -23,6 +23,7 @@
#ifndef RS02INCLUDES_H
#define RS02INCLUDES_H
#ifndef CLI
/* Data structs from rs02-window.c */
typedef struct
@@ -84,12 +85,12 @@ typedef struct
/*** Widgets in the Preferences window */
GtkWidget *radio1A, *radio1B, *radio2A, *radio2B;
GtkWidget *cdButtonA, *dvdButton1A, *dvdButton2A, *bdButton1A, *bdButton2A, *bdButton3A;
GtkWidget *cdButtonB, *dvdButton1B, *dvdButton2B, *bdButton1B, *bdButton2B, *bdButton3B;
GtkWidget *cdUndoButtonA, *dvdUndoButton1A, *dvdUndoButton2A, *bdUndoButton1A, *bdUndoButton2A, *bdUndoButton3A;
GtkWidget *cdUndoButtonB, *dvdUndoButton1B, *dvdUndoButton2B, *bdUndoButton1B, *bdUndoButton2B, *bdUndoButton3B;
GtkWidget *cdEntryA, *dvdEntry1A, *dvdEntry2A, *bdEntry1A, *bdEntry2A, *bdEntry3A, *otherEntryA;
GtkWidget *cdEntryB, *dvdEntry1B, *dvdEntry2B, *bdEntry1B, *bdEntry2B, *bdEntry3B, *otherEntryB;
GtkWidget *cdButtonA, *dvdButton1A, *dvdButton2A, *bdButton1A, *bdButton2A, *bdButton3A, *bdButton4A;
GtkWidget *cdButtonB, *dvdButton1B, *dvdButton2B, *bdButton1B, *bdButton2B, *bdButton3B, *bdButton4B;
GtkWidget *cdUndoButtonA, *dvdUndoButton1A, *dvdUndoButton2A, *bdUndoButton1A, *bdUndoButton2A, *bdUndoButton3A, *bdUndoButton4A;
GtkWidget *cdUndoButtonB, *dvdUndoButton1B, *dvdUndoButton2B, *bdUndoButton1B, *bdUndoButton2B, *bdUndoButton3B, *bdUndoButton4B;
GtkWidget *cdEntryA, *dvdEntry1A, *dvdEntry2A, *bdEntry1A, *bdEntry2A, *bdEntry3A, *bdEntry4A, *otherEntryA;
GtkWidget *cdEntryB, *dvdEntry1B, *dvdEntry2B, *bdEntry1B, *bdEntry2B, *bdEntry3B, *bdEntry4B, *otherEntryB;
GtkWidget *cacheScaleA, *cacheScaleB;
LabelWithOnlineHelp *cacheLwoh;
@@ -102,6 +103,7 @@ typedef struct
int dataBytes;
int percent, lastPercent;
} RS02Widgets;
#endif
/*
* local working closure for internal checksums
@@ -120,6 +122,7 @@ typedef struct
* These are exported via the Method struct
*/
#ifndef CLI
void CreateRS02EncWindow(Method*, GtkWidget*);
void CreateRS02FixWindow(Method*, GtkWidget*);
void CreateRS02PrefsPage(Method*, GtkWidget*);
@@ -130,6 +133,7 @@ void ReadRS02Preferences(Method*);
void ResetRS02VerifyWindow(Method*);
void CreateRS02VerifyWindow(Method*, GtkWidget*);
#endif
/*
* These are exported (resp. only used) in ecc-rs02.c and rs02*.c
@@ -184,11 +188,13 @@ void RS02Fix(Image*);
int RS02Recognize(Image*);
#ifndef CLI
/* rs02-window.c */
void RS02AddFixValues(RS02Widgets*, int, int);
void RS02SetFixMaxValues(RS02Widgets*, int, int, gint64);
void RS02UpdateFixResults(RS02Widgets*, gint64, gint64);
#endif
/* rs02-verify.c */

View File

@@ -29,6 +29,8 @@
*** Recognize RS02 error correction data in the image
***/
#ifndef CLI
/*
* Dialog components for disabling RS02 search
*/
@@ -59,6 +61,7 @@ static void insert_buttons(GtkDialog *dialog)
gtk_widget_show(align);
gtk_widget_show(check);
}
#endif
/*
* See whether a given header is valid for RS02
@@ -167,7 +170,6 @@ int RS02Recognize(Image *image)
int read_count = 0;
int answered_continue = FALSE;
gint64 max_sectors = 0;
switch(image->type)
{ case IMAGE_FILE:
Verbose("RS02Recognize: file %s\n", image->file->path);
@@ -247,8 +249,10 @@ int RS02Recognize(Image *image)
while(pos > 0)
{ int result;
#ifndef CLI
if(Closure->stopActions)
goto bail_out;
#endif
if(GetBit(try_next_header, pos))
{ Verbose("Sector %lld cached; skipping\n", pos);
@@ -267,7 +271,9 @@ int RS02Recognize(Image *image)
SetBit(try_next_header, pos);
read_count++;
if(!answered_continue && read_count > 5)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, insert_buttons,
_("Faster medium initialization\n\n"
"Searching this medium for error correction data may take a long time.\n"
@@ -277,6 +283,7 @@ int RS02Recognize(Image *image)
if(answer) goto bail_out;
answered_continue = TRUE;
}
#endif
}
goto check_next_header;
case TRY_NEXT_MODULO:
@@ -297,7 +304,9 @@ int RS02Recognize(Image *image)
header_modulo >>= 1;
}
#ifndef CLI
bail_out:
#endif
FreeBitmap(try_next_header);
FreeBitmap(try_next_modulo);
FreeAlignedBuffer(ab);

View File

@@ -28,6 +28,8 @@
*** Reset the verify output window
***/
#ifndef CLI
void ResetRS02VerifyWindow(Method *self)
{ RS02Widgets *wl = (RS02Widgets*)self->widgetList;
@@ -328,6 +330,7 @@ void CreateRS02VerifyWindow(Method *self, GtkWidget *parent)
gtk_table_attach(GTK_TABLE(table2), lab, 0, 2, 7, 8, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 5, 4);
}
#endif
/***
*** Check the consistency of the augmented image
@@ -341,7 +344,9 @@ typedef struct
{ Image *image;
EccHeader *eh;
RS02Layout *lay;
#ifndef CLI
RS02Widgets *wl;
#endif
Bitmap *map;
guint32 *crcBuf;
gint8 *crcValid;
@@ -353,8 +358,10 @@ static void cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
AllowActions(TRUE);
#endif
if(cc->image) CloseImage(cc->image);
if(cc->lay) g_free(cc->lay);
@@ -364,8 +371,10 @@ static void cleanup(gpointer data)
g_free(cc);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/***
@@ -506,6 +515,7 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
PrintLog(_("- prognosis : %lld of %lld sectors recoverable (%d.%d%%)\n"),
recoverable, expected, percentage/10, percentage%10);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(vc->wl->cmpEcc1Name), "");
SetLabelText(GTK_LABEL(vc->wl->cmpEcc1Msg), "");
@@ -522,6 +532,7 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
recoverable < expected ? Closure->redMarkup : Closure->greenMarkup,
recoverable, expected, percentage/10, percentage%10);
}
#endif
}
/* Why the first test?
@@ -537,8 +548,10 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
void RS02Verify(Image *image)
{ verify_closure *cc = g_malloc0(sizeof(verify_closure));
#ifndef CLI
Method *self = FindMethod("RS02");
RS02Widgets *wl = self->widgetList;
#endif
EccHeader *eh;
RS02Layout *lay;
struct MD5Context image_md5;
@@ -561,20 +574,26 @@ void RS02Verify(Image *image)
gint64 hdr_missing, hdr_crc_errors;
gint64 hdr_ok,hdr_pos,hdr_correctable;
gint64 ecc_sector,expected_sectors;
#ifndef CLI
int ecc_md5_failure = FALSE;
#endif
int ecc_slice;
int major,minor,micro;
char *unstable="";
char method[5];
char *img_advice = NULL;
char *ecc_advice = NULL;
#ifndef CLI
int try_it;
#endif
int unrecoverable_sectors = 0;
/*** Prepare for early termination */
RegisterCleanup(_("Check aborted"), cleanup, cc);
#ifndef CLI
cc->wl = wl;
#endif
/* extract some important information */
@@ -590,14 +609,17 @@ void RS02Verify(Image *image)
/*** Print information on image size */
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpHeadline), "<big>%s</big>\n<i>%s</i>",
_("Checking the image file."),
_("Image contains error correction data."));
#endif
PrintLog("\n%s: ",Closure->imageName);
PrintLog(_("present, contains %lld medium sectors.\n"),image->sectorSize);
#ifndef CLI
if(Closure->guiMode)
{ if(expected_sectors == image->sectorSize)
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors), "%lld", image->sectorSize);
@@ -610,6 +632,7 @@ void RS02Verify(Image *image)
else img_advice = g_strdup_printf(_("<span %s>Image file is %lld sectors longer than expected.</span>"), Closure->redMarkup, image->sectorSize - expected_sectors);
}
}
#endif
/*** Check integrity of the ecc headers */
@@ -666,6 +689,7 @@ void RS02Verify(Image *image)
hdr_pos = (lay->protectedSectors + lay->headerModulo - 1) & ~(lay->headerModulo-1);
else hdr_pos += lay->headerModulo;
#ifndef CLI
if(Closure->guiMode)
{ if(!hdr_crc_errors && !hdr_missing)
SetLabelText(GTK_LABEL(wl->cmpEccHeaders), _("complete"));
@@ -674,6 +698,7 @@ void RS02Verify(Image *image)
Closure->redMarkup, hdr_ok, hdr_crc_errors, hdr_missing);
}
}
#endif
}
/* take shortcut in quick mode */
@@ -709,6 +734,7 @@ void RS02Verify(Image *image)
/* Check for user interruption */
#ifndef CLI
if(Closure->stopActions)
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->cmpImageResult),
@@ -716,6 +742,7 @@ void RS02Verify(Image *image)
Closure->redMarkup);
goto terminate;
}
#endif
/* Read the next sector */
@@ -793,12 +820,16 @@ void RS02Verify(Image *image)
}
}
#ifndef CLI
if(Closure->guiMode)
percent = (VERIFY_IMAGE_SEGMENTS*(s+1))/expected_sectors;
else percent = (100*(s+1))/expected_sectors;
else
#endif
percent = (100*(s+1))/expected_sectors;
if(last_percent != percent)
{ PrintProgress(_("- testing sectors : %3d%%") ,percent);
#ifndef CLI
if(Closure->guiMode)
{ add_verify_values(self, percent, new_missing, new_crc_errors);
if(data_missing || data_crc_errors)
@@ -814,6 +845,7 @@ void RS02Verify(Image *image)
_("<span %s>%lld sectors missing</span>"),
Closure->redMarkup, ecc_missing);
}
#endif
last_percent = percent;
new_missing = new_crc_errors = 0;
}
@@ -821,6 +853,7 @@ void RS02Verify(Image *image)
/* Complete damage summary */
#ifndef CLI
if(Closure->guiMode)
{ if(data_missing || data_crc_errors)
SetLabelText(GTK_LABEL(wl->cmpDataSection),
@@ -835,6 +868,7 @@ void RS02Verify(Image *image)
_("<span %s>%lld sectors missing</span>"),
Closure->redMarkup, ecc_missing);
}
#endif
/* The image md5sum is only useful if all blocks have been successfully read. */
@@ -873,6 +907,7 @@ void RS02Verify(Image *image)
PrintLog(_(" ... ecc section : %lld sectors missing\n"), ecc_missing);
}
#ifndef CLI
if(Closure->guiMode)
{ if(!data_missing && !data_crc_errors)
SetLabelText(GTK_LABEL(wl->cmpDataSection), _("complete"));
@@ -896,6 +931,13 @@ void RS02Verify(Image *image)
Closure->redMarkup);
}
}
else
#endif
{
if(img_advice)
{ PrintLog(img_advice);
}
}
/*** Print some information on the ecc portion */
continue_with_ecc:
@@ -915,12 +957,14 @@ continue_with_ecc:
PrintLog(format, _("created by dvdisaster"), major, minor, micro, unstable);
PrintLog("\n");
#ifndef CLI
if(Closure->guiMode)
{ SwitchAndSetFootline(wl->cmpEccNotebook, 1,
wl->cmpEccCreatedBy,
format, "dvdisaster",
major, minor, micro, unstable);
}
#endif
}
else
{ char *format = "%s-%d.%d%s";
@@ -928,11 +972,13 @@ continue_with_ecc:
PrintLog(format, _("created by dvdisaster"), major, minor, unstable);
PrintLog("\n");
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->cmpEccNotebook, 1,
wl->cmpEccCreatedBy,
format, "dvdisaster",
major, minor, unstable);
#endif
}
/* Error correction method */
@@ -943,10 +989,12 @@ continue_with_ecc:
method, eh->eccBytes,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMethod), _("%4s, %d roots, %4.1f%% redundancy"),
method, eh->eccBytes,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
#endif
/* required dvdisaster version */
@@ -956,10 +1004,12 @@ continue_with_ecc:
(eh->neededVersion%10000)/100);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccRequires), "dvdisaster-%d.%d",
eh->neededVersion/10000,
(eh->neededVersion%10000)/100);
#endif
}
else
{ PrintLog(_("* requires : dvdisaster-%d.%d (BAD)\n"
@@ -969,6 +1019,7 @@ continue_with_ecc:
(eh->neededVersion%10000)/100);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccRequires),
"<span %s>dvdisaster-%d.%d</span>",
@@ -978,6 +1029,12 @@ continue_with_ecc:
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Please upgrade your version of dvdisaster!</span>"), Closure->redMarkup);
}
else
#endif
{
if(!ecc_advice)
ecc_advice = g_strdup(_("Please upgrade your version of dvdisaster!"));
}
}
/* Number of sectors medium is supposed to have */
@@ -986,9 +1043,11 @@ continue_with_ecc:
{ PrintLog(_("- medium sectors : %lld / %lld (good)\n"),
expected_sectors, lay->dataSectors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%lld / %lld",
expected_sectors, lay->dataSectors);
#endif
}
else
{ if(image->sectorSize > expected_sectors && image->sectorSize - expected_sectors <= 2)
@@ -996,12 +1055,14 @@ continue_with_ecc:
expected_sectors);
else PrintLog(_("* medium sectors : %lld (BAD)\n"),expected_sectors);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
"<span %s>%lld</span>", Closure->redMarkup, expected_sectors);
if(!ecc_advice && image->sectorSize > expected_sectors)
ecc_advice = g_strdup_printf(_("<span %s>Image size does not match recorded size.</span>"), Closure->redMarkup);
}
#endif
}
if(Closure->quickVerify) /* take shortcut again */
@@ -1017,6 +1078,7 @@ continue_with_ecc:
if(n) PrintLog(_("- data md5sum : %s (good)\n"),hdr_digest);
else PrintLog(_("* data md5sum : %s (BAD)\n"),hdr_digest);
#ifndef CLI
if(Closure->guiMode)
{ if(n) SetLabelText(GTK_LABEL(wl->cmpEcc1Msg), "%s", hdr_digest);
else
@@ -1024,12 +1086,15 @@ continue_with_ecc:
SetLabelText(GTK_LABEL(wl->cmpImageMd5Sum), "<span %s>%s</span>", Closure->redMarkup, data_digest);
}
}
#endif
}
else
{ PrintLog(_("- data md5sum : %s\n"), "-");
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEcc1Msg), "%s", "-");
#endif
}
/*** md5sum of the crc portion */
@@ -1039,22 +1104,28 @@ continue_with_ecc:
if(!crc_missing)
{ if(!memcmp(eh->crcSum, cc->crcSum, 16))
{ PrintLog(_("- crc md5sum : %s (good)\n"),digest);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEcc2Msg), "%s", digest);
#endif
}
else
{ PrintLog(_("* crc md5sum : %s (BAD)\n"),digest);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEcc2Msg), "<span %s>%s</span>", Closure->redMarkup, digest);
}
ecc_md5_failure = TRUE;
#endif
}
}
else
{ PrintLog(_("- crc md5sum : %s\n"), "-");
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEcc2Msg), "%s", "-");
#endif
}
/*** meta md5sum of the ecc slices */
@@ -1064,29 +1135,39 @@ continue_with_ecc:
if(!ecc_missing)
{ if(!memcmp(eh->eccSum, ecc_sum, 16))
{ PrintLog(_("- ecc md5sum : %s (good)\n"),digest);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEcc3Msg), "%s", digest);
#endif
}
else
{ PrintLog(_("* ecc md5sum : %s (BAD)\n"),digest);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEcc3Msg), "<span %s>%s</span>", Closure->redMarkup, digest);
}
ecc_md5_failure = TRUE;
#endif
}
}
else
{ PrintLog(_("- ecc md5sum : %s\n"), "-");
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEcc3Msg), "%s", "-");
#endif
}
/*** Print final results */
try_it = prognosis(cc, total_missing + data_crc_errors - hdr_correctable, expected_sectors);
#ifndef CLI
try_it =
#endif
prognosis(cc, total_missing + data_crc_errors - hdr_correctable, expected_sectors);
#ifndef CLI
if(Closure->guiMode)
{ if(ecc_advice)
{ SetLabelText(GTK_LABEL(wl->cmpEccResult), ecc_advice);
@@ -1106,6 +1187,13 @@ continue_with_ecc:
Closure->redMarkup);
}
}
else
#endif
{ if(ecc_advice)
{ PrintLog(ecc_advice);
g_free(ecc_advice);
}
}
/*** Close and clean up */

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"
@@ -416,6 +417,7 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
gtk_widget_set_sensitive(wl->bdEntry1A, TRUE);
gtk_widget_set_sensitive(wl->bdEntry2A, TRUE);
gtk_widget_set_sensitive(wl->bdEntry3A, TRUE);
gtk_widget_set_sensitive(wl->bdEntry4A, TRUE);
gtk_widget_set_sensitive(wl->cdButtonA, TRUE);
gtk_widget_set_sensitive(wl->dvdButton1A, TRUE);
gtk_widget_set_sensitive(wl->dvdButton2A, TRUE);
@@ -444,6 +446,7 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
gtk_widget_set_sensitive(wl->bdEntry1B, TRUE);
gtk_widget_set_sensitive(wl->bdEntry2B, TRUE);
gtk_widget_set_sensitive(wl->bdEntry3B, TRUE);
gtk_widget_set_sensitive(wl->bdEntry4B, TRUE);
gtk_widget_set_sensitive(wl->cdButtonB, TRUE);
gtk_widget_set_sensitive(wl->dvdButton1B, TRUE);
gtk_widget_set_sensitive(wl->dvdButton2B, TRUE);
@@ -473,6 +476,7 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
gtk_widget_set_sensitive(wl->bdEntry1A, FALSE);
gtk_widget_set_sensitive(wl->bdEntry2A, FALSE);
gtk_widget_set_sensitive(wl->bdEntry3A, FALSE);
gtk_widget_set_sensitive(wl->bdEntry4A, FALSE);
gtk_widget_set_sensitive(wl->cdButtonA, FALSE);
gtk_widget_set_sensitive(wl->dvdButton1A, FALSE);
gtk_widget_set_sensitive(wl->dvdButton2A, FALSE);
@@ -502,6 +506,7 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
gtk_widget_set_sensitive(wl->bdEntry1B, FALSE);
gtk_widget_set_sensitive(wl->bdEntry2B, FALSE);
gtk_widget_set_sensitive(wl->bdEntry3B, FALSE);
gtk_widget_set_sensitive(wl->bdEntry4B, FALSE);
gtk_widget_set_sensitive(wl->cdButtonB, FALSE);
gtk_widget_set_sensitive(wl->dvdButton1B, FALSE);
gtk_widget_set_sensitive(wl->dvdButton2B, FALSE);
@@ -601,6 +606,17 @@ static void query_cb(GtkWidget *widget, gpointer data)
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry3A), value);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry3B), value);
}
if(widget == wl->bdButton4A || widget == wl->bdButton4B)
{ gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4A), value);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4B), value);
}
if(widget == wl->bdUndoButton4A || widget == wl->bdUndoButton4B )
{ g_snprintf(value, 40, "%lld", (long long int)Closure->savedBDSize4);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4A), value);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4B), value);
}
}
/*
@@ -664,6 +680,15 @@ static void entry_tracker_cb(GtkWidget *widget, gpointer data)
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry3A), text);
}
if(widget == wl->bdEntry4A)
{ const char *text = gtk_entry_get_text(GTK_ENTRY(wl->bdEntry4A));
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4B), text);
}
if(widget == wl->bdEntry4B)
{ const char *text = gtk_entry_get_text(GTK_ENTRY(wl->bdEntry4B));
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4A), text);
}
if(widget == wl->otherEntryA)
{ const char *text = gtk_entry_get_text(GTK_ENTRY(wl->otherEntryA));
gtk_entry_set_text(GTK_ENTRY(wl->otherEntryB), text);
@@ -715,6 +740,8 @@ void ReadRS02Preferences(Method *method)
Closure->bdSize2 = value > 0 ? value : 0;
value = atoll(gtk_entry_get_text(GTK_ENTRY(wl->bdEntry3A)));
Closure->bdSize3 = value > 0 ? value : 0;
value = atoll(gtk_entry_get_text(GTK_ENTRY(wl->bdEntry4A)));
Closure->bdSize4 = value > 0 ? value : 0;
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wl->radio1A)))
{ Closure->mediumSize = 0;
@@ -1152,6 +1179,67 @@ void CreateRS02PrefsPage(Method *method, GtkWidget *parent)
"may be a few sectors smaller than specified for "
"technical reasons."));
/* BDXL four layer capacity table row */
lwoh = CreateLabelWithOnlineHelp(_("BDXL 4 layers:"), _("BDXL 4 layers:"));
RegisterPreferencesHelpWindow(lwoh);
gtk_misc_set_alignment(GTK_MISC(lwoh->linkLabel), 0.0, 0.0);
gtk_table_attach(GTK_TABLE(table), lwoh->linkBox, 0, 1, 7, 8, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 5, 5);
wl->bdEntry4A = gtk_entry_new();
gtk_entry_set_width_chars(GTK_ENTRY(wl->bdEntry4A), 9);
g_signal_connect(G_OBJECT(wl->bdEntry4A), "activate", G_CALLBACK(entry_tracker_cb), wl);
gtk_table_attach(GTK_TABLE(table), wl->bdEntry4A, 1, 2, 7, 8, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 5, 5);
wl->bdButton4A = gtk_button_new_with_label(_utf("query medium"));
g_signal_connect(G_OBJECT(wl->bdButton4A), "clicked", G_CALLBACK(query_cb), wl);
gtk_table_attach(GTK_TABLE(table), wl->bdButton4A, 2, 3, 7, 8, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 5, 5);
icon = gtk_image_new_from_stock(GTK_STOCK_UNDO, GTK_ICON_SIZE_SMALL_TOOLBAR);
wl->bdUndoButton4A = gtk_button_new();
gtk_container_add(GTK_CONTAINER(wl->bdUndoButton4A), icon);
g_signal_connect(G_OBJECT(wl->bdUndoButton4A), "clicked", G_CALLBACK(query_cb), wl);
gtk_table_attach(GTK_TABLE(table), wl->bdUndoButton4A, 3, 4, 7, 8, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 5, 5);
hbox = gtk_hbox_new(FALSE, 4);
gtk_box_pack_start(GTK_BOX(hbox), lwoh->normalLabel, FALSE, FALSE, 0);
wl->bdEntry4B = gtk_entry_new();
gtk_entry_set_width_chars(GTK_ENTRY(wl->bdEntry4B), 9);
g_signal_connect(G_OBJECT(wl->bdEntry4B), "activate", G_CALLBACK(entry_tracker_cb), wl);
gtk_box_pack_start(GTK_BOX(hbox), wl->bdEntry4B, FALSE, FALSE, 0);
wl->bdButton4B = gtk_button_new_with_label(_utf("query medium"));
g_signal_connect(G_OBJECT(wl->bdButton4B), "clicked", G_CALLBACK(query_cb), wl);
gtk_box_pack_start(GTK_BOX(hbox), wl->bdButton4B, FALSE, FALSE, 0);
icon = gtk_image_new_from_stock(GTK_STOCK_UNDO, GTK_ICON_SIZE_SMALL_TOOLBAR);
wl->bdUndoButton4B = gtk_button_new();
gtk_container_add(GTK_CONTAINER(wl->bdUndoButton4B), icon);
g_signal_connect(G_OBJECT(wl->bdUndoButton4B), "clicked", G_CALLBACK(query_cb), wl);
gtk_box_pack_start(GTK_BOX(hbox), wl->bdUndoButton4B, FALSE, FALSE, 0);
AddHelpWidget(lwoh, hbox);
AddHelpParagraph(lwoh, _("<b>Four layered BDXL medium size</b>\n\n"
"This is the maximum capacity assumed for four layered BDXL media. "
"Images exceeding the smaller media sizes but smaller "
"than this value will be augmented with error correction information "
"so that they will fit on the specified BD.\n\n"
"You can enter the medium size in sectors of 2K each, "
"or press the \"query medium\" button to use the size "
"of a blank medium currently inserted in the selected drive.\n"
"Use the arrow button to revert to the last saved value.\n\n"
"Please note that augmented images will at most triple "
"in size as the highest possible redundancy is 200%%.\n"
"Even if this limit is not reached the augmented image "
"may be a few sectors smaller than specified for "
"technical reasons."));
/* Fill in values from the closure */
g_snprintf(value, 40, "%lld", (long long int)Closure->cdSize);
@@ -1172,6 +1260,9 @@ void CreateRS02PrefsPage(Method *method, GtkWidget *parent)
g_snprintf(value, 40, "%lld", (long long int)Closure->bdSize3);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry3A), value);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry3B), value);
g_snprintf(value, 40, "%lld", (long long int)Closure->bdSize4);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4A), value);
gtk_entry_set_text(GTK_ENTRY(wl->bdEntry4B), value);
/* custom value selection */

View File

@@ -536,7 +536,9 @@ RS03Layout *CalcRS03Layout(Image *image, int target)
lay->mediumCapacity = BD_SL_SIZE; /* Single layered BD */
else if(get_roots(dataSectors, BD_DL_SIZE) >= 8)
lay->mediumCapacity = BD_DL_SIZE; /* Double layered BD */
else lay->mediumCapacity = BDXL_TL_SIZE;
else if(get_roots(dataSectors, BDXL_TL_SIZE) >= 8)
lay->mediumCapacity = BDXL_TL_SIZE; /* Triple layered BDXL */
else lay->mediumCapacity = BDXL_QL_SIZE;
}
}

View File

@@ -24,6 +24,10 @@
#include "rs03-includes.h"
#ifdef SYS_MINGW
#include <windows.h>
#endif
/* Needed version must be consistent between CRC blocks and ECC headers
since ECC headers may be reconstructed from CRC blocks. */
@@ -31,24 +35,27 @@
//#define VERBOSE 1
#ifdef VERBOSE
#define verbose(format,args...) printf(format, ## args)
#define verbose(format,...) printf(format, __VA_ARGS__)
#else
#define verbose(format,args...)
#define verbose(format,...)
#endif
#ifdef HAVE_MMAP
#include <sys/mman.h>
#ifdef SYS_LINUX
#define MMAP_FLAGS (MAP_SHARED | MAP_POPULATE | MAP_NORESERVE)
#endif
#if defined(SYS_LINUX)
#ifdef SYS_FREEBSD
#define MMAP_FLAGS (MAP_SHARED | MAP_PREFAULT_READ)
#endif
#define MMAP_FLAGS (MAP_SHARED | MAP_POPULATE | MAP_NORESERVE)
#elif defined(SYS_FREEBSD)
#define MMAP_FLAGS (MAP_SHARED | MAP_PREFAULT_READ)
#else
/* SYS_NETBSD and others. */
#define MMAP_FLAGS (MAP_SHARED)
#ifdef SYS_NETBSD
#define MMAP_FLAGS (MAP_SHARED)
#endif
#endif
@@ -60,7 +67,9 @@
typedef struct
{ Method *self;
Image *image;
#ifndef CLI
RS03Widgets *wl;
#endif
RS03Layout *lay;
EccHeader *eh; /* ecc header in native byte order */
EccHeader *eh_le; /* ecc header in little endian order */
@@ -138,6 +147,7 @@ static void ecc_cleanup(gpointer data)
}
}
#ifndef CLI
if(Closure->guiMode)
{ if(ec->earlyTermination)
SetLabelText(GTK_LABEL(ec->wl->encFootline),
@@ -145,6 +155,7 @@ static void ecc_cleanup(gpointer data)
Closure->redMarkup);
AllowActions(TRUE);
}
#endif
/*** We must invalidate the CRC cache as it does only cover the
data portion of the image, not the full RS03 enhanced image
@@ -218,8 +229,10 @@ static void ecc_cleanup(gpointer data)
if(ec->encoderData) g_free(ec->encoderData);
g_free(ec);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/***
@@ -231,7 +244,10 @@ static void ecc_cleanup(gpointer data)
*/
static void abort_encoding(ecc_closure *ec, int truncate)
{ RS03Widgets *wl = ec->wl;
{
#ifndef CLI
RS03Widgets *wl = ec->wl;
#endif
if(truncate && ec->lay)
{ if(Closure->eccTarget == ECC_FILE)
@@ -239,17 +255,21 @@ static void abort_encoding(ecc_closure *ec, int truncate)
else if(!LargeTruncate(ec->image->file, (gint64)(2048*ec->lay->dataSectors)))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
#ifndef CLI
if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->encFootline),
_("<span %s>Aborted by user request!</span> (partial ecc data removed from image)"),
Closure->redMarkup);
#endif
}
#ifndef CLI
else
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SetLabelText(GTK_LABEL(wl->encFootline),
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
}
#endif
ec->earlyTermination = FALSE; /* suppress respective error message */
@@ -271,6 +291,7 @@ static void remove_old_ecc(ecc_closure *ec)
{
if(ConfirmEccDeletion(Closure->eccName))
LargeUnlink(Closure->eccName);
#ifndef CLI
else
{ SetLabelText(GTK_LABEL(ec->wl->encFootline),
_("<span %s>Aborted to keep existing ecc file.</span>"),
@@ -278,6 +299,7 @@ static void remove_old_ecc(ecc_closure *ec)
ec->earlyTermination = FALSE;
ecc_cleanup((gpointer)ec);
}
#endif
}
return;
}
@@ -289,12 +311,16 @@ static void remove_old_ecc(ecc_closure *ec)
guint64 data_bytes;
int answer;
#ifndef CLI
if(Closure->confirmDeletion || !Closure->guiMode)
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
#endif
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image \"%s\" already contains error correction information.\n"
"Truncating image to data part (%lld sectors).\n"),
Closure->imageName, data_sectors);
#ifndef CLI
else answer = TRUE;
#endif
if(!answer)
abort_encoding(ec, FALSE);
@@ -488,8 +514,10 @@ static void expand_image(ecc_closure *ec)
{ unsigned char dead_sector[2048];
int n;
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
abort_encoding(ec, TRUE);
#endif
CreateMissingSector(dead_sector, lay->firstEccPos+sectors, image->imageFP, FINGERPRINT_SECTOR,
"ECC padding by expand_image()");
@@ -503,8 +531,10 @@ static void expand_image(ecc_closure *ec)
if(last_percent != percent)
{ PrintProgress(_(progress_msg), percent);
#ifndef CLI
if(Closure->guiMode)
SetProgress(ec->wl->encPBar1, percent, 100);
#endif
last_percent = percent;
}
@@ -513,8 +543,10 @@ static void expand_image(ecc_closure *ec)
PrintProgress(_(progress_msg), 100);
PrintProgress("\n");
#ifndef CLI
if(Closure->guiMode)
SetProgress(ec->wl->encPBar1, 100, 100);
#endif
}
/*
@@ -597,10 +629,12 @@ static void read_next_chunk(ecc_closure *ec, guint64 chunk)
guint64 page_offset;
#endif
#ifndef CLI
if(Closure->stopActions) /* User hit the Stop button */
{ ec->abortImmediately = TRUE;
abort_encoding(ec, TRUE);
}
#endif
/* Read the next data sectors of this layer.
Note that the last layer is made from CRC sums. */
@@ -714,7 +748,7 @@ static void flush_crc(ecc_closure *ec, LargeFile *file_out)
/* Write out the CRC layer */
verbose("IO: writing CRC layer\n");
verbose("%s", "IO: writing CRC layer\n");
crc_sect = 2048*(ec->encoderChunk+lay->firstCrcPos);
if(!LargeSeek(file_out, crc_sect))
{ ec->abortImmediately = TRUE;
@@ -735,7 +769,7 @@ static void flush_parity(ecc_closure *ec, LargeFile *file_out)
/* Write out the created parity. */
verbose("IO: writing parity...\n");
verbose("%s", "IO: writing parity...\n");
for(k=0; k<lay->nroots; k++)
{ gint64 idx=0;
@@ -752,7 +786,7 @@ static void flush_parity(ecc_closure *ec, LargeFile *file_out)
}
}
}
verbose("IO: parity written.\n");
verbose("%s", "IO: parity written.\n");
}
static gpointer io_thread(ecc_closure *ec)
@@ -767,7 +801,7 @@ static gpointer io_thread(ecc_closure *ec)
int parity_available = 0;
int i;
verbose("Reader thread initializing\n");
verbose("%s", "Reader thread initializing\n");
/*** Allocate local parity buffer aligned at 128bit boundary */
@@ -825,7 +859,10 @@ static gpointer io_thread(ecc_closure *ec)
verbose("NOTE: sectors per layer = %lld\n", (long long)lay->sectorsPerLayer);
for(chunk=0; chunk<lay->sectorsPerLayer; chunk+=ec->chunkSize)
{ int cpu_bound = 0;
{
#ifndef CLI
int cpu_bound = 0;
#endif
verbose("Starting IO processing for chunk %d\n", chunk);
@@ -835,7 +872,7 @@ static gpointer io_thread(ecc_closure *ec)
{ read_next_chunk(ec, chunk);
// flush_crc(ec, file_out); // FIXME
needs_preload = 0;
verbose("IO: first chunk loaded\n");
verbose("%s", "IO: first chunk loaded\n");
continue;
}
@@ -880,9 +917,11 @@ static gpointer io_thread(ecc_closure *ec)
/* Wait until the encoders have finished */
g_mutex_lock(ec->lock);
#ifndef CLI
cpu_bound = ec->buffersToEncode;
#endif
while(ec->buffersToEncode)
{ verbose("IO: Waiting for encoders to finish\n");
{ verbose("%s", "IO: Waiting for encoders to finish\n");
g_cond_wait(ec->ioCond, ec->lock);
}
g_mutex_unlock(ec->lock);
@@ -891,6 +930,7 @@ static gpointer io_thread(ecc_closure *ec)
verbose("IO: chunk %d finished\n", ec->ioChunk);
#ifndef CLI
if(Closure->guiMode)
{ if(cpu_bound)
{ SetLabelText(GTK_LABEL(ec->wl->encBottleneck), _("CPU bound"));
@@ -901,6 +941,7 @@ static gpointer io_thread(ecc_closure *ec)
ec->ioBound++;
}
}
#endif
} /* chunk finished */
/* Broadcast read to the worker threads */
@@ -924,7 +965,7 @@ static gpointer io_thread(ecc_closure *ec)
ec->slicesFree = TRUE; /* we have saved the slices; go ahead */
g_cond_broadcast(ec->ioCond);
while(ec->buffersToEncode)
{ verbose("IO: Waiting for encoders to finish last chunk\n");
{ verbose("%s", "IO: Waiting for encoders to finish last chunk\n");
g_cond_wait(ec->ioCond, ec->lock);
}
g_mutex_unlock(ec->lock);
@@ -937,7 +978,7 @@ static gpointer io_thread(ecc_closure *ec)
flush_crc(ec, file_out);
flush_parity(ec, file_out);
verbose("IO: finished\n"); fflush(stdout);
verbose("%s", "IO: finished\n"); fflush(stdout);
return NULL;
}
@@ -1096,6 +1137,7 @@ static gpointer encoder_thread(ecc_closure *ec)
{
ec->lastPercent = percent;
g_mutex_unlock(ec->lock);
#ifndef CLI
if(Closure->guiMode)
{ gdouble elapsed;
gulong ignore;
@@ -1110,7 +1152,9 @@ static gpointer encoder_thread(ecc_closure *ec)
}
SetProgress(ec->wl->encPBar2, percent, 1000);
}
else PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
else
#endif
PrintProgress(_("Ecc generation: %3d.%1d%%"), percent/10, percent%10);
}
else g_mutex_unlock(ec->lock);
@@ -1123,7 +1167,7 @@ static gpointer encoder_thread(ecc_closure *ec)
ec->buffersToEncode-=enc_size;
if(!ec->buffersToEncode)
{ g_cond_broadcast(ec->ioCond);
verbose("ENC: processed last buffer; telling IO process.\n");
verbose("%s", "ENC: processed last buffer; telling IO process.\n");
fflush(stdout);
}
g_mutex_unlock(ec->lock);
@@ -1134,11 +1178,14 @@ static void create_reed_solomon(ecc_closure *ec)
{ int nroots = ec->lay->nroots;
int ndata = ec->lay->ndata;
int i;
#ifndef CLI
char *alg="none";
char *iostrat="none";
#endif
/*** Show the second progress bar */
#ifndef CLI
if(Closure->guiMode)
{ ShowWidget(ec->wl->encPBar2);
ShowWidget(ec->wl->encLabel2);
@@ -1157,6 +1204,7 @@ static void create_reed_solomon(ecc_closure *ec)
SetLabelText(GTK_LABEL(ec->wl->encPerformance), "");
SetLabelText(GTK_LABEL(ec->wl->encBottleneck), "");
}
#endif
/*** Calculate buffer size for the parity calculation and image data caching.
@@ -1176,7 +1224,15 @@ static void create_reed_solomon(ecc_closure *ec)
ec->chunkBytes = 2048*Closure->prefetchSectors;
ec->chunkSize = Closure->prefetchSectors;
#ifdef SYS_MINGW
{
SYSTEM_INFO si;
GetSystemInfo(&si);
ec->pageSize = si.dwPageSize;
}
#else
ec->pageSize = sysconf(_SC_PAGE_SIZE);
#endif
/*** Allocate stuff shared by all threads */
@@ -1223,7 +1279,7 @@ static void create_reed_solomon(ecc_closure *ec)
verbose("SCHED: joined with worker %d\n", i);
fflush(stdout);
}
verbose("SCHED: scheduler finished.\n");
verbose("%s", "SCHED: scheduler finished.\n");
}
/***
@@ -1233,7 +1289,9 @@ static void create_reed_solomon(ecc_closure *ec)
void RS03Create(void)
{ Method *method = FindMethod("RS03");
Image *image = NULL;
#ifndef CLI
RS03Widgets *wl = (RS03Widgets*)method->widgetList;
#endif
RS03Layout *lay;
ecc_closure *ec = g_malloc0(sizeof(ecc_closure));
gdouble elapsed,mbs;
@@ -1243,15 +1301,19 @@ void RS03Create(void)
/*** Register the cleanup procedure for GUI mode */
ec->self = method;
#ifndef CLI
ec->wl = wl;
#endif
ec->earlyTermination = TRUE;
RegisterCleanup(_("Error correction data creation aborted"), ecc_cleanup, ec);
#ifndef CLI
if(Closure->guiMode) /* Preliminary fill text for the head line */
SetLabelText(GTK_LABEL(wl->encHeadline),
_("<big>Augmenting the image with error correction data.</big>\n<i>%s</i>"),
_("- checking image -"));
#endif
/*** Open image file. */
@@ -1297,6 +1359,7 @@ void RS03Create(void)
/*** Announce what we are going to do */
ecc_sectors = lay->nroots*lay->sectorsPerLayer;
#ifndef CLI
if(Closure->guiMode) /* Preliminary fill text for the head line */
{ ec->msg = g_strdup_printf(_("Encoding with Method RS03: %lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
lay->dataSectors/512, ecc_sectors/512, lay->nroots, lay->redundancy);
@@ -1312,6 +1375,7 @@ void RS03Create(void)
}
else
#endif
{ char *alg, *iostrat;
DescribeRSEncoder(&alg, &iostrat);
@@ -1341,9 +1405,9 @@ void RS03Create(void)
if(Closure->eccTarget == ECC_IMAGE && lay->redundancy < 20)
{ int answer;
answer = ModalWarning(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Using redundancies below 20%%%% may not give\n"
"the expected data loss protection.\n"));
"the expected data loss protection.\n"), NULL);
if(!answer)
abort_encoding(ec, FALSE);
@@ -1378,13 +1442,16 @@ void RS03Create(void)
mbs = ((double)lay->ndata*lay->sectorsPerLayer)/(512.0*elapsed);
PrintLog(_("Avg performance: %5.2fs (%5.2fMiB/s) total\n"),
elapsed, mbs);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->encPerformance), _("%5.2fMiB/s average"), mbs);
SetLabelText(GTK_LABEL(ec->wl->encBottleneck),
_("%d times CPU bound; %d times I/O bound"),
ec->cpuBound, ec->ioBound);
}
#endif
#ifndef CLI
if(Closure->guiMode)
{ SetProgress(wl->encPBar2, 100, 100);
@@ -1400,6 +1467,7 @@ void RS03Create(void)
"Make sure to keep this file on a reliable medium."));
}
#endif
/*** Clean up */

View File

@@ -30,7 +30,10 @@
***/
typedef struct
{ RS03Widgets *wl;
{
#ifndef CLI
RS03Widgets *wl;
#endif
RS03Layout *lay;
GaloisTables *gt;
ReedSolomonTables *rt;
@@ -46,6 +49,7 @@ static void fix_cleanup(gpointer data)
UnregisterCleanup();
#ifndef CLI
if(Closure->guiMode)
{ if(fc->earlyTermination)
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
@@ -54,6 +58,7 @@ static void fix_cleanup(gpointer data)
Closure->redMarkup);
AllowActions(TRUE);
}
#endif
/** Clean up */
@@ -71,8 +76,10 @@ static void fix_cleanup(gpointer data)
g_free(fc);
#ifndef CLI
if(Closure->guiMode)
g_thread_exit(0);
#endif
}
/*
@@ -106,17 +113,24 @@ static void expand_image(Image *image, EccHeader *eh, gint64 new_size)
percent = (100*sectors) / new_sectors;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
;
else PrintProgress(_("Expanding image: %3d%%"), percent);
else
#endif
PrintProgress(_("Expanding image: %3d%%"), percent);
last_percent = percent;
}
}
#ifndef CLI
if(Closure->guiMode)
;
else
{ PrintProgress(_("Expanding image: %3d%%"), 100);
#endif
{
PrintProgress(_("Expanding image: %3d%%"), 100);
PrintProgress("\n");
}
}
@@ -126,8 +140,11 @@ static void expand_image(Image *image, EccHeader *eh, gint64 new_size)
***/
void RS03Fix(Image *image)
{ Method *self = FindMethod("RS03");
{
#ifndef CLI
Method *self = FindMethod("RS03");
RS03Widgets *wl = (RS03Widgets*)self->widgetList;
#endif
RS03Layout *lay;
fix_closure *fc = g_malloc0(sizeof(fix_closure));
EccHeader *eh;
@@ -157,12 +174,17 @@ void RS03Fix(Image *image)
gint64 damaged_eccblocks=0;
gint64 damaged_eccsecs=0;
gint64 expected_sectors;
char *t=NULL,*msg;
char *t=NULL;
#ifndef CLI
char *msg;
#endif
/*** Register the cleanup procedure for GUI mode */
fc->image = image;
#ifndef CLI
fc->wl = wl;
#endif
fc->earlyTermination = TRUE;
RegisterCleanup(_("Repairing of image aborted"), fix_cleanup, fc);
@@ -172,10 +194,12 @@ void RS03Fix(Image *image)
/*** Open the image file */
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->fixHeadline),
_("<big>Repairing the image.</big>\n<i>%s</i>"),
_("Opening files..."));
#endif
/* Calculate the layout and optinally open thee ecc file */
@@ -213,6 +237,7 @@ void RS03Fix(Image *image)
/*** Announce what we are going to do */
#ifndef CLI
if(Closure->guiMode)
{ if(eh->methodFlags[0] & MFLAG_ECC_FILE)
msg = g_strdup_printf(_("Error correction file using Method RS03, %d roots, %4.1f%% redundancy."),
@@ -228,6 +253,7 @@ void RS03Fix(Image *image)
RS03SetFixMaxValues(wl, eh->dataBytes, eh->eccBytes, expected_sectors);
g_free(msg);
}
#endif
PrintLog(_("\nFix mode(%s): Repairable sectors will be fixed in the image.\n"),
eh->methodFlags[0] & MFLAG_ECC_FILE ? "RS03f" : "RS03i");
@@ -238,6 +264,7 @@ void RS03Fix(Image *image)
{ int difference = image->inLast - eh->inLast;
guint64 expected_image_size = 2048*(expected_sectors-1)+eh->inLast;
#ifndef CLI
if(Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("The image file is %d bytes longer than noted\n"
@@ -254,8 +281,13 @@ void RS03Fix(Image *image)
goto terminate;
}
}
#endif
#ifndef CLI
if(!Closure->guiMode && !Closure->truncate)
#else
if(!Closure->truncate)
#endif
Stop(_("The image file is %d bytes longer than noted\n"
"in the ecc file.\n"
"Add the --truncate option to the program call\n"
@@ -280,17 +312,21 @@ void RS03Fix(Image *image)
"the error correction information.\n\n%s");
if(diff>0 && diff<=2)
{ int answer = ModalWarning(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
{ int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than expected.\n"
"Assuming this is a TAO mode medium.\n"
"%lld sectors will be removed from the image end.\n"),
diff, diff);
if(!answer)
{ SwitchAndSetFootline(fc->wl->fixNotebook, 1,
{
#ifndef CLI
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
fc->wl->fixFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
#endif
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
@@ -301,6 +337,7 @@ void RS03Fix(Image *image)
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
}
#ifndef CLI
if(diff>2 && Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
trans,
@@ -323,8 +360,13 @@ void RS03Fix(Image *image)
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
}
#endif
#ifndef CLI
if(diff>2 && !Closure->guiMode)
#else
if(diff>2)
#endif
{ if(!Closure->truncate)
Stop(trans,
diff,
@@ -379,6 +421,7 @@ void RS03Fix(Image *image)
/* See if user hit the Stop button */
#ifndef CLI
if(Closure->stopActions)
{ if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
SwitchAndSetFootline(fc->wl->fixNotebook, 1,
@@ -388,6 +431,7 @@ void RS03Fix(Image *image)
fc->earlyTermination = FALSE; /* suppress respective error message */
goto terminate;
}
#endif
/* Fill cache with the next batch of cache_size ecc blocks. */
@@ -506,7 +550,10 @@ void RS03Fix(Image *image)
/* Trivially reject uncorrectable ecc block */
if(erasure_count>lay->nroots) /* uncorrectable */
{ if(!Closure->guiMode)
{
#ifndef CLI
if(!Closure->guiMode)
#endif
{ int sep_printed = 0;
PrintCLI(_("* Ecc block %lld: %3d unrepairable sectors: "), s, erasure_count);
@@ -753,8 +800,8 @@ void RS03Fix(Image *image)
PrintCLI(msg,
sector, type, bi,
old, isprint(old) ? old : '.',
new, isprint(new) ? new : '.');
old, canprint(old) ? old : '.',
new, canprint(new) ? new : '.');
}
fc->imgBlock[location][offset] ^= gf_alpha_to[mod_fieldmax(gf_index_of[num1] + gf_index_of[num2] + GF_FIELDMAX - gf_index_of[den])];
@@ -829,10 +876,10 @@ void RS03Fix(Image *image)
if we were processing an augmented image. */
if(lay->target == ECC_FILE && i >= ndata-1)
{
if(!LargeSeek(image->eccFile, (gint64)(2048*sec)))
Stop(_("Failed seeking to sector %lld in ecc file [%s]: %s"),
sec, "FW", strerror(errno));
{
if(!LargeSeek(image->eccFile, (gint64)(2048*sec)))
Stop(_("Failed seeking to sector %lld in ecc file [%s]: %s"),
sec, "FW", strerror(errno));
n = LargeWrite(image->eccFile, cache_offset+fc->imgBlock[i], 2048);
if(n != 2048)
@@ -865,7 +912,9 @@ skip:
percent = (1000*s)/lay->sectorsPerLayer;
if(last_percent != percent)
{ if(Closure->guiMode)
{
#ifndef CLI
if(Closure->guiMode)
{
RS03AddFixValues(wl, percent, local_plot_max);
local_plot_max = 0;
@@ -873,7 +922,9 @@ skip:
//if(last_corrected != corrected || last_uncorrected != uncorrected)
RS03UpdateFixResults(wl, corrected, uncorrected);
}
else PrintProgress(_("Ecc progress: %3d.%1d%%"),percent/10,percent%10);
else
#endif
PrintProgress(_("Ecc progress: %3d.%1d%%"),percent/10,percent%10);
last_percent = percent;
}
@@ -891,11 +942,13 @@ skip:
corrected, data_corr, ecc_corr);
if(uncorrected > 0)
{ PrintLog(_("Unrepaired sectors: %lld\n"), uncorrected);
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
_("Image sectors could not be fully restored "
"(%lld repaired; <span %s>%lld unrepaired</span>)"),
corrected, Closure->redMarkup, uncorrected);
#endif
exitCode = 2;
}
else
@@ -914,9 +967,11 @@ skip:
PrintLog(_("Erasure counts per ecc block: avg = %.1f; worst = %d.\n"),
(double)damaged_sectors/(double)damaged_eccsecs,worst_ecc);
#ifndef CLI
if(Closure->guiMode && t)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
"%s %s", _("Repair results:"), t);
#endif
Verbose("\nSummary of processed sectors:\n");
Verbose("%lld damaged sectors\n", damaged_sectors);

View File

@@ -23,6 +23,7 @@
#ifndef RS03INCLUDES_H
#define RS03INCLUDES_H
#ifndef CLI
/* Data structs from rs03-window.c */
typedef struct
@@ -117,6 +118,7 @@ typedef struct
int dataBytes;
int percent, lastPercent;
} RS03Widgets;
#endif
/*
* local working closure for internal checksums
@@ -131,6 +133,7 @@ typedef struct
* These are exported via the Method struct
*/
#ifndef CLI
void CreateRS03EncWindow(Method*, GtkWidget*);
void CreateRS03FixWindow(Method*, GtkWidget*);
void CreateRS03PrefsPage(Method*, GtkWidget*);
@@ -141,6 +144,7 @@ void ReadRS03Preferences(Method*);
void ResetRS03VerifyWindow(Method*);
void CreateRS03VerifyWindow(Method*, GtkWidget*);
#endif
/*
* These are exported (resp. only used) in ecc-rs03.c and rs03*.c
@@ -196,11 +200,13 @@ void RS03Fix(Image*);
int RS03RecognizeFile(LargeFile*, EccHeader**);
int RS03RecognizeImage(Image*);
#ifndef CLI
/* rs03-window.c */
void RS03AddFixValues(RS03Widgets*, int, int);
void RS03SetFixMaxValues(RS03Widgets*, int, int, gint64);
void RS03UpdateFixResults(RS03Widgets*, gint64, gint64);
#endif
/* rs03-verify.c */
@@ -211,7 +217,9 @@ void RS03Verify(Image*);
/* temporary single threaded versions */
void RS03SCreate(void);
#ifndef CLI
void CreateRS03SEncWindow(Method*, GtkWidget*);
void ResetRS03SEncWindow(Method*);
#endif
#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"

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