version 1.3, 2007/05/27 14:50:24 |
version 1.4, 2007/05/28 22:04:24 |
|
|
|
|
static int write_sector(int fd, u_char *sec, u_int32_t secsize); |
static int write_sector(int fd, u_char *sec, u_int32_t secsize); |
|
|
int read_data_sector(int fd, u_int32_t lba, u_char *sec, u_int32_t secsize); |
int read_data_sector(u_int32_t lba, u_char *sec, u_int32_t secsize); |
|
|
struct track_info { |
struct track_info { |
int fd; /* descriptor of output file */ |
int fd; /* descriptor of output file */ |
|
|
* [EAGAIN] The operation must be made again. XXX - not implemented |
* [EAGAIN] The operation must be made again. XXX - not implemented |
*/ |
*/ |
int |
int |
read_data_sector(int fd, u_int32_t lba, u_char *sec, u_int32_t secsize) |
read_data_sector(u_int32_t lba, u_char *sec, u_int32_t secsize) |
{ |
{ |
scsireq_t scr; |
scsireq_t scr; |
u_char *cmd; |
u_char *cmd; |
|
|
fprintf(stderr, "track %u '%c' %08u/%08u %3u%%\r", ti->track, |
fprintf(stderr, "track %u '%c' %08u/%08u %3u%%\r", ti->track, |
(ti->isaudio) ? 'a' : 'd', i, n_sec, 100 * i / n_sec); |
(ti->isaudio) ? 'a' : 'd', i, n_sec, 100 * i / n_sec); |
|
|
error = read_data_sector(fd, i + ti->start_lba, sec, blksize); |
error = read_data_sector(i + ti->start_lba, sec, blksize); |
if (error == 0) { |
if (error == 0) { |
if (write_sector(ti->fd, sec, blksize) != 0) { |
if (write_sector(ti->fd, sec, blksize) != 0) { |
free(sec); |
free(sec); |
|
|
int |
int |
cdrip(char *arg) |
cdrip(char *arg) |
{ |
{ |
|
|
return rip_tracks(arg, rip_next_track, 1); |
return rip_tracks(arg, rip_next_track, 1); |
} |
} |
|
|
int |
int |
cdplay(char *arg) |
cdplay(char *arg) |
{ |
{ |
|
|
return rip_tracks(arg, play_next_track, 0); |
return rip_tracks(arg, play_next_track, 0); |
} |
} |