Cleaned up the various errno location tests in configure.
[wine.git] / include / cdrom.h
blob8b6e3c9fb26e8c0c946281993c12bb357ac239eb
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*
3 * Header file for CD-ROM support
5 * Copyright 1994 Martin Ayotte
6 * Copyright 1999 Eric Pouech
7 * Copyright 2000 Andreas Mohr
8 */
10 #ifndef __WINE_CDROM_H__
11 #define __WINE_CDROM_H__
13 #include <stdlib.h>
14 #include <unistd.h>
15 #include "config.h"
16 #include "windef.h"
17 #include "wine/windef16.h"
19 #ifdef HAVE_LINUX_CDROM_H
20 # include <linux/cdrom.h>
21 #endif
22 #ifdef HAVE_LINUX_UCDROM_H
23 # include <linux/ucdrom.h>
24 #endif
25 #ifdef HAVE_SYS_CDIO_H
26 # include <sys/cdio.h>
27 #endif
29 typedef struct {
30 const char *devname;
31 #if defined(linux)
32 struct cdrom_subchnl sc;
33 #elif defined(__FreeBSD__) || defined(__NetBSD__)
34 struct cd_sub_channel_info sc;
35 #endif
36 /* those data reflect the cdaudio structure and
37 * don't change while playing
39 UINT16 nTracks;
40 UINT16 nFirstTrack;
41 UINT16 nLastTrack;
42 LPDWORD lpdwTrackLen;
43 LPDWORD lpdwTrackPos;
44 LPBYTE lpbTrackFlags;
45 DWORD dwFirstFrame;
46 DWORD dwLastFrame;
47 /* those data change while playing */
48 int cdaMode;
49 UINT16 nCurTrack;
50 DWORD dwCurFrame;
51 } WINE_CDAUDIO;
53 #define WINE_CDA_DONTKNOW 0x00
54 #define WINE_CDA_NOTREADY 0x01
55 #define WINE_CDA_OPEN 0x02
56 #define WINE_CDA_PLAY 0x03
57 #define WINE_CDA_STOP 0x04
58 #define WINE_CDA_PAUSE 0x05
60 int CDROM_Open(WINE_CDAUDIO* wcda, int drive);
61 int CDROM_OpenDev(WINE_CDAUDIO* wcda);
62 int CDROM_GetMediaType(WINE_CDAUDIO* wcda, int parentdev);
63 int CDROM_CloseDev(int dev);
64 int CDROM_Close(WINE_CDAUDIO* wcda);
65 int CDROM_Reset(WINE_CDAUDIO* wcda, int parentdev);
66 int CDROM_Audio_Play(WINE_CDAUDIO* wcda, DWORD start, DWORD stop, int parentdev);
67 int CDROM_Audio_Stop(WINE_CDAUDIO* wcda, int parentdev);
68 int CDROM_Audio_Pause(WINE_CDAUDIO* wcda, int pauseOn, int parentdev);
69 int CDROM_Audio_Seek(WINE_CDAUDIO* wcda, DWORD at, int parentdev);
70 int CDROM_SetDoor(WINE_CDAUDIO* wcda, int open, int parentdev);
71 UINT16 CDROM_Audio_GetNumberOfTracks(WINE_CDAUDIO* wcda, int parentdev);
72 BOOL CDROM_Audio_GetTracksInfo(WINE_CDAUDIO* wcda, int parentdev);
73 BOOL CDROM_Audio_GetCDStatus(WINE_CDAUDIO* wcda, int parentdev);
74 WORD CDROM_Data_FindBestVoldesc(int fd);
75 DWORD CDROM_Audio_GetSerial(WINE_CDAUDIO* wcda);
76 DWORD CDROM_Data_GetSerial(WINE_CDAUDIO* wcda, int parentdev);
77 DWORD CDROM_GetSerial(int drive);
78 DWORD CDROM_GetLabel(int drive, char *label);
80 #define CDFRAMES_PERSEC 75
81 #define SECONDS_PERMIN 60
82 #define CDFRAMES_PERMIN ((CDFRAMES_PERSEC) * (SECONDS_PERMIN))
84 #ifndef CDROM_DATA_TRACK
85 #define CDROM_DATA_TRACK 0x04
86 #endif
88 #define CDROM_MSF_MINUTE(msf) ((BYTE)(msf))
89 #define CDROM_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
90 #define CDROM_MSF_FRAME(msf) ((BYTE)((msf)>>16))
92 #define CDROM_MAKE_MSF(m, s, f) ((DWORD)(((BYTE)(m) | \
93 ((WORD)(s)<<8)) | \
94 (((DWORD)(BYTE)(f))<<16)))
96 /* values borrowed from Linux 2.2.x cdrom.h */
97 #define CDS_NO_INFO 0
98 #define CDS_AUDIO 100
99 #define CDS_DATA_1 101
100 #define CDS_DATA_2 102
101 #define CDS_XA_2_1 103
102 #define CDS_XA_2_2 104
103 #define CDS_MIXED 105
105 #endif