$NetBSD$

--- interface/cdda_interface.h.orig	2008-09-11 06:43:52.000000000 -0400
+++ interface/cdda_interface.h	2010-12-15 23:39:17.000000000 -0500
@@ -18,9 +18,24 @@
 #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__)
+#define CAM_NO_SCSI_INQUIRY
+#include <stdio.h>
+#include <camlib.h>
+#endif
+
+#if defined(__NetBSD__) || (defined(__APPLE__) && defined(__MACH__))
+#define ENOMEDIUM 12345
+#endif
+
 #define MAXTRK 100
 
 typedef struct TOC {	/* structure of table of contents */
@@ -35,6 +50,7 @@
 #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 +65,27 @@
   int opened; /* This struct may just represent a candidate for opening */
 
   char *cdda_device_name;
+#if !defined(__FreeBSD__)
   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 +114,7 @@
   int is_atapi;
   int is_mmc;
 
-  cdda_private_data_t *private;
+  cdda_private_data_t *private_data;
   void         *reserved;
   unsigned char inqbytes[4];
 
