[go: up one dir, main page]

File: hardware.h

package info (click to toggle)
cdtool 2.1.5-13
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 316 kB
  • ctags: 185
  • sloc: ansic: 2,375; makefile: 181; sh: 134
file content (42 lines) | stat: -rw-r--r-- 1,246 bytes parent folder | download
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
/* hardware.h */

#ifndef __HARDWARE_H__
#define __HARDWARE_H__

/* state of the CD-ROM hardware */
typedef struct {
    int    iStatus;                        /* see CD_STATUS* below */
    int    iData;
    int    iAudio;
    struct cdrom_tochdr tochdr;            /* from CDROMREADTOCHDR */
    struct cdrom_tocentry tocentries[100]; /* from CDROMREADTOCENTRY */
    struct cdrom_subchnl subchnl;          /* from CDROMSUBCHNL */
} cdhw_t;

/* procedures */
int	first_track(const cdhw_t *hw);
int	last_track(const cdhw_t *hw);
int	is_audio_track(const cdhw_t *hw, int track);
cdhw_t *read_hw(char *progname, int cdfile, char *cdname);
int     checkmount(char *progname, char *pszName);
int     cd_status(char *progname, int cd_fd, char *cdname, cdhw_t *pHw);
void    free_hw_buf(cdhw_t *pHw);
char   *cd_status_text (int iStatus);

/* additional error codes, see linux/cdrom.h */
#define NO_CDROM         200
#define CDROM_MOUNTED    201
#define CDROM_DATA_DISC  202

/* return codes from cd_status */
#define CD_STATUS_ERROR    -1
#define CD_STATUS_NO_CD     0
#define CD_STATUS_CD_IN     1
#define CD_STATUS_INSERTED  2
#define CD_STATUS_REMOVED   3
#define CD_STATUS_MOUNTED   4
#define CD_STATUS_DATA_DISC 5

#define MAX_TRACKS 99

#endif