Allow more freedom in specifying access mode.

Image drivers now have an "image" access mode.
This commit is contained in:
rocky
2004-05-13 01:50:10 +00:00
parent cf6fd8b4c8
commit cb9db0a7d5
9 changed files with 88 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: bincue.c,v 1.17 2004/05/11 02:15:58 rocky Exp $
$Id: bincue.c,v 1.18 2004/05/13 01:50:23 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -24,7 +24,7 @@
(*.cue).
*/
static const char _rcsid[] = "$Id: bincue.c,v 1.17 2004/05/11 02:15:58 rocky Exp $";
static const char _rcsid[] = "$Id: bincue.c,v 1.18 2004/05/13 01:50:23 rocky Exp $";
#include "cdio_assert.h"
#include "cdio_private.h"
@@ -713,6 +713,8 @@ _get_arg_bincue (void *env, const char key[])
return _obj->gen.source_name;
} else if (!strcmp (key, "cue")) {
return _obj->cue_name;
} else if (!strcmp(key, "access-mode")) {
return "image";
}
return NULL;
}

View File

@@ -1,5 +1,5 @@
/*
$Id: cdrdao.c,v 1.6 2004/05/11 02:16:00 rocky Exp $
$Id: cdrdao.c,v 1.7 2004/05/13 01:50:24 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
toc reading routine adapted from cuetools
@@ -25,7 +25,7 @@
(*.cue).
*/
static const char _rcsid[] = "$Id: cdrdao.c,v 1.6 2004/05/11 02:16:00 rocky Exp $";
static const char _rcsid[] = "$Id: cdrdao.c,v 1.7 2004/05/13 01:50:24 rocky Exp $";
#include "cdio_assert.h"
#include "cdio_private.h"
@@ -1054,6 +1054,8 @@ _get_arg_cdrdao (void *env, const char key[])
return _obj->tocent[0].filename;
} else if (!strcmp (key, "toc")) {
return _obj->toc_name;
} else if (!strcmp(key, "access-mode")) {
return "image";
}
return NULL;
}
@@ -1200,8 +1202,8 @@ cdio_is_tocfile(const char *toc_name)
CdIo *
cdio_open_am_cdrdao (const char *psz_source_name, const char *psz_access_mode)
{
if (psz_access_mode != NULL)
cdio_warn ("there is only one access mode for toc. Arg %s ignored",
if (psz_access_mode != NULL && strcmp(psz_access_mode, "image"))
cdio_warn ("there is only one access mode, 'image' for toc. Arg %s ignored",
psz_access_mode);
return cdio_open_cdrdao(psz_source_name);
}

View File

@@ -1,5 +1,5 @@
/*
$Id: nrg.c,v 1.13 2004/05/11 02:16:01 rocky Exp $
$Id: nrg.c,v 1.14 2004/05/13 01:50:25 rocky Exp $
Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -48,7 +48,7 @@
#include "cdio_private.h"
#include "_cdio_stdio.h"
static const char _rcsid[] = "$Id: nrg.c,v 1.13 2004/05/11 02:16:01 rocky Exp $";
static const char _rcsid[] = "$Id: nrg.c,v 1.14 2004/05/13 01:50:25 rocky Exp $";
/* structures used */
@@ -1047,7 +1047,9 @@ _get_arg_nrg (void *env, const char key[])
if (!strcmp (key, "source")) {
return _obj->gen.source_name;
}
} else if (!strcmp(key, "access-mode")) {
return "image";
}
return NULL;
}
@@ -1185,7 +1187,7 @@ cdio_is_nrg(const char *psz_nrg)
CdIo *
cdio_open_am_nrg (const char *psz_source_name, const char *psz_access_mode)
{
if (psz_access_mode != NULL)
if (psz_access_mode != NULL && strcmp(psz_access_mode, "image"))
cdio_warn ("there is only one access mode for nrg. Arg %s ignored",
psz_access_mode);
return cdio_open_nrg(psz_source_name);