File: mycdrom.h

package info (click to toggle)
cdrkit 9:1.1.11-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 7,464 kB
  • sloc: ansic: 107,182; perl: 968; sh: 481; makefile: 229; sed: 4
file content (150 lines) | stat: -rw-r--r-- 4,142 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
 * This file has been modified for the cdrkit suite.
 *
 * The behaviour and appearence of the program code below can differ to a major
 * extent from the version distributed by the original author(s).
 *
 * For details, see Changelog file distributed with the cdrkit package. If you
 * received this file from another source then ask the distributing person for
 * a log of modifications.
 *
 */

/* @(#)mycdrom.h	1.10 06/05/07 Copyright 1998,1999 Heiko Eissfeldt, Copyright 2005-2006 J. Schilling */
#if defined(__linux__)
# include <linux/cdrom.h>
#else
# if defined HAVE_SYS_CDIO_H
#  include <sys/cdio.h>
#  if defined(__FreeBSD__) && __FreeBSD__ >= 2
#   include <osreldate.h>
#  endif
#  if defined HAVE_SYS_CDRIO_H	/* Was: if __FreeBSD_version >= 400014 */
#   include <sys/cdrio.h>
#  endif

#  if (defined (__sun) && defined (SVR4))
#   if 0
/* just for info */
/* Sun has this cdda reading ioctl: CDROMCDDA */
/*
 * Definition of CD-DA structure
 */
struct cdrom_cdda {
 unsigned int cdda_addr;
 unsigned int cdda_length;
 caddr_t  cdda_data;
 unsigned char cdda_subcode;
};
/*
To get the subcode information related to CD-DA data, the following values are
 appropriate for the cdda_subcode field:

CDROM_DA_NO_SUBCODE
CD-DA data with no subcode.

CDROM_DA_SUBQ
CD-DA data with sub Q code.

CDROM_DA_ALL_SUBCODE
CD-DA data with all subcode.

CDROM_DA_SUBCODE_ONLY
All subcode only.

To allocate the memory related to CD-DA and/or subcode data, the following
 values are appropriate for each data block transferred:

CD-DA data with no subcode
2352 bytes

CD-DA data with sub Q code
2368 bytes

CD-DA data with all subcode
2448 bytes

All subcode only
96 bytes
*/

#   endif /* if 0 */
#  else /* not Sun SVR4 */
#   if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __DragonFly__  || defined __OpenBSD__
#    if (defined(__FreeBSD__) && __FreeBSD_version < 228000) || !defined(CDIOCREADAUDIO)
	/*
	 * FreeBSD_version >= 501112 has no CDIOCREADAUDIO but uses pread()
	 */
#	if !(defined(__FreeBSD__) && __FreeBSD_version >= 501112)
#		undef HAVE_IOCTL_INTERFACE
#	endif
#    endif /* __FreeBSD_version < 228000 || !CDIOCREADAUDIO */

#ifdef	HAVE_IOCTL_INTERFACE

#define CDROM_LBA	CD_LBA_FORMAT
#define CDROM_MSF	CD_MSF_FORMAT
#define CDROM_DATA_TRACK	0x04
#define CDROM_LEADOUT	0xAA

#define CDROMSTOP	CDIOCSTOP
#define CDROMSTART	CDIOCSTART
#define CDROMREADTOCHDR	CDIOREADTOCHEADER
#define CDROMREADTOCENTRY	CDIOREADTOCENTRY
#define CDROMPLAYMSF	CDIOCPLAYMSF
#define CDROMREADAUDIO	CDIOCREADAUDIO
#define CDROM_GET_MCN	CDIOCREADSUBCHANNEL
#define CDROMSUBCHNL	CDIOCREADSUBCHANNEL

#ifndef	CDIOREADTOCENTRY
#define CDIOREADTOCENTRY	CDIOREADTOCENTRYS
#endif

#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_adr	entry.addr_type
#define cdte_ctrl	entry.control
#define cdte_addr	entry.addr

#define cdrom_read_audio ioc_read_audio
#define addr_format	address_format
#define buff		buffer

#define cdrom_msf	ioc_play_msf
#define cdmsf_min0	start_m
#define cdmsf_sec0	start_s
#define cdmsf_frame0	start_f
#define cdmsf_min1	end_m
#define cdmsf_sec1	end_s
#define cdmsf_frame1	end_f

#define cdrom_subchnl	ioc_read_subchannel
#define cdsc_audiostatus data->header.audio_status
#define cdsc_format	data->what.position.data_format
#define cdsc_adr	data->what.position.addr_type
#define cdsc_ctrl	data->what.position.control
#define cdsc_trk	data->what.position.track_number
#define cdsc_ind	data->what.position.index_number
#define cdsc_absaddr	data->what.position.absaddr
#define cdsc_reladdr	data->what.position.reladdr
#	endif	/* HAVE_IOCTL_INTERFACE */
#   else /* not *BSD */
#    undef HAVE_IOCTL_INTERFACE
#   endif /* not *BSD */
#  endif /* not SUN SVR4 */
# else /* HAVE_SYS_CDIO_H */
#  if defined HAVE_SUNDEV_SRREG_H
#   include <sundev/srreg.h>
#   if !defined CDROMCDDA
#    undef HAVE_IOCTL_INTERFACE
#   endif
#  else
#    undef HAVE_IOCTL_INTERFACE
#  endif
# endif /* not HAVE_SYS_CDIO_H */
#endif /* not linux */