2 * This file has been modified for the cdrkit suite.
4 * The behaviour and appearence of the program code below can differ to a major
5 * extent from the version distributed by the original author(s).
7 * For details, see Changelog file distributed with the cdrkit package. If you
8 * received this file from another source then ask the distributing person for
9 * a log of modifications.
13 /* @(#)mycdrom.h 1.10 06/05/07 Copyright 1998,1999 Heiko Eissfeldt, Copyright 2005-2006 J. Schilling */
14 #if defined(__linux__)
15 # include <linux/cdrom.h>
17 # if defined HAVE_SYS_CDIO_H
18 # include <sys/cdio.h>
19 # if defined(__FreeBSD__) && __FreeBSD__ >= 2
20 # include <osreldate.h>
22 # if defined HAVE_SYS_CDRIO_H /* Was: if __FreeBSD_version >= 400014 */
23 # include <sys/cdrio.h>
26 # if (defined (__sun) && defined (SVR4))
29 /* Sun has this cdda reading ioctl: CDROMCDDA */
31 * Definition of CD-DA structure
34 unsigned int cdda_addr;
35 unsigned int cdda_length;
37 unsigned char cdda_subcode;
40 To get the subcode information related to CD-DA data, the following values are
41 appropriate for the cdda_subcode field:
44 CD-DA data with no subcode.
47 CD-DA data with sub Q code.
50 CD-DA data with all subcode.
55 To allocate the memory related to CD-DA and/or subcode data, the following
56 values are appropriate for each data block transferred:
58 CD-DA data with no subcode
61 CD-DA data with sub Q code
64 CD-DA data with all subcode
72 # else /* not Sun SVR4 */
73 # if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __DragonFly__ || defined __OpenBSD__
74 # if (defined(__FreeBSD__) && __FreeBSD_version < 228000) || !defined(CDIOCREADAUDIO)
76 * FreeBSD_version >= 501112 has no CDIOCREADAUDIO but uses pread()
78 # if !(defined(__FreeBSD__) && __FreeBSD_version >= 501112)
79 # undef HAVE_IOCTL_INTERFACE
81 # endif /* __FreeBSD_version < 228000 || !CDIOCREADAUDIO */
83 #ifdef HAVE_IOCTL_INTERFACE
85 #define CDROM_LBA CD_LBA_FORMAT
86 #define CDROM_MSF CD_MSF_FORMAT
87 #define CDROM_DATA_TRACK 0x04
88 #define CDROM_LEADOUT 0xAA
90 #define CDROMSTOP CDIOCSTOP
91 #define CDROMSTART CDIOCSTART
92 #define CDROMREADTOCHDR CDIOREADTOCHEADER
93 #define CDROMREADTOCENTRY CDIOREADTOCENTRY
94 #define CDROMPLAYMSF CDIOCPLAYMSF
95 #define CDROMREADAUDIO CDIOCREADAUDIO
96 #define CDROM_GET_MCN CDIOCREADSUBCHANNEL
97 #define CDROMSUBCHNL CDIOCREADSUBCHANNEL
99 #ifndef CDIOREADTOCENTRY
100 #define CDIOREADTOCENTRY CDIOREADTOCENTRYS
103 #define cdrom_tochdr ioc_toc_header
104 #define cdth_trk0 starting_track
105 #define cdth_trk1 ending_track
107 #define cdrom_tocentry ioc_read_toc_single_entry
108 #define cdte_track track
109 #define cdte_format address_format
110 #define cdte_adr entry.addr_type
111 #define cdte_ctrl entry.control
112 #define cdte_addr entry.addr
114 #define cdrom_read_audio ioc_read_audio
115 #define addr_format address_format
118 #define cdrom_msf ioc_play_msf
119 #define cdmsf_min0 start_m
120 #define cdmsf_sec0 start_s
121 #define cdmsf_frame0 start_f
122 #define cdmsf_min1 end_m
123 #define cdmsf_sec1 end_s
124 #define cdmsf_frame1 end_f
126 #define cdrom_subchnl ioc_read_subchannel
127 #define cdsc_audiostatus data->header.audio_status
128 #define cdsc_format data->what.position.data_format
129 #define cdsc_adr data->what.position.addr_type
130 #define cdsc_ctrl data->what.position.control
131 #define cdsc_trk data->what.position.track_number
132 #define cdsc_ind data->what.position.index_number
133 #define cdsc_absaddr data->what.position.absaddr
134 #define cdsc_reladdr data->what.position.reladdr
135 # endif /* HAVE_IOCTL_INTERFACE */
136 # else /* not *BSD */
137 # undef HAVE_IOCTL_INTERFACE
138 # endif /* not *BSD */
139 # endif /* not SUN SVR4 */
140 # else /* HAVE_SYS_CDIO_H */
141 # if defined HAVE_SUNDEV_SRREG_H
142 # include <sundev/srreg.h>
143 # if !defined CDROMCDDA
144 # undef HAVE_IOCTL_INTERFACE
147 # undef HAVE_IOCTL_INTERFACE
149 # endif /* not HAVE_SYS_CDIO_H */
150 #endif /* not linux */