libcdio  1.0.0rc2
device.h
Go to the documentation of this file.
1 /* -*- c -*-
2 
3  Copyright (C) 2005-2006, 2008-2013 Rocky Bernstein <rocky@gnu.org>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
25 #ifndef CDIO_DEVICE_H_
26 #define CDIO_DEVICE_H_
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
32 #include <cdio/types.h>
33 #include <cdio/cdio.h>
34 
36  typedef uint32_t cdio_drive_read_cap_t;
37  typedef uint32_t cdio_drive_write_cap_t;
38  typedef uint32_t cdio_drive_misc_cap_t;
39 
46  typedef enum {
65 
67  typedef enum {
85 
87  typedef enum {
111 
113  typedef enum {
118 
119 
122  typedef struct cdio_hwinfo
123  {
127  } cdio_hwinfo_t;
128 
129 
131  typedef enum {
137 
138 
151  typedef enum {
170  } driver_id_t;
171 
176  extern const driver_id_t cdio_drivers[];
177 
182  extern const driver_id_t cdio_device_drivers[];
183 
190  extern const driver_id_t cdio_os_driver;
191 
192 
205  typedef enum {
232 
242  driver_return_code_t cdio_close_tray (const char *psz_drive,
243  /*in/out*/ driver_id_t *p_driver_id);
244 
249  const char *cdio_driver_errmsg(driver_return_code_t drc);
250 
258 
265  driver_return_code_t cdio_eject_media_drive (const char *psz_drive);
266 
277  void cdio_free_device_list (char * device_list[]);
278 
292  char * cdio_get_default_device (const CdIo_t *p_cdio);
293 
301  char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id);
302 
314  char ** cdio_get_devices (driver_id_t driver_id);
315 
352  char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[],
353  cdio_fs_anal_t capabilities, bool b_any);
354 
361  char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[],
362  cdio_fs_anal_t capabilities,
363  bool b_any,
364  /*out*/ driver_id_t *p_driver_id);
365 
374  char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);
375 
388  void cdio_get_drive_cap (const CdIo_t *p_cdio,
389  cdio_drive_read_cap_t *p_read_cap,
390  cdio_drive_write_cap_t *p_write_cap,
391  cdio_drive_misc_cap_t *p_misc_cap);
392 
402  void cdio_get_drive_cap_dev (const char *device,
403  cdio_drive_read_cap_t *p_read_cap,
404  cdio_drive_write_cap_t *p_write_cap,
405  cdio_drive_misc_cap_t *p_misc_cap);
406 
413  const char * cdio_get_driver_name (const CdIo_t *p_cdio);
414 
420  const char * cdio_get_driver_name_from_id (driver_id_t driver_id);
421 
422 
430  driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);
431 
436  bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
437  /*out*/ cdio_hwinfo_t *p_hw_info );
438 
439 
448  /*out*/ lsn_t *i_last_session);
449 
456  int cdio_get_media_changed(CdIo_t *p_cdio);
457 
460 
462  bool cdio_have_driver (driver_id_t driver_id);
463 
470  void cdio_destroy (CdIo_t *p_cdio);
471 
478  const char *cdio_driver_describe (driver_id_t driver_id);
479 
490  CdIo_t * cdio_open (const char *psz_source, driver_id_t driver_id);
491 
503  CdIo_t * cdio_open_am (const char *psz_source,
504  driver_id_t driver_id, const char *psz_access_mode);
505 
512  CdIo_t * cdio_open_bincue (const char *psz_cue_name);
513 
520  CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
521  const char *psz_access_mode);
522 
528  CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);
529 
535  CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
536  const char *psz_access_mode);
537 
544  char * cdio_get_default_device_bincue(void);
545 
546  char **cdio_get_devices_bincue(void);
547 
553  char * cdio_get_default_device_cdrdao(void);
554 
555  char **cdio_get_devices_cdrdao(void);
556 
564  CdIo_t * cdio_open_cd (const char *device_name);
565 
573  CdIo_t * cdio_open_am_cd (const char *psz_device,
574  const char *psz_access_mode);
575 
582  CdIo_t * cdio_open_cue (const char *cue_name);
583 
593  CdIo_t * cdio_open_am_aix (const char *psz_source,
594  const char *psz_access_mode);
595 
605  CdIo_t * cdio_open_aix (const char *psz_source);
606 
616  char * cdio_get_default_device_aix(void);
617 
626  char **cdio_get_devices_aix(void);
627 
638  CdIo_t * cdio_open_bsdi (const char *psz_source);
639 
649  CdIo_t * cdio_open_am_bsdi (const char *psz_source,
650  const char *psz_access_mode);
651 
661  char * cdio_get_default_device_bsdi(void);
662 
671  char **cdio_get_devices_bsdi(void);
672 
681  CdIo_t * cdio_open_freebsd (const char *paz_psz_source);
682 
691  CdIo_t * cdio_open_am_freebsd (const char *psz_source,
692  const char *psz_access_mode);
693 
700  char * cdio_get_default_device_freebsd(void);
701 
706  char **cdio_get_devices_freebsd(void);
707 
719  CdIo_t * cdio_open_linux (const char *psz_source);
720 
728  CdIo_t * cdio_open_am_linux (const char *psz_source,
729  const char *access_mode);
730 
744  char * cdio_get_default_device_linux(void);
745 
750  char **cdio_get_devices_linux(void);
751 
759  CdIo_t * cdio_open_solaris (const char *psz_source);
760 
768  CdIo_t * cdio_open_am_solaris (const char *psz_source,
769  const char *psz_access_mode);
770 
784  char * cdio_get_default_device_solaris(void);
785 
790  char **cdio_get_devices_solaris(void);
791 
804  CdIo_t * cdio_open_osx (const char *psz_source);
805 
814  CdIo_t * cdio_open_am_osx (const char *psz_source,
815  const char *psz_access_mode);
816 
826  char * cdio_get_default_device_osx(void);
827 
832  char **cdio_get_devices_osx(void);
833 
842  CdIo_t * cdio_open_win32 (const char *psz_source);
843 
850  CdIo_t * cdio_open_am_win32 (const char *psz_source,
851  const char *psz_access_mode);
852 
864  char * cdio_get_default_device_win32(void);
865 
866  char **cdio_get_devices_win32(void);
867 
880  CdIo_t * cdio_open_os2 (const char *psz_source);
881 
890  CdIo_t * cdio_open_am_os2 (const char *psz_source,
891  const char *psz_access_mode);
892 
902  char * cdio_get_default_device_os2(void);
903 
908  char **cdio_get_devices_os2(void);
909 
916  CdIo_t * cdio_open_nrg (const char *psz_source);
917 
924  CdIo_t * cdio_open_am_nrg (const char *psz_source,
925  const char *psz_access_mode);
926 
935  char * cdio_get_default_device_nrg(void);
936 
937  char **cdio_get_devices_nrg(void);
938 
947  char *cdio_is_binfile(const char *bin_name);
948 
955  char *cdio_is_cuefile(const char *cue_name);
956 
964  bool cdio_is_nrg(const char *psz_nrg);
965 
973  bool cdio_is_tocfile(const char *psz_toc);
974 
984  bool cdio_is_device(const char *psz_source, driver_id_t driver_id);
985 
990  int i_blocksize );
991 
1008  driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio,
1009  int i_drive_speed );
1010 
1019  const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[]);
1020 
1028  driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
1029  const char value[]);
1030 
1034  bool cdio_init(void);
1035 
1036 #ifdef __cplusplus
1037 }
1038 #endif /* __cplusplus */
1039 
1050 
1051 #endif /* CDIO_DEVICE_H_ */
CdIo_t * cdio_open_am_nrg(const char *psz_source, const char *psz_access_mode)
const char * cdio_get_driver_name_from_id(driver_id_t driver_id)
Definition: device.h:96
CdIo_t * cdio_open_osx(const char *psz_source)
CdIo_t * cdio_open_am_linux(const char *psz_source, const char *access_mode)
cdio_drive_cap_read_t
Definition: device.h:67
Definition: device.h:94
char ** cdio_get_devices_linux(void)
Common type definitions used pervasively in libcdio.
Definition: device.h:82
const driver_id_t cdio_os_driver
CdIo_t * cdio_open_am_cd(const char *psz_device, const char *psz_access_mode)
Definition: device.h:206
int cdio_fs_anal_t
Definition: types.h:322
char * cdio_get_default_device_solaris(void)
cdio_drive_cap_read_t debug_cdio_drive_cap_read_t
Definition: device.h:211
driver_return_code_t
Definition: device.h:205
Definition: device.h:55
Definition: device.h:56
Definition: device.h:132
CdIo_t * cdio_open_cd(const char *device_name)
CdIo_t * cdio_open_linux(const char *psz_source)
Definition: device.h:89
char * cdio_get_default_device_nrg(void)
Definition: device.h:62
Definition: device.h:165
Definition: device.h:97
int32_t lsn_t
Definition: types.h:266
char * cdio_get_default_device_cdrdao(void)
Definition: device.h:91
char * cdio_get_default_device_bincue(void)
driver_return_code_t cdio_eject_media(CdIo_t **p_cdio)
Definition: device.h:69
char * cdio_get_default_device_aix(void)
CdIo_t * cdio_open_am_solaris(const char *psz_source, const char *psz_access_mode)
Definition: device.h:152
uint32_t cdio_drive_write_cap_t
Definition: device.h:37
CdIo_t * cdio_open_bincue(const char *psz_cue_name)
char psz_revision[CDIO_MMC_HW_REVISION_LEN+1]
Definition: device.h:126
Definition: device.h:79
CdIo_t * cdio_open_am_bsdi(const char *psz_source, const char *psz_access_mode)
char * cdio_is_binfile(const char *bin_name)
char * cdio_get_default_device_os2(void)
Definition: device.h:134
Definition: device.h:225
Definition: device.h:77
Definition: device.h:160
Definition: device.h:73
uint32_t cdio_drive_read_cap_t
Definition: device.h:36
CdIo_t * cdio_open_cue(const char *cue_name)
Definition: device.h:93
driver_return_code_t cdio_set_speed(const CdIo_t *p_cdio, int i_drive_speed)
struct cdio_hwinfo cdio_hwinfo_t
Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command...
CdIo_t * cdio_open(const char *psz_source, driver_id_t driver_id)
int cdio_get_media_changed(CdIo_t *p_cdio)
Definition: device.h:83
Definition: device.h:158
Definition: device.h:92
driver_return_code_t cdio_set_arg(CdIo_t *p_cdio, const char key[], const char value[])
cdio_drive_cap_misc_t
Drive capability bits returned by cdio_get_drive_cap() NOTE: Setting a bit here means the presence of...
Definition: device.h:46
Definition: device.h:48
Definition: device.h:168
Definition: device.h:159
void cdio_get_drive_cap(const CdIo_t *p_cdio, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap)
char * cdio_is_cuefile(const char *cue_name)
Definition: device.h:116
bool cdio_have_driver(driver_id_t driver_id)
void cdio_destroy(CdIo_t *p_cdio)
bool cdio_is_tocfile(const char *psz_toc)
bool cdio_get_hwinfo(const CdIo_t *p_cdio, cdio_hwinfo_t *p_hw_info)
const driver_id_t cdio_drivers[]
cdio_src_category_mask_t debug_cdio_src_category_mask
Definition: device.h:60
void cdio_free_device_list(char *device_list[])
driver_return_code_t cdio_get_last_session(CdIo_t *p_cdio, lsn_t *i_last_session)
Definition: device.h:81
char * cdio_get_default_device(const CdIo_t *p_cdio)
Definition: device.h:221
Definition: device.h:157
char ** cdio_get_devices_solaris(void)
cdio_mmc_hw_len_t
Definition: device.h:113
Definition: device.h:90
bool cdio_is_device(const char *psz_source, driver_id_t driver_id)
CdIo_t * cdio_open_am_bincue(const char *psz_cue_name, const char *psz_access_mode)
Definition: device.h:169
Definition: device.h:226
char * cdio_get_default_device_bsdi(void)
bool cdio_is_nrg(const char *psz_nrg)
cdio_src_category_mask_t
Definition: device.h:131
const char * cdio_driver_describe(driver_id_t driver_id)
CdIo_t * cdio_open_am_os2(const char *psz_source, const char *psz_access_mode)
bool_3way_t cdio_have_atapi(CdIo_t *p_cdio)
const char * cdio_get_arg(const CdIo_t *p_cdio, const char key[])
Definition: device.h:70
char ** cdio_get_devices(driver_id_t driver_id)
Definition: device.h:212
char ** cdio_get_devices_cdrdao(void)
CdIo_t * cdio_open_os2(const char *psz_source)
The top-level header for libcdio: the CD Input and Control library. Applications include this for any...
char ** cdio_get_devices_bincue(void)
char ** cdio_get_devices_bsdi(void)
char ** cdio_get_devices_os2(void)
Definition: device.h:59
char ** cdio_get_devices_osx(void)
Definition: device.h:47
CdIo_t * cdio_open_am_win32(const char *psz_source, const char *psz_access_mode)
const driver_id_t cdio_device_drivers[]
driver_id_t
Definition: device.h:151
CdIo_t * cdio_open_nrg(const char *psz_source)
Definition: device.h:68
Definition: device.h:217
Definition: device.h:156
char ** cdio_get_devices_win32(void)
Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command...
Definition: device.h:122
CdIo_t * cdio_open_bsdi(const char *psz_source)
CdIo_t * cdio_open_win32(const char *psz_source)
struct _CdIo CdIo_t
Definition: cdio.h:47
CdIo_t * cdio_open_am_freebsd(const char *psz_source, const char *psz_access_mode)
Definition: device.h:74
Definition: device.h:88
Definition: device.h:78
CdIo_t * cdio_open_aix(const char *psz_source)
char * cdio_get_default_device_driver(driver_id_t *p_driver_id)
CdIo_t * cdio_open_am(const char *psz_source, driver_id_t driver_id, const char *psz_access_mode)
CdIo_t * cdio_open_solaris(const char *psz_source)
Definition: device.h:95
Definition: device.h:227
char * cdio_get_default_device_linux(void)
Definition: device.h:155
Definition: device.h:72
Definition: device.h:114
Definition: device.h:80
char psz_model[CDIO_MMC_HW_MODEL_LEN+1]
Definition: device.h:125
CdIo_t * cdio_open_am_osx(const char *psz_source, const char *psz_access_mode)
Definition: device.h:75
Definition: device.h:101
bool_3way_t
Definition: types.h:236
Definition: device.h:57
CdIo_t * cdio_open_freebsd(const char *paz_psz_source)
const char * cdio_get_driver_name(const CdIo_t *p_cdio)
char ** cdio_get_devices_freebsd(void)
Definition: device.h:52
Definition: device.h:76
char ** cdio_get_devices_nrg(void)
CdIo_t * cdio_open_am_aix(const char *psz_source, const char *psz_access_mode)
char ** cdio_get_devices_aix(void)
cdio_drive_cap_write_t
Definition: device.h:87
void cdio_get_drive_cap_dev(const char *device, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap)
char * cdio_get_default_device_win32(void)
driver_return_code_t cdio_close_tray(const char *psz_drive, driver_id_t *p_driver_id)
Definition: device.h:61
Definition: device.h:54
cdio_drive_cap_misc_t debug_cdio_drive_cap_misc
char ** cdio_get_devices_ret(driver_id_t *p_driver_id)
char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]
Definition: device.h:124
driver_return_code_t cdio_eject_media_drive(const char *psz_drive)
Definition: device.h:229
Definition: device.h:133
driver_id_t cdio_get_driver_id(const CdIo_t *p_cdio)
bool cdio_init(void)
uint32_t cdio_drive_misc_cap_t
Definition: device.h:38
Definition: device.h:162
CdIo_t * cdio_open_cdrdao(const char *psz_toc_name)
driver_return_code_t cdio_set_blocksize(const CdIo_t *p_cdio, int i_blocksize)
char ** cdio_get_devices_with_cap_ret(char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any, driver_id_t *p_driver_id)
Definition: device.h:154
Definition: device.h:71
const char * cdio_driver_errmsg(driver_return_code_t drc)
char ** cdio_get_devices_with_cap(char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any)
char * cdio_get_default_device_freebsd(void)
cdio_mmc_hw_len_t debug_cdio_mmc_hw_len
CdIo_t * cdio_open_am_cdrdao(const char *psz_toc_name, const char *psz_access_mode)
Definition: device.h:107
cdio_drive_cap_write_t debug_drive_cap_write_t
char * cdio_get_default_device_osx(void)
Definition: device.h:115
Definition: device.h:135