1.1 --- a/src/gdrom/linux.c Sun Feb 11 10:11:05 2007 +0000
1.2 +++ b/src/gdrom/linux.c Tue Oct 16 12:28:42 2007 +0000
1.5 - * $Id: linux.c,v 1.4 2007-02-11 10:11:05 nkeynes Exp $
1.6 + * $Id: linux.c,v 1.5 2007-10-06 08:58:00 nkeynes Exp $
1.8 * Linux cd-rom device driver.
1.11 static gdrom_disc_t linux_open_device( const gchar *filename, FILE *f );
1.12 static gdrom_error_t linux_read_disc_toc( gdrom_image_t disc );
1.13 static gdrom_error_t linux_read_sector( gdrom_disc_t disc, uint32_t sector,
1.14 - int mode, char *buf, uint32_t *length );
1.15 -static gdrom_error_t linux_send_command( int fd, char *cmd, char *buffer, size_t *buflen,
1.16 + int mode, unsigned char *buf, uint32_t *length );
1.17 +static gdrom_error_t linux_send_command( int fd, char *cmd, unsigned char *buffer, size_t *buflen,
1.19 static int linux_drive_status( gdrom_disc_t disc );
1.22 static gdrom_disc_t linux_open_device( const gchar *filename, FILE *f )
1.25 - int fd = fileno(f);
1.27 disc = gdrom_image_new(f);
1.28 if( disc == NULL ) {
1.30 if( status == CDS_DISC_OK ) {
1.31 status = ioctl(fd, CDROM_MEDIA_CHANGED, CDSL_CURRENT);
1.33 - linux_read_disc_toc(disc);
1.34 + linux_read_disc_toc( (gdrom_image_t)disc);
1.36 return ((gdrom_image_t)disc)->disc_type | IDE_DISC_READY;
1.40 int fd = fileno(disc->file);
1.41 unsigned char buf[MAXTOCSIZE];
1.42 - int buflen = sizeof(buf);
1.43 + size_t buflen = sizeof(buf);
1.44 char cmd[12] = { 0x43, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1.46 cmd[7] = (sizeof(buf))>>8;
1.47 @@ -188,13 +187,12 @@
1.50 static gdrom_error_t linux_read_sector( gdrom_disc_t disc, uint32_t sector,
1.51 - int mode, char *buf, uint32_t *length )
1.52 + int mode, unsigned char *buf, uint32_t *length )
1.54 gdrom_image_t image = (gdrom_image_t)disc;
1.55 int fd = fileno(image->file);
1.56 uint32_t real_sector = sector - CD_MSF_OFFSET;
1.57 uint32_t sector_size = MAX_SECTOR_SIZE;
1.59 char cmd[12] = { 0xBE, 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1.61 cmd[1] = (mode & 0x0E) << 1;
1.63 * @return 0 on success, -1 on an operating system error, or a sense error
1.64 * code on a device error.
1.66 -static gdrom_error_t linux_send_command( int fd, char *cmd, char *buffer, size_t *buflen,
1.67 +static gdrom_error_t linux_send_command( int fd, char *cmd, unsigned char *buffer, size_t *buflen,
1.70 struct request_sense sense;