/* * Copyright (c) 1999-2003 Robert Woodcock * Copyright (c) 2009 Timur Birsh * This code is hereby licensed for public consumption under either the * GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef H_DISCID #define H_DISCID #include #include #include #include #include #include /* Porting credits: * Solaris: David Champion * FreeBSD: Niels Bakker * OpenBSD: Marcus Daniel * NetBSD: Chris Gilbert * MacOSX: Evan Jones http://www.eng.uwaterloo.ca/~ejones/ */ #if defined(linux) #include #define cdte_track_address cdte_addr.lba #define DEVICE_NAME "/dev/cdrom" #elif defined(sun) && defined(unix) && defined(__SVR4) #include #define CD_MSF_OFFSET 150 #define CD_FRAMES 75 /* According to David Schweikert , cd-discid needs this * to compile on Solaris */ #define cdte_track_address cdte_addr.lba #define DEVICE_NAME "/dev/vol/aliases/cdrom0" /* __FreeBSD_kernel__ is needed for properly compiling on Debian GNU/kFreeBSD Look at http://glibc-bsd.alioth.debian.org/porting/PORTING for more info */ #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #define CDROM_LBA CD_LBA_FORMAT /* first frame is 0 */ #define CD_MSF_OFFSET 150 /* MSF offset of first frame */ #define CD_FRAMES 75 /* per second */ #define CDROM_LEADOUT 0xAA /* leadout track */ #define CDROMREADTOCHDR CDIOREADTOCHEADER #define CDROMREADTOCENTRY CDIOREADTOCENTRY #define cdrom_tochdr ioc_toc_header #define cdth_trk0 starting_track #define cdth_trk1 ending_track #define cdrom_tocentry ioc_read_toc_single_entry #define cdte_track track #define cdte_format address_format #define cdte_track_address entry.addr.lba #define DEVICE_NAME "/dev/cdrom" #elif defined(__OpenBSD__) || defined(__NetBSD__) #include #define CDROM_LBA CD_LBA_FORMAT /* first frame is 0 */ #define CD_MSF_OFFSET 150 /* MSF offset of first frame */ #define CD_FRAMES 75 /* per second */ #define CDROM_LEADOUT 0xAA /* leadout track */ #define CDROMREADTOCHDR CDIOREADTOCHEADER #define cdrom_tochdr ioc_toc_header #define cdth_trk0 starting_track #define cdth_trk1 ending_track #define cdrom_tocentry cd_toc_entry #define cdte_track track #define cdte_track_address addr.lba #define DEVICE_NAME "/dev/cd0a" #elif defined(__APPLE__) #include #include #include #define CD_FRAMES 75 /* per second */ #define CD_MSF_OFFSET 150 /* MSF offset of first frame */ #define cdrom_tochdr CDDiscInfo #define cdth_trk0 numberOfFirstTrack /* NOTE: Judging by the name here, we might have to do this: * hdr.lastTrackNumberInLastSessionMSB << 8 * * sizeof(hdr.lastTrackNumberInLastSessionLSB) * | hdr.lastTrackNumberInLastSessionLSB; */ #define cdth_trk1 lastTrackNumberInLastSessionLSB #define cdrom_tocentry CDTrackInfo #define cdte_track_address trackStartAddress #define DEVICE_NAME "/dev/disk1" #else # error "Your OS isn't supported yet." #endif /* os selection */ #endif