X-Git-Url: https://git.toastfreeware.priv.at/debian/cdck.git/blobdiff_plain/fed0402f9c9c4faeaa0a8b8c2692305a55df2fc8..b01997d953783550bfd3fa09d897a53b37cbd7cf:/src/cdck_main.cpp diff --git a/src/cdck_main.cpp b/src/cdck_main.cpp index 908e928..d8af638 100644 --- a/src/cdck_main.cpp +++ b/src/cdck_main.cpp @@ -1,7 +1,7 @@ /* * $RCSfile: cdck_main.cpp,v $ * $Author: swaj $ - * $Revision: 1.4 $ + * $Revision: 1.7 $ */ #ifdef HAVE_CONFIG_H @@ -21,11 +21,11 @@ int main (int argc, char *argv[]) { - char ch; + signed char ch; char *program_name = (strchr(argv[0], '/') == NULL) ? argv[0] : (strrchr(argv[0], '/') + 1); bool verbose = false; - bool only_info = false; + bool only_info = true; bool do_plot = false; char devname[FILE_MAX]; char plotname[FILE_MAX]; @@ -33,7 +33,7 @@ int main (int argc, char *argv[]) memset (devname, 0x0, FILE_MAX); memset (plotname, 0x0, FILE_MAX); - while ((ch = getopt(argc, argv, "?hivd:po:V"))!=-1) { + while ((ch = getopt(argc, argv, "?hitvd:po:V"))!=-1) { switch (ch) { case 'h': case '?': @@ -48,6 +48,9 @@ int main (int argc, char *argv[]) case 'i': only_info = true; break; + case 't': + only_info = false; + break; case 'p': do_plot = true; break; @@ -102,6 +105,11 @@ int main (int argc, char *argv[]) if (only_info) exit (0); + + printf ("\nNB! For disks written with some burners cdck might \n"); + printf (" report about unreadable sectors at the end of the disk.\n"); + printf (" In such cases you can just ignore those warnings.\n\n"); + rv = cdrom->ReadCD(); if (rv) { fprintf (stderr, "Unable to read disc because %s\n", cdrom->Error() ); @@ -109,6 +117,9 @@ int main (int argc, char *argv[]) exit (1); } + + + cdrom->AnalyzeResults(); if (do_plot) { @@ -131,13 +142,13 @@ int main (int argc, char *argv[]) exit (0); } - static void print_help (char *program_name) { printf ("Usage: %s [-d /dev/devname] [-i] [-v] [-p] [-o plot-file.dat]\n", program_name); - printf (" -d CD/DVD device name, default is /dev/cdrom\n"); - printf (" -i Print CD/DVD information and quit, perform no timings\n"); + printf (" -d CD/DVD device name, default is /dev/cdrom\n"); + printf (" -i Print CD/DVD information and quit, perform no timings (default mode)\n"); + printf (" -t Perform timing test\n"); printf (" -p Save data for gnuplot(1) program\n"); printf (" -o specify plot file, ./cdck-plot.dat is default\n"); printf (" -V Print version\n"); @@ -148,7 +159,7 @@ static void print_ver (void) { printf ("Simple CD/DVD check program, ver %s. ", VERSION); - printf ("Written by Alexey Semenoff (c) 2005-2006.\n"); + printf ("Written by Alexey Semenoff (c) 2005-2008.\n"); }