summaryrefslogtreecommitdiff
path: root/audio/cdparanoia/files/patch-interface_common__interface.c
blob: f631f86bae78b99f8901cbe367ce319b73c3c949 (plain) (blame)
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
Index: interface/common_interface.c
===================================================================
RCS file: /home/cvs/cdparanoia/interface/common_interface.c,v
retrieving revision 1.1.1.1
retrieving revision 1.5
--- interface/common_interface.c.orig	2000-04-19 22:41:04 UTC
+++ interface/common_interface.c
@@ -13,12 +13,19 @@
 #include "utils.h"
 #include "smallft.h"
 
+#ifdef Linux
 #include <linux/hdreg.h>
+#endif
 
 /* Test for presence of a cdrom by pinging with the 'CDROMVOLREAD' ioctl() */
 int ioctl_ping_cdrom(int fd){
+#ifdef Linux
   struct cdrom_volctrl volctl;
   if (ioctl(fd, CDROMVOLREAD, &volctl)) 
+#elif defined(__FreeBSD__)
+  struct ioc_vol volctl;
+  if (ioctl(fd, CDIOCGETVOL, &volctl))
+#endif
     return(1); /* failure */
 
   return(0);
@@ -26,6 +33,7 @@ int ioctl_ping_cdrom(int fd){
 }
 
 
+#ifdef Linux
 /* Use the ioctl thingy above ping the cdrom; this will get model info */
 char *atapi_drive_info(int fd){
   /* Work around the fact that the struct grew without warning in
@@ -46,6 +54,7 @@ char *atapi_drive_info(int fd){
   free(id);
   return(ret);
 }
+#endif
 
 int data_bigendianp(cdrom_drive *d){
   float lsb_votes=0;
@@ -171,7 +180,9 @@ int data_bigendianp(cdrom_drive *d){
    knows the leasoud/leadin size. */
 
 int FixupTOC(cdrom_drive *d,int tracks){
+#ifdef Linux
   struct cdrom_multisession ms_str;
+#endif
   int j;
   
   /* First off, make sure the 'starting sector' is >=0 */
@@ -208,6 +219,8 @@ int FixupTOC(cdrom_drive *d,int tracks){
   /* For a scsi device, the ioctl must go to the specialized SCSI
      CDROM device, not the generic device. */
 
+  /* XXX */
+#ifdef Linux
   if (d->ioctl_fd != -1) {
     int result;
 
@@ -231,6 +244,7 @@ int FixupTOC(cdrom_drive *d,int tracks){
       return 1;
     }
   }
+#endif
   return 0;
 }