Harmonize source headers: C examples (Patch 4/5)

This commit is contained in:
R. Bernstein
2012-03-02 23:41:06 -05:00
parent a08e5931e0
commit c67e423704
23 changed files with 164 additions and 67 deletions

View File

@@ -22,36 +22,35 @@
CDDA player program using curses display see cdda-player in this
distribution.
*/
#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
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#include <signal.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <signal.h>
#include <cdio/cdio.h>
#include <cdio/mmc.h>
#include <cdio/util.h>
#include <cdio/cd_types.h>

View File

@@ -16,16 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* config.h has to come first else _FILE_OFFSET_BITS are redefined in
say opensolaris. */
/* Test media changed */
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#endif
#include <cdio/cdio.h>
/* Test media changed */
#ifdef HAVE_STDIO_H
# include <stdio.h>
#endif
@@ -58,6 +54,8 @@
#define sleep(s) Sleep(1000*s)
#endif
#include <cdio/cdio.h>
int
main(int argc, const char *argv[])
{

View File

@@ -14,10 +14,19 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <cdio/cdio.h>
#include <stdio.h>
#include <string.h>
static void usage(char * progname)
{

View File

@@ -18,17 +18,20 @@
/* Simple program to list CD-Text info of a Compact Disc using
libcdio. See also corresponding C++ programs of similar names. */
#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
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/cdtext.h>
#include <cdio/cdio.h>
#include <cdio/cdtext.h>
static void
print_cdtext_track_info(cdtext_t *cdtext, track_t i_track, const char *psz_msg) {

View File

@@ -18,7 +18,11 @@
/* Simple program to show drivers installed and what the default
CD-ROM drive is. See also corresponding C++ programs of similar
names .*/
#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
@@ -29,6 +33,8 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#define _(x) x
/* Prints out drive capabilities */

View File

@@ -22,11 +22,18 @@
discs. The disc-ID can be used to query info (tracks, title,
interpret) about compact audio discs from a CDDB-Server.
*/
#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
#include <cdio/cdio.h>
static int cddb_sum(int n)

View File

@@ -17,7 +17,11 @@
/* Simple program to show drivers installed and what the default
CD-ROM drive is and what CD drives are available. */
#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
@@ -27,6 +31,8 @@
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/cd_types.h>
#include <cdio/logging.h>

View File

@@ -24,7 +24,11 @@
See also corresponding C++ program of a similar name.
*/
#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
@@ -35,6 +39,8 @@
#include <string.h>
#endif
#include <cdio/cdio.h>
int
main(int argc, const char *argv[])
{

View File

@@ -33,7 +33,6 @@
say opensolaris. */
#include "portable.h"
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/iso9660.h>

View File

@@ -39,9 +39,6 @@
say opensolaris. */
#include "portable.h"
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -64,6 +61,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

@@ -30,12 +30,9 @@
say opensolaris. */
#include "portable.h"
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -52,6 +49,9 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
int
main(int argc, const char *argv[])
{

View File

@@ -30,15 +30,13 @@
#define ISO9660_IMAGE ISO9660_IMAGE_PATH "copying.iso"
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#include "config.h"
#define __CDIO_CONFIG_H__ 1
#endif
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -52,6 +50,9 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#define print_vd_info(title, fn) \
if (fn(p_iso, &psz_str)) { \
printf(title ": %s\n", psz_str); \

View File

@@ -32,15 +32,13 @@
#define ISO9660_IMAGE ISO9660_IMAGE_PATH "copying.iso"
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#include "config.h"
#define __CDIO_CONFIG_H__ 1
#endif
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -54,6 +52,9 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
#define print_vd_info(title, fn) \
if (fn(p_iso, &psz_str)) { \
printf(title ": %s\n", psz_str); \

View File

@@ -22,16 +22,20 @@
See also corresponding C++ programs.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#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 <cdio/mmc_cmds.h>

View File

@@ -18,16 +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"
# define __CDIO_CONFIG_H__ 1
#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>

View File

@@ -22,10 +22,13 @@
routines.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#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

View File

@@ -19,17 +19,25 @@
the libdio scsi_mmc_get_hwinfo() routine.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#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_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.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

@@ -19,9 +19,21 @@
A somewhat simplified program to show the use of cdio_guess_cd_type().
Figure out the kind of CD image we've got.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/cd_types.h>

View File

@@ -19,9 +19,21 @@
A slightly improved sample3 program: we handle cdio logging and
take an optional CD-location.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/cd_types.h>
#include <cdio/logging.h>

View File

@@ -18,11 +18,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>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
int
main(int argc, const char *argv[])
{

View File

@@ -25,12 +25,14 @@
#define UDF_IMAGE_PATH "../"
#define UDF_IMAGE "/src2/cd-images/udf/UDF102ISO.iso"
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/udf.h>
#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
@@ -44,6 +46,9 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/udf.h>
#define udf_PATH_DELIMITERS "/\\"
static void

View File

@@ -27,12 +27,14 @@
#define UDF_IMAGE "/src2/cd-images/udf/test2.iso"
#define UDF_FILENAME "/parse/cue.L"
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/udf.h>
#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
@@ -46,6 +48,9 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/udf.h>
#define CEILING(x, y) ((x+(y-1))/y)
#define udf_PATH_DELIMITERS "/\\"

View File

@@ -26,8 +26,8 @@
/* config.h has to come first else _FILE_OFFSET_BITS are redefined in
say opensolaris. */
#ifdef HAVE_CONFIG_H
# include "config.h"
# define __CDIO_CONFIG_H__ 1
#include "config.h"
#define __CDIO_CONFIG_H__ 1
#endif
/* This is the UDF image. */
@@ -36,12 +36,9 @@
#define UDF_FILENAME "/COPYING"
#define LOCAL_FILENAME "copying"
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/udf.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -58,6 +55,9 @@
#include <sys/types.h>
#endif
#include <cdio/cdio.h>
#include <cdio/udf.h>
#define CEILING(x, y) ((x+(y-1))/y)
#define udf_PATH_DELIMITERS "/\\"