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.
This commit is contained in:
Stéphane Lesimple
2020-08-18 18:26:24 +02:00
parent 4f480905dc
commit 99b27b982a
59 changed files with 9419 additions and 7349 deletions

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;
}