Remove duplicate functions.

Submitted by:	gj
This commit is contained in:
Jordan K. Hubbard 1995-02-09 11:30:07 +00:00
parent 11af896263
commit 640ed9d2a8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6271
2 changed files with 2 additions and 128 deletions

View File

@ -33,7 +33,7 @@
*/
/* $Id: scd.c,v 1.5 1995/01/30 05:29:03 phk Exp $ */
/* $Id: scd.c,v 1.6 1995/02/06 22:35:06 jkh Exp $ */
/* Please send any comments to micke@dynas.se */
@ -1527,67 +1527,4 @@ scd_toc_entrys (int unit, struct ioc_read_toc_entry *te)
}
/* these two routines for xcdplayer - "borrowed" from mcd.c */
static int
scd_toc_header (int unit, struct ioc_toc_header* th)
{
struct scd_data *cd = scd_data + unit;
int rc;
if (!(cd->flags & SCDTOC) && (rc = read_toc(unit)) != 0) {
print_error(unit, rc);
return EIO;
}
th->starting_track = cd->first_track;
th->ending_track = cd->last_track;
th->len = 0; /* not used */
return 0;
}
static int
scd_toc_entrys (int unit, struct ioc_read_toc_entry *te)
{
struct scd_data *cd = scd_data + unit;
struct cd_toc_entry toc_entry;
int rc, i, len = te->data_len;
if (!(cd->flags & SCDTOC) && (rc = read_toc(unit)) != 0) {
print_error(unit, rc);
return EIO;
}
/* find the toc to copy*/
i = te->starting_track;
if (i == SCD_LASTPLUS1)
i = cd->last_track + 1;
/* verify starting track */
if (i < cd->first_track || i > cd->last_track+1)
return EINVAL;
/* valid length ? */
if (len < sizeof(struct cd_toc_entry)
|| (len % sizeof(struct cd_toc_entry)) != 0)
return EINVAL;
/* copy the toc data */
toc_entry.control = cd->toc[i].ctl;
toc_entry.addr_type = te->address_format;
toc_entry.track = i;
if (te->address_format == CD_MSF_FORMAT) {
toc_entry.addr.msf.unused = 0;
toc_entry.addr.msf.minute = bcd2bin(cd->toc[i].start_msf[0]);
toc_entry.addr.msf.second = bcd2bin(cd->toc[i].start_msf[1]);
toc_entry.addr.msf.frame = bcd2bin(cd->toc[i].start_msf[2]);
}
/* copy the data back */
if (copyout(&toc_entry, te->data, sizeof(struct cd_toc_entry)) != 0)
return EFAULT;
return 0;
}
#endif /* NSCD > 0 */

View File

@ -33,7 +33,7 @@
*/
/* $Id: scd.c,v 1.5 1995/01/30 05:29:03 phk Exp $ */
/* $Id: scd.c,v 1.6 1995/02/06 22:35:06 jkh Exp $ */
/* Please send any comments to micke@dynas.se */
@ -1527,67 +1527,4 @@ scd_toc_entrys (int unit, struct ioc_read_toc_entry *te)
}
/* these two routines for xcdplayer - "borrowed" from mcd.c */
static int
scd_toc_header (int unit, struct ioc_toc_header* th)
{
struct scd_data *cd = scd_data + unit;
int rc;
if (!(cd->flags & SCDTOC) && (rc = read_toc(unit)) != 0) {
print_error(unit, rc);
return EIO;
}
th->starting_track = cd->first_track;
th->ending_track = cd->last_track;
th->len = 0; /* not used */
return 0;
}
static int
scd_toc_entrys (int unit, struct ioc_read_toc_entry *te)
{
struct scd_data *cd = scd_data + unit;
struct cd_toc_entry toc_entry;
int rc, i, len = te->data_len;
if (!(cd->flags & SCDTOC) && (rc = read_toc(unit)) != 0) {
print_error(unit, rc);
return EIO;
}
/* find the toc to copy*/
i = te->starting_track;
if (i == SCD_LASTPLUS1)
i = cd->last_track + 1;
/* verify starting track */
if (i < cd->first_track || i > cd->last_track+1)
return EINVAL;
/* valid length ? */
if (len < sizeof(struct cd_toc_entry)
|| (len % sizeof(struct cd_toc_entry)) != 0)
return EINVAL;
/* copy the toc data */
toc_entry.control = cd->toc[i].ctl;
toc_entry.addr_type = te->address_format;
toc_entry.track = i;
if (te->address_format == CD_MSF_FORMAT) {
toc_entry.addr.msf.unused = 0;
toc_entry.addr.msf.minute = bcd2bin(cd->toc[i].start_msf[0]);
toc_entry.addr.msf.second = bcd2bin(cd->toc[i].start_msf[1]);
toc_entry.addr.msf.frame = bcd2bin(cd->toc[i].start_msf[2]);
}
/* copy the data back */
if (copyout(&toc_entry, te->data, sizeof(struct cd_toc_entry)) != 0)
return EFAULT;
return 0;
}
#endif /* NSCD > 0 */