Add C++ wrapper routines for MMC commands inside CdioDevice class.
Some comments/code in sample programs gone over and new onse added for libcdio++.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: mmc1.c,v 1.5 2005/03/09 10:29:06 rocky Exp $
|
||||
$Id: mmc1.c,v 1.6 2005/11/14 01:15:33 rocky Exp $
|
||||
|
||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -18,17 +18,23 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Simple program to show use of MMC interface. Is basically the
|
||||
the libdio mmc_get_hwinfo() routine.
|
||||
/* Sample program to show use of the MMC interface.
|
||||
An optional drive name can be supplied as an argument.
|
||||
This basically the libdio mmc_get_hwinfo() routine.
|
||||
See also corresponding C++ programs.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#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 to wait for MMC commands to complete */
|
||||
#define DEFAULT_TIMEOUT_MS 10000
|
||||
@@ -37,8 +43,10 @@ int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
CdIo_t *p_cdio;
|
||||
const char *psz_drive = NULL;
|
||||
|
||||
p_cdio = cdio_open (NULL, DRIVER_DEVICE);
|
||||
if (argc > 1) psz_drive = argv[1];
|
||||
p_cdio = cdio_open (psz_drive, DRIVER_UNKNOWN);
|
||||
|
||||
if (!p_cdio) {
|
||||
printf("Couldn't find CD\n");
|
||||
|
||||
Reference in New Issue
Block a user