diff options
author | R. Bernstein <rocky@gnu.org> | 2012-03-03 07:42:11 -0500 |
---|---|---|
committer | R. Bernstein <rocky@gnu.org> | 2012-03-03 07:42:11 -0500 |
commit | 2b84a552e30f1754784cfd051403db881626b051 (patch) | |
tree | f170c19d4808e4faadbacf55fccf18291faddb75 /example | |
parent | 422693a7cd3c882b93149a4eca96a526f34e004e (diff) |
Harmonize source headers: C++ examples [PATCH 3/5] from pbatard.
Diffstat (limited to 'example')
-rw-r--r-- | example/C++/OO/cdtext.cpp | 7 | ||||
-rw-r--r-- | example/C++/OO/device.cpp | 8 | ||||
-rw-r--r-- | example/C++/OO/drives.cpp | 11 | ||||
-rw-r--r-- | example/C++/OO/eject.cpp | 7 | ||||
-rw-r--r-- | example/C++/OO/iso4.cpp | 11 | ||||
-rw-r--r-- | example/C++/OO/isofile.cpp | 9 | ||||
-rw-r--r-- | example/C++/OO/isofile2.cpp | 8 | ||||
-rw-r--r-- | example/C++/OO/isolist.cpp | 11 | ||||
-rw-r--r-- | example/C++/OO/mmc1.cpp | 10 | ||||
-rw-r--r-- | example/C++/OO/mmc2.cpp | 7 | ||||
-rw-r--r-- | example/C++/OO/tracks.cpp | 11 | ||||
-rw-r--r-- | example/C++/device.cpp | 7 | ||||
-rw-r--r-- | example/C++/eject.cpp | 8 | ||||
-rw-r--r-- | example/C++/isofile.cpp | 10 | ||||
-rw-r--r-- | example/C++/isofile2.cpp | 11 | ||||
-rw-r--r-- | example/C++/isolist.cpp | 9 | ||||
-rw-r--r-- | example/C++/mmc1.cpp | 17 | ||||
-rw-r--r-- | example/C++/mmc2.cpp | 14 | ||||
-rw-r--r-- | example/C++/paranoia.cpp | 15 | ||||
-rw-r--r-- | example/C++/paranoia2.cpp | 12 |
20 files changed, 150 insertions, 53 deletions
diff --git a/example/C++/OO/cdtext.cpp b/example/C++/OO/cdtext.cpp index 394404bf..0a692343 100644 --- a/example/C++/OO/cdtext.cpp +++ b/example/C++/OO/cdtext.cpp @@ -21,20 +21,19 @@ libcdio. An optional drive name can be supplied as an argument. See also corresponding C program of a similar name. */ - -#include <cdio++/cdio.hpp> #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" +#define __CDIO_CONFIG_H__ 1 #endif #ifdef HAVE_STDIO_H #include <stdio.h> #endif - #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif +#include <cdio++/cdio.hpp> /* Set up a CD-DA image to test on which is in the libcdio distribution. */ #define CDDA_IMAGE_PATH "../../../test/" diff --git a/example/C++/OO/device.cpp b/example/C++/OO/device.cpp index fcb4b991..05210543 100644 --- a/example/C++/OO/device.cpp +++ b/example/C++/OO/device.cpp @@ -20,8 +20,10 @@ /* Simple program to show drivers installed and what the default CD-ROM drive is. See also corresponding C program of a similar name. */ - -#include <cdio++/cdio.hpp> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif #ifdef HAVE_STDIO_H #include <stdio.h> @@ -33,6 +35,8 @@ #include <sys/types.h> #endif +#include <cdio++/cdio.hpp> + #define _(x) x /* Prints out drive capabilities */ diff --git a/example/C++/OO/drives.cpp b/example/C++/OO/drives.cpp index ac318cbb..789d5762 100644 --- a/example/C++/OO/drives.cpp +++ b/example/C++/OO/drives.cpp @@ -17,9 +17,10 @@ /* Simple program to show drivers installed and what the default CD-ROM drive is and what CD drives are available. */ -#include <cdio++/cdio.hpp> -#include <cdio/cd_types.h> -#include <cdio/logging.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif #ifdef HAVE_STDIO_H #include <stdio.h> @@ -31,6 +32,10 @@ #include <sys/types.h> #endif +#include <cdio++/cdio.hpp> +#include <cdio/cd_types.h> +#include <cdio/logging.h> + static void log_handler (cdio_log_level_t level, const char message[]) { diff --git a/example/C++/OO/eject.cpp b/example/C++/OO/eject.cpp index 1b6030a4..974fd8bb 100644 --- a/example/C++/OO/eject.cpp +++ b/example/C++/OO/eject.cpp @@ -24,7 +24,10 @@ See also corresponding C program of a similar name. */ -#include <cdio++/cdio.hpp> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif #include <stdio.h> #ifdef HAVE_STDLIB_H @@ -34,6 +37,8 @@ #include <string.h> #endif +#include <cdio++/cdio.hpp> + int main(int argc, const char *argv[]) { diff --git a/example/C++/OO/iso4.cpp b/example/C++/OO/iso4.cpp index 4f01df11..6a186a6e 100644 --- a/example/C++/OO/iso4.cpp +++ b/example/C++/OO/iso4.cpp @@ -32,11 +32,14 @@ #define ISO9660_IMAGE_PATH "../../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/isofs-m1.cue" -#include <sys/types.h> -#include <cdio++/iso9660.hpp> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif +#ifdef HAVE_STDIO_H #include <stdio.h> - +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -50,6 +53,8 @@ #include <sys/types.h> #endif +#include <cdio++/iso9660.hpp> + #define print_vd_info(title, fn) \ psz_str = p_pvd->fn(); \ if (psz_str) { \ diff --git a/example/C++/OO/isofile.cpp b/example/C++/OO/isofile.cpp index 1e034120..da9e5b90 100644 --- a/example/C++/OO/isofile.cpp +++ b/example/C++/OO/isofile.cpp @@ -29,12 +29,11 @@ #define LOCAL_FILENAME "copying" -#include <sys/types.h> -#include <cdio++/iso9660.hpp> - #include "portable.h" -#include <stdio.h> +#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif #ifdef HAVE_ERRNO_H #include <errno.h> #endif @@ -51,6 +50,8 @@ #include <sys/types.h> #endif +#include <cdio++/iso9660.hpp> + #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ diff --git a/example/C++/OO/isofile2.cpp b/example/C++/OO/isofile2.cpp index 311c6ca9..8a32bf62 100644 --- a/example/C++/OO/isofile2.cpp +++ b/example/C++/OO/isofile2.cpp @@ -35,13 +35,8 @@ #define ISO9660_FILENAME "COPYING" #define LOCAL_FILENAME "copying" -#include <cdio++/cdio.hpp> -#include <cdio++/iso9660.hpp> #include "portable.h" -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -61,6 +56,9 @@ #include <sys/types.h> #endif +#include <cdio++/cdio.hpp> +#include <cdio++/iso9660.hpp> + #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ diff --git a/example/C++/OO/isolist.cpp b/example/C++/OO/isolist.cpp index 52eb68cc..e8642b92 100644 --- a/example/C++/OO/isolist.cpp +++ b/example/C++/OO/isolist.cpp @@ -34,11 +34,14 @@ #define ISO9660_IMAGE_PATH "../../../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/copying.iso" -#include <sys/types.h> -#include <cdio++/iso9660.hpp> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif +#ifdef HAVE_STDIO_H #include <stdio.h> - +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -52,6 +55,8 @@ #include <sys/types.h> #endif +#include <cdio++/iso9660.hpp> + #define print_vd_info(title, fn) \ if (p_iso->fn(psz_str)) { \ printf(title ": %s\n", psz_str); \ diff --git a/example/C++/OO/mmc1.cpp b/example/C++/OO/mmc1.cpp index 97bf25b7..63425bbe 100644 --- a/example/C++/OO/mmc1.cpp +++ b/example/C++/OO/mmc1.cpp @@ -20,8 +20,14 @@ This basically the libdio mmc_get_hwinfo() routine. See also corresponding C and non OO C++ program. */ -#include <cdio++/cdio.hpp> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif + +#ifdef HAVE_STDIO_H #include <stdio.h> +#endif #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -29,6 +35,8 @@ #include <string.h> #endif +#include <cdio++/cdio.hpp> + /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 diff --git a/example/C++/OO/mmc2.cpp b/example/C++/OO/mmc2.cpp index 55aa1f3c..62b522ab 100644 --- a/example/C++/OO/mmc2.cpp +++ b/example/C++/OO/mmc2.cpp @@ -18,15 +18,20 @@ /* A program to using the MMC interface to list CD and drive features from the MMC GET_CONFIGURATION command . */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" +#define __CDIO_CONFIG_H__ 1 #endif + +#ifdef HAVE_STDIO_H #include <stdio.h> +#endif #ifdef HAVE_SYS_TYPE_H #include <sys/types.h> #endif #ifdef HAVE_STRING_H #include <string.h> #endif + #include <cdio++/cdio.hpp> /* Set how long do wto wait for SCSI-MMC commands to complete */ diff --git a/example/C++/OO/tracks.cpp b/example/C++/OO/tracks.cpp index 7dbb4ff9..f7ef2d28 100644 --- a/example/C++/OO/tracks.cpp +++ b/example/C++/OO/tracks.cpp @@ -17,11 +17,20 @@ /* Simple program to list track numbers and logical sector numbers of a Compact Disc using libcdio. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif + +#ifdef HAVE_STDIO_H #include <stdio.h> -#include <cdio++/cdio.hpp> +#endif #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif + +#include <cdio++/cdio.hpp> + int main(int argc, const char *argv[]) { diff --git a/example/C++/device.cpp b/example/C++/device.cpp index 4ab5610b..ffd8ff8c 100644 --- a/example/C++/device.cpp +++ b/example/C++/device.cpp @@ -19,8 +19,11 @@ /* Simple program to show drivers installed and what the default CD-ROM drive is. See also corresponding C program of a similar name. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif -#include <cdio/cdio.h> #ifdef HAVE_STDIO_H #include <stdio.h> #endif @@ -31,6 +34,8 @@ #include <sys/types.h> #endif +#include <cdio/cdio.h> + #define _(x) x /* Prints out drive capabilities */ diff --git a/example/C++/eject.cpp b/example/C++/eject.cpp index f49e9376..e4835279 100644 --- a/example/C++/eject.cpp +++ b/example/C++/eject.cpp @@ -20,7 +20,11 @@ If a single argument is given, it is used as the CD-ROM device to eject/close. Otherwise a CD-ROM drive will be scanned for. */ -#include <cdio/cdio.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif + #ifdef HAVE_STDIO_H #include <stdio.h> #endif @@ -31,6 +35,8 @@ #include <string.h> #endif +#include <cdio/cdio.h> + int main(int argc, const char *argv[]) { diff --git a/example/C++/isofile.cpp b/example/C++/isofile.cpp index f3be5fc6..fdb84228 100644 --- a/example/C++/isofile.cpp +++ b/example/C++/isofile.cpp @@ -29,14 +29,11 @@ #define LOCAL_FILENAME "copying" -#include <sys/types.h> -#include <cdio/cdio.h> -#include <cdio/iso9660.h> - #include "portable.h" +#ifdef HAVE_STDIO_H #include <stdio.h> - +#endif #ifdef HAVE_ERRNO_H #include <errno.h> #endif @@ -53,6 +50,9 @@ #include <sys/types.h> #endif +#include <cdio/cdio.h> +#include <cdio/iso9660.h> + #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ diff --git a/example/C++/isofile2.cpp b/example/C++/isofile2.cpp index 8670f84e..838e2dd1 100644 --- a/example/C++/isofile2.cpp +++ b/example/C++/isofile2.cpp @@ -29,13 +29,11 @@ #define LOCAL_FILENAME "copying" -#include <sys/types.h> -#include <cdio/cdio.h> -#include <cdio/iso9660.h> - #include "portable.h" -#include <stdio.h> +#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif #ifdef HAVE_ERRNO_H #include <errno.h> #endif @@ -52,6 +50,9 @@ #include <sys/types.h> #endif +#include <cdio/cdio.h> +#include <cdio/iso9660.h> + #define CEILING(x, y) ((x+(y-1))/y) #define my_exit(rc) \ diff --git a/example/C++/isolist.cpp b/example/C++/isolist.cpp index 0db05825..68a09647 100644 --- a/example/C++/isolist.cpp +++ b/example/C++/isolist.cpp @@ -33,12 +33,13 @@ #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/copying.iso" #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" +#define __CDIO_CONFIG_H__ 1 #endif -#include <cdio/iso9660.h> +#ifdef HAVE_STDIO_H #include <stdio.h> - +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -52,6 +53,8 @@ #include <sys/types.h> #endif +#include <cdio/iso9660.h> + #define print_vd_info(title, fn) \ if (fn(p_iso, &psz_str)) { \ printf(title ": %s\n", psz_str); \ diff --git a/example/C++/mmc1.cpp b/example/C++/mmc1.cpp index 78b68047..67a6cd58 100644 --- a/example/C++/mmc1.cpp +++ b/example/C++/mmc1.cpp @@ -20,11 +20,26 @@ This basically the libdio mmc_get_hwinfo() routine. See also corresponding C and OO C++ program. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif + +#ifdef HAVE_STDIO_H #include <stdio.h> +#endif +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + #include <cdio/cdio.h> #include <cdio/mmc.h> -#include <string.h> /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 diff --git a/example/C++/mmc2.cpp b/example/C++/mmc2.cpp index a9190589..ecec992c 100644 --- a/example/C++/mmc2.cpp +++ b/example/C++/mmc2.cpp @@ -17,11 +17,23 @@ /* A program to using the MMC interface to list CD and drive features from the MMC GET_CONFIGURATION command . */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif + +#ifdef HAVE_STDIO_H #include <stdio.h> +#endif +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif + #include <cdio/cdio.h> #include <cdio/mmc.h> -#include <string.h> /* Set how long do wto wait for SCSI-MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 diff --git a/example/C++/paranoia.cpp b/example/C++/paranoia.cpp index a75581f2..c9c452f0 100644 --- a/example/C++/paranoia.cpp +++ b/example/C++/paranoia.cpp @@ -19,6 +19,10 @@ /* Simple program to show using libcdio's version of the CD-DA paranoia. library. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif #include <iostream> #include <cstdlib> @@ -27,14 +31,15 @@ using namespace std; extern "C"{ - #include <cdio/paranoia.h> - #include <cdio/cd_types.h> + #ifdef HAVE_STDIO_H #include <stdio.h> - -#ifdef HAVE_STDLIB_H + #endif + #ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif + #endif + #include <cdio/paranoia.h> + #include <cdio/cd_types.h> } diff --git a/example/C++/paranoia2.cpp b/example/C++/paranoia2.cpp index f3a2d096..b2cbbd7f 100644 --- a/example/C++/paranoia2.cpp +++ b/example/C++/paranoia2.cpp @@ -20,15 +20,21 @@ calling paranoia's open. I imagine in many cases such as media players this may be what will be done since, one may want to get CDDB/CD-Text info beforehand. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif -#include <cdio/cdda.h> -#include <cdio/cd_types.h> +#ifdef HAVE_STDIO_H #include <stdio.h> - +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif +#include <cdio/cdda.h> +#include <cdio/cd_types.h> + int main(int argc, const char *argv[]) { |