blob: 8285daa0c7c613674197eab2986857a02ca8d090 (
plain)
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
|
$NetBSD: patch-ch,v 1.5 2009/08/14 15:51:06 drochner Exp $
--- interface/cdda_interface.h.orig 2008-09-11 12:43:52.000000000 +0200
+++ interface/cdda_interface.h
@@ -18,9 +18,23 @@
#endif
#define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4)
+#if defined(__APPLE__) && defined(__MACH__)
+#include <IOKit/IOKitLib.h>
+#include <IOKit/storage/IOCDTypes.h>
+#endif
+
#include <sys/types.h>
#include <signal.h>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <stdio.h>
+#include <camlib.h>
+#endif
+
+#ifdef __NetBSD__
+#define ENOMEDIUM 12345
+#endif
+
#define MAXTRK 100
typedef struct TOC { /* structure of table of contents */
@@ -35,6 +49,7 @@ typedef struct TOC { /* structure of tab
#define TEST_INTERFACE 2
#define SGIO_SCSI 3
#define SGIO_SCSI_BUGGY1 4
+#define OSX_IOKIT 5
#define CDDA_MESSAGE_FORGETIT 0
#define CDDA_MESSAGE_PRINTIT 1
@@ -49,13 +64,27 @@ typedef struct cdrom_drive{
int opened; /* This struct may just represent a candidate for opening */
char *cdda_device_name;
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
char *ioctl_device_name;
int cdda_fd;
- int ioctl_fd;
- char *drive_model;
int drive_type;
+#else
+ struct cam_device *dev;
+ union ccb *ccb;
+#endif
+
+#if defined(__APPLE__) && defined(__MACH__)
+ io_object_t io;
+ int fd;
+ char *dev;
+ CDTOC *raw_toc;
+ int descriptor_count;
+#endif
+
+ int ioctl_fd;
+ char *drive_model;
int interface;
int bigendianp;
int nsectors;
@@ -84,7 +113,7 @@ typedef struct cdrom_drive{
int is_atapi;
int is_mmc;
- cdda_private_data_t *private;
+ cdda_private_data_t *private_data;
void *reserved;
unsigned char inqbytes[4];
|