Harmonize source headers: C++ examples [PATCH 3/5] from pbatard.

This commit is contained in:
R. Bernstein
2012-03-03 07:42:11 -05:00
parent 422693a7cd
commit 2b84a552e3
20 changed files with 151 additions and 54 deletions

View File

@@ -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/"

View File

@@ -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 */

View File

@@ -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[])
{

View File

@@ -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[])
{

View File

@@ -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) { \

View File

@@ -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) \

View File

@@ -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) \

View File

@@ -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); \

View File

@@ -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

View File

@@ -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 */

View File

@@ -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[])
{

View File

@@ -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 */

View File

@@ -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[])
{

View File

@@ -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) \

View File

@@ -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) \

View File

@@ -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); \

View File

@@ -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

View File

@@ -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

View File

@@ -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"{
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <cdio/paranoia.h>
#include <cdio/cd_types.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
}

View File

@@ -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[])
{