Another "cooked" name bites the dust. Soem doxygen cleanup too.

This commit is contained in:
rocky
2005-02-05 23:45:57 +00:00
parent 187c314225
commit 0e2f37193c
2 changed files with 61 additions and 70 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cdda.h,v 1.16 2005/02/05 12:37:35 rocky Exp $ $Id: cdda.h,v 1.17 2005/02/05 23:45:57 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Xiph.org Copyright (C) 2001 Xiph.org
@@ -178,25 +178,21 @@ extern cdrom_drive_t *cdio_cddap_find_a_cdrom(int messagedest,
char **ppsz_message); char **ppsz_message);
/** Returns a paranoia CD-ROM drive object with a CD-DA in it. /** Returns a paranoia CD-ROM drive object with a CD-DA in it.
@see cdda_identify_cdio @see cdio_cddap_identify_cdio
*/ */
extern cdrom_drive_t *cdio_cddap_identify(const char *psz_device, extern cdrom_drive_t *cdio_cddap_identify(const char *psz_device,
int messagedest, int messagedest,
char **ppsz_message); char **ppsz_message);
/** Returns a paranoia CD-ROM drive ojbect with a CD-DA in it. /** Returns a paranoia CD-ROM drive ojbect with a CD-DA in it.
In contrast to cdda_identify, we start out with an initialzed p_cdio In contrast to cdio_cddap_identify, we start out with an initialzed p_cdio
object. For example you may have used that for other purposes such object. For example you may have used that for other purposes such
as to get CDDB/CD-Text information. as to get CDDB/CD-Text information.
@see cdda_identify @see cdio_cddap_identify
*/ */
cdrom_drive_t *cdio_cddap_identify_cdio(CdIo_t *p_cdio, cdrom_drive_t *cdio_cddap_identify_cdio(CdIo_t *p_cdio,
int messagedest, char **ppsz_messages); int messagedest, char **ppsz_messages);
/** Obsolete interface. Don't use. @see cdda_identify */
extern cdrom_drive_t *cdio_cddap_identify_cooked(const char *ppsz_device,
int messagedest,
char **ppsz_message);
/** drive-oriented functions */ /** drive-oriented functions */
extern int cdio_cddap_speed_set(cdrom_drive_t *d, int speed); extern int cdio_cddap_speed_set(cdrom_drive_t *d, int speed);

View File

@@ -1,5 +1,5 @@
/* /*
$Id: scan_devices.c,v 1.22 2005/02/05 23:16:34 rocky Exp $ $Id: scan_devices.c,v 1.23 2005/02/05 23:45:57 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -130,37 +130,7 @@ cdio_cddap_find_a_cdrom(int messagedest, char **ppsz_messages){
return(NULL); return(NULL);
} }
cdrom_drive_t * #ifdef DEVICE_IN_FILESYSTEM
cdda_identify(const char *psz_device, int messagedest,char **ppsz_messages)
{
cdrom_drive_t *d=NULL;
if (psz_device)
idmessage(messagedest, ppsz_messages, "Checking %s for cdrom...",
psz_device);
else
idmessage(messagedest, ppsz_messages, "Checking for cdrom...", NULL);
d=cdio_cddap_identify_cooked(psz_device, messagedest, ppsz_messages);
return(d);
}
cdrom_drive_t *
cdio_cddap_identify_cdio(CdIo_t *p_cdio, int messagedest, char **ppsz_messages)
{
if (!p_cdio) return NULL;
{
const char *psz_device = cdio_get_arg(p_cdio, "source");
idmessage(messagedest, ppsz_messages, "Checking %s for cdrom...",
psz_device);
return cdda_identify_device_cdio(p_cdio, psz_device, messagedest,
ppsz_messages);
}
}
#ifdef HAVE_LSTAT
static char * static char *
test_resolve_symlink(const char *file, int messagedest, char **ppsz_messages) test_resolve_symlink(const char *file, int messagedest, char **ppsz_messages)
{ {
@@ -180,6 +150,61 @@ test_resolve_symlink(const char *file, int messagedest, char **ppsz_messages)
} }
#endif #endif
/** Returns a paranoia CD-ROM drive object with a CD-DA in it.
@see cdio_cddap_identify_cdio
*/
cdrom_drive_t *
cdio_cddap_identify(const char *psz_dev, int messagedest,
char **ppsz_messages)
{
CdIo_t *p_cdio = NULL;
if (psz_dev)
idmessage(messagedest, ppsz_messages, "Checking %s for cdrom...",
psz_dev);
else
idmessage(messagedest, ppsz_messages, "Checking for cdrom...", NULL);
#ifdef DEVICE_IN_FILESYSTEM
if (psz_dev) {
char *psz_device = test_resolve_symlink(psz_dev, messagedest,
ppsz_messages);
if ( psz_device ) {
cdrom_drive_t *d=NULL;
p_cdio = cdio_open(psz_device, DRIVER_UNKNOWN);
d = cdda_identify_device_cdio(p_cdio, psz_device, messagedest,
ppsz_messages);
free(psz_device);
return d;
}
}
#endif
p_cdio = cdio_open(psz_dev, DRIVER_UNKNOWN);
return cdda_identify_device_cdio(p_cdio, psz_dev, messagedest,
ppsz_messages);
}
/** Returns a paranoia CD-ROM drive ojbect with a CD-DA in it.
In contrast to cdio_cddap_identify, we start out with an initialzed p_cdio
object. For example you may have used that for other purposes such
as to get CDDB/CD-Text information.
@see cdio_cddap_identify
*/
cdrom_drive_t *
cdio_cddap_identify_cdio(CdIo_t *p_cdio, int messagedest, char **ppsz_messages)
{
if (!p_cdio) return NULL;
{
const char *psz_device = cdio_get_arg(p_cdio, "source");
idmessage(messagedest, ppsz_messages, "Checking %s for cdrom...",
psz_device);
return cdda_identify_device_cdio(p_cdio, psz_device, messagedest,
ppsz_messages);
}
}
static cdrom_drive_t * static cdrom_drive_t *
cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device, cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device,
int messagedest, char **ppsz_messages) int messagedest, char **ppsz_messages)
@@ -300,33 +325,3 @@ cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device,
return(d); return(d);
} }
/* Really has nothing to with "cooked" mode. This is historical stuff
put in to fool folks who love to give opinions based on a
superficial reading of code. Down the line when we're ready to deal
with such folks, perhaps this routine should be renamed.
*/
cdrom_drive_t *
cdio_cddap_identify_cooked(const char *psz_dev, int messagedest,
char **ppsz_messages)
{
CdIo_t *p_cdio = NULL;
#ifdef DEVICE_IN_FILESYSTEM
if (psz_dev) {
char *psz_device = test_resolve_symlink(psz_dev, messagedest,
ppsz_messages);
if ( psz_device ) {
cdrom_drive_t *d=NULL;
p_cdio = cdio_open(psz_device, DRIVER_UNKNOWN);
d = cdda_identify_device_cdio(p_cdio, psz_device, messagedest,
ppsz_messages);
free(psz_device);
return d;
}
}
#endif
p_cdio = cdio_open(psz_dev, DRIVER_UNKNOWN);
return cdda_identify_device_cdio(p_cdio, psz_dev, messagedest,
ppsz_messages);
}