First-cut to auto-scan for device capabilities

This commit is contained in:
rocky
2003-09-28 17:14:20 +00:00
parent 624ac3c529
commit 083f472570
11 changed files with 502 additions and 221 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: cd_types.h,v 1.1 2003/08/16 15:34:58 rocky Exp $
$Id: cd_types.h,v 1.2 2003/09/28 17:14:20 rocky Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
@@ -32,16 +32,16 @@
extern "C" {
#endif /* __cplusplus */
#define CDIO_FS_NO_DATA 0 /* audio only */
#define CDIO_FS_HIGH_SIERRA 1
#define CDIO_FS_ISO_9660 2
#define CDIO_FS_INTERACTIVE 3
#define CDIO_FS_HFS 4
#define CDIO_FS_UFS 5
#define CDIO_FS_EXT2 6
#define CDIO_FS_ISO_HFS 7 /* both hfs & isofs filesystem */
#define CDIO_FS_ISO_9660_INTERACTIVE 8 /* both CD-RTOS and isofs filesystem */
#define CDIO_FS_3DO 9
#define CDIO_FS_AUDIO 1 /* audio only - not really a fs */
#define CDIO_FS_HIGH_SIERRA 2
#define CDIO_FS_ISO_9660 3
#define CDIO_FS_INTERACTIVE 4
#define CDIO_FS_HFS 5
#define CDIO_FS_UFS 6
#define CDIO_FS_EXT2 7
#define CDIO_FS_ISO_HFS 8 /* both hfs & isofs filesystem */
#define CDIO_FS_ISO_9660_INTERACTIVE 9 /* both CD-RTOS and isofs filesystem */
#define CDIO_FS_3DO 10
#define CDIO_FS_MASK 15 /* Should be 2*n-1 and > above */
#define CDIO_FS_UNKNOWN CDIO_FS_MASK
@@ -60,14 +60,17 @@ extern "C" {
#define CDIO_FS_ANAL_HIDDEN_TRACK 128
#define CDIO_FS_ANAL_CDTV 256
#define CDIO_FS_ANAL_BOOTABLE 512
#define CDIO_FS_ANAL_VIDEOCDI 1024
#define CDIO_FS_ANAL_VIDEOCD 1024 /* VCD 1.1 */
#define CDIO_FS_ANAL_ROCKRIDGE 2048
#define CDIO_FS_ANAL_JOLIET 4096
#define CDIO_FS_ANAL_SVCD 8192 /* Super VCD or Choiji Video CD */
#define CDIO_FS_ANAL_CVD 16384 /* Choiji Video CD */
/* Pattern which can be used by cdio_get_devices to specify matching
any sort of CD.
*/
#define CDIO_FS_MATCH_ALL (cdio_fs_anal_t) (~CDIO_FS_MASK)
typedef int cdio_fs_anal_t;
typedef struct
{
@@ -82,7 +85,7 @@ typedef struct
have at track track_num. Return information about the CD image
is returned in cdio_analysis and the return value.
*/
cdio_fs_anal_t cdio_guess_cd_type(/*in*/ CdIo *cdio, int start_session,
cdio_fs_anal_t cdio_guess_cd_type(const CdIo *cdio, int start_session,
track_t track_num,
/*out*/ cdio_analysis_t *cdio_analysis);

View File

@@ -1,5 +1,5 @@
/* -*- c -*-
$Id: cdio.h,v 1.23 2003/09/28 01:04:57 rocky Exp $
$Id: cdio.h,v 1.24 2003/09/28 17:14:20 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -115,12 +115,43 @@ extern "C" {
*/
void cdio_destroy (CdIo *obj);
/*!
Free device list returned by cdio_get_devices or
cdio_get_devices_with_cap.
*/
void cdio_free_device_list (char * device_list[]);
/*!
Return the value associatied with key. NULL is returned if obj is NULL
or "key" does not exist.
*/
const char * cdio_get_arg (const CdIo *obj, const char key[]);
/*!
Return an array of device names in search_devices that have at
least the capabilities listed by cap. If search_devices is NULL,
then we'll search all possible CD drives.
If "any" is set false then every capability listed in the extended
portion of capabilities (i.e. not the basic filesystem) must be
satisified. If "any" is set true, then if any of the capabilities
matches, we call that a success.
To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
NULL is returned if we couldn't get a default device.
*/
char ** cdio_get_devices_with_cap (char* search_devices[],
cdio_fs_anal_t capabilities, bool any);
/*!
Return an array of device names. if CdIo is NULL (we haven't
initialized a specific device driver), then find a suitable device
driver.
NULL is returned if we couldn't return a list of devices.
*/
char ** cdio_get_devices (const CdIo *obj);
/*!
Return a string containing the default CD device if none is specified.
if CdIo is NULL (we haven't initialized a specific device driver),

View File

@@ -1,5 +1,5 @@
/*
$Id: types.h,v 1.6 2003/09/06 02:51:29 rocky Exp $
$Id: types.h,v 1.7 2003/09/28 17:14:20 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
@@ -218,6 +218,8 @@ extern "C" {
*/
#define CDIO_INVALID_LSN 0xFFFFFFFF
typedef int cdio_fs_anal_t;
#ifdef __cplusplus
}
#endif /* __cplusplus */